UART Class

class UARTClass : public Acroname::BrainStem::EntityClass

UART Class: A UART is a “Universal Asynchronous Receiver/Transmitter. Many times referred to as a COM (communication), Serial, or TTY (teletypewriter) port.

The UART Class allows the enabling and disabling of the UART data lines.

Public Functions

UARTClass(void)

Constructor.

~UARTClass(void)

Destructor.

void init(Module *pModule, const uint8_t index)

Initialize the class.

Parameters:
  • pModule – The module to which this entity belongs.

  • index – The index of the entity, i.e. aMUX_UART or aMUX_USB.

aErr setEnable(const uint8_t bEnabled)

Enable the UART channel.

Parameters:

bEnabled – true: enabled, false: disabled.

Returns:

Returns common entity return values

aErr getEnable(uint8_t *bEnabled)

Get the enabled state of the uart.

Parameters:

bEnabled – true: enabled, false: disabled.

Returns:

Returns common entity return values

aErr setBaudRate(const uint32_t rate)

Set the UART baud rate.

Parameters:

rate – baud rate.

Returns:

Returns common entity return values

aErr getBaudRate(uint32_t *rate)

Get the UART baud rate.

Parameters:

rate – Pointer variable to be filled with baud rate.

Returns:

Returns common entity return values

aErr setProtocol(const uint8_t protocol)

Set the UART protocol.

Parameters:

protocol – An enumeration of serial protocols.

Returns:

Returns common entity return values

aErr getProtocol(uint8_t *protocol)

Get the UART protocol.

Parameters:

protocol – Pointer to where result is placed.

Returns:

Returns common entity return values