Fixes for Tiva TM4C1294NCPDT. From Frank Sautter.

This commit is contained in:
Gregory Nutt 2015-05-20 18:34:15 -06:00
parent 9489565a98
commit d467065f4a
2 changed files with 66 additions and 128 deletions

View File

@ -63,7 +63,7 @@
/* Frequencies of other clock sources */
#define PIOSC_FREQUENCY 16000000 /* Precision internal oscillator */
#define RTCOSC_FREQUENCY 32768 /* Hibernation Module RTC Oscillator */
#define RTCOSC_FREQUENCY 32768 /* Hibernation module RTC oscillator */
#define LFIOSC_FREQUENCY 33000 /* Low frequency internal oscillator */
/* The PLL generates Fvco according to the following formulae. The input clock to
@ -113,15 +113,18 @@
#define ALTCLK_FREQUENCY PIOSC_FREQUENCY
/* LED definitions ******************************************************************/
/* The EK-TM4C1294XL has a four green LEDs.
/* The EK-TM4C1294XL has 5 green LEDs.
* LED D0 is lit when 3.3V power supply is available .
* LEDs D1 and D2 are general purpose LEDs.
* LEDs D3 and D4 can be used for Ethernet link and activity.
*
* --- ------------
* Pin Pin Function
* --- ------------
* PN1 Green LED D1
* PN0 Green LED D2
* PF4 Green LED D3
* PF0 Green LED D4
* PN1 green LED D1
* PN0 green LED D2
* PF4 green LED D3
* PF0 green LED D4
* --- ------------
*/
@ -143,15 +146,15 @@
/* If CONFIG_ARCH_LEDS is defined, then automated support for the EK-TM4C1294XL LED
* will be included in the build:
*/
/* LED1 LED1 LED2 LED3 */
#define LED_STARTED 0 /* OFF OFF ON OFF */
#define LED_HEAPALLOCATE 1 /* NC NC NC OFF */
#define LED_IRQSENABLED 1 /* NC NC NC OFF */
#define LED_STACKCREATED 2 /* OFF ON OFF OFF */
#define LED_INIRQ 1 /* NC NC NC OFF */
#define LED_SIGNAL 1 /* NC NC NC OFF */
#define LED_ASSERTION 1 /* NC NC NC OFF */
#define LED_PANIC 3 /* ON OFF OFF OFF (flashing 2Hz) */
/* LED1 LED2 LED3 LED4 */
#define LED_STARTED 1 /* ON OFF NC NC */
#define LED_HEAPALLOCATE 0 /* NC NC NC NC */
#define LED_IRQSENABLED 0 /* NC NC NC NC */
#define LED_STACKCREATED 2 /* ON ON NC NC */
#define LED_INIRQ 0 /* NC NC NC NC */
#define LED_SIGNAL 0 /* NC NC NC NC */
#define LED_ASSERTION 0 /* NC NC NC NC */
#define LED_PANIC 3 /* OFF ON NC NC (flashing 2Hz) */
/* Button definitions ***************************************************************/
/* There are four push buttons on the board. Two of them are user controllable.
@ -173,72 +176,15 @@
#define BUTTON_SW2_BIT (1 << BUTTON_SW2)
/* Pin Multiplexing Disambiguation **************************************************/
/* UARTs
*
* UART0: PA0-1 (fixed configuration)
* UART3: PJ0-1 to EM_TX/EM_RX or BOOSTER_PACK2_RX/BOOSTER_PACK2_TX(Depending
* on J12/J13)
* UART5: PH6-7 to BOOSTER_PACK1_RX/BOOSTER_PACK1_TX
*/
#define GPIO_UART3_RX GPIO_UART3_RX_2
#define GPIO_UART3_TX GPIO_UART3_TX_2
#define GPIO_UART5_RX GPIO_UART5_RX_2
#define GPIO_UART5_TX GPIO_UART5_TX_2
/* SSI:
*
* SSI0: PA2-5 are used for SSI0 to the second booster pack (fixed configuration)
* SSI3: PF0/PF4-5/PH4/PQ0-2 are used for the SPI flash (on-board and SD card).
* PH4 selects the SD card and PQ1 selects the on-board SPI flash.
*/
#define GPIO_SSI3_CLK GPIO_SSI3_CLK_2
#define GPIO_SSI3_FSS GPIO_SSI3_FSS_2
#define GPIO_SSI3_XDAT0 GPIO_SSI3_XDAT0_2
#define GPIO_SSI3_XDAT1 GPIO_SSI3_XDAT1_1
#define GPIO_SSI3_XDAT2 GPIO_SSI3_XDAT2_1
#define GPIO_SSI3_XDAT3 GPIO_SSI3_XDAT3_1
/* I2C:
*
* I2C3: PG4-5 are provide to the BoostPack 1 interface
* I2C7: PA4-5 are provide to the BoostPack 2 interface
* I2C6: PB6-7 are used for I2C to the EM connector.
*/
#define GPIO_I2C3_SCL GPIO_I2C3_SCL_1
#define GPIO_I2C3_SDA GPIO_I2C3_SDA_1
#define GPIO_I2C7_SCL GPIO_I2C7_SCL_1
#define GPIO_I2C7_SDA GPIO_I2C7_SDA_1
#define GPIO_I2C6_SCL GPIO_I2C6_SCL_2
#define GPIO_I2C6_SDA GPIO_I2C6_SDA_2
/* USB:
*
* PB0-1/PD6-7/PL6-7 are used for USB (Only PD6-7 are not fixed configuration)
*/
#define GPIO_USB0_EPEN GPIO_USB0_EPEN_3
#define GPIO_USB0_PFLT GPIO_USB0_PFLT_2
/* Ethernet LEDs
*
* PF1/PK4/PK6 are used for Ethernet LEDs.
* PK4/EN0RXD3/LED0
* PK6/EN0TXD2/LED1
* PF1/LED2
* PF4/EN0LED1/LED3 Ethernet TX/RX activity
* PF0/EN0LED0/LED4 Ethernet link OK
*/
# define GPIO_EN0_LED0 GPIO_EN0_LED0_2
# define GPIO_EN0_LED1 GPIO_EN0_LED1_2
# define GPIO_EN0_LED2 GPIO_EN0_LED2_1
/* LCD
*
* PF6-7/PJ6/PS4-5/PR0-7 are used for the LCD (fixed configuration).
*/
#define GPIO_EN0_LED0 GPIO_EN0_LED0_1
#define GPIO_EN0_LED1 GPIO_EN0_LED1_1
/************************************************************************************
* Public Function Prototypes

View File

@ -63,8 +63,6 @@
void tm4c_ledinit(void)
{
/* Configure LED PIOs for output */
// FIXME: sauttefk
tiva_configgpio(GPIO_LED_D1);
tiva_configgpio(GPIO_LED_D2);
tiva_configgpio(GPIO_LED_D3);
@ -77,47 +75,41 @@ void tm4c_ledinit(void)
void board_led_on(int led)
{
/* --------------- ------- ---- ----- --------------------
* STATE VALUE RED GREEN BLUE
* --------------- ------- ---- ----- --------------------
* LED_STARTED 0 OFF OFF ON
* LED_HEAPALLOCATE 1 NC NC NC
* LED_IRQSENABLED 1 NC NC NC
* LED_STACKCREATED 2 OFF ON OFF
* LED_INIRQ 1 NC NC NC
* LED_SIGNAL 1 NC NC NC
* LED_ASSERTION 1 NC NC NC
* LED_PANIC 3 ON OFF OFF (flashing 2Hz)
* --------------- ------- ---- ----- --------------------
/* --------------- ------- ----- ----- ----- ----- ----------
* STATE VALUE LED1 LED2 LED3 LED4
* --------------- ------- ----- ----- ----- ----- ----------
* LED_STARTED 1 ON OFF NC NC
* LED_HEAPALLOCATE 0 NC NC NC NC
* LED_IRQSENABLED 0 NC NC NC NC
* LED_STACKCREATED 2 ON ON NC NC
* LED_INIRQ 0 NC NC NC NC
* LED_SIGNAL 0 NC NC NC NC
* LED_ASSERTION 0 NC NC NC NC
* LED_PANIC 3 OFF ON NC NC (flashing 2Hz)
* --------------- ------- ----- ----- ----- ---------------
*
* A high output illuminates the LED.
*/
switch (led)
{
case 0: /* R=OFF, G=OFF, B=ON */
/* Previous state was all OFF */
tiva_gpiowrite(GPIO_LED_D1, true);
break;
default:
case 1: /* No change */
case 0: /* No change */
break;
case 2: /* R=OFF, G=ON, B=OFF */
/* Previous state was all: R=OFF, G=OFF, B=ON */
tiva_gpiowrite(GPIO_LED_D2, true);
tiva_gpiowrite(GPIO_LED_D3, false);
break;
case 3: /* R=ON, G=OFF, B=OFF */
/* Previous state was all: R=OFF, G=Unknown, B=Unknown */
case 1: /* LED1=OFF, LED2=OFF, LED3=NC, LED4=NC */
tiva_gpiowrite(GPIO_LED_D1, true);
tiva_gpiowrite(GPIO_LED_D2, false);
tiva_gpiowrite(GPIO_LED_D3, false);
break;
case 2: /* LED1=ON, LED2=ON, LED3=NC, LED4=NC */
tiva_gpiowrite(GPIO_LED_D1, true);
tiva_gpiowrite(GPIO_LED_D2, true);
break;
case 3: /* LED1=OFF, LED2=ON, LED3=NC, LED4=NC */
tiva_gpiowrite(GPIO_LED_D1, false);
tiva_gpiowrite(GPIO_LED_D2, true);
break;
}
}
@ -128,34 +120,34 @@ void board_led_on(int led)
void board_led_off(int led)
{
/* --------------- ------- ---- ----- --------------------
* STATE VALUE RED GREEN BLUE
* --------------- ------- ---- ----- --------------------
* LED_STARTED 0 OFF OFF ON
* LED_HEAPALLOCATE 1 NC NC NC
* LED_IRQSENABLED 1 NC NC NC
* LED_STACKCREATED 2 OFF ON OFF
* LED_INIRQ 1 NC NC NC
* LED_SIGNAL 1 NC NC NC
* LED_ASSERTION 1 NC NC NC
* LED_PANIC 3 ON OFF OFF (flashing 2Hz)
* --------------- ------- ---- ----- --------------------
/* --------------- ------- ----- ----- ----- ----- ----------
* STATE VALUE LED1 LED2 LED3 LED4
* --------------- ------- ----- ----- ----- ----- ----------
* LED_STARTED 1 ON OFF NC NC
* LED_HEAPALLOCATE 0 NC NC NC NC
* LED_IRQSENABLED 0 NC NC NC NC
* LED_STACKCREATED 2 ON ON NC NC
* LED_INIRQ 0 NC NC NC NC
* LED_SIGNAL 0 NC NC NC NC
* LED_ASSERTION 0 NC NC NC NC
* LED_PANIC 3 ON OFF NC NC (flashing 2Hz)
* --------------- ------- ----- ----- ----- ---------------
*
* A high output illuminates the LED.
*/
switch (led)
{
case 0: /* Will not happen */
case 1: /* No change */
case 0: /* No change */
case 1: /* Will not happen */
case 2: /* Will not happen */
default:
break;
case 3: /* R=OFF, G=OFF, B=OFF */
/* Previous state was all: R=ON, G=OFF, B=OFF */
tiva_gpiowrite(GPIO_LED_D1, false);
case 3: /* LED1=ON, LED2=OFF, LED3=NC, LED4=NC */
tiva_gpiowrite(GPIO_LED_D1, true);
tiva_gpiowrite(GPIO_LED_D2, false);
break;
}
}