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>
This commit is contained in:
Alexandru Gagniuc 2012-11-24 13:58:21 -06:00
parent 1a9d628a02
commit 2477681c7d

View File

@ -27,13 +27,12 @@
* Green controlled by PF3
* Blue controlled by PF2
*/
#include <libopencm3/lm4f/systemcontrol.h>
#include <libopencm3/lm4f/gpio.h>
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));
GPIO_DIR(GPIOF) |= outpins; /* Configure outputs. */