Difference between revisions of "Component: SPI Slave (Comms: Interface)"
From Flowcode Help
Jump to navigationJump to searchLine 16: | Line 16: | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
Line 24: | Line 26: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
Revision as of 13:30, 17 November 2021
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.
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.
Downloadable macro reference
![]() |
SendChar |
General purpose SPI send byte macro | |
![]() |
Char |
Data byte to send | |
![]() |
Return |
![]() |
GetChar |
General purpose SPI get byte macro | |
![]() |
Return |
![]() |
UnInitialise |
Deactivates the SPI peripheral leaving the I/O pins in a state where they can be used for general purpose I/O. | |
![]() |
Return |
![]() |
Initialise |
Activates the SPI peripheral and claims control over the I/O pins. | |
![]() |
Return |