Difference between revisions of "HANcoder/STM32/Blocks/SPI Master Transfer"
From OpenMBD
Line 10: | Line 10: | ||
}} | }} | ||
+ | |||
+ | == Inputs (inports) == | ||
+ | Data (byte) to send to the slave device.[uint8] | ||
+ | Note: To send multiple bytes use mutliple Master Transfer blocks | ||
+ | |||
+ | == Outputs (outports) == | ||
+ | Data (byte) received from the slave device. [uint8] | ||
+ | |||
== Block parameters == | == Block parameters == | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 19: | Line 27: | ||
| Select the SPI channel to use. | | Select the SPI channel to use. | ||
|- | |- | ||
− | | | + | | Use slave select output |
− | | Select the | + | | When this checkbox is ticked a slave select output can be chosen. The slave select output pin will be pulled low when data needs to be transferred. |
+ | |- | ||
+ | | Slave select output pin (optional) | ||
+ | | Select the pin to use as slave select pin. | ||
+ | |- | ||
+ | | Enable slave select before transfer (optional) | ||
+ | | When this checkbox is ticked the slave select output pin will be pulled low before transfer starts. | ||
|- | |- | ||
− | | | + | | Disable slave select after transfer (optional) |
− | | | + | | When this checkbox is ticked the slave select output pin will be disable after transfer finished. |
|- | |- | ||
− | | | + | | Delay cycles between slave select enable and transfer |
− | | | + | | The amount of time, expressed in CPU cycles. Note that the time of a cycle is system dependent. On a STM32F10x running at 72 MHz, 80 cycles are approximately 10 µs. On a STM32F40x running at 168 Mhz, 240 cycles are approximately 10 µs. |
+ | |- | ||
+ | | Sample time | ||
+ | | The block execution time, the amount of time between consequetive executions of the block. 0.1 means the the block will be executed at 10 Hz | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Examples == | == Examples == |
Revision as of 12:19, 27 April 2017
Supported Targets: Olimexino, E407, P405
Contents
General information about SPI Master Transfer
The 'SPI Master Transfer' block performs a byte transfer via SPI.
Block
Mask
Inputs (inports)
Data (byte) to send to the slave device.[uint8] Note: To send multiple bytes use mutliple Master Transfer blocks
Outputs (outports)
Data (byte) received from the slave device. [uint8]
Block parameters
Parameter | Description |
---|---|
Channel | Select the SPI channel to use. |
Use slave select output | When this checkbox is ticked a slave select output can be chosen. The slave select output pin will be pulled low when data needs to be transferred. |
Slave select output pin (optional) | Select the pin to use as slave select pin. |
Enable slave select before transfer (optional) | When this checkbox is ticked the slave select output pin will be pulled low before transfer starts. |
Disable slave select after transfer (optional) | When this checkbox is ticked the slave select output pin will be disable after transfer finished. |
Delay cycles between slave select enable and transfer | The amount of time, expressed in CPU cycles. Note that the time of a cycle is system dependent. On a STM32F10x running at 72 MHz, 80 cycles are approximately 10 µs. On a STM32F40x running at 168 Mhz, 240 cycles are approximately 10 µs. |
Sample time | The block execution time, the amount of time between consequetive executions of the block. 0.1 means the the block will be executed at 10 Hz |