Jump to content

Component: IO Expander (BL0155) (E-blocks 2): Difference between revisions

From Flowcode Help
XML import - Pre 8.0 release
 
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(17 intermediate revisions by 3 users 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
| 1.0 (Release)
| 1.0
|-
|-
| width="20%" style="color: gray;" | Category
| width="20%" style="color:gray;" | Category
| E-blocks 2
| E-blocks 2
|}
|}




 
==IO Expander component==
==[[File:Component Icon e565ab5d_bf80_4911_938a_75b226ca6f93.png|Image]] IO Expander (BL0155) component==
Provides 16 digital input/output pins arranged into two 8-bit E-block 2 ports using a SPI bus connection.
Provides 16 digital input/output pins arranged into two 8-bit E-block 2 ports using a SPI bus connection.


==Examples==
==Component Source Code==
''<span style="color:red;">No additional examples</span>''


Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_EBlocks2_IOEXP_BL0155.fcfx FC_Comp_Source_EBlocks2_IOEXP_BL0155.fcfx]


==Downloadable macro reference==
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_EBlocks2_IOEXP_BL0155.fcfx FC_Comp_Source_EBlocks2_IOEXP_BL0155.fcfx]


===<span style="font-weight: normal;"><u><tt>ReadPort</tt></u></span>===
==Detailed description==
Reads a value to one of the ports with a mask.


Configures the masked bits to be inputs before reading the input value.


'''Parameters'''


:[[Variable Types|BYTE]] ''Port''
::0=PortA, 1=PortB


:[[Variable Types|BYTE]] ''Mask''
::Allows port bits to be modified without effecting other bits, 255 = write full port.




'''Return value'''


:[[Variable Types|BYTE]]




===<span style="font-weight: normal;"><u><tt>ConfigureInversion</tt></u></span>===
Configures the pin inversion for the two ports.


Disabled on all pins by default.


'''Parameters'''
''No detailed description exists yet for this component''


:[[Variable Types|BYTE]] ''PortA''
==Examples==
::Port A inversion sent as an 8-bit value, 0 = Disabled, 1 = Enabled


:[[Variable Types|BYTE]] ''PortB''
::Port B inversion sent as an 8-bit value, 0 = Disabled, 1 = Enabled




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>ReadPortPin</tt></u></span>===
Reads a single port pin from one of the ports.


Configures the pins to be an input before reading the input value.


Returns 0 or 1 corresponding to the value on the port pin.


'''Parameters'''


:[[Variable Types|BYTE]] ''Port''
::0=PortA, 1=PortB


:[[Variable Types|BYTE]] ''Pin''
::Port pin to read. Range: 0-7


''<span style="color:red;">No additional examples</span>''


'''Return value'''


:[[Variable Types|BYTE]]




===<span style="font-weight: normal;"><u><tt>WritePortPin</tt></u></span>===
Writes a single port pin on one of the ports.


Configures the pins to be an output before writing the input value.


'''Parameters'''


:[[Variable Types|BYTE]] ''Port''
::0=PortA, 1=PortB


:[[Variable Types|BYTE]] ''Pin''
::Port pin to read. Range: 0-7


:[[Variable Types|BYTE]] ''Value''
::Value to output on the selected pin. Range: 0-1




'''Return value'''


:''This call does not return a value''




===<span style="font-weight: normal;"><u><tt>WritePort</tt></u></span>===
==Macro reference==
Writes a value to one of the ports with a mask.


Configures the masked bits to be outputs before writing the output value.
===ConfigureInversion===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''ConfigureInversion'''
|-
| colspan="2" | Configures the pin inversion for the two ports.  Disabled on all pins by default.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | PortA
|-
| colspan="2" | Port A inversion sent as an 8-bit value, 0 = Disabled, 1 = Enabled&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | PortB
|-
| colspan="2" | Port B inversion sent as an 8-bit value, 0 = Disabled, 1 = Enabled&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''
|}


'''Parameters'''


:[[Variable Types|BYTE]] ''Port''
===ConfigurePullups===
::0=PortA, 1=PortB
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''ConfigurePullups'''
|-
| colspan="2" | Configures the pullups for the two ports. Disabled on all pins by default.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | PortA
|-
| colspan="2" | Port A pull ups sent as an 8-bit value, 0 = Disabled, 1 = Enabled&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | PortB
|-
| colspan="2" | Port B pull ups sent as an 8-bit value, 0 = Disabled, 1 = Enabled&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]] ''Mask''
::Allows port bits to be modified without effecting other bits, 255 = write full port.


:[[Variable Types|BYTE]] ''Value''
===Initialise===
::Value to write. Range 0-255
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
| 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'''
===ReadPort===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''ReadPort'''
|-
| colspan="2" | Reads a value to one of the ports with a mask. Configures the masked bits to be inputs before reading the input value.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Port
|-
| colspan="2" | 0=PortA, 1=PortB&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Mask
|-
| colspan="2" | Allows port bits to be modified without effecting other bits, 255 = write full port.&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''
|}


:''This call does not return a value''


===ReadPortPin===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''ReadPortPin'''
|-
| colspan="2" | Reads a single port pin from one of the ports. Configures the pins to be an input before reading the input value. Returns 0 or 1 corresponding to the value on the port pin.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Port
|-
| colspan="2" | 0=PortA, 1=PortB&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Pin
|-
| colspan="2" | Port pin to read. Range: 0-7&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>ConfigurePullups</tt></u></span>===
Configures the pullups for the two ports.


Disabled on all pins by default.
===ReadRegister===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''ReadRegister'''
|-
| colspan="2" | Reads an 8-bit value from a register on the I/O expander device.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Address
|-
| colspan="2" | Register address to write to. Range: 0-15&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'''


:[[Variable Types|BYTE]] ''PortA''
===WritePort===
::Port A pull ups sent as an 8-bit value, 0 = Disabled, 1 = Enabled
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''WritePort'''
|-
| colspan="2" | Writes a value to one of the ports with a mask. Configures the masked bits to be outputs before writing the output value.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Port
|-
| colspan="2" | 0=PortA, 1=PortB&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Mask
|-
| colspan="2" | Allows port bits to be modified without effecting other bits, 255 = write full port.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Value
|-
| colspan="2" | Value to write. Range 0-255&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]] ''PortB''
::Port B pull ups sent as an 8-bit value, 0 = Disabled, 1 = Enabled


===WritePortPin===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" class="mtx-class-macrohead" | '''WritePortPin'''
|-
| colspan="2" | Writes a single port pin on one of the ports. Configures the pins to be an output before writing the input value. &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Port
|-
| colspan="2" | 0=PortA, 1=PortB&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Pin
|-
| colspan="2" | Port pin to read. Range: 0-7&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Value
|-
| colspan="2" | Value to output on the selected pin. Range: 0-1&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'''


:''This call does not return a value''
===WriteRegister===
 
{| class="mtx-class-macrotable wikitable"
 
|-
===<span style="font-weight: normal;"><u><tt>ReadRegister</tt></u></span>===
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
Reads an 8-bit value from a register on the I/O expander device.
| width="90%" class="mtx-class-macrohead" | '''WriteRegister'''
 
|-
'''Parameters'''
| colspan="2" | Writes an 8-bit value to a register on the I/O expander device.&nbsp;
 
|-
:[[Variable Types|BYTE]] ''Address''
|-
::Register address to write to. Range: 0-15
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Address
 
|-
'''Return value'''
| colspan="2" | Register address to write to. Range: 0-15&nbsp;
 
|-
:[[Variable Types|BYTE]]
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Value
 
|-
===<span style="font-weight: normal;"><u><tt>WriteRegister</tt></u></span>===
| colspan="2" | Value to write. Range: 0-255&nbsp;
Writes an 8-bit value to a register on the I/O expander device.
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
'''Parameters'''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
:[[Variable Types|BYTE]] ''Address''
::Register address to write to. Range: 0-15
 
:[[Variable Types|BYTE]] ''Value''
::Value to write. Range: 0-255
 
 
'''Return value'''
 
:''This call does not return a value''
 
 
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
''<span style="color:red;">No additional information</span>''
 
 
 
'''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_spi1::CHANNEL''.
{| class="mtx-class-macrotable wikitable"
 
|-
SPI Channel selector
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
 
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
<span style="font-weight: normal;"><u>Prescale</u></span>
|-
 
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi1::PR_SCALE''.
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
 
| width="90%" class="mtx-class-propfolder" | SPI Communications
Prescale option selector
|-
 
|-
<span style="font-weight: normal;"><u>MOSI</u></span>
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | External Address
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::MOSI''.
|-
 
| colspan="2" | Selects the value of the three address pins for the MCP23S17.&nbsp;
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.
|-
 
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
<span style="font-weight: normal;"><u>MISO</u></span>
| width="90%" | Channel
 
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::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-16-icon.png]]
 
| width="90%" | Prescale
<span style="font-weight: normal;"><u>CLK</u></span>
|-
 
| colspan="2" | Prescale option selector&nbsp;
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::CLK''.
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
SPI Clock Pin CLK - The Clock signal is driven by the SPI master.
| width="90%" | MOSI
 
|-
<span style="font-weight: normal;"><u>CS / SS</u></span>
| colspan="2" | SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.&nbsp;
 
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi1::SS''.
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | MOSI Remap Pin
Chip Select / Slave Select Pin  
|-
 
| colspan="2" | Select which the target pin to assign the MOSI hardware pin functionality.&nbsp;
Master Mode: General purpose output pin used to select the remote SPI device.
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
Slave Mode: Hardware chip select pin input used to select the SPI device.
| width="90%" | MISO
 
|-
<span style="font-weight: normal;"><u>Reset Pin</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 ''reset_pin''.
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | MISO Remap Pin
''<span style="color:red;">No additional information</span>''
|-
 
| colspan="2" | Select which the target pin to assign the MISO hardware pin functionality.&nbsp;
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
<span style="font-weight: normal;"><u>Label</u></span>
| width="90%" | CLK
 
|-
This property is of type ''Line of text'' and can be referenced with the variable name ''label''.
| colspan="2" | SPI Clock Pin CLK - The Clock signal is driven by the SPI master.&nbsp;
 
|-
''<span style="color:red;">No additional information</span>''
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
| width="90%" | CLK Remap Pin
 
|-
 
| colspan="2" | Select which the target pin to assign the CLK hardware pin functionality.&nbsp;
<span style="font-weight: normal;"><u>Scope Traces</u></span>
|-
 
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi1::ScopeTraces''.
| width="90%" | CS / SS
 
|-
Selects if the scope traces are automatically generated or not
| colspan="2" | Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device. &nbsp;
 
|-
<span style="font-weight: normal;"><u>Console Data</u></span>
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
| width="90%" | Reset Pin
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi1::ConsoleData''.
|-
 
| colspan="2" | &nbsp;
Selects if the console data is automatically generated or not
|-
 
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
<span style="font-weight: normal;"><u>Injector</u></span>
| width="90%" class="mtx-class-propfolder" | Simulation
 
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi1::Injector''.
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
''<span style="color:red;">No additional information</span>''
| width="90%" | Simulate Comms
|-
| colspan="2" | &nbsp;
|}

Latest revision as of 14:37, 13 July 2026

Author Matrix TSL
Version 1.0
Category E-blocks 2


IO Expander component

Provides 16 digital input/output pins arranged into two 8-bit E-block 2 ports using a SPI bus connection.

Component Source Code

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

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

Detailed description

No detailed description exists yet for this component

Examples

No additional examples








Macro reference

ConfigureInversion

ConfigureInversion
Configures the pin inversion for the two ports. Disabled on all pins by default. 
- BYTE PortA
Port A inversion sent as an 8-bit value, 0 = Disabled, 1 = Enabled 
- BYTE PortB
Port B inversion sent as an 8-bit value, 0 = Disabled, 1 = Enabled 
- VOID Return


ConfigurePullups

ConfigurePullups
Configures the pullups for the two ports. Disabled on all pins by default. 
- BYTE PortA
Port A pull ups sent as an 8-bit value, 0 = Disabled, 1 = Enabled 
- BYTE PortB
Port B pull ups sent as an 8-bit value, 0 = Disabled, 1 = Enabled 
- VOID Return


Initialise

Initialise
 
- VOID Return


ReadPort

ReadPort
Reads a value to one of the ports with a mask. Configures the masked bits to be inputs before reading the input value. 
- BYTE Port
0=PortA, 1=PortB 
- BYTE Mask
Allows port bits to be modified without effecting other bits, 255 = write full port. 
- BYTE Return


ReadPortPin

ReadPortPin
Reads a single port pin from one of the ports. Configures the pins to be an input before reading the input value. Returns 0 or 1 corresponding to the value on the port pin. 
- BYTE Port
0=PortA, 1=PortB 
- BYTE Pin
Port pin to read. Range: 0-7 
- BYTE Return


ReadRegister

ReadRegister
Reads an 8-bit value from a register on the I/O expander device. 
- BYTE Address
Register address to write to. Range: 0-15 
- BYTE Return


WritePort

WritePort
Writes a value to one of the ports with a mask. Configures the masked bits to be outputs before writing the output value. 
- BYTE Port
0=PortA, 1=PortB 
- BYTE Mask
Allows port bits to be modified without effecting other bits, 255 = write full port. 
- BYTE Value
Value to write. Range 0-255 
- VOID Return


WritePortPin

WritePortPin
Writes a single port pin on one of the ports. Configures the pins to be an output before writing the input value.  
- BYTE Port
0=PortA, 1=PortB 
- BYTE Pin
Port pin to read. Range: 0-7 
- BYTE Value
Value to output on the selected pin. Range: 0-1 
- VOID Return


WriteRegister

WriteRegister
Writes an 8-bit value to a register on the I/O expander device. 
- BYTE Address
Register address to write to. Range: 0-15 
- BYTE Value
Value to write. Range: 0-255 
- VOID Return


Property reference

Properties
SPI Communications
External Address
Selects the value of the three address pins for the MCP23S17. 
Channel
SPI Channel selector 
Prescale
Prescale option selector 
MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
MOSI Remap Pin
Select which the target pin to assign the MOSI hardware pin functionality. 
MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
MISO Remap Pin
Select which the target pin to assign the MISO hardware pin functionality. 
CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
CLK Remap Pin
Select which the target pin to assign the CLK hardware pin functionality. 
CS / SS
Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device.  
Reset Pin
 
Simulation
Simulate Comms