Difference between revisions of "HANcoder/STM32/Blocks/UART Receive"

From OpenMBD
< HANcoder‎ | STM32‎ | Blocks
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
info=
 
info=
 
Reads a byte from the UART reception buffer.
 
Reads a byte from the UART reception buffer.
 
'''Outputs'''
 
Output 1: The value of the receive byte.
 
Output 2: When the status output is 0, the reception buffer was empty.
 
  
 
|blockImage=UARTReceive.png
 
|blockImage=UARTReceive.png
 
|maskImage=UARTReceiveMask.png
 
|maskImage=UARTReceiveMask.png
 
 
}}
 
}}
== Inputs (inports) ==
 
Data (byte) to send to the slave device.[uint8]
 
Note: To send multiple bytes use mutliple Master Transfer blocks
 
 
 
== Outputs (outports) ==
 
== Outputs (outports) ==
(optional) If this output has a value of 0, the UART driver could not be initialized. This happens if no space could be allocated on the heap for the transmit and/or receive buffer. Use the 'Get free heap' block to verify that enough space is available on the heap. The used datatype is boolean.
+
Output 1: The value of the receive byte. <br/>
 +
Output 2 (optional): When the status output is 0, the reception buffer was empty.<br/>
  
 
== Block parameters ==
 
== Block parameters ==
Line 25: Line 17:
 
|-
 
|-
 
| Channel
 
| Channel
| Select channelfor UART communication
+
| Select channel for UART communication
 
|-
 
|-
| Baudrate
+
| Use status output
| Select the baudrate to be used for the communication
+
| When this checkbox is ticked an extra output appears which show the status of the reception buffer.
|-
 
| Databits
 
| Select the number of databits per message. (8 or 9)
 
|-
 
| Parity
 
| Select whether to use the parity bit and if it should be odd or even.
 
 
|-
 
|-
| Stopbits
+
| Sample time
| Select the number of stopbits.
+
| The block execution time, the amount of time between consecutive executions of the block. 0.1 means the the block will be executed at 10 Hz.
|-
 
| TransmitBufferSize
 
| Enter the size (in bytes) of the buffer for transmitting. The buffer space is reserved in HEAP.
 
|-
 
| ReceiveBufferSize
 
| Enter the size (in bytes) of the buffer for receiving. The buffer space is reserved in HEAP.  
 
|-
 
| Use status output
 
| Enable the status output to check if the initialization has been successful.
 
 
|}
 
|}
  
 
== Examples ==
 
== Examples ==
[[HANcoder/Examples/??|??]]
+
[[HANcoder/STM32/Examples/ZigBee|ZigBee communication]]
  
 
{{HANcoder/BlockFooter|  
 
{{HANcoder/BlockFooter|  
|SeeAlso = [[HANcoder/UART_Receive|UART Receive]] {{!}} [[HANcoder/UART_Receive_Buffer_Status|UART Receive buffer status]] {{!}} [[HANcoder/UART_Send|UART Send]]
+
|SeeAlso = [[HANcoder/STM32/Blocks/UART_Init|UART Init]] {{!}} [[HANcoder/STM32/Blocks/UART_Receive_Buffer_Status|UART Receive buffer status]] {{!}} [[HANcoder/STM32/Blocks/UART_Send|UART Send]]
 
}}
 
}}

Latest revision as of 10:33, 5 May 2017

Supported Targets: Olimexino, E407, P405

General information about UART Receive

Reads a byte from the UART reception buffer.

Block

UARTReceive.png

Mask

UARTReceiveMask.png

Outputs (outports)

Output 1: The value of the receive byte.
Output 2 (optional): When the status output is 0, the reception buffer was empty.

Block parameters

Parameter Description
Channel Select channel for UART communication
Use status output When this checkbox is ticked an extra output appears which show the status of the reception buffer.
Sample time The block execution time, the amount of time between consecutive executions of the block. 0.1 means the the block will be executed at 10 Hz.

Examples

ZigBee communication

See Also

UART Init | UART Receive buffer status | UART Send