Author
|
Matrix TSL
|
Version
|
2.2
|
Category
|
Misc
|
UART component
CAL = Code Abstraction Layer - Allows one code base to run on a wide range of chips. A low level implementation giving direct access to the UART peripheral. Includes simulation functionality to commmunicate via a COM port or an Injector component. Also includes timestamped logging via the console and Data Recorder trace monitoring support.
Component Pack
FREE
Detailed description
No detailed description exists yet for this component
Examples
Example showing how to build a component using a CAL component Using CAL Components.
Downloadable macro reference
|
ControlPin
|
Allows direct control over the TX and RTS pins Also allows for reading of the state of the RX and CTS pins. Only available when the UART is uninitialised.
|
- BYTE
|
Pin
|
0=TX, 1=RX, 2=RTS, 3=CTS
|
- BYTE
|
State
|
|
- BYTE
|
Return
|
|
SendString
|
Transmits a string of bytes via the UART peripheral
|
- STRING
|
Data
|
Data String to transmit
|
- VOID
|
Return
|
|
UpdateBaud
|
Changes the UART Baud rate. 0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200, 8=250000
|
- BYTE
|
new_baud
|
0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200, 8=250000
|
- VOID
|
Return
|
|
TestProperty
|
A simple macro to allow us to test the value of a single property during runtime.
|
- BYTE
|
Property
|
0=UseTX, 1=UseRX, 2=UseFlowControl
|
- BYTE
|
Return
|
|
SendNumber
|
Transmits a numeric value as an ASCII string
|
- LONG
|
Number
|
Numeric value to send
|
- VOID
|
Return
|
|
GetValue
|
Get Value of Named property
|
- STRING
|
Name
|
|
- STRING
|
Return
|
|
Prv_SimShowWaveform
|
|
- BYTE
|
TXRX
|
|
- UINT
|
Data
|
|
- VOID
|
Return
|
|
Receive
|
Receive a Character
|
- BYTE
|
Timeout
|
Period to wait for the character to be received
|
- INT
|
Return
|
|
Send
|
Send the Character
|
- UINT
|
Char
|
The Character to send
|
- VOID
|
Return
|
|
GetConsoleHandle
|
|
- HANDLE
|
Return
|
|
SendByteArray
|
Transmits an array of bytes via the UART peripheral
|
- BYTE
|
Data
|
Data to transmit
|
- BYTE
|
NumBytes
|
Number of bytes to send from the array
|
- VOID
|
Return
|
|
Init
|
Initialize the component with the specified properties
|
- VOID
|
Return
|
|
Delay
|
Software UART Bit Delay
|
- VOID
|
Return
|
|
SetValue
|
set Value of Named property
|
- STRING
|
Name
|
|
- STRING
|
Value
|
|
- VOID
|
Return
|
|
Uninit
|
Un-initialize the UART and release the resources
|
- VOID
|
Return
|
|
GetList
|
Gets Named property List
|
- STRING
|
Name
|
|
- STRING
|
Return
|
|
ReceiveByteArray
|
Receives an array of bytes and returns the number of bytes received.
|
- BYTE
|
Data
|
|
- BYTE
|
NumBytes
|
Maximum number of bytes to try and receive
|
- BYTE
|
Timeout
|
Max amount of time in ms to wait between bytes
|
- BYTE
|
Return
|
|
ReceiveString
|
Receives a string of bytes and returns the number of bytes received.
|
- STRING
|
StringData
|
|
- BYTE
|
NumBytes
|
Maximum number of bytes to try and receive
|
- BYTE
|
Timeout
|
Max amount of time in ms to wait between bytes
|
- BYTE
|
Return
|
Property reference
|
Properties
|
|
Component Enable
|
A global flag to enable or disable the UART component from producing code. Useful for generating components with multiple communications options.
|
|
Connections
|
|
Channel
|
UART Channel selector Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels. Hardware channels use the selected peripheral on-board the target microcontroller.
|
|
Transmit
|
|
Use TX
|
Selects if the Transmit pin is used by the component. Yes: The TX pin is active and used to transmit data for the UART. No: The TX pin is disabled and free to be used as general I/O.
|
|
TX
|
Pin to be used for Transmit data
|
|
Receive
|
|
Use RX
|
Selects if the Receive pin is used by the component. Yes: The RX pin is active and used to receive data for the UART. No: The RX pin is disabled and free to be used as general I/O.
|
|
RX
|
Pin to be used for Receive data
|
|
Flow Control
|
|
Use Flow Control
|
Flow Control (Handshake) enable or disable. On: Two I/O pins are used to control the flow of data in and out of the device. Off: Flow control is disabled.
|
|
Options
|
|
Baud Options
|
Baud rate option selector
|
|
Baud Rate
|
|
|
Data Bits
|
Number of data bits
|
|
Return
|
Return data width from Receive macro. 8-bit data mode always returns a byte ranging from 0-255, 255 could mean a timeout or could be a valid data. 16-bit data mode rereturns 0-255 for valid data, 256 for a timeout, return data must be stored into an INT or UINT variable.
|
|
Echo
|
Automatically echoes back any received data when enabled by re-transmitting the received byte.
|
|
Interrupt
|
Automatic receive interrupt mode enable or disable. Used on components such as the GSM or GPS where data can come in at any time. Software channel is disabled when interrupt is enabled, for interrupt with a software channel use an I/O edge triggered interrupt.
|
|
Simulation
|
|
Scope Traces
|
Selects if the scope traces are automatically added to the data recorder window or not. Simulation - draws an approximation of the UART data onto the scope trace. ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD.
|
|
Console Data
|
Selects if the console data is automatically generated or not
|
|
Console Format
|
Controls if the data is shown as a log with time and date stamps or just as raw data
|
|
Console Columns
|
Number of characters that can be displayed on a single line of the console.
|
|
Data Source
|
Simulation data source used to allow the component to connect to various remote devices Nothing - Simulation data is ignored COM port - Routes the communication data to and from a physical or virtual COM port API - Routes the communication data via a data injector component on the Panel.
|