theCore C++ embedded framework
|
Data Structures | |
struct | ecl::usart_cfg< dev > |
Base template class for the usart configuration. More... | |
class | ecl::usart_bus< dev > |
STM32 USART bus. More... | |
Enumerations | |
enum | ecl::usart_device { ecl::usart_device::dev1, ecl::usart_device::dev2, ecl::usart_device::dev3, ecl::usart_device::dev4, ecl::usart_device::dev5, ecl::usart_device::dev6, ecl::usart_device::dev7, ecl::usart_device::dev8 } |
Represents distinct peripheral devices. More... | |
Functions | |
static ecl::err | ecl::usart_bus< dev >::init () |
Lazy initialization. More... | |
static void | ecl::usart_bus< dev >::set_rx (uint8_t *rx, size_t size) |
Sets rx buffer with given size. More... | |
static void | ecl::usart_bus< dev >::set_tx (size_t size, uint8_t fill_byte=0xff) |
Sets tx buffer made-up from sequence of similar bytes. More... | |
static void | ecl::usart_bus< dev >::set_tx (const uint8_t *tx, size_t size) |
Sets tx buffer with given size. More... | |
static void | ecl::usart_bus< dev >::set_handler (const handler_fn &handler) |
Sets event handler. More... | |
static void | ecl::usart_bus< dev >::reset_buffers () |
Reset xfer buffers. More... | |
static void | ecl::usart_bus< dev >::reset_handler () |
Resets previously set handler. More... | |
static ecl::err | ecl::usart_bus< dev >::do_xfer () |
Executes xfer, using buffers previously set. More... | |
static ecl::err | ecl::usart_bus< dev >::do_rx () |
Executes rx transfer, using rx buffer previously set. More... | |
static ecl::err | ecl::usart_bus< dev >::do_tx () |
Executes tx transfer, using tx buffer previously set. More... | |
static ecl::err | ecl::usart_bus< dev >::cancel_xfer () |
Cancels xfer. More... | |
static ecl::err | ecl::usart_bus< dev >::cancel_rx () |
Cancels xfer on rx. More... | |
static ecl::err | ecl::usart_bus< dev >::cancel_tx () |
Cancels xfer on tx. More... | |
static ecl::err | ecl::usart_bus< dev >::enable_listen_mode () |
Enables listen mode. More... | |
static ecl::err | ecl::usart_bus< dev >::disable_listen_mode () |
Disables listen mode. More... | |
|
strong |
|
static |
Lazy initialization.
|
static |
Sets rx buffer with given size.
[in,out] | rx | Buffer to write data to. Optional. |
[in] | size | Size |
|
static |
Sets tx buffer made-up from sequence of similar bytes.
[in] | size | Size of sequence |
[in] | fill_byte | Byte to fill a sequence. Optional. |
|
static |
Sets tx buffer with given size.
[in] | tx | Buffer to transmit. Optional. |
[in] | size | Buffer size. |
|
static |
Sets event handler.
Handler will be used by the bus, until reset_handler() will be called.
[in] | handler | Handler itself. |
|
static |
|
static |
Resets previously set handler.
|
static |
Executes xfer, using buffers previously set.
When it will be done, handler will be invoked.
|
static |
Executes rx transfer, using rx buffer previously set.
When it will be done, handler will be invoked.
|
static |
Executes tx transfer, using tx buffer previously set.
When it will be done, handler will be invoked.
|
static |
Cancels xfer.
After this call no xfer will occur.
|
static |
Cancels xfer on rx.
After this call no rx transfer will occur.
|
static |
Cancels xfer on tx.
After this call no tx transfer will occur.
|
static |
Enables listen mode.
In listen mode, UART bus uses different semantics of the transfer complete
event. transfer complete
will be generated with every byte received. bus_handler will be called with total
argument that equal to current count of bytes written to the buffer.
|
static |
Disables listen mode.
transfer compelte
event semantics back to normal.