Paparazzi UAS  v5.18.0_stable-1-g6993852-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gpio_ext_pca95xx.c File Reference
#include "modules/gpio_ext/gpio_ext_pca95xx.h"
#include "modules/gpio_ext/gpio_ext_common.h"
#include "generated/airframe.h"
#include "peripherals/pca95xx.h"
#include "mcu_periph/i2c.h"
#include <stdbool.h>
+ Include dependency graph for gpio_ext_pca95xx.c:

Go to the source code of this file.

Data Structures

struct  gpio_ext_pca95xx_impl_t
 

Macros

#define GPIO_EXT_PCA95XX_I2C_PERIPH1_PTR   NULL
 
#define GPIO_EXT_PCA95XX_I2C_PERIPH2_PTR   NULL
 
#define GPIO_EXT_PCA95XX_I2C_PERIPH3_PTR   NULL
 
#define GPIO_EXT_PCA95XX_I2C_PERIPH4_PTR   NULL
 
#define GPIO_EXT_PCA95XX_I2C_ADDRESS1   0x00
 
#define GPIO_EXT_PCA95XX_I2C_ADDRESS2   0x00
 
#define GPIO_EXT_PCA95XX_I2C_ADDRESS3   0x00
 
#define GPIO_EXT_PCA95XX_I2C_ADDRESS4   0x00
 
#define GPIO_EXT_PCA95XX_BLOCKING1   TRUE
 
#define GPIO_EXT_PCA95XX_BLOCKING2   TRUE
 
#define GPIO_EXT_PCA95XX_BLOCKING3   TRUE
 
#define GPIO_EXT_PCA95XX_BLOCKING4   TRUE
 

Functions

static void gpio_ext_pca95xx_setup_output (uint32_t port, uint32_t gpios)
 
static void gpio_ext_pca95xx_setup_input (uint32_t port, uint32_t gpios)
 
static uint32_t gpio_ext_pca95xx_get (uint32_t port, uint32_t gpios)
 
static void gpio_ext_pca95xx_set (uint32_t port, uint32_t gpios)
 
static void gpio_ext_pca95xx_clear (uint32_t port, uint32_t gpios)
 
static void gpio_ext_pca95xx_toggle (uint32_t port, uint32_t gpios)
 
static void gpio_ext_pca95xx_lazy_init (uint32_t port)
 

Variables

static struct i2c_periph *const i2c_periph []
 
static const uint8_t i2c_addr []
 
static const bool blocking []
 
struct gpio_ext_functions pca95xx_functions
 
static struct
gpio_ext_pca95xx_impl_t 
impl [GPIOEXT_NB]
 

Detailed Description

Author
Tom van Dijk tomva.nosp@m.nd@u.nosp@m.sers..nosp@m.nore.nosp@m.ply.g.nosp@m.ithu.nosp@m.b.com PCA95XX external GPIO peripheral

Definition in file gpio_ext_pca95xx.c.


Data Structure Documentation

struct gpio_ext_pca95xx_impl_t

Definition at line 120 of file gpio_ext_pca95xx.c.

+ Collaboration diagram for gpio_ext_pca95xx_impl_t:
Data Fields
uint8_t config_reg
bool initialized
uint8_t output_reg
struct pca95xx periph

Macro Definition Documentation

#define GPIO_EXT_PCA95XX_BLOCKING1   TRUE

Definition at line 83 of file gpio_ext_pca95xx.c.

#define GPIO_EXT_PCA95XX_BLOCKING2   TRUE

Definition at line 86 of file gpio_ext_pca95xx.c.

#define GPIO_EXT_PCA95XX_BLOCKING3   TRUE

Definition at line 89 of file gpio_ext_pca95xx.c.

#define GPIO_EXT_PCA95XX_BLOCKING4   TRUE

Definition at line 92 of file gpio_ext_pca95xx.c.

#define GPIO_EXT_PCA95XX_I2C_ADDRESS1   0x00

Definition at line 64 of file gpio_ext_pca95xx.c.

#define GPIO_EXT_PCA95XX_I2C_ADDRESS2   0x00

Definition at line 67 of file gpio_ext_pca95xx.c.

#define GPIO_EXT_PCA95XX_I2C_ADDRESS3   0x00

Definition at line 70 of file gpio_ext_pca95xx.c.

#define GPIO_EXT_PCA95XX_I2C_ADDRESS4   0x00

Definition at line 73 of file gpio_ext_pca95xx.c.

#define GPIO_EXT_PCA95XX_I2C_PERIPH1_PTR   NULL

Definition at line 39 of file gpio_ext_pca95xx.c.

#define GPIO_EXT_PCA95XX_I2C_PERIPH2_PTR   NULL

Definition at line 44 of file gpio_ext_pca95xx.c.

#define GPIO_EXT_PCA95XX_I2C_PERIPH3_PTR   NULL

Definition at line 49 of file gpio_ext_pca95xx.c.

#define GPIO_EXT_PCA95XX_I2C_PERIPH4_PTR   NULL

Definition at line 54 of file gpio_ext_pca95xx.c.

Function Documentation

static void gpio_ext_pca95xx_clear ( uint32_t  port,
uint32_t  gpios 
)
static

Definition at line 173 of file gpio_ext_pca95xx.c.

References blocking, impl, gpio_ext_pca95xx_impl_t::output_reg, pca95xx_set_output(), and gpio_ext_pca95xx_impl_t::periph.

+ Here is the call graph for this function:

static uint32_t gpio_ext_pca95xx_get ( uint32_t  port,
uint32_t  gpios 
)
static

Definition at line 160 of file gpio_ext_pca95xx.c.

References impl, pca95xx_get_input(), and gpio_ext_pca95xx_impl_t::periph.

+ Here is the call graph for this function:

static void gpio_ext_pca95xx_lazy_init ( uint32_t  port)
static
static void gpio_ext_pca95xx_set ( uint32_t  port,
uint32_t  gpios 
)
static

Definition at line 167 of file gpio_ext_pca95xx.c.

References blocking, impl, gpio_ext_pca95xx_impl_t::output_reg, pca95xx_set_output(), and gpio_ext_pca95xx_impl_t::periph.

+ Here is the call graph for this function:

static void gpio_ext_pca95xx_setup_input ( uint32_t  port,
uint32_t  gpios 
)
static

Definition at line 153 of file gpio_ext_pca95xx.c.

References blocking, gpio_ext_pca95xx_impl_t::config_reg, gpio_ext_pca95xx_lazy_init(), impl, pca95xx_configure(), and gpio_ext_pca95xx_impl_t::periph.

+ Here is the call graph for this function:

static void gpio_ext_pca95xx_setup_output ( uint32_t  port,
uint32_t  gpios 
)
static

Definition at line 146 of file gpio_ext_pca95xx.c.

References blocking, gpio_ext_pca95xx_impl_t::config_reg, gpio_ext_pca95xx_lazy_init(), impl, pca95xx_configure(), and gpio_ext_pca95xx_impl_t::periph.

+ Here is the call graph for this function:

static void gpio_ext_pca95xx_toggle ( uint32_t  port,
uint32_t  gpios 
)
static

Definition at line 179 of file gpio_ext_pca95xx.c.

References blocking, impl, gpio_ext_pca95xx_impl_t::output_reg, pca95xx_set_output(), and gpio_ext_pca95xx_impl_t::periph.

+ Here is the call graph for this function:

Variable Documentation

const uint8_t i2c_addr[]
static
Initial value:
= {
}
#define GPIO_EXT_PCA95XX_I2C_ADDRESS4
#define GPIO_EXT_PCA95XX_I2C_ADDRESS2
#define GPIO_EXT_PCA95XX_I2C_ADDRESS1
#define GPIO_EXT_PCA95XX_I2C_ADDRESS3

Definition at line 75 of file gpio_ext_pca95xx.c.

Referenced by gpio_ext_pca95xx_lazy_init().

struct i2c_periph* const i2c_periph[]
static
Initial value:

Definition at line 56 of file gpio_ext_pca95xx.c.

struct gpio_ext_functions pca95xx_functions
Initial value:
= {
}
static void gpio_ext_pca95xx_set(uint32_t port, uint32_t gpios)
static void gpio_ext_pca95xx_clear(uint32_t port, uint32_t gpios)
static void gpio_ext_pca95xx_setup_input(uint32_t port, uint32_t gpios)
static void gpio_ext_pca95xx_setup_output(uint32_t port, uint32_t gpios)
static void gpio_ext_pca95xx_toggle(uint32_t port, uint32_t gpios)
static uint32_t gpio_ext_pca95xx_get(uint32_t port, uint32_t gpios)

Definition at line 110 of file gpio_ext_pca95xx.c.