GPIO_NXP_Arduino 0.1.1
GPIO device operation sample code for Arduino
|
GPIO device operation sample code for Arduino
Note
This library works with I2C_device
library together. Please be sure the I2C_device
library is imported in your environment before trying to build.
PCAL6416AEV-ARD (on Arduino), PCAL6534EV-ARD, PCAL6524EV-ARD and PCAL6408A-ARD (far side from left to right) : Arduino® Shield Evaluation Boards for GPIO
An Arduino library for I²C GPIO-expander with sample code.
This library provides simple API to control GPIO device IO bits
With GPIO_NXP_Arduino
library, parallel output can be controlled by next sample code.
Type# | IO bits | Features | Interface | Evaluation board |
---|---|---|---|---|
PCAL6408A | 8 | Low-Voltage Translating, 8-Bit I²C-Bus/SMBus I/O Expander | I²C Fast-mode Plus (1MHz) | PCAL6408A 8-Bit GPIO Arduino® Shield |
PCAL6416A | 16 | Low-Voltage Translating 16-Bit I²C-Bus/SMBus I/O Expander | I²C Fast-mode Plus (1MHz) | PCAL6416A 16-bit GPIO Arduino® Shield |
PCAL6408A | 24 | Ultra-Low-Voltage Translating 24-Bit Fm+ I²C-Bus/SMBus I/O Expander | I²C Fast-mode Plus (1MHz) | PCAL6524EV 24-Bit GPIO Arduino® Shield |
PCAL6408A | 34 | Ultra-Low-Voltage, Level Translating, 34-Bit I2C-Bus/SMBus I/O Expander | I²C Fast-mode Plus (1MHz) | PCAL6534EV 34-Bit GPIO Arduino® Shield |
Use Library manager in Arduino IDE for easy install
Examples are provided as scketch files.
After library install, Choose menu on Arduino-IDE: File
→Examples
→GPIO_NXP_Arduino
→ sketch for your try
Sketch | Folder/Target | Feature |
---|---|---|
PCAL6408A_simple_OUT | PCAL6408A | Simple sample for just output counter value |
PCAL6408A_simple_IN_OUT | PCAL6408A | Blink LED to show which buton pressed. Read value shown on serial terminal also |
PCAL6408A_interrupt | PCAL6408A | IO demo with interrupt |
PCAL6416A_simple_OUT | PCAL6416A | Simple sample for just output counter value |
PCAL6416A_simple_IN_OUT | PCAL6416A | Blink LED to show which buton pressed. Read value shown on serial terminal also |
PCAL6416A_interrupt | PCAL6416A | IO demo with interrupt |
PCAL6524A_simple_OUT | PCAL6524 | Simple sample for just output counter value |
PCAL6524_simple_IN_OUT | PCAL6524 | Blink LED to show which buton pressed. Read value shown on serial terminal also |
PCAL6524_interrupt | PCAL6524 | IO demo with interrupt |
PCAL6534_simple_OUT | PCAL6534 | Simple sample for just output counter value |
PCAL6534_simple_IN_OUT | PCAL6534 | Blink LED to show which buton pressed. Read value shown on serial terminal also |
PCAL6534_interrupt | PCAL6534 | IO demo with interrupt |
For details of the library, please find descriptions in this document.
Library | Feature | Target devices | Required library |
---|---|---|---|
GPIO_NXP_Arduino | LED driver libraries | PCAL6408A, PCAL6416A, PCAL6524, PCAL6534 | I2C_device_Arduino |
LEDDriver_NXP_Arduino | LED driver libraries | PCA9955B, PCA9956B, PCA9957 | I2C_device_Arduino |
RTC_NXP_Arduino | RTC driver libraries | PCF2131, PCF85063A | I2C_device_Arduino |
TempSensor_NXP_Arduino | Temperature sensor libraries | LM75B, PCT2075, P3T1085 | I2C_device_Arduino |
I2C_device_Arduino | Base library for I²C operations | none (can be applied as base class for all I²C targets) | — |