![]() |
EVE 1.0
|
Driver for I2C-based IO expander type NXP PCAL9535A. More...
#include <stdbool.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | io_expander_state_t |
struct | io_expander_t |
Functions | |
Functions called from application programs | |
bool | IoExpanderRead (const struct io_expander_t *IoExpander, const uint8_t Address, uint16_t *Data) |
bool | IoExpanderWrite (const struct io_expander_t *IoExpander, const uint8_t Address, const uint16_t Data) |
bool | IoExpPortInit (const struct io_expander_t *IoExpander) |
Name: IoExpPortInit Initializes I2C-based IO expander type NXP PCAL9535A. More... | |
bool | IoExpPortRead (const struct io_expander_t *IoExpander, uint16_t *In) |
Name: IoExpPortRead Read 16-bits data from IO expander ports. More... | |
bool | IoExpPortWrite (const struct io_expander_t *IoExpander, const uint16_t Out, const uint16_t Mask) |
uint16_t | IoExpPortInterruptsRead (const struct io_expander_t *IoExpander) |
Name: IoExpPortInterruptsRead Read and clear interrupt status from the IO expander. More... | |
bool | IoExpPortInterruptsEnable (const struct io_expander_t *IoExpander, uint16_t Mask) |
Name: IoExpPortInterruptsEnable Enable (unmask) interrupts for the selected set of pins. More... | |
bool | IoExpPortInterruptsDisable (const struct io_expander_t *IoExpander, uint16_t Mask) |
Name: IoExpPortInterruptsDisable Disable (mask) interrupts for the selected set of pins. More... | |
void | IoExpPortInterruptsClear (const struct io_expander_t *IoExpander, uint16_t Mask) |
Name: IoExpPortInterruptsDisable Clear (remove pending status) interrupts for the selected set of pins. More... | |
static bool | IoExpPortSet (const struct io_expander_t *IoExpander, const uint16_t SetBits) |
Name: IoExpPortSet Sets IO expander port bits. More... | |
static bool | IoExpPortClear (const struct io_expander_t *IoExpander, const uint16_t ClearBits) |
Name: IoExpPortClear Clears IO expander port bits. More... | |
static bool | IoExpPortDirection (const struct io_expander_t *IoExpander, const uint16_t Direction) |
Name: IoExpPortDirection Set IO expander ports to input and output. More... | |
static bool | IoExpPortDriveSet (const struct io_expander_t *IoExpander, const uint32_t Drive) |
Name: IoExpPortDriveSet Set output drive strength for IO expander ports. More... | |
static bool | IoExpPortPullResistorSet (const struct io_expander_t *IoExpander, const uint16_t PullEnable, const uint16_t PullSelect) |
Name: IoExpPortPullResistorSet Disables/enables pullup/pulldown resistors for IO expander port pins. More... | |
Driver for I2C-based IO expander type NXP PCAL9535A.
Definition in file io-expander-pcal9535a.h.
bool IoExpPortInit | ( | const struct io_expander_t * | IoExpander | ) |
Name: IoExpPortInit
Initializes I2C-based IO expander type NXP PCAL9535A.
IoExpander | Parameters for the IO port expander to be used |
bool IoExpPortRead | ( | const struct io_expander_t * | IoExpander, |
uint16_t * | In | ||
) |
Name: IoExpPortRead
Read 16-bits data from IO expander ports.
IoExpander | Parameters for the IO port expander to be used |
In | Pointer to put data read from IO expander ports |
uint16_t IoExpPortInterruptsRead | ( | const struct io_expander_t * | IoExpander | ) |
Name: IoExpPortInterruptsRead
Read and clear interrupt status from the IO expander.
IoExpander | Parameters for the IO port expander to be used |
bool IoExpPortInterruptsEnable | ( | const struct io_expander_t * | IoExpander, |
uint16_t | Mask | ||
) |
Name: IoExpPortInterruptsEnable
Enable (unmask) interrupts for the selected set of pins.
IoExpander | Parameters for the IO port expander to be used |
Mask | Pin bitmap |
bool IoExpPortInterruptsDisable | ( | const struct io_expander_t * | IoExpander, |
uint16_t | Mask | ||
) |
Name: IoExpPortInterruptsDisable
Disable (mask) interrupts for the selected set of pins.
IoExpander | Parameters for the IO port expander to be used |
Mask | Pin bitmap |
void IoExpPortInterruptsClear | ( | const struct io_expander_t * | IoExpander, |
uint16_t | Mask | ||
) |
Name: IoExpPortInterruptsDisable
Clear (remove pending status) interrupts for the selected set of pins.
IoExpander | Parameters for the IO port expander to be used |
Mask | Pin bitmap |
|
inlinestatic |
Name: IoExpPortSet
Sets IO expander port bits.
IoExpander | Parameters for the IO port expander to be used |
SetBits | Bits to be set at IO expander ports |
Definition at line 202 of file io-expander-pcal9535a.h.
References IoExpPortWrite().
|
inlinestatic |
Name: IoExpPortClear
Clears IO expander port bits.
IoExpander | Parameters for the IO port expander to be used |
ClearBits | Bits to be cleared at IO expander ports |
Definition at line 216 of file io-expander-pcal9535a.h.
References IoExpPortWrite().
|
inlinestatic |
Name: IoExpPortDirection
Set IO expander ports to input and output.
IoExpander | Parameters for the IO port expander to be used |
Direction | 0 = output, 1 = input |
Definition at line 230 of file io-expander-pcal9535a.h.
References io_expander_state_t::Direction, and io_expander_t::State.
|
inlinestatic |
Name: IoExpPortDriveSet
Set output drive strength for IO expander ports.
IoExpander | Parameters for the IO port expander to be used |
Drive | Output drive strength data for the port bits 00 = 25%, 01 = 50%, 10 = 75%, 11 = 100% for each bit |
Definition at line 246 of file io-expander-pcal9535a.h.
|
inlinestatic |
Name: IoExpPortPullResistorSet
Disables/enables pullup/pulldown resistors for IO expander port pins.
IoExpander | Parameters for the IO port expander to be used |
PullEnable | Enable pull resistors for port pins 0 = disable, 1 = enable |
PullSelect | Sets pullup or polldown resistors for port pins 0 = 100k pulldown, 1 = 100k pullup |
Definition at line 267 of file io-expander-pcal9535a.h.