Difference between revisions of "Component: SPI Master (EB013) (E-blocks 1)"

From Flowcode Help
Jump to navigationJump to search
(XML import - Pre 8.0 release)
 
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix TSL
 
| Matrix TSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 2.0 (Release)
+
| 2.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| E-blocks 1
 
| 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.
  
==[[File:Component Icon 4627d2fb_b41e_44cf_b125_e8511e5ebaa4.png|Image]] SPI Master (EB013) component==
+
==Component Source Code==
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==
+
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_SPI_Legacy.fcfx FC_Comp_Source_SPI_Legacy.fcfx]
''<span style="color:red;">No additional examples</span>''
 
  
 +
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_SPI_Legacy.fcfx FC_Comp_Source_SPI_Legacy.fcfx]
  
==Downloadable macro reference==
+
==Detailed description==
  
===<span style="font-weight: normal;"><u><tt>SendString</tt></u></span>===
 
Sends a string of bytes to the SPI bus
 
  
'''Parameters'''
 
  
:[[Variable Types|<- STRING]] ''Str''
 
::''This parameter may be returned back to the caller''
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
  
===<span style="font-weight: normal;"><u><tt>NVMSendChar</tt></u></span>===
 
Send a byte to the non-volatile memory device on the EB013 SPI E-block.
 
  
'''Parameters'''
 
  
:[[Variable Types|ULONG]] ''Address''
 
::NVM Address to write data to
 
  
:[[Variable Types|BYTE]] ''Data''
+
''No detailed description exists yet for this component''
::Data Byte to write to the sepected memory location
 
  
 +
==Examples==
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
  
===<span style="font-weight: normal;"><u><tt>GetString</tt></u></span>===
 
Attempts to read a string of bytes from the SPI bus.
 
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''NumBytes''
 
  
:[[Variable Types|BYTE]] ''Ch''
 
  
  
'''Return value'''
 
  
:[[Variable Types|STRING]]
 
  
  
===<span style="font-weight: normal;"><u><tt>DACSendChar</tt></u></span>===
+
''<span style="color:red;">No additional examples</span>''
Send a byte to the digital to analogue converter (DAC) on the EB013 SPI E-block.
 
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Data''
 
::Data byte to output using the DAC
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
  
===<span style="font-weight: normal;"><u><tt>SendChar</tt></u></span>===
 
General purpose SPI send byte macro
 
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Char''
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
+
==Macro reference==
  
 +
===DACSendChar===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DACSendChar'''
 +
|-
 +
| colspan="2" | Send a byte to the digital to analogue converter (DAC) on the EB013 SPI E-block.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Data byte to output using the DAC&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>NVMGetChar</tt></u></span>===
 
Reads a byte from the non-volatile memory device on the EB013 SPI E-block.
 
  
'''Parameters'''
+
===DisableFram===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisableFram'''
 +
|-
 +
| colspan="2" | Disable the SPI RAM chip on the EB013 SPI E-block.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|ULONG]] ''Address''
 
::NVM Address to read data from
 
  
 +
===EnableFram===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EnableFram'''
 +
|-
 +
| colspan="2" | Enable the SPI RAM chip on the EB013 SPI E-block.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|BYTE]]
+
===FramOutput===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''FramOutput'''
 +
|-
 +
| colspan="2" | Send a value to the RAM on the EB013 SPI E-block.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Char
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>EnableFram</tt></u></span>===
+
===GetChar===
Enable the SPI RAM chip on the EB013 SPI E-block.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetChar'''
 +
|-
 +
| colspan="2" | General purpose SPI get byte macro&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Parameters'''
 
  
:''This macro has no parameters''
+
===GetString===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetString'''
 +
|-
 +
| colspan="2" | Attempts to read a string of bytes from the SPI bus.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | NumBytes
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Ch
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
'''Return value'''
+
===Initialise===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Activates the SPI peripheral and claims control over the I/O pins.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:''This call does not return a value''
 
  
 +
===NVMGetChar===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''NVMGetChar'''
 +
|-
 +
| colspan="2" | Reads a byte from the non-volatile memory device on the EB013 SPI E-block.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 +
| width="90%" | Address
 +
|-
 +
| colspan="2" | NVM Address to read data from&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>FramOutput</tt></u></span>===
 
Send a value to the RAM on the EB013 SPI E-block.
 
  
'''Parameters'''
+
===NVMSendChar===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''NVMSendChar'''
 +
|-
 +
| colspan="2" | Send a byte to the non-volatile memory device on the EB013 SPI E-block.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 +
| width="90%" | Address
 +
|-
 +
| colspan="2" | NVM Address to write data to&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Data Byte to write to the sepected memory location&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|BYTE]] ''Char''
 
  
 +
===SendChar===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendChar'''
 +
|-
 +
| colspan="2" | General purpose SPI send byte macro&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Char
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Return value'''
 
  
:[[Variable Types|BYTE]]
+
===SendString===
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendString'''
 +
|-
 +
| colspan="2" | Sends a string of bytes to the SPI bus&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Str
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>DisableFram</tt></u></span>===
+
===UnInitialise===
Disable the SPI RAM chip on the EB013 SPI E-block.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
'''Parameters'''
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UnInitialise'''
:''This macro has no parameters''
+
|-
 
+
| colspan="2" | Deactivates the SPI peripheral leaving the I/O pins in a state where they can be used for general purpose I/O.&nbsp;
 
+
|-
'''Return value'''
+
|-
 
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
:''This call does not return a value''
+
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
+
|}
 
 
===<span style="font-weight: normal;"><u><tt>GetChar</tt></u></span>===
 
General purpose SPI get byte macro
 
 
 
'''Parameters'''
 
 
 
:''This macro has no parameters''
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|BYTE]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>UnInitialise</tt></u></span>===
 
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''
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
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==
 
==Property reference==
<span style="font-weight: normal;"><u>Channel</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi::CHANNEL''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
SPI Channel selector
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
<span style="font-weight: normal;"><u>MOSI</u></span>
+
|-
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi::MOSI''.
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.
+
|-
 
+
|-
<span style="font-weight: normal;"><u>MISO</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Channel
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi::MISO''.
+
|-
 
+
| colspan="2" | SPI Channel selector&nbsp;
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
<span style="font-weight: normal;"><u>CLK</u></span>
+
| width="90%" | MOSI
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi::CLK''.
+
| colspan="2" | SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.&nbsp;
 
+
|-
SPI Clock Pin CLK - The Clock signal is driven by the SPI master.
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | MISO
<span style="font-weight: normal;"><u>DAC En</u></span>
+
|-
 
+
| colspan="2" | SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.&nbsp;
This property is of type ''Single digital pin'' and can be referenced with the variable name ''DAC_En''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
DAC enable pin - only used with the EB013 SPI E-block
+
| width="90%" | CLK
 
+
|-
<span style="font-weight: normal;"><u>NVM En</u></span>
+
| colspan="2" | SPI Clock Pin CLK - The Clock signal is driven by the SPI master.&nbsp;
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''NVM_En''.
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | DAC En
NVM enable pin - only used with the EB013 SPI E-block
+
|-
 
+
| colspan="2" | DAC enable pin - only used with the EB013 SPI E-block&nbsp;
<span style="font-weight: normal;"><u>Board Version</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''Version''.
+
| width="90%" | NVM En
 
+
|-
The Latest version of the E-block have a newer NVM IC which requires 3 address bytes instead of 2 address bytes.
+
| colspan="2" | NVM enable pin - only used with the EB013 SPI E-block&nbsp;
 
+
|-
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.  
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Bus Settings
The version is written on the board as EB013-00-X where X is the version number.
+
|-
 
+
|-
<span style="font-weight: normal;"><u>Prescale</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Board Version
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi::PR_SCALE''.
+
|-
 
+
| colspan="2" | 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.&nbsp;
Prescale option selector
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
<span style="font-weight: normal;"><u>Clock Phase</u></span>
+
| width="90%" | Prescale
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi::CKE''.
+
| colspan="2" | Prescale option selector&nbsp;
 
+
|-
Clock Phase (data change edge) selection
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Clock Phase
<span style="font-weight: normal;"><u>Clock Polarity</u></span>
+
|-
 
+
| colspan="2" | Clock Phase (data change edge) selection&nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi::CKP''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
Clock Polarity setting, inactive (idle) state
+
| width="90%" | Clock Polarity
 
+
|-
<span style="font-weight: normal;"><u>Sample Point</u></span>
+
| colspan="2" | Clock Polarity setting, inactive (idle) state&nbsp;
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi::SMP''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Sample Point
Data bit read sample point
+
|-
 
+
| colspan="2" | Data bit read sample point&nbsp;
<span style="font-weight: normal;"><u>Label</u></span>
+
|-
 
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
This property is of type ''Line of text'' and can be referenced with the variable name ''label''.
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
 
+
|-
Label used to identify the component on the panel.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
<span style="font-weight: normal;"><u>Scope Traces</u></span>
+
| width="90%" | Label
 
+
|-
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi::ScopeTraces''.
+
| colspan="2" | Label used to identify the component on the panel.&nbsp;
 
+
|-
Selects if the scope traces are automatically generated or not
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
+
| width="90%" | Scope Traces
<span style="font-weight: normal;"><u>Console Data</u></span>
+
|-
 
+
| colspan="2" | Selects if the scope traces are automatically generated or not&nbsp;
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi::ConsoleData''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
Selects if the console data is automatically generated or not
+
| width="90%" | Console Data
 
+
|-
<span style="font-weight: normal;"><u>Injector</u></span>
+
| colspan="2" | Selects if the console data is automatically generated or not&nbsp;
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi::Injector''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | API
''<span style="color:red;">No additional information</span>''
+
|-
 +
| colspan="2" | &nbsp;
 +
|}

Latest revision as of 13:12, 7 February 2023

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