Changeset 429 for EcnlProtoTool/trunk/asp3_dcre/mbed/hal/serial_api.h
- Timestamp:
- Jul 3, 2020, 7:19:17 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/serial_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2013 ARM Limited … … 18 21 19 22 #include "device.h" 20 #include " buffer.h"21 #include " dma_api.h"23 #include "hal/buffer.h" 24 #include "hal/dma_api.h" 22 25 23 26 #if DEVICE_SERIAL … … 81 84 82 85 #if DEVICE_SERIAL_ASYNCH 83 /** Asynch serial halstructure86 /** Asynch serial HAL structure 84 87 */ 85 88 typedef struct { 86 89 struct serial_s serial; /**< Target specific serial structure */ 87 struct buffer_s tx_buff; /**< T xbuffer */88 struct buffer_s rx_buff; /**< R xbuffer */90 struct buffer_s tx_buff; /**< TX buffer */ 91 struct buffer_s rx_buff; /**< RX buffer */ 89 92 uint8_t char_match; /**< Character to be matched */ 90 93 uint8_t char_found; /**< State of the matched character */ … … 92 95 93 96 #else 94 /** Non-asynch serial halstructure97 /** Non-asynch serial HAL structure 95 98 */ 96 99 typedef struct serial_s serial_t; … … 103 106 104 107 /** 105 * \defgroup GeneralSerial Serial Configuration Functions108 * \defgroup hal_GeneralSerial Serial Configuration Functions 106 109 * @{ 107 110 */ 108 111 109 112 /** Initialize the serial peripheral. It sets the default parameters for serial 110 * peripheral, and configure its specifieds pins.111 * 112 * @param obj The serial object 113 * @param tx The TX pin 114 * @param rx The RX pin 113 * peripheral, and configures its specifieds pins. 114 * 115 * @param obj The serial object 116 * @param tx The TX pin name 117 * @param rx The RX pin name 115 118 */ 116 119 void serial_init(serial_t *obj, PinName tx, PinName rx); … … 139 142 void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_bits); 140 143 141 /** The serial interrupt handler registration .144 /** The serial interrupt handler registration 142 145 * 143 146 * @param obj The serial object 144 * @param handler The interrupt handler which will be invoked when interrupt fires.147 * @param handler The interrupt handler which will be invoked when the interrupt fires 145 148 * @param id The SerialBase object 146 149 */ … … 161 164 int serial_getc(serial_t *obj); 162 165 163 /** Puta character. This is a blocking call, waiting for a peripheral to be available166 /** Send a character. This is a blocking call, waiting for a peripheral to be available 164 167 * for writing 165 168 * … … 172 175 * 173 176 * @param obj The serial object 174 * @return Non-zero value if a character can be read, 0 if nothing to read .177 * @return Non-zero value if a character can be read, 0 if nothing to read 175 178 */ 176 179 int serial_readable(serial_t *obj); … … 203 206 /** Configure the TX pin for UART function. 204 207 * 205 * @param tx The pin used for TX208 * @param tx The pin name used for TX 206 209 */ 207 210 void serial_pinout_tx(PinName tx); … … 212 215 * @param obj The serial object 213 216 * @param type The type of the flow control. Look at the available FlowControl types. 214 * @param rxflow The tx pin215 * @param txflow The rx pin217 * @param rxflow The TX pin name 218 * @param txflow The RX pin name 216 219 */ 217 220 void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, PinName txflow); … … 222 225 223 226 /** 224 * \defgroup AsynchSerial Asynchronous Serial Hardware Abstraction Layer227 * \defgroup hal_AsynchSerial Asynchronous Serial Hardware Abstraction Layer 225 228 * @{ 226 229 */ … … 230 233 * 231 234 * @param obj The serial object 232 * @param tx The buffer for sending233 * @param tx_length The number of words to transmit234 * @param tx_width The bit width of buffer word235 * @param tx The transmit buffer 236 * @param tx_length The number of bytes to transmit 237 * @param tx_width Deprecated argument 235 238 * @param handler The serial handler 236 239 * @param event The logical OR of events to be registered 237 240 * @param hint A suggestion for how to use DMA with this transfer 238 * @return Returns number of data transfered, o r 0 otherwise241 * @return Returns number of data transfered, otherwise returns 0 239 242 */ 240 243 int serial_tx_asynch(serial_t *obj, const void *tx, size_t tx_length, uint8_t tx_width, uint32_t handler, uint32_t event, DMAUsage hint); … … 244 247 * 245 248 * @param obj The serial object 246 * @param rx The buffer for sending247 * @param rx_length The number of words to transmit248 * @param rx_width The bit width of buffer word249 * @param rx The receive buffer 250 * @param rx_length The number of bytes to receive 251 * @param rx_width Deprecated argument 249 252 * @param handler The serial handler 250 253 * @param event The logical OR of events to be registered … … 272 275 * 273 276 * @param obj The serial object 274 * @return Returns event flags if a RX transfer termination condition was met or 0 otherwise277 * @return Returns event flags if an RX transfer termination condition was met; otherwise returns 0 275 278 */ 276 279 int serial_irq_handler_asynch(serial_t *obj); 277 280 278 281 /** Abort the ongoing TX transaction. It disables the enabled interupt for TX and 279 * flush TX hardware buffer if TX FIFO is used282 * flushes the TX hardware buffer if TX FIFO is used 280 283 * 281 284 * @param obj The serial object … … 283 286 void serial_tx_abort_asynch(serial_t *obj); 284 287 285 /** Abort the ongoing RX transaction It disables the enabled interrupt for RX and286 * flush RX hardware buffer if RX FIFO is used288 /** Abort the ongoing RX transaction. It disables the enabled interrupt for RX and 289 * flushes the RX hardware buffer if RX FIFO is used 287 290 * 288 291 * @param obj The serial object … … 301 304 302 305 #endif 306 307 /** @}*/
Note:
See TracChangeset
for help on using the changeset viewer.