UART

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

Provides UART entity access on certain BrainStem modules.

A UART is a “Universal Asynchronous Reciever/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 Baud rate of the UART.

Returns:

Result object, containing NO_ERROR and the UART baud rate

or a non zero Error code.

Return type:

Result

getEnable()[source]

Get the enable status of the UART.

Returns:

Result object, containing NO_ERROR and the UART state

or a non zero Error code.

Return type:

Result

getProtocol()[source]

Get the protocol format of the UART.

Returns:

Result object, containing NO_ERROR and the UART protocol

or a non zero Error code.

Return type:

Result

setBaudRate(rate)[source]

Set the Baud rate of the UART.

Param:

rate (int):

Returns:

Return NO_ERROR on success, or one of the common sets of return error codes on failure.

Return type:

Result.error

setEnable(bEnable)[source]

Enable the UART.

Param:

bEnable (bool): True = Enable, False = Disable

Returns:

Return NO_ERROR on success, or one of the common sets of return error codes on failure.

Return type:

Result.error

setProtocol(protocol)[source]

Set the protocol format of the UART.

Param:

protocol (int):

Returns:

Return NO_ERROR on success, or one of the common sets of return error codes on failure.

Return type:

Result.error