Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
gpio_ext_common.c File Reference
#include "gpio_ext_common.h"
#include "generated/airframe.h"
#include "generated/modules.h"
#include "mcu_periph/gpio.h"
#include <stdint.h>
+ Include dependency graph for gpio_ext_common.c:

Go to the source code of this file.

Macros

#define GPIO_EXT_NOT_PROVIDED   NULL
 
#define GPIO_EXT_PROVIDER1   GPIO_EXT_NOT_PROVIDED
 
#define GPIO_EXT_PROVIDER2   GPIO_EXT_NOT_PROVIDED
 
#define GPIO_EXT_PROVIDER3   GPIO_EXT_NOT_PROVIDED
 
#define GPIO_EXT_PROVIDER4   GPIO_EXT_NOT_PROVIDED
 
#define SAFE_CALL(_port, _fn, _args...)   if(gpio_ext_impl[_port - GPIOEXT1] && gpio_ext_impl[_port - GPIOEXT1]->_fn) gpio_ext_impl[_port - GPIOEXT1]->_fn(_args);
 

Functions

void __wrap_gpio_setup_output (uint32_t port, uint32_t gpios)
 
void __real_gpio_setup_output (uint32_t port, uint32_t gpios)
 
void __wrap_gpio_setup_input (uint32_t port, uint32_t gpios)
 
void __real_gpio_setup_input (uint32_t port, uint32_t gpios)
 
uint32_t __wrap_gpio_get (uint32_t port, uint32_t gpios)
 
uint32_t __real_gpio_get (uint32_t port, uint32_t gpios)
 
void __wrap_gpio_set (uint32_t port, uint32_t gpios)
 
void __real_gpio_set (uint32_t port, uint32_t gpios)
 
void __wrap_gpio_clear (uint32_t port, uint32_t gpios)
 
void __real_gpio_clear (uint32_t port, uint32_t gpios)
 
void __wrap_gpio_toggle (uint32_t port, uint32_t gpios)
 
void __real_gpio_toggle (uint32_t port, uint32_t gpios)
 

Variables

static struct gpio_ext_functionsgpio_ext_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 Common external GPIO functions.

Definition in file gpio_ext_common.c.

Macro Definition Documentation

◆ GPIO_EXT_NOT_PROVIDED

#define GPIO_EXT_NOT_PROVIDED   NULL

Definition at line 36 of file gpio_ext_common.c.

◆ GPIO_EXT_PROVIDER1

#define GPIO_EXT_PROVIDER1   GPIO_EXT_NOT_PROVIDED

Definition at line 39 of file gpio_ext_common.c.

◆ GPIO_EXT_PROVIDER2

#define GPIO_EXT_PROVIDER2   GPIO_EXT_NOT_PROVIDED

Definition at line 42 of file gpio_ext_common.c.

◆ GPIO_EXT_PROVIDER3

#define GPIO_EXT_PROVIDER3   GPIO_EXT_NOT_PROVIDED

Definition at line 45 of file gpio_ext_common.c.

◆ GPIO_EXT_PROVIDER4

#define GPIO_EXT_PROVIDER4   GPIO_EXT_NOT_PROVIDED

Definition at line 48 of file gpio_ext_common.c.

◆ SAFE_CALL

#define SAFE_CALL (   _port,
  _fn,
  _args... 
)    if(gpio_ext_impl[_port - GPIOEXT1] && gpio_ext_impl[_port - GPIOEXT1]->_fn) gpio_ext_impl[_port - GPIOEXT1]->_fn(_args);

Definition at line 62 of file gpio_ext_common.c.

Function Documentation

◆ __real_gpio_clear()

void __real_gpio_clear ( uint32_t  port,
uint32_t  gpios 
)

Referenced by __wrap_gpio_clear().

+ Here is the caller graph for this function:

◆ __real_gpio_get()

uint32_t __real_gpio_get ( uint32_t  port,
uint32_t  gpios 
)

Referenced by __wrap_gpio_get().

+ Here is the caller graph for this function:

◆ __real_gpio_set()

void __real_gpio_set ( uint32_t  port,
uint32_t  gpios 
)

Referenced by __wrap_gpio_set().

+ Here is the caller graph for this function:

◆ __real_gpio_setup_input()

void __real_gpio_setup_input ( uint32_t  port,
uint32_t  gpios 
)

Referenced by __wrap_gpio_setup_input().

+ Here is the caller graph for this function:

◆ __real_gpio_setup_output()

void __real_gpio_setup_output ( uint32_t  port,
uint32_t  gpios 
)

Referenced by __wrap_gpio_setup_output().

+ Here is the caller graph for this function:

◆ __real_gpio_toggle()

void __real_gpio_toggle ( uint32_t  port,
uint32_t  gpios 
)

Referenced by __wrap_gpio_toggle().

+ Here is the caller graph for this function:

◆ __wrap_gpio_clear()

void __wrap_gpio_clear ( uint32_t  port,
uint32_t  gpios 
)

Definition at line 111 of file gpio_ext_common.c.

References __real_gpio_clear(), gpio_ext_functions::clear, and SAFE_CALL.

+ Here is the call graph for this function:

◆ __wrap_gpio_get()

uint32_t __wrap_gpio_get ( uint32_t  port,
uint32_t  gpios 
)

Definition at line 87 of file gpio_ext_common.c.

References __real_gpio_get(), gpio_ext_functions::get, and gpio_ext_impl.

+ Here is the call graph for this function:

◆ __wrap_gpio_set()

void __wrap_gpio_set ( uint32_t  port,
uint32_t  gpios 
)

Definition at line 101 of file gpio_ext_common.c.

References __real_gpio_set(), SAFE_CALL, and gpio_ext_functions::set.

+ Here is the call graph for this function:

◆ __wrap_gpio_setup_input()

void __wrap_gpio_setup_input ( uint32_t  port,
uint32_t  gpios 
)

Definition at line 77 of file gpio_ext_common.c.

References __real_gpio_setup_input(), SAFE_CALL, and gpio_ext_functions::setup_input.

+ Here is the call graph for this function:

◆ __wrap_gpio_setup_output()

void __wrap_gpio_setup_output ( uint32_t  port,
uint32_t  gpios 
)

Definition at line 67 of file gpio_ext_common.c.

References __real_gpio_setup_output(), SAFE_CALL, and gpio_ext_functions::setup_output.

+ Here is the call graph for this function:

◆ __wrap_gpio_toggle()

void __wrap_gpio_toggle ( uint32_t  port,
uint32_t  gpios 
)

Definition at line 121 of file gpio_ext_common.c.

References __real_gpio_toggle(), SAFE_CALL, and gpio_ext_functions::toggle.

+ Here is the call graph for this function:

Variable Documentation

◆ gpio_ext_impl

struct gpio_ext_functions* gpio_ext_impl[GPIOEXT_NB]
static
Initial value:
= {
}
#define GPIO_EXT_PROVIDER2
#define GPIO_EXT_PROVIDER1
#define GPIO_EXT_PROVIDER3
#define GPIO_EXT_PROVIDER4

Definition at line 51 of file gpio_ext_common.c.

Referenced by __wrap_gpio_get().