#include <compiler.h>
#include <stdlib.h>
#include <string.h>
#include <memdebug.h>
#include <sys/heap.h>
#include <sys/event.h>
#include <cfg/os.h>
#include <dev/twif.h>
#include <dev/gpio.h>
#include <cfg/pca9555.h>
#include <dev/pca9555.h>
Data Structures | |
struct | pca_regs_t |
Defines | |
#define | I2C_SLA_IOEXP 0x23 |
#define | PCA_PINP 0 |
#define | PCA_POUT 2 |
#define | PCA_PINV 4 |
#define | PCA_CONF 6 |
Functions | |
int | IOExpInit (void) |
int | IOExpPinConfigSet (int bank, int bit, uint32_t flags) |
int | IOExpRawWrite (int bank, int value) |
int | IOExpRawRead (int bank, int *value) |
int | IOExpGetBit (int bank, int bit, int *value) |
int | IOExpSetBitHigh (int bank, int bit) |
int | IOExpSetBitLow (int bank, int bit) |
int | IOExpSetBit (int bank, int bit, int value) |
Variables | |
pca_regs_t * | pca_ctrl = NULL |
#define I2C_SLA_IOEXP 0x23 |
Referenced by IOExpGetBit(), IOExpInit(), IOExpPinConfigSet(), IOExpRawRead(), IOExpRawWrite(), IOExpSetBitHigh(), and IOExpSetBitLow().
#define PCA_PINP 0 |
PCA Input register offset
Referenced by IOExpGetBit(), and IOExpRawRead().
#define PCA_POUT 2 |
PCA Output register offset
Referenced by IOExpInit(), IOExpPinConfigSet(), IOExpRawWrite(), IOExpSetBitHigh(), and IOExpSetBitLow().
#define PCA_PINV 4 |
PCA Polarity inversion register offset
Referenced by IOExpInit(), and IOExpPinConfigSet().
#define PCA_CONF 6 |
PCA Configuration register offset
Referenced by IOExpInit(), and IOExpPinConfigSet().
int IOExpInit | ( | void | ) |
References pca_regs_t::con, I2C_SLA_IOEXP, malloc(), memset(), NULL, pca_regs_t::out, PCA_CONF, PCA_PINV, PCA_POUT, pca_regs_t::pol, and TwMasterRegWrite.
int IOExpPinConfigSet | ( | int | bank, |
int | bit, | ||
uint32_t | flags | ||
) |
References pca_regs_t::con, GPIO_CFG_INVERT, GPIO_CFG_NORM, GPIO_CFG_OUTPUT, I2C_SLA_IOEXP, pca_regs_t::out, PCA_CONF, PCA_PINV, PCA_POUT, pca_regs_t::pol, and TwMasterRegWrite.
int IOExpRawWrite | ( | int | bank, |
int | value | ||
) |
References I2C_SLA_IOEXP, pca_regs_t::out, PCA_POUT, and TwMasterRegWrite.
int IOExpRawRead | ( | int | bank, |
int * | value | ||
) |
References I2C_SLA_IOEXP, PCA_PINP, and TwMasterRegRead.
Referenced by sys_key().
int IOExpGetBit | ( | int | bank, |
int | bit, | ||
int * | value | ||
) |
References I2C_SLA_IOEXP, PCA_PINP, and TwMasterRegRead.
int IOExpSetBitHigh | ( | int | bank, |
int | bit | ||
) |
References I2C_SLA_IOEXP, pca_regs_t::out, PCA_POUT, and TwMasterRegWrite.
Referenced by InitLED(), and IOExpSetBit().
int IOExpSetBitLow | ( | int | bank, |
int | bit | ||
) |
References I2C_SLA_IOEXP, pca_regs_t::out, PCA_POUT, and TwMasterRegWrite.
Referenced by IOExpSetBit().
int IOExpSetBit | ( | int | bank, |
int | bit, | ||
int | value | ||
) |
References IOExpSetBitHigh(), and IOExpSetBitLow().
Referenced by NutSetLed().
pca_regs_t* pca_ctrl = NULL |