Difference between revisions of "Component: SPI Slave (Comms: Interface)"
(One intermediate revision by the same user not shown) | |||
Line 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
− | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/ | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_SPI_Slave.fcfx FC_Comp_Source_SPI_Slave.fcfx] |
− | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/ | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_SPI_Slave.fcfx FC_Comp_Source_SPI_Slave.fcfx] |
==Detailed description== | ==Detailed description== | ||
Line 86: | Line 86: | ||
{{Fcfile|SPI_Slave2.fcfx|SPI_Slave2}} | {{Fcfile|SPI_Slave2.fcfx|SPI_Slave2}} | ||
+ | |||
+ | |||
+ | |||
+ | |||
Line 155: | Line 159: | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | |||
− | |||
Latest revision as of 13:12, 7 February 2023
Author | Matrix Ltd |
Version | 1.0 |
Category | Comms: Interface |
Contents
SPI Slave component
Low level routines for controlling or interacting with an SPI interface. SPI or Serial Peripheral Interface is a bus used for board level communications between devices. A target microcontroller will usually have at least one hardware SPI peripheral built in.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_SPI_Slave.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_SPI_Slave.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Simple Master program that sends an incrementing test value to the SPI bus as well as outputting the value onto LEDs.
Simple Slave program that collects the value sent by the master and outputs the value onto LEDs. Allows the master slave comms to be compared to check that everything is working correctly.
Another simple example to buffer incoming SPI bytes sent by the master and output these to the LCD.
Macro reference
GetChar
![]() |
GetChar |
General purpose SPI get byte macro | |
![]() |
Return |
Initialise
![]() |
Initialise |
Activates the SPI peripheral and claims control over the I/O pins. | |
![]() |
Return |
SendChar
![]() |
SendChar |
General purpose SPI send byte macro | |
![]() |
Char |
Data byte to send | |
![]() |
Return |
UnInitialise
![]() |
UnInitialise |
Deactivates the SPI peripheral leaving the I/O pins in a state where they can be used for general purpose I/O. | |
![]() |
Return |