Koduino
|
Fixed length bulk serial data transfers using DMA. More...
#include <BulkSerial.h>
Fixed length bulk serial data transfers using DMA.
No interrupts are used for either RX or TX, but the tradeoff is that the transfer length must be known beforehand. Since the DMA availability depends on the chip, this is only supported on some USARTSs, and the connections from USART to DMA must be hardcoded here.
TODO!
Public Member Functions | |
BulkSerial (const BulkSerialSettings &bss) | |
Constructor needs a BulkSerialSettings instance. More... | |
void | begin (uint32_t baud, uint16_t sizeTx, void *bufTx, uint16_t sizeRx) |
Call this in setup. More... | |
void | enable (bool flag) |
TX can be disabled or enabled (default is disabled) More... | |
void | write () |
Sends the TX buffer. | |
int | received (uint16_t alignment, uint8_t *dest) |
Flag to check if a new packet was received (call this often) More... | |
void | initOpenLog (const char *header, const char *fmt) |
special function to init OpenLog before bulk transmits start More... | |
|
inline |
Constructor needs a BulkSerialSettings instance.
Use predefined MBLC_OPENLOG
or MBLC_RPI
for now
void BulkSerial::begin | ( | uint32_t | baud, |
uint16_t | sizeTx, | ||
void * | bufTx, | ||
uint16_t | sizeRx | ||
) |
Call this in setup.
[long description]
baud | Baud rate |
sizeTx | Set 0 to disable TX, otherwise specify the packet size in bytes |
bufTx | Pointer to TX struct (can pass NULL if sizeTx is 0) |
sizeRx | Set 0 to disable RX, otherwise specify the packet size in bytes |
|
inline |
TX can be disabled or enabled (default is disabled)
This is to maintain compatibility with OpenLog functionality
flag | enable TX |
void BulkSerial::initOpenLog | ( | const char * | header, |
const char * | fmt | ||
) |
special function to init OpenLog before bulk transmits start
header | see OpenLog::init() |
fmt | see OpenLog::init() |
int BulkSerial::received | ( | uint16_t | alignment, |
uint8_t * | dest | ||
) |
Flag to check if a new packet was received (call this often)
Once this is called, the flag is reset, and will return
alignment | alignment word (remember this is little endian!) |
dest | copies the received buffer here starting with alignment on success |