Browse Source

lm4f: Switch GPIOs to using AHB bus ***WARNING***

The AHB bus allows faster control of GPIO pins versus the older APB bus.
The GPIO ports A through H default on the APB bus. Change the GPIOx
defines in gpio.h to use the base address of the AHB bus.

There's another reason to use the AHB bus: ports K tand highercan only be
accessed via the AHB bus.

***WARNING***
To work, GPIO acces to the AHB bus must be explictly enabled via the
GPIOHBCTL register. Without any additional change, this patch will break
any code using the older APB bus. If the GPIOHBCTL is not properly
modified, any acces to the GPIO register will cause a hard fault.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
pull/150/merge
Alexandru Gagniuc 12 years ago
committed by Piotr Esden-Tempski
parent
commit
4c45702d2d
  1. 16
      include/libopencm3/lm4f/gpio.h

16
include/libopencm3/lm4f/gpio.h

@ -43,14 +43,14 @@ LGPL License Terms @ref lgpl_license
/* --- Convenience macros -------------------------------------------------- */
/* GPIO port base addresses (for convenience) */
#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 GPIOA GPIOA_BASE
#define GPIOB GPIOB_BASE
#define GPIOC GPIOC_BASE
#define GPIOD GPIOD_BASE
#define GPIOE GPIOE_BASE
#define GPIOF GPIOF_BASE
#define GPIOG GPIOG_BASE
#define GPIOH GPIOH_BASE
/* GPIO number definitions (for convenience) */
#define GPIO0 (1 << 0)

Loading…
Cancel
Save