Public Documentation
  • Introduction
  • Getting started
    • Introduction
    • 1. Welcome Page
    • 2. Introduction (Beginner's Guide)
  • Portal Tools
    • Blocko
      • Ůvod do blocka
      • Flip-flop
      • REST-API bloček
    • Grid
      • Úvod do GRID
      • Základní Tlačítko (základy GRID)
      • vylepšený Přepínač (stylování a pokročilé možnosti GRID)
      • text generátor button (messeage type, two elements one widget)
      • graf (pokročilé funkce GRID)
      • Slider (User class v GRIDu)
      • Styly a jejich použití
  • Cloud
    • Cloud
    • Instancies
    • Rest-Api
  • General
    • What we plan
  • Hardware a programování
    • Úvod
      • Nahrání prvního programu
    • Konektivita
      • Specifikace zdroje internetu
      • GSM
      • 6LowPAN
      • Komunikace s portálem
      • Přepínání mezi servery
    • Hardware
      • Základní jednotky
        • IODAG3E
          • Rozhraní a periférie
          • Konektor X a Y
          • Napájení
          • Připojení zdroje k VBAT
          • Paměti
          • Technické specifikace
          • Schémata
        • IODAG3L
      • Rozšiřující moduly
        • GSM shield
        • LED shield
        • Relay shield
        • RFID shield
        • Ultrasonic shield
        • Meteo shield
        • Movement shield
        • PIR shield
        • RGB Displej shield
        • Serial shield
      • Ostatní
        • DevKitG3
          • Schéma
        • TK3G
          • Schéma
        • ZPPG3
          • Schéma
        • WEXP
    • Programování HW
      • Architektura FW
        • Aktualizace FW
        • Autobackup
      • Struktura programu
      • Byzance API
        • Vstupy a výstupy do Portálu
        • Callback Busy
        • Odložený restart
        • Callbacky připojení
        • Uživatelská makra
      • MBED API
        • Vstupy a výstupy
        • Komunikační rozhraní
        • Časování
        • RTOS
      • Knihovny
        • DHT
        • DS1820
        • Dali
        • EdgeStruct
        • I2CWrapper
        • Knock
        • MFRC522
        • MFRC522::MIFARE_Key
        • MPU9150
        • ms5637
        • OneWire
        • PCA9536
        • RGB_matrix
        • RollerDrive
        • SHT21
        • ST7565
        • Servo
        • TCA6424A
        • TLC59116
        • TripleSevenSeg
        • MFRC522::Uid
        • WS2812
        • WakeUp
      • Offline programování
        • Vlastní IDE
        • Upload kódu z GUI
        • Upload kódu z konzole
        • Upload kódu Drag&drop
    • Tutoriály
      • Datum a čas (RTC)
      • Komunikace po sériové lince (UART) s PC
        • Konfigurace sériové linky v PC
        • Programování sériové linky
      • Základní tutoriály
        • Digital Read
        • Analog Read/Write
        • PWM Fade
        • Timer/Ticker
        • State Change Detection
        • Ovládání LED modulu
        • BusOut
        • HC-SR04 Senzor
      • Pokročilé
    • Správa a diagnostika
      • Zdroj restartu
      • LED modul
      • Identifikace zařízení
      • Monitoring parametrů
      • Vytížení zařízení
      • Webové rozhraní
        • Základní přehled
        • Správce firmware
        • Vlákna
        • Definované vstupy
        • Konfigurace MQTT
        • Nastavení
      • Bootloader
        • Režimy bootloaderu
        • Command mód
        • Další vlastnosti bootloaderu
      • Webová konzole
      • Konfigurace zařízení
        • Confighash
      • Omezení konfigurace
        • Konfigurace
        • Binárky
        • Omezení MQTT
        • Lowpan
    • Knowledge base
      • Náhodná čísla
      • Watchdog
      • Paměť RAM
Powered by GitBook
On this page
  • Public Functions
  • Public Functions Documentation
  • function TCA6424A
  • function TCA6424A
  • function initialize
  • function testConnection
  • function readPin
  • function readBank
  • function readAll
  • function readAll
  • function getPinOutputLevel
  • function getBankOutputLevel
  • function getAllOutputLevel
  • function getAllOutputLevel
  • function writePin
  • function writeBank
  • function writeAll
  • function writeAll
  • function getPinPolarity
  • function getBankPolarity
  • function getAllPolarity
  • function getAllPolarity
  • function setPinPolarity
  • function setBankPolarity
  • function setAllPolarity
  • function setAllPolarity
  • function getPinDirection
  • function getBankDirection
  • function getAllDirection
  • function getAllDirection
  • function setPinDirection
  • function setBankDirection
  • function setAllDirection
  • function setAllDirection
  1. Hardware a programování
  2. Programování HW
  3. Knihovny

TCA6424A

PreviousServoNextTLC59116

Last updated 6 years ago

Driver for 24-bit I2C IO pin expander.

Public Functions

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

Public Functions Documentation

TCA6424A::TCA6424A ()

Default constructor, uses default I2C address.

See also:

TCA6424A_DEFAULT_ADDRESS

TCA6424A::TCA6424A (
    uint8_t 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

void TCA6424A::initialize (
    PinName sda,
    PinName scl
)
bool TCA6424A::testConnection ()

Verify the I2C connection. Make sure the device is connected and responds as expected.

Returns:

True if connection is valid, false otherwise

bool TCA6424A::readPin (
    uint16_t pin
)

Get a single INPUT pin's logic level.

Returns:

Pin logic level (0 or 1)

uint8_t TCA6424A::readBank (
    uint8_t bank
)

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)

bool TCA6424A::readAll (
    uint8_t * banks
)

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)

bool TCA6424A::readAll (
    uint8_t * bank0,
    uint8_t * bank1,
    uint8_t * bank2
)

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)

bool TCA6424A::getPinOutputLevel (
    uint16_t pin
)

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)

uint8_t TCA6424A::getBankOutputLevel (
    uint8_t bank
)

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)

void TCA6424A::getAllOutputLevel (
    uint8_t * banks
)

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)

void TCA6424A::getAllOutputLevel (
    uint8_t * bank0,
    uint8_t * bank1,
    uint8_t * bank2
)

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)

void TCA6424A::writePin (
    uint16_t pin,
    bool value
)

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)

void TCA6424A::writeBank (
    uint8_t bank,
    uint8_t value
)

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)

void TCA6424A::writeAll (
    uint8_t * banks
)

Set all OUTPUT pins' logic levels in all banks.

Parameters:

  • banks All pins' new logic values (P00-P27) in 3-byte array

void TCA6424A::writeAll (
    uint8_t bank0,
    uint8_t bank1,
    uint8_t bank2
)

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)

bool TCA6424A::getPinPolarity (
    uint16_t pin
)

Get a single pin's polarity (normal/inverted) setting.

Returns:

Pin polarity setting (0 or 1)

uint8_t TCA6424A::getBankPolarity (
    uint8_t bank
)

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)

void TCA6424A::getAllPolarity (
    uint8_t * banks
)

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)

void TCA6424A::getAllPolarity (
    uint8_t * bank0,
    uint8_t * bank1,
    uint8_t * bank2
)

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)

void TCA6424A::setPinPolarity (
    uint16_t pin,
    bool polarity
)

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)

void TCA6424A::setBankPolarity (
    uint8_t bank,
    uint8_t polarity
)

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)

void TCA6424A::setAllPolarity (
    uint8_t * banks
)

Set all pin polarity (normal/inverted) settings in all banks.

Parameters:

  • banks All pins' new logic values (P00-P27) in 3-byte array

void TCA6424A::setAllPolarity (
    uint8_t bank0,
    uint8_t bank1,
    uint8_t bank2
)

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)

bool TCA6424A::getPinDirection (
    uint16_t pin
)

Get a single pin's direction (I/O) setting.

Returns:

Pin direction setting (0 or 1)

uint8_t TCA6424A::getBankDirection (
    uint8_t bank
)

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)

void TCA6424A::getAllDirection (
    uint8_t * banks
)

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)

void TCA6424A::getAllDirection (
    uint8_t * bank0,
    uint8_t * bank1,
    uint8_t * bank2
)

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)

void TCA6424A::setPinDirection (
    uint16_t pin,
    bool direction
)

Set a single pin's direction (I/O) setting.

Parameters:

  • pin Which pin to write (0-23)

  • direction Pin direction setting (0 or 1)

void TCA6424A::setBankDirection (
    uint8_t bank,
    uint8_t direction
)

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)

void TCA6424A::setAllDirection (
    uint8_t * banks
)

Set all pin direction (I/O) settings in all banks.

Parameters:

  • banks All pins' new direction values (P00-P27) in 3-byte array

void TCA6424A::setAllDirection (
    uint8_t bank0,
    uint8_t bank1,
    uint8_t bank2
)

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)

function

function

function

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.

function

function

function

function

function

function

function

function

function

function

function

function

function

function

function

function

function

function

function

function

function

function

function

function

function

function

function

function

function

TCA6424A
TCA6424A
TCA6424A
TCA6424A
initialize
testConnection
readPin
readBank
readAll
readAll
getPinOutputLevel
getBankOutputLevel
getAllOutputLevel
getAllOutputLevel
writePin
writeBank
writeAll
writeAll
getPinPolarity
getBankPolarity
getAllPolarity
getAllPolarity
setPinPolarity
setBankPolarity
setAllPolarity
setAllPolarity
getPinDirection
getBankDirection
getAllDirection
getAllDirection
setPinDirection
setBankDirection
setAllDirection
setAllDirection
TCA6424A
TCA6424A
initialize
testConnection
readPin
readBank
readAll
readAll
getPinOutputLevel
getBankOutputLevel
getAllOutputLevel
getAllOutputLevel
writePin
writeBank
writeAll
writeAll
getPinPolarity
getBankPolarity
getAllPolarity
getAllPolarity
setPinPolarity
setBankPolarity
setAllPolarity
setAllPolarity
getPinDirection
getBankDirection
getAllDirection
getAllDirection
setPinDirection
setBankDirection
setAllDirection
setAllDirection