From 10a9cfc30317e02c8fabca572fd8b4d97105842b Mon Sep 17 00:00:00 2001 From: James Snyder Date: Tue, 19 Jul 2011 15:08:09 -0500 Subject: [PATCH] basic working port for soldercore with console over telnet --- src/platform/lm3s/platform.c | 24 ++++++++++-------------- src/platform/lm3s/platform_conf.h | 10 +++++++--- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/platform/lm3s/platform.c b/src/platform/lm3s/platform.c index d582841e..8bd9ca74 100644 --- a/src/platform/lm3s/platform.c +++ b/src/platform/lm3s/platform.c @@ -372,8 +372,14 @@ static void spis_init() { unsigned i; +#if defined( ELUA_BOARD_SOLDERCORE ) + GPIOPinConfigure( GPIO_PH4_SSI1CLK ); + GPIOPinConfigure( GPIO_PF4_SSI1RX ); + GPIOPinConfigure( GPIO_PF5_SSI1TX ); +#endif + for( i = 0; i < NUM_SPI; i ++ ) - MAP_SysCtlPeripheralEnable(spi_sysctl[ i ]); + MAP_SysCtlPeripheralEnable( spi_sysctl[ i ] ); } u32 platform_spi_setup( unsigned id, int mode, u32 clock, unsigned cpol, unsigned cpha, unsigned databits ) @@ -387,16 +393,6 @@ u32 platform_spi_setup( unsigned id, int mode, u32 clock, unsigned cpol, unsigne mode = mode == PLATFORM_SPI_MASTER ? SSI_MODE_MASTER : SSI_MODE_SLAVE; MAP_SSIDisable( spi_base[ id ] ); -#if defined( ELUA_BOARD_SOLDERCORE ) - if( id == 1 ) - { - GPIOPinConfigure( GPIO_PH4_SSI1CLK ); - GPIOPinConfigure( GPIO_PF4_SSI1RX ); - GPIOPinConfigure( GPIO_PF5_SSI1TX ); - } -#endif - - MAP_GPIOPinTypeSSI( spi_gpio_base[ id ], spi_gpio_pins[ id ] ); MAP_GPIOPinTypeSSI( spi_gpio_clk_base[ id ], spi_gpio_clk_pin[ id ] ); @@ -773,18 +769,18 @@ static void adcs_init() unsigned id; elua_adc_dev_state *d = adc_get_dev_state( 0 ); - MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC); + MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC); // Try ramping up max sampling rate MAP_SysCtlADCSpeedSet(SYSCTL_ADCSPEED_500KSPS); MAP_SysCtlADCSpeedSet(SYSCTL_ADCSPEED_1MSPS); - for( id = 0; id < NUM_ADC; id ++ ) + for( id = 0; id < NUM_ADC; id ++ ) adc_init_ch_state( id ); // Perform sequencer setup platform_adc_setclock( 0, 0 ); - MAP_ADCIntEnable( ADC_BASE, d->seq_id ); + MAP_ADCIntEnable( ADC_BASE, d->seq_id ); MAP_IntEnable( adc_ints[ d->seq_id ] ); } diff --git a/src/platform/lm3s/platform_conf.h b/src/platform/lm3s/platform_conf.h index c8017572..d1e0a8cf 100644 --- a/src/platform/lm3s/platform_conf.h +++ b/src/platform/lm3s/platform_conf.h @@ -19,7 +19,7 @@ #define BUILD_SHELL #define BUILD_ROMFS -//#define BUILD_MMCFS +#define BUILD_MMCFS #ifndef FORLM3S1968 #define BUILD_UIP @@ -158,11 +158,15 @@ #if defined(FORLM3S1968) #define NUM_PIO 8 #elif defined(FORLM3S9B92) || defined( FORLM3S9D92 ) - #define NUM_PIO 7 + #define NUM_PIO 9 #else #define NUM_PIO 7 #endif -#define NUM_SPI 1 +#if defined( FORLM3S9B92 ) || defined( FORLM3S9D92 ) + #define NUM_SPI 2 +#else + #define NUM_SPI 1 +#endif #if defined( FORLM3S6965 ) #define NUM_UART 3 #elif defined( FORLM3S9B92 ) || defined( FORLM3S9D92 )