UART Entity¶
See the UART Entity for generic information.
- group UARTEntity
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 enabled)¶
Enable the UART channel.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
enabled – true: enabled, false: disabled.
-
void uart_getEnable(unsigned int *id, struct Result *result, const int index)¶
Get the enabled state of the uart.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: true: enabled, false: disabled.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
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. If zero, automatic baud rate selection is used.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
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. If zero, automatic baud rate selection is used.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: Pointer variable to be filled with baud rate.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
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.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
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.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: Pointer to where result is placed.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void uart_setLinkChannel(unsigned int *id, struct Result *result, const int index, const unsigned char channel)¶
Set the index of another UART Entity that should be linked to this UART.
If set to the index of this entity, the channel will not be linked. If set to the index of another UART entity, data will be sent between the two UART entities with no additional processing.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
channel – Index of the UART Entity to link
-
void uart_getLinkChannel(unsigned int *id, struct Result *result, const int index)¶
Gets the index of the UART Entity that this entity is linked to.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: Pointer to where result is placed.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void uart_setStopBits(unsigned int *id, struct Result *result, const int index, const unsigned char stopBits)¶
Set the UART stop bit configuration
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
stopBits – Stop Bits of UART Channel. Allowed options:
uartStopBits_1_Value
uartStopBits_1p5_Value
uartStopBits_2_Value
-
void uart_getStopBits(unsigned int *id, struct Result *result, const int index)¶
Set the UART stop bit configuration
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: Pointer to where result is placed. Possible values:
uartStopBits_1_Value
uartStopBits_1p5_Value
uartStopBits_2_Value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void uart_setParity(unsigned int *id, struct Result *result, const int index, const unsigned char parity)¶
Set the UART parity.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
parity – Parity of UART Channel. Allowed options:
uartParity_None_Value
uartParity_Odd_Value
uartParity_Even_Value
uartParity_Mark_Value
uartParity_Space_Value
-
void uart_getParity(unsigned int *id, struct Result *result, const int index)¶
Get the UART parity.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: Pointer variable to be filled with value. Possible values:
uartParity_None_Value
uartParity_Odd_Value
uartParity_Even_Value
uartParity_Mark_Value
uartParity_Space_Value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void uart_setDataBits(unsigned int *id, struct Result *result, const int index, const unsigned char dataBits)¶
Set the number of bits per character
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
dataBits – Data Bits of UART Channel.
-
void uart_getDataBits(unsigned int *id, struct Result *result, const int index)¶
Get the number of bits per character
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: Pointer to where result is placed.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void uart_setFlowControl(unsigned int *id, struct Result *result, const int index, const unsigned char flowControl)¶
Set the UART flow control configuration
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
flowControl – Flow Control of UART Channel as a bitmask. Allowed bits:
uartFlowControl_RTS_CTS_Bit
uartFlowControl_DSR_DTR_Bit
uartFlowControl_XON_XOFF_Bit
-
void uart_getFlowControl(unsigned int *id, struct Result *result, const int index)¶
Set the UART flow control configuration
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: Pointer to bitmask where result is placed. Possible bits:
uartFlowControl_RTS_CTS_Bit
uartFlowControl_DSR_DTR_Bit
uartFlowControl_XON_XOFF_Bit
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void uart_getCapableProtocols(unsigned int *id, struct Result *result, const int index)¶
Returns a bitmask containing a list of protocols that this UART entity is allowed to select. This does not guarantee that selecting a protocol with “setProtocol” will have an available resource.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: Bitmask containing list of protocols that may be selected. The value of the uartProtocol is mapped to the bit index (e.g. uartProtocol_Undefined is bit 0, uartProtocol_ExtronResponder_Value is bit 1, etc.)
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void uart_getAvailableProtocols(unsigned int *id, struct Result *result, const int index)¶
Returns a bitmask containing a list of protocols that this UART entity is capable of selecting, and has an available protocol resource to assign.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: Bitmask containing list of protocols that are available to select. The value of the uartProtocol is mapped to the bit index (e.g. uartProtocol_Undefined is bit 0, uartProtocol_ExtronResponder_Value is bit 1, etc.)
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.