Mercury API - Sample serial transport that does nothing. More...

Go to the source code of this file.
Classes | |
| struct | buf_st |
Defines | |
| #define | MAX_RX_BUFFER_LENGTH 256 |
| #define | RBUFLEN ((uint32_t)((rbuf.head < rbuf.tail) ? ((MAX_RX_BUFFER_LENGTH- rbuf.tail)+rbuf.head):(rbuf.head - rbuf.tail))) |
Typedefs | |
| typedef struct buf_st | circBuf_t |
Functions | |
| void | configure_usart (void) |
| static TMR_Status | s_flush (TMR_SR_SerialTransport *this) |
| static TMR_Status | s_open (TMR_SR_SerialTransport *this) |
| static TMR_Status | s_receiveBytes (TMR_SR_SerialTransport *this, uint32_t length, uint32_t *messageLength, uint8_t *message, const uint32_t timeoutMs) |
| static TMR_Status | s_sendBytes (TMR_SR_SerialTransport *this, uint32_t length, uint8_t *message, const uint32_t timeoutMs) |
| static TMR_Status | s_setBaudRate (TMR_SR_SerialTransport *this, uint32_t rate) |
| static TMR_Status | s_shutdown (TMR_SR_SerialTransport *this) |
| void | sercom4Handler (void) |
| TMR_Status | TMR_SR_SerialTransportNativeInit (TMR_SR_SerialTransport *transport, TMR_SR_SerialPortNativeContext *context, const char *device) |
Variables | |
| struct usart_config | config_usart |
| circBuf_t | rbuf |
| static uint8_t | s_open_flag = 1 |
| struct usart_module | usart_instance |
Mercury API - Sample serial transport that does nothing.
Definition in file serial_transport_samD21j18a.c.
| #define MAX_RX_BUFFER_LENGTH 256 |
Definition at line 36 of file serial_transport_samD21j18a.c.
| #define RBUFLEN ((uint32_t)((rbuf.head < rbuf.tail) ? ((MAX_RX_BUFFER_LENGTH- rbuf.tail)+rbuf.head):(rbuf.head - rbuf.tail))) |
Definition at line 37 of file serial_transport_samD21j18a.c.
| void configure_usart | ( | void | ) |
Definition at line 147 of file serial_transport_samD21j18a.c.
| static TMR_Status s_flush | ( | TMR_SR_SerialTransport * | this | ) | [static] |
Definition at line 264 of file serial_transport_samD21j18a.c.
| static TMR_Status s_open | ( | TMR_SR_SerialTransport * | this | ) | [static] |
Definition at line 172 of file serial_transport_samD21j18a.c.
| static TMR_Status s_receiveBytes | ( | TMR_SR_SerialTransport * | this, |
| uint32_t | length, | ||
| uint32_t * | messageLength, | ||
| uint8_t * | message, | ||
| const uint32_t | timeoutMs | ||
| ) | [static] |
Definition at line 204 of file serial_transport_samD21j18a.c.
| static TMR_Status s_sendBytes | ( | TMR_SR_SerialTransport * | this, |
| uint32_t | length, | ||
| uint8_t * | message, | ||
| const uint32_t | timeoutMs | ||
| ) | [static] |
Definition at line 188 of file serial_transport_samD21j18a.c.
| static TMR_Status s_setBaudRate | ( | TMR_SR_SerialTransport * | this, |
| uint32_t | rate | ||
| ) | [static] |
Definition at line 232 of file serial_transport_samD21j18a.c.
| static TMR_Status s_shutdown | ( | TMR_SR_SerialTransport * | this | ) | [static] |
Definition at line 254 of file serial_transport_samD21j18a.c.
| void sercom4Handler | ( | void | ) |
Handles receive interrupt as it occur. Note:To use this interrupt handler you have to register it in usart_init() function as shown below. _sercom_set_handler(instance_index, sercom4Handler);
Definition at line 62 of file serial_transport_samD21j18a.c.
| TMR_Status TMR_SR_SerialTransportNativeInit | ( | TMR_SR_SerialTransport * | transport, |
| TMR_SR_SerialPortNativeContext * | context, | ||
| const char * | device | ||
| ) |
Initialize a TMR_SR_SerialTransport structure with a given serial device.
| transport | The TMR_SR_SerialTransport structure to initialize. |
| context | A TMR_SR_SerialPortNativeContext structure for the callbacks to use. |
| device | The path or name of the serial device (/dev/ttyS0, COM1) |
Definition at line 281 of file serial_transport_samD21j18a.c.
| struct usart_config config_usart |
Definition at line 48 of file serial_transport_samD21j18a.c.
Definition at line 51 of file serial_transport_samD21j18a.c.
uint8_t s_open_flag = 1 [static] |
Definition at line 49 of file serial_transport_samD21j18a.c.
| struct usart_module usart_instance |
Definition at line 50 of file serial_transport_samD21j18a.c.