r_pdl_adc_10_RX62Nxx.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*""FILE COMMENT""*******************************************************
  2. * System Name : A/D converter API for RX62Nxx
  3. * File Name : r_pdl_adc_10_RX62Nxx.h
  4. * Version : 1.02
  5. * Contents : ADC header
  6. * Customer :
  7. * Model :
  8. * Order :
  9. * CPU : RX
  10. * Compiler : RXC
  11. * OS : Nothing
  12. * Programmer :
  13. * Note :
  14. ************************************************************************
  15. * Copyright, 2011. Renesas Electronics Corporation
  16. * and Renesas Solutions Corporation
  17. ************************************************************************
  18. * History : 2011.04.08
  19. * : Ver 1.02
  20. * : CS-5 release.
  21. *""FILE COMMENT END""**************************************************/
  22. #ifndef R_PDL_ADC_10_RX62Nxx_H
  23. #define R_PDL_ADC_10_RX62Nxx_H
  24. #define ADC_10_UNITS 2
  25. extern VoidCallBackFunc rpdl_ADC_10_callback_func[];
  26. /* Library prototypes */
  27. bool R_ADC_10_CreateAll(
  28. const uint8_t,
  29. const uint32_t,
  30. const uint32_t,
  31. const float,
  32. VoidCallBackFunc const,
  33. const uint8_t
  34. );
  35. bool R_ADC_10_DestroyAll(
  36. const uint8_t
  37. );
  38. bool R_ADC_10_ControlAll(
  39. const uint16_t
  40. );
  41. bool R_ADC_10_ReadAll(
  42. const uint8_t,
  43. volatile uint16_t * const
  44. );
  45. bool ReturnFalse(void);
  46. /* Macro definitions */
  47. #define R_ADC_10_Create(a, b, c, d, e, f) \
  48. ( \
  49. ( ( ((a) < ADC_10_UNITS) && ((f) <= IPL_MAX) ) ) ? \
  50. R_ADC_10_CreateAll( (a), (b), (c), (d), (e), (f)): \
  51. ReturnFalse() \
  52. )
  53. #define R_ADC_10_Destroy(a) \
  54. ( \
  55. ( (a) < ADC_10_UNITS ) ? \
  56. R_ADC_10_DestroyAll( (a) ): \
  57. ReturnFalse() \
  58. )
  59. #define R_ADC_10_Control(a) \
  60. ( \
  61. ( ((a) & 0xFFu) != 0x00u ) ? \
  62. R_ADC_10_ControlAll( (a) ): \
  63. ReturnFalse() \
  64. )
  65. #define R_ADC_10_Read(a, b) \
  66. ( \
  67. ( (a) < ADC_10_UNITS ) ? \
  68. R_ADC_10_ReadAll( (a), (b) ): \
  69. ReturnFalse() \
  70. )
  71. #endif
  72. /* End of file */