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

From OpenMBD
< HANcoder‎ | STM32‎ | Blocks
Jump to: navigation, search
(Created page with "{{HANcoder/block| info= This block initialized a UART channel. |blockImage=UARTInit.png |maskImage=UARTInitMask.png |Channel= Select channel |Baudrate= Select baudrate |D...")
 
 
(5 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
This block initialized a UART channel.
 
This block initialized a UART channel.
  
 +
|blockImage=UARTInit.png
 +
|maskImage=UARTInitMask.png
 +
}}
 +
== Inputs (inports) ==
 +
Data (byte) to send to the slave device.[uint8]
 +
Note: To send multiple bytes use mutliple Master Transfer blocks
  
 +
== 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.
  
|blockImage=UARTInit.png
+
== Block parameters ==
 
+
{| class="wikitable"
|maskImage=UARTInitMask.png
+
|-
 +
! style="width:150px" | Parameter
 +
! Description
 +
|-
 +
| Channel
 +
| Select channelfor UART communication
 +
|-
 +
| Baudrate
 +
| Select the baudrate to be used for the communication
 +
|-
 +
| 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
 +
| Select the number of stopbits.
 +
|-
 +
| 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.
 +
|}
  
|Channel= Select channel
+
== Examples ==
|Baudrate= Select baudrate
+
[[HANcoder/STM32/Examples/ZigBee|ZigBee communication]]
|Databits= Select number of databits
 
|Parity= Select parity
 
|StopBits= Select number of stopbits
 
|TransmitBufferSize= Configure the size of the transmit buffer
 
|ReceiveBufferSize= Configure the size of the reception buffer
 
|StatusOutput= Enable/disable the status output port
 
  
 +
{{HANcoder/BlockFooter|
 +
|SeeAlso = [[HANcoder/STM32/Blocks/UART_Receive|UART Receive]] {{!}} [[HANcoder/STM32/Blocks/UART_Receive_Buffer_Status|UART Receive buffer status]] {{!}} [[HANcoder/STM32/Blocks/UART_Send|UART Send]]
 
}}
 
}}

Latest revision as of 10:32, 5 May 2017

Supported Targets: Olimexino, E407, P405

General information about UART Init

This block initialized a UART channel.

Block

UARTInit.png

Mask

UARTInitMask.png

Inputs (inports)

Data (byte) to send to the slave device.[uint8] Note: To send multiple bytes use mutliple Master Transfer blocks

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.

Block parameters

Parameter Description
Channel Select channelfor UART communication
Baudrate Select the baudrate to be used for the communication
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 Select the number of stopbits.
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

ZigBee communication

See Also

UART Receive | UART Receive buffer status | UART Send