r_pdl_sci_rx62nxx.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /*""FILE COMMENT""*******************************************************
  2. * System Name : Serial Communication Interface API for RX62Nxx
  3. * File Name : r_pdl_sci_RX62Nxx.h
  4. * Version : 1.02
  5. * Contents : Serial Interface 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_SCI_RX62Nxx_H
  23. #define R_PDL_SCI_RX62Nxx_H
  24. #define SCI_CHANNELS 7
  25. /* Globals */
  26. extern volatile const uint8_t * rpdl_SCI_tx_string_pointer[SCI_CHANNELS];
  27. extern volatile uint8_t * rpdl_SCI_rx_string_pointer[SCI_CHANNELS];
  28. extern volatile uint8_t * rpdl_SCI_rx_string_start[SCI_CHANNELS];
  29. extern volatile uint16_t rpdl_SCI_rx_counter[SCI_CHANNELS];
  30. extern volatile uint16_t rpdl_SCI_tx_counter[SCI_CHANNELS];
  31. extern volatile uint16_t rpdl_SCI_rx_threshold[SCI_CHANNELS];
  32. extern volatile uint16_t rpdl_SCI_tx_threshold[SCI_CHANNELS];
  33. extern volatile uint8_t rpdl_SCI_tx_using_irq[SCI_CHANNELS];
  34. extern volatile uint8_t rpdl_SCI_rx_using_irq[SCI_CHANNELS];
  35. extern volatile uint8_t rpdl_SCI_sync_simultaneous[SCI_CHANNELS];
  36. extern volatile uint8_t rpdl_SCI_MP_mode[SCI_CHANNELS];
  37. extern volatile uint8_t rpdl_SCI_MP_rx_stationID[SCI_CHANNELS];
  38. /* Callback function prototypes */
  39. extern VoidCallBackFunc rpdl_SCI_TX_End_callback_func[SCI_CHANNELS];
  40. extern VoidCallBackFunc rpdl_SCI_RX_End_callback_func[SCI_CHANNELS];
  41. extern VoidCallBackFunc rpdl_SCI_RX_Error_callback_func[SCI_CHANNELS];
  42. /* Library prototypes */
  43. bool R_SCI_SetAll(
  44. const uint8_t
  45. );
  46. bool R_SCI_CreateAll(
  47. const uint8_t,
  48. const uint32_t,
  49. const uint32_t,
  50. const uint8_t
  51. );
  52. bool R_SCI_CreateAsyncAll(
  53. const uint8_t,
  54. const uint32_t,
  55. const uint32_t,
  56. const uint8_t
  57. );
  58. bool R_SCI_CreateSyncAll(
  59. const uint8_t,
  60. const uint32_t,
  61. const uint32_t,
  62. const uint8_t
  63. );
  64. bool R_SCI_CreateSmartAll(
  65. const uint8_t,
  66. const uint32_t,
  67. const uint32_t,
  68. const uint8_t
  69. );
  70. bool R_SCI_DestroyAll(
  71. const uint8_t
  72. );
  73. bool R_SCI_SendAll(
  74. const uint8_t,
  75. const uint16_t,
  76. volatile const uint8_t * const,
  77. const uint16_t,
  78. VoidCallBackFunc const
  79. );
  80. bool R_SCI_SendStationID(
  81. const uint8_t,
  82. const uint16_t
  83. );
  84. bool R_SCI_SendData(
  85. const uint8_t,
  86. const uint16_t,
  87. volatile const uint8_t * const,
  88. const uint16_t,
  89. VoidCallBackFunc const
  90. );
  91. bool R_SCI_ReceiveAll(
  92. const uint8_t,
  93. const uint16_t,
  94. volatile uint8_t * const,
  95. const uint16_t,
  96. VoidCallBackFunc const,
  97. VoidCallBackFunc const
  98. );
  99. bool R_SCI_ReceiveStationID(
  100. const uint8_t,
  101. const uint16_t,
  102. VoidCallBackFunc const,
  103. VoidCallBackFunc const
  104. );
  105. bool R_SCI_ReceiveData(
  106. const uint8_t,
  107. const uint16_t,
  108. volatile uint8_t * const,
  109. const uint16_t,
  110. VoidCallBackFunc const,
  111. VoidCallBackFunc const
  112. );
  113. bool R_SCI_ControlAll(
  114. const uint8_t,
  115. const uint8_t
  116. );
  117. bool R_SCI_GetStatusAll(
  118. const uint8_t,
  119. volatile uint8_t * const,
  120. volatile uint8_t * const,
  121. volatile uint16_t * const,
  122. volatile uint16_t * const
  123. );
  124. bool ReturnFalse(void);
  125. /* Macro definitions */
  126. #define R_SCI_Set(a) \
  127. ( R_SCI_SetAll( (a) ) )
  128. #define R_SCI_Create(a, b, c, d) \
  129. ( \
  130. ( ((a) >= SCI_CHANNELS) || ((a) == 4) || ((c) == 0) || ((d) > IPL_MAX) )? \
  131. ReturnFalse(): \
  132. R_SCI_CreateAll( (a), (b), (c), (d) )\
  133. )
  134. #define R_SCI_Destroy(a) \
  135. ( \
  136. (((a) < SCI_CHANNELS) && ((a) != 4)) ? \
  137. R_SCI_DestroyAll( (a) ): \
  138. ReturnFalse() \
  139. )
  140. #define R_SCI_Send(a, b, c, d, e) \
  141. ( \
  142. (((a) < SCI_CHANNELS) && ((a) != 4)) ? \
  143. R_SCI_SendAll( (a), (b), (c), (d), (e) ): \
  144. ReturnFalse() \
  145. )
  146. #define R_SCI_Receive(a, b, c, d, e, f) \
  147. ( \
  148. (((a) < SCI_CHANNELS) && ((a) != 4)) ? \
  149. R_SCI_ReceiveAll( (a), (b), (c), (d), (e), (f) ): \
  150. ReturnFalse() \
  151. )
  152. #define R_SCI_Control(a, b) \
  153. ( \
  154. (((a) < SCI_CHANNELS) && ((a) != 4)) ? \
  155. R_SCI_ControlAll( (a), (b) ): \
  156. ReturnFalse() \
  157. )
  158. #define R_SCI_GetStatus(a, b, c, d, e) \
  159. ( \
  160. (((a) < SCI_CHANNELS) && ((a) != 4)) ? \
  161. R_SCI_GetStatusAll( (a), (b), (c), (d), (e) ): \
  162. ReturnFalse() \
  163. )
  164. #endif
  165. /* End of file */