theCore C++ embedded framework
Collaboration diagram for UART driver:

Files

file  uart.hpp
 UART implementation for TI TM4C MCU.
 

Data Structures

class  ecl::uart< ch >
 UART driver. More...
 

Enumerations

enum  ecl::uart_channel {
  ecl::uart_channel::ch0 = UART0_BASE, ecl::uart_channel::ch1 = UART1_BASE, ecl::uart_channel::ch2 = UART2_BASE, ecl::uart_channel::ch3 = UART3_BASE,
  ecl::uart_channel::ch4 = UART4_BASE, ecl::uart_channel::ch5 = UART5_BASE, ecl::uart_channel::ch6 = UART6_BASE, ecl::uart_channel::ch7 = UART7_BASE
}
 Represents distinct UART peripheral devices (channels) More...
 

Functions

static void ecl::uart< ch >::irq_bus_handler ()
 UART interrupt handler. More...
 
static err ecl::uart< ch >::init ()
 Lazy initialization. More...
 
static void ecl::uart< ch >::set_rx (uint8_t *rx, size_t size)
 Sets rx buffer with given size. More...
 
static void ecl::uart< ch >::set_tx (const uint8_t *tx, size_t size)
 Sets tx buffer with given size. More...
 
static void ecl::uart< ch >::set_tx (size_t size, uint8_t fill_byte=0xff)
 Sets rx buffer made-up from sequence of similar bytes. More...
 
static void ecl::uart< ch >::set_handler (const bus_handler &handler)
 Sets event handler. More...
 
static void ecl::uart< ch >::reset_buffers ()
 Reset xfer buffers. More...
 
static void ecl::uart< ch >::reset_handler ()
 Resets previously set handler. More...
 
static err ecl::uart< ch >::do_xfer ()
 Executes xfer, using buffers previously set. More...
 
static err ecl::uart< ch >::cancel_xfer ()
 Cancels xfer. More...
 

Detailed Description

Enumeration Type Documentation

◆ uart_channel

enum ecl::uart_channel
strong

Represents distinct UART peripheral devices (channels)

Enumerator
ch0 
ch1 
ch2 
ch3 
ch4 
ch5 
ch6 
ch7 

Function Documentation

◆ irq_bus_handler()

template<uart_channel ch>
void ecl::uart< ch >::irq_bus_handler ( )
staticprotected

UART interrupt handler.

Receives interrupt from IRQ subsystem.

Here is the call graph for this function:

◆ init()

template<uart_channel ch>
err ecl::uart< ch >::init ( )
static

Lazy initialization.

Returns
Status of operation.

◆ set_rx()

template<uart_channel ch>
void ecl::uart< ch >::set_rx ( uint8_t *  rx,
size_t  size 
)
static

Sets rx buffer with given size.

Parameters
[in,out]rxBuffer to write data to. Optional.
[in]sizeSize

◆ set_tx() [1/2]

template<uart_channel ch>
void ecl::uart< ch >::set_tx ( const uint8_t *  tx,
size_t  size 
)
static

Sets tx buffer with given size.

Parameters
[in]txBuffer to transmit. Optional.
[in]sizeBuffer size.

◆ set_tx() [2/2]

template<uart_channel ch>
void ecl::uart< ch >::set_tx ( size_t  size,
uint8_t  fill_byte = 0xff 
)
static

Sets rx buffer made-up from sequence of similar bytes.

Parameters
[in]sizeSize of sequence
[in]fill_byteByte to fill a sequence. Optional.

◆ set_handler()

template<uart_channel ch>
void ecl::uart< ch >::set_handler ( const bus_handler handler)
static

Sets event handler.

Handler will be used by the bus, until reset_handler() will be called.

Parameters
[in]handlerHandler itself.

◆ reset_buffers()

template<uart_channel ch>
void ecl::uart< ch >::reset_buffers ( )
static

Reset xfer buffers.

Buffers that were set by

See also
set_tx() and
set_rx() will be no longer used after this call.

◆ reset_handler()

template<uart_channel ch>
void ecl::uart< ch >::reset_handler ( )
static

Resets previously set handler.

◆ do_xfer()

template<uart_channel ch>
err ecl::uart< ch >::do_xfer ( )
static

Executes xfer, using buffers previously set.

When it will be done, handler will be invoked.

Returns
Status of operation.
Here is the call graph for this function:

◆ cancel_xfer()

template<uart_channel ch>
err ecl::uart< ch >::cancel_xfer ( )
static

Cancels xfer.

After this call no xfer will occur.

Returns
Status of operation.
Here is the call graph for this function: