UART

class brainstem.entity.UART(module, index)[source]

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.

getBaudRate()[source]

Get the UART baud rate. Pointer variable to be filled with baud rate.

Returns:

Result object containing the requested value when the results error is set to NO_ERROR(0)

Return type:

Result

getEnable()[source]

Get the enabled state of the uart. true: enabled, false: disabled.

Returns:

Result object containing the requested value when the results error is set to NO_ERROR(0)

Return type:

Result

getProtocol()[source]

Get the UART protocol. Pointer to where result is placed.

Returns:

Result object containing the requested value when the results error is set to NO_ERROR(0)

Return type:

Result

setBaudRate(rate)[source]

Set the UART baud rate.

Parameters:

rate (const unsigned int) – baud rate.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte

setEnable(bEnabled)[source]

Enable the UART channel.

Parameters:

bEnabled (const unsigned char) – true: enabled, false: disabled.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte

setProtocol(protocol)[source]

Set the UART protocol.

Parameters:

protocol (const unsigned char) – An enumeration of serial protocols.

Returns:

An error result from the list of defined error codes in brainstem.result

Return type:

unsigned byte