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:
- 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:
- 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:
- 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