Component: SPI Master (EB013) (E-blocks 1)
Author | Matrix TSL |
Version | 2.0 (Release) |
Category | E-blocks 1 |
Contents
SPI Master (EB013) 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.
Examples
No additional examples
Downloadable macro reference
SendString
Sends a string of bytes to the SPI bus
Parameters
- <- STRING Str
- This parameter may be returned back to the caller
Return value
- This call does not return a value
NVMSendChar
Send a byte to the non-volatile memory device on the EB013 SPI E-block.
Parameters
- ULONG Address
- NVM Address to write data to
- BYTE Data
- Data Byte to write to the sepected memory location
Return value
- This call does not return a value
GetString
Attempts to read a string of bytes from the SPI bus.
Parameters
- BYTE NumBytes
- BYTE Ch
Return value
DACSendChar
Send a byte to the digital to analogue converter (DAC) on the EB013 SPI E-block.
Parameters
- BYTE Data
- Data byte to output using the DAC
Return value
- This call does not return a value
SendChar
General purpose SPI send byte macro
Parameters
- BYTE Char
Return value
- This call does not return a value
NVMGetChar
Reads a byte from the non-volatile memory device on the EB013 SPI E-block.
Parameters
- ULONG Address
- NVM Address to read data from
Return value
EnableFram
Enable the SPI RAM chip on the EB013 SPI E-block.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
FramOutput
Send a value to the RAM on the EB013 SPI E-block.
Parameters
- BYTE Char
Return value
DisableFram
Disable the SPI RAM chip on the EB013 SPI E-block.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
GetChar
General purpose SPI get byte macro
Parameters
- This macro has no parameters
Return value
UnInitialise
Deactivates the SPI peripheral leaving the I/O pins in a state where they can be used for general purpose I/O.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
Initialise
Activates the SPI peripheral and claims control over the I/O pins.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
Simulation macro reference
This component does not contain any simulation macros
Property reference
Channel
This property is of type Fixed list of ints and can be referenced with the variable name cal_spi::CHANNEL.
SPI Channel selector
MOSI
This property is of type Single digital pin and can be referenced with the variable name cal_spi::MOSI.
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.
MISO
This property is of type Single digital pin and can be referenced with the variable name cal_spi::MISO.
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.
CLK
This property is of type Single digital pin and can be referenced with the variable name cal_spi::CLK.
SPI Clock Pin CLK - The Clock signal is driven by the SPI master.
DAC En
This property is of type Single digital pin and can be referenced with the variable name DAC_En.
DAC enable pin - only used with the EB013 SPI E-block
NVM En
This property is of type Single digital pin and can be referenced with the variable name NVM_En.
NVM enable pin - only used with the EB013 SPI E-block
Board Version
This property is of type Fixed list of ints and can be referenced with the variable name 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.
Prescale
This property is of type Fixed list of ints and can be referenced with the variable name cal_spi::PR_SCALE.
Prescale option selector
Clock Phase
This property is of type Fixed list of ints and can be referenced with the variable name cal_spi::CKE.
Clock Phase (data change edge) selection
Clock Polarity
This property is of type Fixed list of ints and can be referenced with the variable name cal_spi::CKP.
Clock Polarity setting, inactive (idle) state
Sample Point
This property is of type Fixed list of ints and can be referenced with the variable name cal_spi::SMP.
Data bit read sample point
Label
This property is of type Line of text and can be referenced with the variable name label.
Label used to identify the component on the panel.
Scope Traces
This property is of type True or false and can be referenced with the variable name cal_spi::ScopeTraces.
Selects if the scope traces are automatically generated or not
Console Data
This property is of type True or false and can be referenced with the variable name cal_spi::ConsoleData.
Selects if the console data is automatically generated or not
Injector
This property is of type Fixed list of ints and can be referenced with the variable name cal_spi::Injector.
No additional information