Component: SPI Master (EB013) (E-blocks 1)

From Flowcode Help
Jump to navigationJump to search
Author Matrix TSL
Version 2.0
Category E-blocks 1


SPI Master 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. If the hardware SPI pins are in use or more SPI channels are required then there is also a software mode available. Has additional functions to work with the E-blocks EB013 SPI hardware.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_SPI_Legacy.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_SPI_Legacy.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples







Macro reference

DACSendChar

Fc9-comp-macro.png DACSendChar
Send a byte to the digital to analogue converter (DAC) on the EB013 SPI E-block. 
Fc9-u8-icon.png - BYTE Data
Data byte to output using the DAC 
Fc9-void-icon.png - VOID Return


DisableFram

Fc9-comp-macro.png DisableFram
Disable the SPI RAM chip on the EB013 SPI E-block. 
Fc9-void-icon.png - VOID Return


EnableFram

Fc9-comp-macro.png EnableFram
Enable the SPI RAM chip on the EB013 SPI E-block. 
Fc9-void-icon.png - VOID Return


FramOutput

Fc9-comp-macro.png FramOutput
Send a value to the RAM on the EB013 SPI E-block. 
Fc9-u8-icon.png - BYTE Char
 
Fc9-u8-icon.png - BYTE Return


GetChar

Fc9-comp-macro.png GetChar
General purpose SPI get byte macro 
Fc9-u8-icon.png - BYTE Return


GetString

Fc9-comp-macro.png GetString
Attempts to read a string of bytes from the SPI bus. 
Fc9-u8-icon.png - BYTE NumBytes
 
Fc9-u8-icon.png - BYTE Ch
 
Fc9-string-icon.png - STRING Return


Initialise

Fc9-comp-macro.png Initialise
Activates the SPI peripheral and claims control over the I/O pins. 
Fc9-void-icon.png - VOID Return


NVMGetChar

Fc9-comp-macro.png NVMGetChar
Reads a byte from the non-volatile memory device on the EB013 SPI E-block. 
Fc9-u32-icon.png - ULONG Address
NVM Address to read data from 
Fc9-u8-icon.png - BYTE Return


NVMSendChar

Fc9-comp-macro.png NVMSendChar
Send a byte to the non-volatile memory device on the EB013 SPI E-block. 
Fc9-u32-icon.png - ULONG Address
NVM Address to write data to 
Fc9-u8-icon.png - BYTE Data
Data Byte to write to the sepected memory location 
Fc9-void-icon.png - VOID Return


SendChar

Fc9-comp-macro.png SendChar
General purpose SPI send byte macro 
Fc9-u8-icon.png - BYTE Char
 
Fc9-void-icon.png - VOID Return


SendString

Fc9-comp-macro.png SendString
Sends a string of bytes to the SPI bus 
Fc9-string-icon.png - STRING Str
 
Fc9-void-icon.png - VOID Return


UnInitialise

Fc9-comp-macro.png UnInitialise
Deactivates the SPI peripheral leaving the I/O pins in a state where they can be used for general purpose I/O. 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Channel
SPI Channel selector 
Fc9-type-5-icon.png MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
Fc9-type-5-icon.png MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
Fc9-type-5-icon.png CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
Fc9-type-5-icon.png DAC En
DAC enable pin - only used with the EB013 SPI E-block 
Fc9-type-5-icon.png NVM En
NVM enable pin - only used with the EB013 SPI E-block 
Fc9-conn-icon.png Bus Settings
Fc9-type-16-icon.png Board Version
The Latest version of the E-block have a newer NVM IC which requires 3 address bytes instead of 2 address bytes. If you find that the NVM is not responding to commands then try changing the version property to match the version of the E-block. The version is written on the board as EB013-00-X where X is the version number. 
Fc9-type-16-icon.png Prescale
Prescale option selector 
Fc9-type-16-icon.png Clock Phase
Clock Phase (data change edge) selection 
Fc9-type-16-icon.png Clock Polarity
Clock Polarity setting, inactive (idle) state 
Fc9-type-16-icon.png Sample Point
Data bit read sample point 
Fc9-conn-icon.png Simulation
Fc9-type-10-icon.png Label
Label used to identify the component on the panel. 
Fc9-type-7-icon.png Scope Traces
Selects if the scope traces are automatically generated or not 
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
Fc9-type-16-icon.png API