libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
General Purpose I/O Defines

Defined Constants and Types for the LM3S General Purpose I/O More...

Collaboration diagram for General Purpose I/O Defines:

Macros

#define GPIOA   GPIOA_APB_BASE
 
#define GPIOB   GPIOB_APB_BASE
 
#define GPIOC   GPIOC_APB_BASE
 
#define GPIOD   GPIOD_APB_BASE
 
#define GPIOE   GPIOE_APB_BASE
 
#define GPIOF   GPIOF_APB_BASE
 
#define GPIOG   GPIOG_APB_BASE
 
#define GPIOH   GPIOH_APB_BASE
 
#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 GPIO_DATA(port)   (&MMIO32((port) + 0x000))
 
#define GPIO_DIR(port)   MMIO32((port) + 0x400)
 
#define GPIO_IS(port)   MMIO32((port) + 0x404)
 
#define GPIO_IBE(port)   MMIO32((port) + 0x408)
 
#define GPIO_IEV(port)   MMIO32((port) + 0x40c)
 
#define GPIO_IM(port)   MMIO32((port) + 0x410)
 
#define GPIO_RIS(port)   MMIO32((port) + 0x414)
 
#define GPIO_MIS(port)   MMIO32((port) + 0x418)
 
#define GPIO_ICR(port)   MMIO32((port) + 0x41c)
 
#define GPIO_AFSEL(port)   MMIO32((port) + 0x420)
 
#define GPIO_DR2R(port)   MMIO32((port) + 0x500)
 
#define GPIO_DR4R(port)   MMIO32((port) + 0x504)
 
#define GPIO_DR8R(port)   MMIO32((port) + 0x508)
 
#define GPIO_ODR(port)   MMIO32((port) + 0x50c)
 
#define GPIO_PUR(port)   MMIO32((port) + 0x510)
 
#define GPIO_PDR(port)   MMIO32((port) + 0x514)
 
#define GPIO_SLR(port)   MMIO32((port) + 0x518)
 
#define GPIO_DEN(port)   MMIO32((port) + 0x51c)
 
#define GPIO_LOCK(port)   MMIO32((port) + 0x520)
 
#define GPIO_CR(port)   MMIO32((port) + 0x524)
 
#define GPIO_AMSEL(port)   MMIO32((port) + 0x528)
 

Functions

void gpio_set (uint32_t gpioport, uint8_t gpios)
 
void gpio_clear (uint32_t gpioport, uint8_t gpios)
 

Detailed Description

Defined Constants and Types for the LM3S General Purpose I/O

Version
1.0.0
Author
© 2011 Gareth McMullin garet.nosp@m.h@bl.nosp@m.acksp.nosp@m.here.nosp@m..co.n.nosp@m.z
Date
10 March 2013

LGPL License Terms libopencm3 License

Macro Definition Documentation

◆ GPIO0

#define GPIO0   (1 << 0)

Definition at line 56 of file gpio.h.

◆ GPIO1

#define GPIO1   (1 << 1)

Definition at line 57 of file gpio.h.

◆ GPIO2

#define GPIO2   (1 << 2)

Definition at line 58 of file gpio.h.

◆ GPIO3

#define GPIO3   (1 << 3)

Definition at line 59 of file gpio.h.

◆ GPIO4

#define GPIO4   (1 << 4)

Definition at line 60 of file gpio.h.

◆ GPIO5

#define GPIO5   (1 << 5)

Definition at line 61 of file gpio.h.

◆ GPIO6

#define GPIO6   (1 << 6)

Definition at line 62 of file gpio.h.

◆ GPIO7

#define GPIO7   (1 << 7)

Definition at line 63 of file gpio.h.

◆ GPIO_AFSEL

#define GPIO_AFSEL (   port)    MMIO32((port) + 0x420)

Definition at line 76 of file gpio.h.

◆ GPIO_AMSEL

#define GPIO_AMSEL (   port)    MMIO32((port) + 0x528)

Definition at line 87 of file gpio.h.

◆ GPIO_CR

#define GPIO_CR (   port)    MMIO32((port) + 0x524)

Definition at line 86 of file gpio.h.

◆ GPIO_DATA

#define GPIO_DATA (   port)    (&MMIO32((port) + 0x000))

Definition at line 67 of file gpio.h.

◆ GPIO_DEN

#define GPIO_DEN (   port)    MMIO32((port) + 0x51c)

Definition at line 84 of file gpio.h.

◆ GPIO_DIR

#define GPIO_DIR (   port)    MMIO32((port) + 0x400)

Definition at line 68 of file gpio.h.

◆ GPIO_DR2R

#define GPIO_DR2R (   port)    MMIO32((port) + 0x500)

Definition at line 77 of file gpio.h.

◆ GPIO_DR4R

#define GPIO_DR4R (   port)    MMIO32((port) + 0x504)

Definition at line 78 of file gpio.h.

◆ GPIO_DR8R

#define GPIO_DR8R (   port)    MMIO32((port) + 0x508)

Definition at line 79 of file gpio.h.

◆ GPIO_IBE

#define GPIO_IBE (   port)    MMIO32((port) + 0x408)

Definition at line 70 of file gpio.h.

◆ GPIO_ICR

#define GPIO_ICR (   port)    MMIO32((port) + 0x41c)

Definition at line 75 of file gpio.h.

◆ GPIO_IEV

#define GPIO_IEV (   port)    MMIO32((port) + 0x40c)

Definition at line 71 of file gpio.h.

◆ GPIO_IM

#define GPIO_IM (   port)    MMIO32((port) + 0x410)

Definition at line 72 of file gpio.h.

◆ GPIO_IS

#define GPIO_IS (   port)    MMIO32((port) + 0x404)

Definition at line 69 of file gpio.h.

◆ GPIO_LOCK

#define GPIO_LOCK (   port)    MMIO32((port) + 0x520)

Definition at line 85 of file gpio.h.

◆ GPIO_MIS

#define GPIO_MIS (   port)    MMIO32((port) + 0x418)

Definition at line 74 of file gpio.h.

◆ GPIO_ODR

#define GPIO_ODR (   port)    MMIO32((port) + 0x50c)

Definition at line 80 of file gpio.h.

◆ GPIO_PDR

#define GPIO_PDR (   port)    MMIO32((port) + 0x514)

Definition at line 82 of file gpio.h.

◆ GPIO_PUR

#define GPIO_PUR (   port)    MMIO32((port) + 0x510)

Definition at line 81 of file gpio.h.

◆ GPIO_RIS

#define GPIO_RIS (   port)    MMIO32((port) + 0x414)

Definition at line 73 of file gpio.h.

◆ GPIO_SLR

#define GPIO_SLR (   port)    MMIO32((port) + 0x518)

Definition at line 83 of file gpio.h.

◆ GPIOA

#define GPIOA   GPIOA_APB_BASE

Definition at line 46 of file gpio.h.

◆ GPIOB

#define GPIOB   GPIOB_APB_BASE

Definition at line 47 of file gpio.h.

◆ GPIOC

#define GPIOC   GPIOC_APB_BASE

Definition at line 48 of file gpio.h.

◆ GPIOD

#define GPIOD   GPIOD_APB_BASE

Definition at line 49 of file gpio.h.

◆ GPIOE

#define GPIOE   GPIOE_APB_BASE

Definition at line 50 of file gpio.h.

◆ GPIOF

#define GPIOF   GPIOF_APB_BASE

Definition at line 51 of file gpio.h.

◆ GPIOG

#define GPIOG   GPIOG_APB_BASE

Definition at line 52 of file gpio.h.

◆ GPIOH

#define GPIOH   GPIOH_APB_BASE

Definition at line 53 of file gpio.h.

Function Documentation

◆ gpio_clear()

void gpio_clear ( uint32_t  gpioport,
uint8_t  gpios 
)

Definition at line 46 of file gpio.c.

References GPIO_DATA.

◆ gpio_set()

void gpio_set ( uint32_t  gpioport,
uint8_t  gpios 
)

Definition at line 40 of file gpio.c.

References GPIO_DATA.