UART Entity¶
API Documentation: [cpp] [python] [.NET] [LabVIEW]
The UART entity is a class which allows the configuration of a specified uart port.
Channel Enable (Get/Set)¶
uart [ index ] . setEnable => (unsigned char) enable
uart [ index ] . getEnable <= (unsigned char) enable
Enables the uart channel for the specified index.
Change Baudrate (Get/Set)¶
uart [ index ] . setBaudRate => (unsigned int) rate
uart [ index ] . getBaudRate <= (unsigned int) rate
Allows for get and set of the uart channel’s baudrate.
Change Protocol (Get/Set)¶
uart [ index ] . setProtocol => (unsigned char) protocol
uart [ index ] . getProtocol <= (unsigned char) protocol
Allows for get and set of the uart channel’s protocol if there are different protocols.
Code Examples¶
C++¶
// All commands return aErr values when errors are encountered and aErrNone on
// success. Get calls will fill the variable with the returned value.
err = stem.uart[0].setEnable(1);
err = stem.uart[1].setEnable(1);
err = stem.uart[0].getEnable(&enable);
err = stem.uart[1].getEnable(&enable);
err = stem.uart[0].setEnable(0);
err = stem.uart[1].setEnable(0);
Python¶
err = stem.uart[0].setEnable(1);
err = stem.uart[1].setEnable(1);
result = stem.uart[0].getEnable()
print result.value
result = stem.uart[1].getEnable()
print result.value
err = stem.uart[0].setEnable(0);
err = stem.uart[1].setEnable(0);