1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00

LM3S platform fixes

1. fixed "uart_setup" function
2. enabled UART buffering
3. changed invalid keys in lm3s.pio
This commit is contained in:
Bogdan Marinescu 2012-08-15 21:55:13 +03:00
parent 26989d4bb8
commit 53f5807cee
3 changed files with 14 additions and 7 deletions

View File

@ -489,10 +489,10 @@ const LUA_REG_TYPE lm3s_pio_map[] =
{ LSTRKEY( "set_function" ), LFUNCVAL( lm3s_pio_set_function ) },
#endif // #ifdef LM3S_HAS_ALTERNATE_PIO
{ LSTRKEY( "set_strength" ), LFUNCVAL( lm3s_pio_set_strength ) },
{ LSTRKEY( "2MA" ), LNUMVAL( GPIO_STRENGTH_2MA ) },
{ LSTRKEY( "4MA" ), LNUMVAL( GPIO_STRENGTH_4MA ) },
{ LSTRKEY( "8MA" ), LNUMVAL( GPIO_STRENGTH_8MA ) },
{ LSTRKEY( "8MA_SC" ), LNUMVAL( GPIO_STRENGTH_8MA_SC ) },
{ LSTRKEY( "MA_2" ), LNUMVAL( GPIO_STRENGTH_2MA ) },
{ LSTRKEY( "MA_4" ), LNUMVAL( GPIO_STRENGTH_4MA ) },
{ LSTRKEY( "MA_8" ), LNUMVAL( GPIO_STRENGTH_8MA ) },
{ LSTRKEY( "MA_8SC" ), LNUMVAL( GPIO_STRENGTH_8MA_SC ) },
{ LSTRKEY( "set_direction" ), LFUNCVAL( lm3s_pio_set_direction ) },
{ LSTRKEY( "GPIO_IN" ), LNUMVAL( GPIO_DIR_MODE_IN ) },
{ LSTRKEY( "GPIO_OUT" ), LNUMVAL( GPIO_DIR_MODE_OUT ) },

View File

@ -490,6 +490,8 @@ u32 platform_uart_setup( unsigned id, u32 baud, int databits, int parity, int st
MAP_UARTConfigSetExpClk( uart_base[ id ], MAP_SysCtlClockGet(), baud, config );
MAP_UARTConfigGetExpClk( uart_base[ id ], MAP_SysCtlClockGet(), &baud, &config );
MAP_UARTEnable( uart_base[ id ] );
}
return baud;
}

View File

@ -33,7 +33,9 @@
#define BUILD_UIP
#define BUILD_DHCPC
#define BUILD_DNS
#endif
#endif
#define BUILD_LINENOISE
#define BUILD_ADC
#define BUILD_RPC
@ -57,6 +59,9 @@
#define ENABLE_LM3S_GPIO
#define LINENOISE_HISTORY_SIZE_LUA 30
#define LINENOISE_HISTORY_SIZE_SHELL 10
// *****************************************************************************
// UART/Timer IDs configuration data (used in main.c)
@ -215,8 +220,8 @@
#define NUM_CAN 1
// Enable RX buffering on UART
//#define BUF_ENABLE_UART
//#define CON_BUF_SIZE BUF_SIZE_128
#define BUF_ENABLE_UART
#define CON_BUF_SIZE BUF_SIZE_128
// ADC Configuration Params
#define ADC_BIT_RESOLUTION 10