r_pdl_cmt_rx62nxx.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*""FILE COMMENT""*******************************************************
  2. * System Name : CMT API for RX62Nxx
  3. * File Name : r_pdl_cmt_RX62Nxx.h
  4. * Version : 1.02
  5. * Contents : CMT API 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_CMT_RX62Nxx_H
  23. #define R_PDL_CMT_RX62Nxx_H
  24. #define CMT_UNITS 2
  25. #define CMT_CHANNELS_PER_UNIT 2
  26. #define CMT_CHANNELS (uint8_t)(CMT_UNITS * CMT_CHANNELS_PER_UNIT)
  27. /* Callback function storage */
  28. extern VoidCallBackFunc rpdl_CMT_callback_func[CMT_CHANNELS];
  29. /* Global variables */
  30. extern volatile uint8_t rpdl_CMT_one_shot[CMT_CHANNELS];
  31. /* Library prototypes */
  32. bool R_CMT_CreateAll(
  33. const uint8_t,
  34. const uint16_t,
  35. const float,
  36. VoidCallBackFunc const,
  37. const uint8_t
  38. );
  39. bool R_CMT_CreateOneShotAll(
  40. const uint8_t,
  41. const uint16_t,
  42. const float,
  43. VoidCallBackFunc const,
  44. const uint8_t
  45. );
  46. bool R_CMT_DestroyAll(
  47. const uint8_t
  48. );
  49. bool R_CMT_ControlAll(
  50. const uint8_t,
  51. const uint16_t,
  52. const float
  53. );
  54. bool R_CMT_ReadAll(
  55. const uint8_t,
  56. volatile uint8_t * const,
  57. volatile uint16_t * const
  58. );
  59. bool ReturnFalse(void);
  60. /* Macro definitions */
  61. #define R_CMT_Create(a, b, c, d, e) \
  62. ( \
  63. ( ( ((a) < CMT_CHANNELS ) && ((e) <= IPL_MAX) ) ) ? \
  64. R_CMT_CreateAll( (a), (b), (c), (d), (e) ) : \
  65. ReturnFalse() \
  66. )
  67. #define R_CMT_CreateOneShot(a, b, c, d, e) \
  68. ( \
  69. ( ( ((a) < CMT_CHANNELS ) && ((e) <= IPL_MAX) ) ) ? \
  70. R_CMT_CreateOneShotAll( (a), (b), (c), (d), (e) ) : \
  71. ReturnFalse() \
  72. )
  73. #define R_CMT_Destroy(a) \
  74. ( \
  75. ( (a) < CMT_UNITS ) ? \
  76. R_CMT_DestroyAll( (a) ) : \
  77. ReturnFalse() \
  78. )
  79. #define R_CMT_Control(a, b, c) \
  80. ( \
  81. ( (a) < CMT_CHANNELS ) ? \
  82. R_CMT_ControlAll( (a), (b), (c) ) : \
  83. ReturnFalse() \
  84. )
  85. #define R_CMT_Read(a, b, c) \
  86. ( \
  87. ( (a) < CMT_CHANNELS ) ? \
  88. R_CMT_ReadAll( (a), (b), (c) ) : \
  89. ReturnFalse() \
  90. )
  91. #endif
  92. /* End of file */