EVE 1.0
io-expander-pca9535a.h File Reference

Driver for I2C-based IO expander type NXP PCA9535A. More...

#include <stdbool.h>
#include <string.h>
#include <em_device.h>
Include dependency graph for io-expander-pca9535a.h:

Go to the source code of this file.

Data Structures

struct  io_expander_t
 

Functions

Functions called from application programs
bool IoExpPortInit (const struct io_expander_t *IoExpander)
 Name: IoExpPortInit
Initializes I2C-based IO expander type NXP PCA9535A. I2C address range is 0x20 - 0x27. Max baudrate is 400 kbit/s. More...
 
bool IoExpPortWrite (const struct io_expander_t *IoExpander, const uint8_t Port0, const uint8_t Port1)
 Name: IoExpPortWrite
Write to IO expander PORT0 and PORT1. More...
 
bool IoExpPort0Write (const struct io_expander_t *IoExpander, const uint8_t Port0)
 Name: IoExpPort0Write
Write to IO expander PORT0. More...
 
bool IoExpPort1Write (const struct io_expander_t *IoExpander, const uint8_t Port1)
 Name: IoExpPort1Write
Write to IO expander PORT1. More...
 
bool IoExpPortRead (const struct io_expander_t *IoExpander, uint8_t *Port0, uint8_t *Port1)
 Name: IoExpPortRead
Read IO expander PORT0 and PORT1. More...
 
static bool IoExpPort0Read (const struct io_expander_t *IoExpander, uint8_t *Port0)
 Name: IoExpPort0Read
Read IO expander PORT0. More...
 
static bool IoExpPort1Read (const struct io_expander_t *IoExpander, uint8_t *Port1)
 Name: IoExpPort1Read
Read IO expander PORT1. More...
 

Detailed Description

Driver for I2C-based IO expander type NXP PCA9535A.

Author
KLO, Jetro as

Definition in file io-expander-pca9535a.h.

Function Documentation

bool IoExpPortInit ( const struct io_expander_t IoExpander)

Name: IoExpPortInit
Initializes I2C-based IO expander type NXP PCA9535A. I2C address range is 0x20 - 0x27. Max baudrate is 400 kbit/s.

Parameters
IoExpanderParameters for the IO port expander to be used
Returns
true if OK, else false
bool IoExpPortWrite ( const struct io_expander_t IoExpander,
const uint8_t  Port0,
const uint8_t  Port1 
)

Name: IoExpPortWrite
Write to IO expander PORT0 and PORT1.

Parameters
IoExpanderParameters for the IO port expander to be used
Port0Data to be written to PORT0
Port1Data to be written to PORT1
Returns
true if OK, else false

Referenced by IoExpPortClear(), IoExpPortSet(), and UpdateLeds().

bool IoExpPort0Write ( const struct io_expander_t IoExpander,
const uint8_t  Port0 
)

Name: IoExpPort0Write
Write to IO expander PORT0.

Parameters
IoExpanderParameters for the IO port expander to be used
Port0Data to be written to PORT0
Returns
true if OK, else false
bool IoExpPort1Write ( const struct io_expander_t IoExpander,
const uint8_t  Port1 
)

Name: IoExpPort1Write
Write to IO expander PORT1.

Parameters
IoExpanderParameters for the IO port expander to be used
Port1Data to be written to PORT1
Returns
true if OK, else false
bool IoExpPortRead ( const struct io_expander_t IoExpander,
uint8_t *  Port0,
uint8_t *  Port1 
)

Name: IoExpPortRead
Read IO expander PORT0 and PORT1.

Parameters
IoExpanderParameters for the IO port expander to be used
Port0Pointer to put data read from IO expander PORT0
Port1Pointer to put data read from IO expander PORT1
Returns
true if OK, else false

Referenced by IoExpPort0Read(), IoExpPort1Read(), and ReadKeyInput().

static bool IoExpPort0Read ( const struct io_expander_t IoExpander,
uint8_t *  Port0 
)
inlinestatic

Name: IoExpPort0Read
Read IO expander PORT0.

Parameters
IoExpanderParameters for the IO port expander to be used
Port0Pointer to put data read from IO expander PORT0
Returns
true if OK, else false

Definition at line 150 of file io-expander-pca9535a.h.

References IoExpPortRead().

static bool IoExpPort1Read ( const struct io_expander_t IoExpander,
uint8_t *  Port1 
)
inlinestatic

Name: IoExpPort1Read
Read IO expander PORT1.

Parameters
IoExpanderParameters for the IO port expander to be used
Port1Pointer to put data read from IO expander PORT1
Returns
true if OK, else false

Definition at line 164 of file io-expander-pca9535a.h.

References IoExpPortRead().