Difference between revisions of "Component: IO Expander (MCP23017) (Comms: System)"

From Flowcode Help
Jump to navigationJump to search
(XML import - Pre 8.0 release)
 
 
(11 intermediate revisions by 2 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
 
| Comms: System
 
| Comms: System
 
|}
 
|}
  
  
 +
==IO Expander component==
 +
Provides 16 digital input/output pins arranged into two 8-bit ports using a I2C bus connection. Up to eight expanders can be connected to the same I2C peripheral by means of three address pins.
  
==[[File:Component Icon 76bb1b8c_43da_48d3_b53f_a9907f03a528.png|Image]] IO Expander (MCP23017) component==
+
==Component Pack==
Provides 16 digital input/output pins arranged into two 8-bit ports using a I2C bus connection.
 
Up to eight expanders can be connected to the same I2C peripheral by means of three address pins.
 
  
==Examples==
+
COMMSA
''<span style="color:red;">No additional examples</span>''
 
  
 +
==Detailed description==
  
==Downloadable macro reference==
 
  
===<span style="font-weight: normal;"><u><tt>ReadPort</tt></u></span>===
 
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'''
 
  
:[[Variable Types|BYTE]] ''PortA''
 
::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.
+
''No detailed description exists yet for this component''
  
Returns 0 or 1 corresponding to the value on the port pin.
+
==Examples==
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Port''
 
::0=PortA, 1=PortB
 
  
:[[Variable Types|BYTE]] ''Pin''
 
::Port pin to read. Range: 0-7
 
  
  
'''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>===
 
Writes a value to one of the ports with a mask.
 
  
Configures the masked bits to be outputs before writing the output value.
 
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Port''
 
::0=PortA, 1=PortB
 
  
:[[Variable Types|BYTE]] ''Mask''
+
''<span style="color:red;">No additional examples</span>''
::Allows port bits to be modified without effecting other bits, 255 = write full port.
 
  
:[[Variable Types|BYTE]] ''Value''
 
::Value to write. Range 0-255
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
+
==Downloadable macro reference==
  
 +
{| 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;" | '''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''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>ConfigurePullups</tt></u></span>===
 
Configures the pullups for the two ports.
 
  
Disabled on all pins by default.
+
{| 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;" | '''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]] ''PortA''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::Port A pull ups sent as an 8-bit value, 0 = Disabled, 1 = Enabled
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''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''
 +
|}
  
:[[Variable Types|BYTE]] ''PortB''
 
::Port B pull ups sent as an 8-bit value, 0 = Disabled, 1 = Enabled
 
  
 +
{| 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;" | '''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''
+
{| 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;" | '''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''
 +
|}
  
  
===<span style="font-weight: normal;"><u><tt>ReadRegister</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Reads an 8-bit value from a register on the I/O expander device.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''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''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Address''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::Register address to write to. Range: 0-15
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''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''
 +
|}
  
  
'''Return value'''
+
{| 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;" | '''SetAddress'''
 +
|-
 +
| colspan="2" | Allows the slave address to be overridden to allow multiple modules to be controlled using a single component.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Address
 +
|-
 +
| colspan="2" | Range: 0-7&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]]
 
  
 +
{| 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;" | '''WriteRegister'''
 +
|-
 +
| colspan="2" | Writes an 8-bit value to 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" | [[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''
 +
|}
  
===<span style="font-weight: normal;"><u><tt>WriteRegister</tt></u></span>===
 
Writes an 8-bit value to a register on the I/O expander device.
 
 
'''Parameters'''
 
 
:[[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>''
 
  
 +
{| 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" | &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'''
 
 
:''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>External Address</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''ExtAddress''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Selects the value of the three address pins for the MCP23S17.
+
| 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>Channel</u></span>
+
|-
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_i2c1::CHANNEL''.
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | I²C Communications
Channel selection
+
|-
 
+
|-
<span style="font-weight: normal;"><u>Stop Delay</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | External Address
This property is of type ''True or false'' and can be referenced with the variable name ''cal_i2c1::StopDel''.
+
|-
 
+
| colspan="2" | Selects the value of the three address pins for the MCP23S17.&nbsp;
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not  
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
a 10ms delay between an I2C stop event and the next I2C start event.
+
| width="90%" | Channel
 
+
|-
 
+
| colspan="2" | Channel selection&nbsp;
 
+
|-
Most modern microcontrollers will not have a problem so this property can be disabled to speed up the  
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
+
| width="90%" | Stop Delay
I2C communications.
+
|-
 
+
| colspan="2" | On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications. &nbsp;
<span style="font-weight: normal;"><u>Baud Select</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_i2c1::BAUD_LIST''.
+
| width="90%" | Baud Select
 
+
|-
Baud rate option selector
+
| colspan="2" | Baud rate option selector&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Baud Rate</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Baud Rate
This property is of type ''Signed integer'' and can be referenced with the variable name ''cal_i2c1::BAUD''.
+
|-
 
+
| colspan="2" | Baud rate to be used&nbsp;
Baud rate to be used
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
<span style="font-weight: normal;"><u>SDA</u></span>
+
| width="90%" | SDA
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_i2c1::SDA''.
+
| colspan="2" | Pin used for SDA (data signal)&nbsp;
 
+
|-
Pin used for SDA (data signal)
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | SCL
<span style="font-weight: normal;"><u>SCL</u></span>
+
|-
 
+
| colspan="2" | Pin used for SCL (clock signal)&nbsp;
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_i2c1::SCL''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
Pin used for SCL (clock signal)
+
| width="90%" | Use Reset
 
+
|-
<span style="font-weight: normal;"><u>Reset Pin</u></span>
+
| colspan="2" | &nbsp;
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''reset_pin''.
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
''<span style="color:red;">No additional information</span>''
+
|-
 
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
+
| width="90%" | Label
<span style="font-weight: normal;"><u>Label</u></span>
+
|-
 
+
| colspan="2" | &nbsp;
This property is of type ''Line of text'' and can be referenced with the variable name ''label''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
''<span style="color:red;">No additional information</span>''
+
| width="90%" | Scope Traces
 
+
|-
 
+
| colspan="2" | Selects if the scope traces are automatically generated or not&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Scope Traces</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
+
| width="90%" | Console Data
This property is of type ''True or false'' and can be referenced with the variable name ''cal_i2c1::ScopeTraces''.
+
|-
 
+
| colspan="2" | Selects if the console data is automatically generated or not&nbsp;
Selects if the scope traces are automatically generated or not
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
<span style="font-weight: normal;"><u>Console Data</u></span>
+
| width="90%" | API
 
+
|-
This property is of type ''True or false'' and can be referenced with the variable name ''cal_i2c1::ConsoleData''.
+
| colspan="2" | &nbsp;
 
+
|}
Selects if the console data is automatically generated or not
 
 
 
<span style="font-weight: normal;"><u>Injector</u></span>
 
 
 
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_i2c1::Injector''.
 
 
 
''<span style="color:red;">No additional information</span>''
 

Latest revision as of 17:21, 9 November 2022

Author Matrix TSL
Version 1.0
Category Comms: System


IO Expander component

Provides 16 digital input/output pins arranged into two 8-bit ports using a I2C bus connection. Up to eight expanders can be connected to the same I2C peripheral by means of three address pins.

Component Pack

COMMSA

Detailed description

No detailed description exists yet for this component

Examples

No additional examples



Downloadable macro reference

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


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


Fc9-comp-macro.png 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. 
Fc9-u8-icon.png - BYTE Port
0=PortA, 1=PortB 
Fc9-u8-icon.png - BYTE Pin
Port pin to read. Range: 0-7 
Fc9-u8-icon.png - BYTE Return


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


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


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


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


Fc9-comp-macro.png SetAddress
Allows the slave address to be overridden to allow multiple modules to be controlled using a single component. 
Fc9-u8-icon.png - BYTE Address
Range: 0-7 
Fc9-void-icon.png - VOID Return


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


Fc9-comp-macro.png Initialise
 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png I²C Communications
Fc9-type-16-icon.png External Address
Selects the value of the three address pins for the MCP23S17. 
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-7-icon.png Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-7-icon.png Use Reset
 
Fc9-conn-icon.png Simulation
Fc9-type-10-icon.png Label
 
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