TCA6424A
Last updated
Last updated
Driver for 24-bit I2C IO pin expander.
Type
Name
void
bool
bool
uint8_t
bool
bool
bool
uint8_t
void
void
void
void
void
void
bool
uint8_t
void
void
void
void
void
void
bool
uint8_t
void
void
void
void
void
void
Default constructor, uses default I2C address.
See also:
TCA6424A_DEFAULT_ADDRESS
Specific address constructor.
Parameters:
address I2C address
See also:
TCA6424A_DEFAULT_ADDRESS
See also:
TCA6424A_ADDRESS_ADDR_LOW
See also:
TCA6424A_ADDRESS_ADDR_HIGH
Verify the I2C connection. Make sure the device is connected and responds as expected.
Returns:
True if connection is valid, false otherwise
Get a single INPUT pin's logic level.
Returns:
Pin logic level (0 or 1)
Get all pin logic levels from one bank.
Parameters:
bank Which bank to read (0/1/2 for P0*, P1*, P2* respectively)
Returns:
8 pins' logic levels (0 or 1 for each pin)
Get all pin logic levels from all banks. Reads into single 3-byte data container.
Parameters:
banks Container for all bank's pin values (P00-P27)
Get all pin logic levels from all banks. Reads into individual 1-byte containers.
Parameters:
bank0 Container for Bank 0's pin values (P00-P07)
bank1 Container for Bank 1's pin values (P10-P17)
bank2 Container for Bank 2's pin values (P20-P27)
Get a single OUTPUT pin's setting. Note that this returns the level set in the flip-flop, and does not necessarily represent the actual logic level present at the pin.
Returns:
Pin output setting (0 or 1)
Get all pin output settings from one bank. Note that this returns the level set in the flip-flop, and does not necessarily represent the actual logic level present at the pin.
Parameters:
bank Which bank to read (0/1/2 for P0*, P1*, P2* respectively)
Returns:
8 pins' output settings (0 or 1 for each pin)
Get all pin output settings from all banks. Reads into single 3-byte data container.
Parameters:
banks Container for all bank's pin values (P00-P27)
Get all pin output settings from all banks. Reads into individual 1-byte containers. Note that this returns the level set in the flip-flop, and does not necessarily represent the actual logic level present at the pin.
Parameters:
bank0 Container for Bank 0's pin values (P00-P07)
bank1 Container for Bank 1's pin values (P10-P17)
bank2 Container for Bank 2's pin values (P20-P27)
Set a single OUTPUT pin's logic level.
Parameters:
pin Which pin to write (0-23)
value New pin output logic level (0 or 1)
Set all OUTPUT pins' logic levels in one bank.
Parameters:
bank Which bank to write (0/1/2 for P0*, P1*, P2* respectively)
value New pins' output logic level (0 or 1 for each pin)
Set all OUTPUT pins' logic levels in all banks.
Parameters:
banks All pins' new logic values (P00-P27) in 3-byte array
Set all OUTPUT pins' logic levels in all banks.
Parameters:
bank0 Bank 0's new logic values (P00-P07)
bank1 Bank 1's new logic values (P10-P17)
bank2 Bank 2's new logic values (P20-P27)
Get a single pin's polarity (normal/inverted) setting.
Returns:
Pin polarity setting (0 or 1)
Get all pin polarity (normal/inverted) settings from one bank.
Parameters:
bank Which bank to read (0/1/2 for P0*, P1*, P2* respectively)
Returns:
8 pins' polarity settings (0 or 1 for each pin)
Get all pin polarity (normal/inverted) settings from all banks. Reads into single 3-byte data container.
Parameters:
banks Container for all bank's pin values (P00-P27)
Get all pin polarity (normal/inverted) settings from all banks. Reads into individual 1-byte containers.
Parameters:
bank0 Container for Bank 0's pin values (P00-P07)
bank1 Container for Bank 1's pin values (P10-P17)
bank2 Container for Bank 2's pin values (P20-P27)
Set a single pin's polarity (normal/inverted) setting.
Parameters:
pin Which pin to write (0-23)
polarity New pin polarity setting (0 or 1)
Set all pin polarity (normal/inverted) settings in one bank.
Parameters:
bank Which bank to write (0/1/2 for P0*, P1*, P2* respectively)
Returns:
New pins' polarity settings (0 or 1 for each pin)
Set all pin polarity (normal/inverted) settings in all banks.
Parameters:
banks All pins' new logic values (P00-P27) in 3-byte array
Set all pin polarity (normal/inverted) settings in all banks.
Parameters:
bank0 Bank 0's new polarity values (P00-P07)
bank1 Bank 1's new polarity values (P10-P17)
bank2 Bank 2's new polarity values (P20-P27)
Get a single pin's direction (I/O) setting.
Returns:
Pin direction setting (0 or 1)
Get all pin direction (I/O) settings from one bank.
Parameters:
bank Which bank to read (0/1/2 for P0*, P1*, P2* respectively)
Returns:
8 pins' direction settings (0 or 1 for each pin)
Get all pin direction (I/O) settings from all banks. Reads into single 3-byte data container.
Parameters:
banks Container for all bank's pin values (P00-P27)
Get all pin direction (I/O) settings from all banks. Reads into individual 1-byte containers.
Parameters:
bank0 Container for Bank 0's pin values (P00-P07)
bank1 Container for Bank 1's pin values (P10-P17)
bank2 Container for Bank 2's pin values (P20-P27)
Set a single pin's direction (I/O) setting.
Parameters:
pin Which pin to write (0-23)
direction Pin direction setting (0 or 1)
Set all pin direction (I/O) settings in one bank.
Parameters:
bank Which bank to read (0/1/2 for P0*, P1*, P2* respectively)
direction New pins' direction settings (0 or 1 for each pin)
Set all pin direction (I/O) settings in all banks.
Parameters:
banks All pins' new direction values (P00-P27) in 3-byte array
Set all pin direction (I/O) settings in all banks.
Parameters:
bank0 Bank 0's new direction values (P00-P07)
bank1 Bank 1's new direction values (P10-P17)
bank2 Bank 2's new direction values (P20-P27)
The documentation for this class was generated from the following file: D:/w/hw-libs/\_libs\_/libraries/TCA6424A.h
()
(uint8_t address)
(PinName sda, PinName scl)
()
(uint16_t pin)
(uint8_t bank)
(uint8_t * banks)
(uint8_t * bank0, uint8_t * bank1, uint8_t * bank2)
(uint16_t pin)
(uint8_t bank)
(uint8_t * banks)
(uint8_t * bank0, uint8_t * bank1, uint8_t * bank2)
(uint16_t pin, bool value)
(uint8_t bank, uint8_t value)
(uint8_t * banks)
(uint8_t bank0, uint8_t bank1, uint8_t bank2)
(uint16_t pin)
(uint8_t bank)
(uint8_t * banks)
(uint8_t * bank0, uint8_t * bank1, uint8_t * bank2)
(uint16_t pin, bool polarity)
(uint8_t bank, uint8_t polarity)
(uint8_t * banks)
(uint8_t bank0, uint8_t bank1, uint8_t bank2)
(uint16_t pin)
(uint8_t bank)
(uint8_t * banks)
(uint8_t * bank0, uint8_t * bank1, uint8_t * bank2)
(uint16_t pin, bool direction)
(uint8_t bank, uint8_t direction)
(uint8_t * banks)
(uint8_t bank0, uint8_t bank1, uint8_t bank2)
Power on and prepare for general usage. The I/O expander requires no preparation after power-on. All pins will be default to INPUT mode, and the device is ready for usage immediately. This is an empty function for consistency and/or future expansion.