Component: IO Expander (Comms: System): Difference between revisions
Appearance
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;"" to "width="10%" align="center" class="mtx-class-macrohead"" |
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead"" |
||
| Line 49: | Line 49: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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. | | 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. | ||
| Line 72: | Line 72: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ConfigureInversion''' | ||
|- | |- | ||
| colspan="2" | Configures the pin inversion for the two ports. Disabled on all pins by default. | | colspan="2" | Configures the pin inversion for the two ports. Disabled on all pins by default. | ||
| Line 95: | Line 95: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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. | | 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. | ||
| Line 118: | Line 118: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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. | | colspan="2" | Writes a single port pin on one of the ports. Configures the pins to be an output before writing the input value. | ||
| Line 146: | Line 146: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | 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. | | 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. | ||
| Line 174: | Line 174: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ConfigurePullups''' | ||
|- | |- | ||
| colspan="2" | Configures the pullups for the two ports. Disabled on all pins by default. | | colspan="2" | Configures the pullups for the two ports. Disabled on all pins by default. | ||
| Line 197: | Line 197: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ReadRegister''' | ||
|- | |- | ||
| colspan="2" | Reads an 8-bit value from a register on the I/O expander device. | | colspan="2" | Reads an 8-bit value from a register on the I/O expander device. | ||
| Line 215: | Line 215: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''WriteRegister''' | ||
|- | |- | ||
| colspan="2" | Writes an 8-bit value to a register on the I/O expander device. | | colspan="2" | Writes an 8-bit value to a register on the I/O expander device. | ||
| Line 238: | Line 238: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Initialise''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
| Line 251: | Line 251: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Initialise''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
| Line 264: | Line 264: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Initialise''' | ||
|- | |- | ||
| colspan="2" | Enables the I²C hardware and performs some initialization. Should be called at the start of the program or at least before any of the other I²C functions are called. | | colspan="2" | Enables the I²C hardware and performs some initialization. Should be called at the start of the program or at least before any of the other I²C functions are called. | ||
| Line 277: | Line 277: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CheckNetworkStatus''' | ||
|- | |- | ||
| colspan="2" | Returns the state of the GSM network. 0 = Not connected, 1 = connected, 255 = no reply from GSM. | | colspan="2" | Returns the state of the GSM network. 0 = Not connected, 1 = connected, 255 = no reply from GSM. | ||
| Line 290: | Line 290: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''CheckForIncoming''' | ||
|- | |- | ||
| colspan="2" | Checks to see if any incoming phone call or SMS message. 0 = Nothing, 1 = Text Received, 2 = Phone Ringing | | colspan="2" | Checks to see if any incoming phone call or SMS message. 0 = Nothing, 1 = Text Received, 2 = Phone Ringing | ||
| Line 303: | Line 303: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Initialise''' | ||
|- | |- | ||
| colspan="2" | Sets up the GSM module. Returns 0 for OK, 255 for no reply and 254 for command fail. | | colspan="2" | Sets up the GSM module. Returns 0 for OK, 255 for no reply and 254 for command fail. | ||
| Line 320: | Line 320: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|- | |- | ||
| Line 364: | Line 364: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-conn-icon.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Connections''' | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-conn-icon.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-conn-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Simulations''' | ||
|- | |- | ||
|- | |- | ||
Latest revision as of 14:23, 13 July 2026
| 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 SPI bus connection. Multiple expanders can be connected to the same SPI peripheral by means of individual chip select pins.
Detailed description
No detailed description exists yet for this component
Examples
More information on I2C can be found here,
Matrix Flowcode Blog: Simplified communications I2C and SPI
Generic I2C EEPROM
Example file demonstrating how to read and write bytes from a generic I2C EEPROM device.
I2CEEPROM
Downloadable macro reference
| ReadRegister | |
| Reads an 8-bit value from a register on the I/O expander device. | |
| Address | |
| Register address to write to. Range: 0-15 | |
| Return | |
| WriteRegister | |
| Writes an 8-bit value to a register on the I/O expander device. | |
| Address | |
| Register address to write to. Range: 0-15 | |
| Value | |
| Value to write. Range: 0-255 | |
| Return | |
| Initialise | |
| Return | |
| Initialise | |
| Return | |
| Initialise | |
| Enables the I²C hardware and performs some initialization. Should be called at the start of the program or at least before any of the other I²C functions are called. | |
| Return | |
| CheckNetworkStatus | |
| Returns the state of the GSM network. 0 = Not connected, 1 = connected, 255 = no reply from GSM. | |
| Return | |
| CheckForIncoming | |
| Checks to see if any incoming phone call or SMS message. 0 = Nothing, 1 = Text Received, 2 = Phone Ringing | |
| Return | |
| Initialise | |
| Sets up the GSM module. Returns 0 for OK, 255 for no reply and 254 for command fail. | |
| Return | |