13 #ifndef _D_USARTDMA_H_ 14 #define _D_USARTDMA_H_ 20 #include "../ASF/sam/drivers/usart/usart.h" 45 int serWrite(
int serialNum,
const unsigned char *buf,
int size );
53 int serRead(
int serialNum,
unsigned char *buf,
int size );
115 #endif // _D_USARTDMA_H_ int serWrite(int serialNum, const unsigned char *buf, int size)
Write data on USART. Returns number of bytes written.
int serGetBaudRate(int serialNum)
Read USART baudrate. Return value is the baudrate or -1 on failure.
#define MAX_NUMBER_SERIAL_PORTS
int serTxFree(int serialNum)
Returns number of bytes available in Tx buffer.
bool d_usartDMA_callback_cdc_enable(void)
int serRxClear(int serialNum, int len)
Removes removes data from USART Rx buffer. Returns number of bytes removed. Length of -1 removes all ...
int validateBaudRate(unsigned int baudRate)
Returns -1 if the baudrate is not a standard baudrate.
void d_usartDMA_callback_cdc_disable(void)
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.
int serTxClear(int serialNum)
Clear the entire Tx buffer, returns how much was cleared.
int serFindCharacter(int serialNum, uint8_t ch)
Returns number of characters in buffer before specified character.
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 wil...
int serTxUsed(int serialNum)
Returns number of bytes used in Tx buffer.
int serRxUsed(int serialNum)
Returns number of bytes used in Rx buffer.
port_monitor_helper_t g_portMonitorHelper[MAX_NUMBER_SERIAL_PORTS]
int serSetBaudRate(int serialNum, int baudrate)
Change USART baudrate. 0 on success, -1 on failure.
int serRxFree(int serialNum)
Returns number of bytes available in Rx buffer.
void d_usartDMA_callback_cdc_tx_empty_notify(void)