UART Entity

group UARTEntity

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.

void uart_setEnable(unsigned int *id, struct Result *result, const int index, const unsigned char bEnabled)

Enable the UART channel.

Returns common entity return values

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Object containing aErrNone on success. Non-zero error code on failure.

  • index – The index of the entity in question.

  • bEnabled – true: enabled, false: disabled.

void uart_getEnable(unsigned int *id, struct Result *result, const int index)

Get the enabled state of the uart.

Returns common entity return values

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. true: enabled, false: disabled.

  • index – The index of the entity in question.

void uart_setBaudRate(unsigned int *id, struct Result *result, const int index, const unsigned int rate)

Set the UART baud rate.

Returns common entity return values

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Object containing aErrNone on success. Non-zero error code on failure.

  • index – The index of the entity in question.

  • rate – baud rate.

void uart_getBaudRate(unsigned int *id, struct Result *result, const int index)

Get the UART baud rate.

Returns common entity return values

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. Pointer variable to be filled with baud rate.

  • index – The index of the entity in question.

void uart_setProtocol(unsigned int *id, struct Result *result, const int index, const unsigned char protocol)

Set the UART protocol.

Returns common entity return values

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Object containing aErrNone on success. Non-zero error code on failure.

  • index – The index of the entity in question.

  • protocol – An enumeration of serial protocols.

void uart_getProtocol(unsigned int *id, struct Result *result, const int index)

Get the UART protocol.

Returns common entity return values

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. Pointer to where result is placed.

  • index – The index of the entity in question.