Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gpio_arch.h File Reference

GPIO helper functions for LPC21xx. More...

#include "std.h"
#include "LPC21xx.h"
+ Include dependency graph for gpio_arch.h:

Go to the source code of this file.

Macros

#define GPIOA   0
 
#define GPIOB   1
 
#define GPIO0   (1 << 0)
 
#define GPIO1   (1 << 1)
 
#define GPIO2   (1 << 2)
 
#define GPIO3   (1 << 3)
 
#define GPIO4   (1 << 4)
 
#define GPIO5   (1 << 5)
 
#define GPIO6   (1 << 6)
 
#define GPIO7   (1 << 7)
 
#define GPIO8   (1 << 8)
 
#define GPIO9   (1 << 9)
 
#define GPIO10   (1 << 10)
 
#define GPIO11   (1 << 11)
 
#define GPIO12   (1 << 12)
 
#define GPIO13   (1 << 13)
 
#define GPIO14   (1 << 14)
 
#define GPIO15   (1 << 15)
 
#define GPIO16   (1 << 16)
 
#define GPIO17   (1 << 17)
 
#define GPIO18   (1 << 18)
 
#define GPIO19   (1 << 19)
 
#define GPIO20   (1 << 20)
 
#define GPIO21   (1 << 21)
 
#define GPIO22   (1 << 22)
 
#define GPIO23   (1 << 23)
 
#define GPIO24   (1 << 24)
 
#define GPIO25   (1 << 25)
 
#define GPIO26   (1 << 26)
 
#define GPIO27   (1 << 27)
 
#define GPIO28   (1 << 28)
 
#define GPIO29   (1 << 29)
 
#define GPIO30   (1 << 30)
 
#define GPIO31   (1 << 31)
 

Functions

static void gpio_setup_output (uint32_t port, uint32_t gpios)
 Setup one or more pins of the given GPIO port as outputs. More...
 
static void gpio_setup_input (uint32_t port, uint32_t gpios)
 Setup one or more pins of the given GPIO port as inputs. More...
 
static void gpio_set (uint32_t port, uint32_t gpios)
 Set one or more pins of the given GPIO port to high level. More...
 
static void gpio_clear (uint32_t port, uint32_t gpios)
 Clear one or more pins of the given GPIO port to low level. More...
 
static void gpio_toggle (uint32_t port, uint32_t gpios)
 Toggle a one or more pins of the given GPIO port. More...
 
static uint32_t gpio_get (uint32_t port, uint32_t gpios)
 Read the value of one or more pins of the given GPIO port. More...
 

Detailed Description

GPIO helper functions for LPC21xx.

Definition in file gpio_arch.h.

Macro Definition Documentation

#define GPIO0   (1 << 0)

Definition at line 37 of file gpio_arch.h.

#define GPIO1   (1 << 1)

Definition at line 38 of file gpio_arch.h.

#define GPIO10   (1 << 10)

Definition at line 47 of file gpio_arch.h.

#define GPIO11   (1 << 11)

Definition at line 48 of file gpio_arch.h.

#define GPIO12   (1 << 12)

Definition at line 49 of file gpio_arch.h.

#define GPIO13   (1 << 13)

Definition at line 50 of file gpio_arch.h.

#define GPIO14   (1 << 14)

Definition at line 51 of file gpio_arch.h.

#define GPIO15   (1 << 15)

Definition at line 52 of file gpio_arch.h.

#define GPIO16   (1 << 16)

Definition at line 53 of file gpio_arch.h.

#define GPIO17   (1 << 17)

Definition at line 54 of file gpio_arch.h.

#define GPIO18   (1 << 18)

Definition at line 55 of file gpio_arch.h.

#define GPIO19   (1 << 19)

Definition at line 56 of file gpio_arch.h.

#define GPIO2   (1 << 2)

Definition at line 39 of file gpio_arch.h.

#define GPIO20   (1 << 20)

Definition at line 57 of file gpio_arch.h.

#define GPIO21   (1 << 21)

Definition at line 58 of file gpio_arch.h.

#define GPIO22   (1 << 22)

Definition at line 59 of file gpio_arch.h.

#define GPIO23   (1 << 23)

Definition at line 60 of file gpio_arch.h.

#define GPIO24   (1 << 24)

Definition at line 61 of file gpio_arch.h.

#define GPIO25   (1 << 25)

Definition at line 62 of file gpio_arch.h.

#define GPIO26   (1 << 26)

Definition at line 63 of file gpio_arch.h.

#define GPIO27   (1 << 27)

Definition at line 64 of file gpio_arch.h.

#define GPIO28   (1 << 28)

Definition at line 65 of file gpio_arch.h.

#define GPIO29   (1 << 29)

Definition at line 66 of file gpio_arch.h.

#define GPIO3   (1 << 3)

Definition at line 40 of file gpio_arch.h.

#define GPIO30   (1 << 30)

Definition at line 67 of file gpio_arch.h.

#define GPIO31   (1 << 31)

Definition at line 68 of file gpio_arch.h.

#define GPIO4   (1 << 4)

Definition at line 41 of file gpio_arch.h.

#define GPIO5   (1 << 5)

Definition at line 42 of file gpio_arch.h.

#define GPIO6   (1 << 6)

Definition at line 43 of file gpio_arch.h.

#define GPIO7   (1 << 7)

Definition at line 44 of file gpio_arch.h.

#define GPIO8   (1 << 8)

Definition at line 45 of file gpio_arch.h.

#define GPIO9   (1 << 9)

Definition at line 46 of file gpio_arch.h.

#define GPIOA   0

Definition at line 34 of file gpio_arch.h.

Referenced by gpio_enable_clock(), stm32_gpio_init(), VCOM_init(), and vms_ecu_demo_init().

Function Documentation

static void gpio_clear ( uint32_t  port,
uint32_t  gpios 
)
inlinestatic

Clear one or more pins of the given GPIO port to low level.

Parameters
[in]port
[in]gpiosIf multiple pins are to be changed, use logical OR '|' to separate them.

Definition at line 118 of file gpio_arch.h.

References IO0CLR, and IO1CLR.

static uint32_t gpio_get ( uint32_t  port,
uint32_t  gpios 
)
inlinestatic

Read the value of one or more pins of the given GPIO port.

Parameters
[in]portGPIO port (0 or 1)
[in]gpiosGPIO pin(s). If multiple pins are to be changed, use logical OR '|' to separate them.

Definition at line 154 of file gpio_arch.h.

References IO0PIN, and IO1PIN.

static void gpio_set ( uint32_t  port,
uint32_t  gpios 
)
inlinestatic

Set one or more pins of the given GPIO port to high level.

Parameters
[in]port
[in]gpiosIf multiple pins are to be changed, use logical OR '|' to separate them.

Definition at line 104 of file gpio_arch.h.

References IO0SET, and IO1SET.

static void gpio_setup_input ( uint32_t  port,
uint32_t  gpios 
)
inlinestatic

Setup one or more pins of the given GPIO port as inputs.

Parameters
[in]port
[in]gpiosIf multiple pins are to be changed, use logical OR '|' to separate them.

Definition at line 90 of file gpio_arch.h.

References IO0DIR, and IO1DIR.

static void gpio_setup_output ( uint32_t  port,
uint32_t  gpios 
)
inlinestatic

Setup one or more pins of the given GPIO port as outputs.

Parameters
[in]port
[in]gpiosIf multiple pins are to be changed, use logical OR '|' to separate them.

Definition at line 76 of file gpio_arch.h.

References IO0DIR, and IO1DIR.

static void gpio_toggle ( uint32_t  port,
uint32_t  gpios 
)
inlinestatic

Toggle a one or more pins of the given GPIO port.

Parameters
[in]port
[in]gpiosIf multiple pins are to be changed, use logical OR '|' to separate them.

Definition at line 132 of file gpio_arch.h.

References IO0CLR, IO0PIN, IO0SET, IO1CLR, IO1PIN, and IO1SET.