Browse Source

lm4f: Update stellaris example to new LM4F registers

The LM4F provides new registers for system control. Each peripheral
now has its own clock gating control register. The LM4F still supports
the legacy registers for backwards compatibility.

Use SYSCTL_RCGCGPIO instead of SYSCTL_RCGC to enable the GPIO.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
pull/74/head
Alexandru Gagniuc 12 years ago
parent
commit
2477681c7d
  1. 3
      examples/lm4f/stellaris-ek-lm4f120xl/miniblink/miniblink.c

3
examples/lm4f/stellaris-ek-lm4f120xl/miniblink/miniblink.c

@ -27,13 +27,12 @@
* Green controlled by PF3 * Green controlled by PF3
* Blue controlled by PF2 * Blue controlled by PF2
*/ */
#include <libopencm3/lm4f/systemcontrol.h> #include <libopencm3/lm4f/systemcontrol.h>
#include <libopencm3/lm4f/gpio.h> #include <libopencm3/lm4f/gpio.h>
void gpio_setup(void) void gpio_setup(void)
{ {
SYSTEMCONTROL_RCGC2 |= 0x20; /* Enable GPIOF in run mode. */ SYSCTL_RCGCGPIO |= 0x20; /* Enable GPIOF in run mode. */
const u32 outpins = ((1<<3) | (1<<2) | (1<<1)); const u32 outpins = ((1<<3) | (1<<2) | (1<<1));
GPIO_DIR(GPIOF) |= outpins; /* Configure outputs. */ GPIO_DIR(GPIOF) |= outpins; /* Configure outputs. */

Loading…
Cancel
Save