Go to the source code of this file.
Classes | |
struct | port_monitor_helper_t |
Functions | |
void | d_usartDMA_callback_cdc_disable (void) |
bool | d_usartDMA_callback_cdc_enable (void) |
void | d_usartDMA_callback_cdc_tx_empty_notify (void) |
int | serFindCharacter (int serialNum, uint8_t ch) |
Returns number of characters in buffer before specified character. More... | |
int | serGetBaudRate (int serialNum) |
Read USART baudrate. Return value is the baudrate or -1 on failure. More... | |
int | serInit (int serialNum, uint32_t baudRate, sam_usart_opt_t *options, uint32_t *overrunStatus) |
Initialize serial port with specific USART/UART and DMA settings. If not NULL, the overrun status will have bits HDW_STATUS_ERR_COM_TX_LIMITED and HDW_STATUS_ERR_COM_RX_OVERRUN set during buffer limitation. More... | |
int | serRead (int serialNum, unsigned char *buf, int size) |
Read data on USART. Returns number of bytes read. With use of the PDCA ring buffer, buffer overrun may occur if bytes are received is greater than bytes read plus buffer size. More... | |
int | serRxClear (int serialNum, int len) |
Removes removes data from USART Rx buffer. Returns number of bytes removed. Length of -1 removes all data from USART buffer. More... | |
int | serRxFree (int serialNum) |
Returns number of bytes available in Rx buffer. More... | |
int | serRxUsed (int serialNum) |
Returns number of bytes used in Rx buffer. More... | |
int | serSetBaudRate (int serialNum, int baudrate) |
Change USART baudrate. 0 on success, -1 on failure. More... | |
int | serTxClear (int serialNum) |
Clear the entire Tx buffer, returns how much was cleared. More... | |
int | serTxFree (int serialNum) |
Returns number of bytes available in Tx buffer. More... | |
int | serTxUsed (int serialNum) |
Returns number of bytes used in Tx buffer. More... | |
int | serWrite (int serialNum, const unsigned char *buf, int size) |
Write data on USART. Returns number of bytes written. More... | |
int | validateBaudRate (unsigned int baudRate) |
Returns -1 if the baudrate is not a standard baudrate. More... | |
Variables | |
port_monitor_helper_t | g_portMonitorHelper [MAX_NUMBER_SERIAL_PORTS] |
void d_usartDMA_callback_cdc_disable | ( | void | ) |
Definition at line 166 of file d_usartDMA.c.
bool d_usartDMA_callback_cdc_enable | ( | void | ) |
Definition at line 160 of file d_usartDMA.c.
void d_usartDMA_callback_cdc_tx_empty_notify | ( | void | ) |
Definition at line 171 of file d_usartDMA.c.
int serFindCharacter | ( | int | serialNum, |
uint8_t | ch | ||
) |
Returns number of characters in buffer before specified character.
Definition at line 884 of file d_usartDMA.c.
int serGetBaudRate | ( | int | serialNum | ) |
Read USART baudrate. Return value is the baudrate or -1 on failure.
Definition at line 1016 of file d_usartDMA.c.
int serInit | ( | int | serialNum, |
uint32_t | baudRate, | ||
sam_usart_opt_t * | options, | ||
uint32_t * | overrunStatus | ||
) |
Initialize serial port with specific USART/UART and DMA settings. If not NULL, the overrun status will have bits HDW_STATUS_ERR_COM_TX_LIMITED and HDW_STATUS_ERR_COM_RX_OVERRUN set during buffer limitation.
Definition at line 1560 of file d_usartDMA.c.
int serRead | ( | int | serialNum, |
unsigned char * | buf, | ||
int | size | ||
) |
Read data on USART. Returns number of bytes read. With use of the PDCA ring buffer, buffer overrun may occur if bytes are received is greater than bytes read plus buffer size.
Definition at line 782 of file d_usartDMA.c.
int serRxClear | ( | int | serialNum, |
int | len | ||
) |
Removes removes data from USART Rx buffer. Returns number of bytes removed. Length of -1 removes all data from USART buffer.
Definition at line 398 of file d_usartDMA.c.
int serRxFree | ( | int | serialNum | ) |
Returns number of bytes available in Rx buffer.
Definition at line 332 of file d_usartDMA.c.
int serRxUsed | ( | int | serialNum | ) |
Returns number of bytes used in Rx buffer.
Definition at line 301 of file d_usartDMA.c.
int serSetBaudRate | ( | int | serialNum, |
int | baudrate | ||
) |
Change USART baudrate. 0 on success, -1 on failure.
Definition at line 995 of file d_usartDMA.c.
int serTxClear | ( | int | serialNum | ) |
Clear the entire Tx buffer, returns how much was cleared.
Clear the entire Tx buffer, returns how much was cleared.
Definition at line 344 of file d_usartDMA.c.
int serTxFree | ( | int | serialNum | ) |
Returns number of bytes available in Tx buffer.
Definition at line 313 of file d_usartDMA.c.
int serTxUsed | ( | int | serialNum | ) |
Returns number of bytes used in Tx buffer.
Definition at line 289 of file d_usartDMA.c.
int serWrite | ( | int | serialNum, |
const unsigned char * | buf, | ||
int | size | ||
) |
Write data on USART. Returns number of bytes written.
Definition at line 443 of file d_usartDMA.c.
int validateBaudRate | ( | unsigned int | baudRate | ) |
Returns -1 if the baudrate is not a standard baudrate.
Definition at line 980 of file d_usartDMA.c.
port_monitor_helper_t g_portMonitorHelper[MAX_NUMBER_SERIAL_PORTS] |
Definition at line 153 of file d_usartDMA.c.