Proper GPIO initialization for LTDC

This commit is contained in:
Romain Goyet
2015-05-11 16:38:20 +02:00
parent 78f01dc981
commit 6e4ffa7402

View File

@@ -133,7 +133,7 @@ static void init_rgb_gpios() {
RCC_AHB1ENR |= (
GPIOAEN | GPIOBEN | GPIOCEN | GPIODEN |
GPIOEEN | GPIOFEN | GPIOGEN | GPIOHEN |
GPIOIEN | GPIOJEN | GPIOJEN
GPIOIEN | GPIOJEN | GPIOKEN
);
// The LTDC is always mapped to AF14
@@ -141,6 +141,7 @@ static void init_rgb_gpios() {
for (int i=0; i<rgb_pin_count; i++) {
struct gpio_pin * pin = rgb_pins+i;
REGISTER_SET_VALUE(GPIO_AFR(pin->group, pin->number), AFR(pin->number), 14);
REGISTER_SET_VALUE(GPIO_MODER(pin->group), MODER(pin->number), GPIO_MODE_ALTERNATE_FUNCTION);
}
//FIXME: Apprently DMA should be enabled?