Jump to content

Component: UART Software (Timer) (Comms: Interface)

From Flowcode Help
Revision as of 16:13, 16 November 2021 by Wiki bot (talk | contribs)
Author MatrixTSL
Version 1.0
Category Comms: Interface


UART Software (Timer) component

Creates a reliable software UART that can be driven using a timer interrupt setup by the user. The timer interrupt must be interrupting at the required baud rate. e.g 9600Hz.

Detailed description

No detailed description exists yet for this component

Examples

Simple example showing how to enable a timer interrupt at the desired baud rate then receive a string. If anything is received then it will be echoed back out and displayed on a LCD

UART_Timer_Example


Downloadable macro reference

SendString
Sends an string to the transmit buffer 
- STRING Data
 
- VOID Return


ReceiveArray
Gets an array of values from the receive buffer. Returns number of values received. 
- UINT Values
 
- UINT NumValues
 
- UINT Timeout
Time in milliseconds to wait for data 
- UINT Return


SendArray
Sends an array of values to the transmit buffer 
- UINT Values
 
- UINT NumValues
 
- VOID Return


UART_Timer_Process
Called as part of a timer interrupt at the specific UART baud rate. 
- VOID Return


ReceiveValue
Gets a single value from the receive buffer 
- UINT Timeout
Time in milliseconds to wait for data 
- UINT Return


SendValue
Sends a single value to the transmit buffer 
- UINT Value
 
- VOID Return


CheckBuffer
Returns the number of values in the transmit or receive buffer 
[[File:]] - Buffer
0=Transmit / 1=Receive 
- UINT Return


ReceiveString
Gets a string from the receive buffer 
- UINT MaxChars
 
- UINT Timeout
Time in milliseconds to wait for data 
- STRING Return


Initialise
Initialises the UART component pins ready to send and receive data 
- VOID Return


ReceiveByteArray
Receives an array of bytes and returns the number of bytes received. 
- BYTE Data
A byte array variable to hold the received data 
- UINT NumBytes
Maximum number of bytes to try and receive 
- UINT Timeout
Max amount of time in ms to wait between bytes 
- UINT Return


ReceiveString
Receives a string of bytes and returns the number of bytes received. 
- STRING StringData
 
- UINT NumBytes
Maximum number of bytes to try and receive 
- UINT Timeout
Max amount of time in ms to wait between bytes 
- BYTE Return


Uninit
Un-initialize the UART and release the resources 
- VOID Return


GetList
Gets Named property List 
- STRING Name
 
- STRING 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


GetList
returns Named property list 
- STRING Name
 
- STRING Return



Property reference

Properties
Data Bits
 
Stop Bits
 
Use TX
Allows the Transmit pin to be enabled / disabled 
Use RX
Allows the Receive pin to be enabled / disabled 
Transmit Pin
Pin assigned to transmitting data 
Transmit Buffer Size
Number of bytes that can be stored in the outgoing transmit buffer 
Receive Pin
Pin assigned to receiving data 
Receive Buffer Size
Number of bytes that can be stored in the incoming receive buffer 
Connections
Simulations
API