From 8241a4c640d036faa148350219ad3deea72a23c2 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Tue, 8 Mar 2011 12:54:33 -0500 Subject: Separated GPIO config to a separate FSMC routine. --- libmaple/fsmc.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'libmaple/fsmc.c') diff --git a/libmaple/fsmc.c b/libmaple/fsmc.c index 42e0eb1..db77ff1 100644 --- a/libmaple/fsmc.c +++ b/libmaple/fsmc.c @@ -31,14 +31,7 @@ #include "gpio.h" #include "fsmc.h" -/* Sets up the FSMC peripheral to use the SRAM chip on the maple - * native as an external segment of system memory space. This - * implementation is for the IS62WV51216BLL 8mbit chip (55ns - * timing) */ -void fsmc_native_sram_init(void) { - FSMC_Bank *bank; - - /* First we setup all the GPIO pins. */ +void fsmc_init_gpios(void) { /* Data lines... */ gpio_set_mode(GPIOD_BASE, 0, MODE_AF_OUTPUT_PP); /* D2 */ gpio_set_mode(GPIOD_BASE, 1, MODE_AF_OUTPUT_PP); /* D3 */ @@ -89,6 +82,17 @@ void fsmc_native_sram_init(void) { gpio_set_mode(GPIOE_BASE, 0, MODE_AF_OUTPUT_PP); /* NBL0 */ gpio_set_mode(GPIOE_BASE, 1, MODE_AF_OUTPUT_PP); /* NBL1 */ +} + +/* Sets up the FSMC peripheral to use the SRAM chip on the maple + * native as an external segment of system memory space. This + * implementation is for the IS62WV51216BLL 8mbit chip (55ns + * timing) */ +void fsmc_native_sram_init(void) { + FSMC_Bank *bank; + + /* First set up the GPIO pins */ + fsmc_init_gpios(); /* Next enable the clock */ rcc_clk_enable(RCC_FSMC); -- cgit v1.2.3