r_pdl_io_port_rx62nxle.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. /*""FILE COMMENT""*******************************************************
  2. * System Name : I/O Port API for RX62N (145-pin TFLGA)
  3. * File Name : r_pdl_io_port_RX62NxLE.h
  4. * Version : 1.02
  5. * Contents : I/O Port 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_IO_PORT_RX62NxLE_H
  23. #define R_PDL_IO_PORT_RX62NxLE_H
  24. /* Library prototypes */
  25. /* Library prototypes */
  26. bool R_IO_PORT_SetAll(
  27. const uint8_t,
  28. const uint8_t,
  29. const uint8_t,
  30. const uint8_t
  31. );
  32. bool R_IO_PORT_ReadControlAll(
  33. const uint8_t,
  34. const uint8_t,
  35. const uint8_t,
  36. volatile uint8_t * const
  37. );
  38. bool R_IO_PORT_ReadControlRegisterAll(
  39. const uint8_t,
  40. const uint8_t,
  41. volatile uint8_t * const
  42. );
  43. bool R_IO_PORT_ModifyControlAll(
  44. const uint8_t,
  45. const uint8_t,
  46. const uint8_t,
  47. const uint8_t,
  48. const uint8_t
  49. );
  50. bool R_IO_PORT_ModifyControlRegisterAll(
  51. const uint8_t,
  52. const uint8_t,
  53. const uint8_t
  54. );
  55. bool R_IO_PORT_ReadDataAll(
  56. const uint8_t,
  57. const uint8_t,
  58. volatile uint8_t * const
  59. );
  60. bool R_IO_PORT_ReadDataRegisterAll(
  61. const uint8_t,
  62. volatile uint8_t * const
  63. );
  64. bool R_IO_PORT_WriteAll(
  65. const uint8_t,
  66. const uint8_t,
  67. const uint8_t,
  68. const uint8_t
  69. );
  70. bool R_IO_PORT_WriteRegisterAll(
  71. const uint8_t,
  72. const uint8_t
  73. );
  74. bool R_IO_PORT_CompareAll(
  75. const uint8_t,
  76. const uint8_t,
  77. const uint8_t,
  78. VoidCallBackFunc const
  79. );
  80. bool R_IO_PORT_CompareRegisterAll(
  81. const uint8_t,
  82. const uint8_t,
  83. VoidCallBackFunc const
  84. );
  85. bool R_IO_PORT_ModifyDataAll(
  86. const uint8_t,
  87. const uint8_t,
  88. const uint8_t,
  89. const uint8_t,
  90. const uint8_t
  91. );
  92. bool R_IO_PORT_ModifyDataRegisterAll(
  93. const uint8_t,
  94. const uint8_t,
  95. const uint8_t
  96. );
  97. bool R_IO_PORT_WaitAll(
  98. const uint8_t,
  99. const uint8_t,
  100. const uint8_t
  101. );
  102. bool R_IO_PORT_WaitRegisterAll(
  103. const uint8_t,
  104. const uint8_t
  105. );
  106. bool ReturnFalse(void);
  107. /* Macro definitions */
  108. /* R_IO_PORT_Set */
  109. /* Call the function if the port number is valid. */
  110. #define R_IO_PORT_Set(a, b) \
  111. ( \
  112. ( ((a) >= PDL_IO_PORT_0_0) && ((a) <= PDL_IO_PORT_E_7) ) ? \
  113. R_IO_PORT_SetAll( (uint8_t)((a) >> 8), (uint8_t)(a), (uint8_t)~(a), (b) ) : \
  114. ReturnFalse() \
  115. )
  116. /* R_IO_PORT_ReadControl */
  117. /* Call the function if the port number is valid. */
  118. #define R_IO_PORT_ReadControl(a, b, c) \
  119. ( \
  120. ( (((a) >= PDL_IO_PORT_0_0) && ((a) <= PDL_IO_PORT_E_7)) ) ? \
  121. R_IO_PORT_ReadControlAll( (uint8_t)((a) >> 8), (uint8_t)(a), (b), (c) ) : \
  122. ( ((a) >= PDL_IO_PORT_0) && ((a) <= PDL_IO_PORT_E) ) ? \
  123. R_IO_PORT_ReadControlRegisterAll( (uint8_t)(a), (b), (c) ) : \
  124. ReturnFalse() \
  125. )
  126. /* R_IO_PORT_ModifyControl */
  127. /* Call the function if the port number is valid (0 to E). */
  128. #define R_IO_PORT_ModifyControl(a, b, c) \
  129. ( \
  130. ( (((a) >= PDL_IO_PORT_0_0) && ((a) <= PDL_IO_PORT_E_7)) ) ? \
  131. R_IO_PORT_ModifyControlAll( (uint8_t)((a) >> 8), (uint8_t)(a), (uint8_t)~(a), (b), (c) ) : \
  132. ( ((a) >= PDL_IO_PORT_0) && ((a) <= PDL_IO_PORT_E) ) ? \
  133. R_IO_PORT_ModifyControlRegisterAll( (uint8_t)(a), (b), (c) ) : \
  134. ReturnFalse() \
  135. )
  136. /* R_IO_PORT_Read */
  137. /* Call the function if the port number is valid. */
  138. #define R_IO_PORT_Read(a, b) \
  139. ( \
  140. ( (((a) >= PDL_IO_PORT_0_0) && ((a) <= PDL_IO_PORT_E_7)) ) ? \
  141. R_IO_PORT_ReadDataAll( (uint8_t)((a) >> 8), (uint8_t)(a), (b) ) : \
  142. ( ((a) >= PDL_IO_PORT_0) && ((a) <= PDL_IO_PORT_E) ) ? \
  143. R_IO_PORT_ReadDataRegisterAll( (uint8_t)(a), (b) ) : \
  144. ReturnFalse() \
  145. )
  146. /* R_IO_PORT_Write */
  147. /* Call the function if the port number is valid. */
  148. #define R_IO_PORT_Write(a, b) \
  149. ( \
  150. ( (((a) >= PDL_IO_PORT_0_0) && ((a) <= PDL_IO_PORT_E_7)) ) ? \
  151. R_IO_PORT_WriteAll( (uint8_t)((a) >> 8), (uint8_t)(a), (uint8_t)~(a), (b) ) : \
  152. ( ((a) >= PDL_IO_PORT_0) && ((a) <= PDL_IO_PORT_E) ) ? \
  153. R_IO_PORT_WriteRegisterAll( (uint8_t)(a), (b) ): \
  154. ReturnFalse() \
  155. )
  156. /* R_IO_PORT_Compare */
  157. /* Call the function if the port number is valid. */
  158. #define R_IO_PORT_Compare(a, b, c) \
  159. ( \
  160. ( (((a) >= PDL_IO_PORT_0_0) && ((a) <= PDL_IO_PORT_E_7)) ) ? \
  161. R_IO_PORT_CompareAll( (uint8_t)((a) >> 8), (uint8_t)(a), (b), (c) ) : \
  162. ( ((a) >= PDL_IO_PORT_0) && ((a) <= PDL_IO_PORT_E) ) ? \
  163. R_IO_PORT_CompareRegisterAll( (uint8_t)(a), (b), (c) ): \
  164. ReturnFalse() \
  165. )
  166. /* R_IO_PORT_Modify */
  167. /* Call the function if the port number is valid. */
  168. #define R_IO_PORT_Modify(a, b, c) \
  169. ( \
  170. ( (((a) >= PDL_IO_PORT_0_0) && ((a) <= PDL_IO_PORT_E_7)) ) ? \
  171. R_IO_PORT_ModifyDataAll( (uint8_t)((a) >> 8), (uint8_t)(a), (uint8_t)~(a), (b), (c) ) : \
  172. ( ((a) >= PDL_IO_PORT_0) && ((a) <= PDL_IO_PORT_E) ) ? \
  173. R_IO_PORT_ModifyDataRegisterAll( (uint8_t)(a), (b), (c) ): \
  174. ReturnFalse() \
  175. )
  176. /* R_IO_PORT_Wait */
  177. /* Call the function if the port number is valid. */
  178. #define R_IO_PORT_Wait(a, b) \
  179. ( \
  180. ( (((a) >= PDL_IO_PORT_0_0) && ((a) <= PDL_IO_PORT_E_7)) && (b == 1u) ) ? \
  181. R_IO_PORT_WaitAll( (uint8_t)((a) >> 8), (uint8_t)(a), (uint8_t)(a) ) : \
  182. ( (((a) >= PDL_IO_PORT_0_0) && ((a) <= PDL_IO_PORT_E_7)) && (b == 0u) ) ? \
  183. R_IO_PORT_WaitAll( (uint8_t)((a) >> 8), (uint8_t)(a), 0u ) : \
  184. ( ((a) >= PDL_IO_PORT_0) && ((a) <= PDL_IO_PORT_E) ) ? \
  185. R_IO_PORT_WaitRegisterAll( (uint8_t)(a), (b) ) : \
  186. ReturnFalse() \
  187. )
  188. #endif
  189. /* End of file */