From 4c45702d2d046bb2f3169bb4ca10427463b0da6e Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Thu, 16 May 2013 00:51:47 -0500 Subject: [PATCH] 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 --- include/libopencm3/lm4f/gpio.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/libopencm3/lm4f/gpio.h b/include/libopencm3/lm4f/gpio.h index 3cb0ee1a..d19bbdb3 100644 --- a/include/libopencm3/lm4f/gpio.h +++ b/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)