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