r_pdl_io_port_rx62nxbg.h 5.3 KB

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