Bridle API 4.1.99
A Zephyr based application framework
|
GPIO controller for an PCA9555 (w/regrst) More...
Data Structures | |
struct | gpio_pca9555_regrst_config |
Configuration data. More... | |
struct | gpio_pca9555_regrst_drv_data |
Runtime driver data. More... | |
Macros | |
#define | REG_INPUT_PORT0 0x00 |
#define | REG_INPUT_PORT1 0x01 |
#define | REG_OUTPUT_PORT0 0x02 |
#define | REG_OUTPUT_PORT1 0x03 |
#define | REG_OUTPUT_DFLT 0xFFFF |
#define | REG_POL_INV_PORT0 0x04 |
#define | REG_POL_INV_PORT1 0x05 |
#define | REG_POL_INV_DFLT 0x0000 |
#define | REG_CONF_PORT0 0x06 |
#define | REG_CONG_PORT1 0x07 |
#define | REG_CONG_DFLT 0xFFFF |
#define | PCA_HAS_INTERRUPT BIT(1) |
#define | PCA_HAS_RST_DFLTS BIT(7) |
#define | GPIO_PCA9555_REGRST_DEVICE_INSTANCE(inst) |
Functions | |
static int | read_port_regs (const struct device *dev, uint8_t reg, uint16_t *cache, uint16_t *buf) |
Read both port 0 and port 1 registers of certain register function. | |
static int | write_port_regs (const struct device *dev, uint8_t reg, uint16_t *cache, uint16_t value) |
Write both port 0 and port 1 registers of certain register function. | |
static int | update_input_regs (const struct device *dev, uint16_t *buf) |
static int | update_output_regs (const struct device *dev, uint16_t value) |
static int | update_direction_regs (const struct device *dev, uint16_t value) |
static int | setup_pin_dir (const struct device *dev, uint32_t pin, int flags) |
Setup the pin direction (input or output) | |
static int | gpio_pca9555_regrst_config (const struct device *dev, gpio_pin_t pin, gpio_flags_t flags) |
Configure pin or port. | |
static int | gpio_pca9555_regrst_port_get_raw (const struct device *dev, uint32_t *value) |
static int | gpio_pca9555_regrst_port_set_masked_raw (const struct device *dev, uint32_t mask, uint32_t value) |
static int | gpio_pca9555_regrst_port_set_bits_raw (const struct device *dev, uint32_t mask) |
static int | gpio_pca9555_regrst_port_clear_bits_raw (const struct device *dev, uint32_t mask) |
static int | gpio_pca9555_regrst_port_toggle_bits (const struct device *dev, uint32_t mask) |
static int | gpio_pca9555_regrst_pin_interrupt_configure (const struct device *dev, gpio_pin_t pin, enum gpio_int_mode mode, enum gpio_int_trig trig) |
static int | gpio_pca9555_regrst_reset_defaults (const struct device *dev) |
Reset defaults function of PCA9555. | |
static int | gpio_pca9555_regrst_init (const struct device *dev) |
Initialization function of PCA9555. | |
Variables | |
static const struct gpio_driver_api | gpio_pca9555_regrst_drv_api_funcs |
GPIO controller for an PCA9555 (w/regrst)
The GPIO controller for the I2C-based PCA9555 chip with the reset register to defaults feature.
#define GPIO_PCA9555_REGRST_DEVICE_INSTANCE | ( | inst | ) |
#include <drivers/gpio/gpio_pca9555_regrst.c>
#define PCA_HAS_INTERRUPT BIT(1) |
#include <drivers/gpio/gpio_pca9555_regrst.c>
#define PCA_HAS_RST_DFLTS BIT(7) |
#include <drivers/gpio/gpio_pca9555_regrst.c>
#define REG_CONF_PORT0 0x06 |
#include <drivers/gpio/gpio_pca9555_regrst.c>
#define REG_CONG_DFLT 0xFFFF |
#include <drivers/gpio/gpio_pca9555_regrst.c>
#define REG_CONG_PORT1 0x07 |
#include <drivers/gpio/gpio_pca9555_regrst.c>
#define REG_INPUT_PORT0 0x00 |
#include <drivers/gpio/gpio_pca9555_regrst.c>
#define REG_INPUT_PORT1 0x01 |
#include <drivers/gpio/gpio_pca9555_regrst.c>
#define REG_OUTPUT_DFLT 0xFFFF |
#include <drivers/gpio/gpio_pca9555_regrst.c>
#define REG_OUTPUT_PORT0 0x02 |
#include <drivers/gpio/gpio_pca9555_regrst.c>
#define REG_OUTPUT_PORT1 0x03 |
#include <drivers/gpio/gpio_pca9555_regrst.c>
#define REG_POL_INV_DFLT 0x0000 |
#include <drivers/gpio/gpio_pca9555_regrst.c>
#define REG_POL_INV_PORT0 0x04 |
#include <drivers/gpio/gpio_pca9555_regrst.c>
#define REG_POL_INV_PORT1 0x05 |
#include <drivers/gpio/gpio_pca9555_regrst.c>
|
static |
#include <drivers/gpio/gpio_pca9555_regrst.c>
Configure pin or port.
dev | Device struct of the PCA9555 |
pin | The pin number |
flags | Flags of pin or port |
|
static |
#include <drivers/gpio/gpio_pca9555_regrst.c>
Initialization function of PCA9555.
dev | Device struct |
|
static |
#include <drivers/gpio/gpio_pca9555_regrst.c>
|
static |
#include <drivers/gpio/gpio_pca9555_regrst.c>
|
static |
#include <drivers/gpio/gpio_pca9555_regrst.c>
|
static |
#include <drivers/gpio/gpio_pca9555_regrst.c>
|
static |
#include <drivers/gpio/gpio_pca9555_regrst.c>
|
static |
#include <drivers/gpio/gpio_pca9555_regrst.c>
|
static |
#include <drivers/gpio/gpio_pca9555_regrst.c>
Reset defaults function of PCA9555.
dev | Device struct |
|
static |
#include <drivers/gpio/gpio_pca9555_regrst.c>
Read both port 0 and port 1 registers of certain register function.
Given the register in reg, read the pair of port 0 and port 1.
dev | Device struct of the PCA9555. |
reg | Register to read (the PORT0 of the pair of registers). |
cache | Pointer to the cache to be updated after successful read. |
buf | Buffer to read data into. |
|
static |
#include <drivers/gpio/gpio_pca9555_regrst.c>
Setup the pin direction (input or output)
dev | Device struct of the PCA9555 |
pin | The pin number |
flags | Flags of pin or port |
|
inlinestatic |
#include <drivers/gpio/gpio_pca9555_regrst.c>
|
inlinestatic |
#include <drivers/gpio/gpio_pca9555_regrst.c>
|
inlinestatic |
#include <drivers/gpio/gpio_pca9555_regrst.c>
|
static |
#include <drivers/gpio/gpio_pca9555_regrst.c>
Write both port 0 and port 1 registers of certain register function.
Given the register in reg, write the pair of port 0 and port 1.
dev | Device struct of the PCA9555. |
reg | Register to write into (the PORT0 of the pair of registers). |
cache | Pointer to the cache to be updated after successful write. |
value | New value to set. |
|
static |
#include <drivers/gpio/gpio_pca9555_regrst.c>