nuttx/boards/arm/tiva/launchxl-cc1310/src/cc1310_autoleds.c

149 lines
4.6 KiB
C
Raw Normal View History

arch/arm/src/tiva/cc13xx: The trim files from the TI DriverLib now compile successfully. This merge also brings in the ROM files from the TI DriverLib which do NOT year compile correctly. This is still a work in progress. There merge also adds unverified support for the LaunchXL-CC1310. Squashed commit of the following: confgs/launchxl-cc1310: Add board support for the LaunchXL-CC1310. This is a work in progress and does not yet build error free. arch/arm/src/tiva/cc13xx: cc13x0_trim.c now compiles; Make xxx_rom.h header files conform a little more closely to the NuttX coding style. arch/arm/src/tiva/cc13xx: CC13x2 (V1 and V2) rom.c files now build with no errors or warnings. Still have to work through the CC13x0 version. arch/arm/src/tiva/hardware: Add CC13x0/CC13x2_CC26x2 AON BATMON register definition header file. arch/arm/src/tiva/cc13xx: A little more progress converting TI DriverLib ROM code to NuttX coding style. Lots of possibilities for breakage here! arch/arm/src/tiva/cc13xx: Remove functions from cc13x._rom.c that are defined from ROM access in cc13x._rom.h; Add prototypes in cc13x._rom.h for functions in cc13x._rom.c that are not defined in cc13x._rom.h. arch/arm/src/tiva/cc13xx: Remove some dangling whitespace at the end of lines. arch/arm/src/tiva/cc13xx: Second (and final) round of name changes to get ROM function-like defines consistent with NuttX coding standard arch/arm/src/tiva/cc13xx: Fix a few errors in last big name conversion. arch/arm/src/tiva/cc13xx: First round of name changes to get ROM function-like defines consistent with NuttX coding standard arch/arm/src/tiva/cc13xx: Remove ROM_ prefix from function-like defines.
2019-01-22 22:21:58 +01:00
/****************************************************************************
* boards/arm/tiva/launchxl-cc1310/src/cc1310_autoleds.c
arch/arm/src/tiva/cc13xx: The trim files from the TI DriverLib now compile successfully. This merge also brings in the ROM files from the TI DriverLib which do NOT year compile correctly. This is still a work in progress. There merge also adds unverified support for the LaunchXL-CC1310. Squashed commit of the following: confgs/launchxl-cc1310: Add board support for the LaunchXL-CC1310. This is a work in progress and does not yet build error free. arch/arm/src/tiva/cc13xx: cc13x0_trim.c now compiles; Make xxx_rom.h header files conform a little more closely to the NuttX coding style. arch/arm/src/tiva/cc13xx: CC13x2 (V1 and V2) rom.c files now build with no errors or warnings. Still have to work through the CC13x0 version. arch/arm/src/tiva/hardware: Add CC13x0/CC13x2_CC26x2 AON BATMON register definition header file. arch/arm/src/tiva/cc13xx: A little more progress converting TI DriverLib ROM code to NuttX coding style. Lots of possibilities for breakage here! arch/arm/src/tiva/cc13xx: Remove functions from cc13x._rom.c that are defined from ROM access in cc13x._rom.h; Add prototypes in cc13x._rom.h for functions in cc13x._rom.c that are not defined in cc13x._rom.h. arch/arm/src/tiva/cc13xx: Remove some dangling whitespace at the end of lines. arch/arm/src/tiva/cc13xx: Second (and final) round of name changes to get ROM function-like defines consistent with NuttX coding standard arch/arm/src/tiva/cc13xx: Fix a few errors in last big name conversion. arch/arm/src/tiva/cc13xx: First round of name changes to get ROM function-like defines consistent with NuttX coding standard arch/arm/src/tiva/cc13xx: Remove ROM_ prefix from function-like defines.
2019-01-22 22:21:58 +01:00
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
arch/arm/src/tiva/cc13xx: The trim files from the TI DriverLib now compile successfully. This merge also brings in the ROM files from the TI DriverLib which do NOT year compile correctly. This is still a work in progress. There merge also adds unverified support for the LaunchXL-CC1310. Squashed commit of the following: confgs/launchxl-cc1310: Add board support for the LaunchXL-CC1310. This is a work in progress and does not yet build error free. arch/arm/src/tiva/cc13xx: cc13x0_trim.c now compiles; Make xxx_rom.h header files conform a little more closely to the NuttX coding style. arch/arm/src/tiva/cc13xx: CC13x2 (V1 and V2) rom.c files now build with no errors or warnings. Still have to work through the CC13x0 version. arch/arm/src/tiva/hardware: Add CC13x0/CC13x2_CC26x2 AON BATMON register definition header file. arch/arm/src/tiva/cc13xx: A little more progress converting TI DriverLib ROM code to NuttX coding style. Lots of possibilities for breakage here! arch/arm/src/tiva/cc13xx: Remove functions from cc13x._rom.c that are defined from ROM access in cc13x._rom.h; Add prototypes in cc13x._rom.h for functions in cc13x._rom.c that are not defined in cc13x._rom.h. arch/arm/src/tiva/cc13xx: Remove some dangling whitespace at the end of lines. arch/arm/src/tiva/cc13xx: Second (and final) round of name changes to get ROM function-like defines consistent with NuttX coding standard arch/arm/src/tiva/cc13xx: Fix a few errors in last big name conversion. arch/arm/src/tiva/cc13xx: First round of name changes to get ROM function-like defines consistent with NuttX coding standard arch/arm/src/tiva/cc13xx: Remove ROM_ prefix from function-like defines.
2019-01-22 22:21:58 +01:00
*
* http://www.apache.org/licenses/LICENSE-2.0
arch/arm/src/tiva/cc13xx: The trim files from the TI DriverLib now compile successfully. This merge also brings in the ROM files from the TI DriverLib which do NOT year compile correctly. This is still a work in progress. There merge also adds unverified support for the LaunchXL-CC1310. Squashed commit of the following: confgs/launchxl-cc1310: Add board support for the LaunchXL-CC1310. This is a work in progress and does not yet build error free. arch/arm/src/tiva/cc13xx: cc13x0_trim.c now compiles; Make xxx_rom.h header files conform a little more closely to the NuttX coding style. arch/arm/src/tiva/cc13xx: CC13x2 (V1 and V2) rom.c files now build with no errors or warnings. Still have to work through the CC13x0 version. arch/arm/src/tiva/hardware: Add CC13x0/CC13x2_CC26x2 AON BATMON register definition header file. arch/arm/src/tiva/cc13xx: A little more progress converting TI DriverLib ROM code to NuttX coding style. Lots of possibilities for breakage here! arch/arm/src/tiva/cc13xx: Remove functions from cc13x._rom.c that are defined from ROM access in cc13x._rom.h; Add prototypes in cc13x._rom.h for functions in cc13x._rom.c that are not defined in cc13x._rom.h. arch/arm/src/tiva/cc13xx: Remove some dangling whitespace at the end of lines. arch/arm/src/tiva/cc13xx: Second (and final) round of name changes to get ROM function-like defines consistent with NuttX coding standard arch/arm/src/tiva/cc13xx: Fix a few errors in last big name conversion. arch/arm/src/tiva/cc13xx: First round of name changes to get ROM function-like defines consistent with NuttX coding standard arch/arm/src/tiva/cc13xx: Remove ROM_ prefix from function-like defines.
2019-01-22 22:21:58 +01:00
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
arch/arm/src/tiva/cc13xx: The trim files from the TI DriverLib now compile successfully. This merge also brings in the ROM files from the TI DriverLib which do NOT year compile correctly. This is still a work in progress. There merge also adds unverified support for the LaunchXL-CC1310. Squashed commit of the following: confgs/launchxl-cc1310: Add board support for the LaunchXL-CC1310. This is a work in progress and does not yet build error free. arch/arm/src/tiva/cc13xx: cc13x0_trim.c now compiles; Make xxx_rom.h header files conform a little more closely to the NuttX coding style. arch/arm/src/tiva/cc13xx: CC13x2 (V1 and V2) rom.c files now build with no errors or warnings. Still have to work through the CC13x0 version. arch/arm/src/tiva/hardware: Add CC13x0/CC13x2_CC26x2 AON BATMON register definition header file. arch/arm/src/tiva/cc13xx: A little more progress converting TI DriverLib ROM code to NuttX coding style. Lots of possibilities for breakage here! arch/arm/src/tiva/cc13xx: Remove functions from cc13x._rom.c that are defined from ROM access in cc13x._rom.h; Add prototypes in cc13x._rom.h for functions in cc13x._rom.c that are not defined in cc13x._rom.h. arch/arm/src/tiva/cc13xx: Remove some dangling whitespace at the end of lines. arch/arm/src/tiva/cc13xx: Second (and final) round of name changes to get ROM function-like defines consistent with NuttX coding standard arch/arm/src/tiva/cc13xx: Fix a few errors in last big name conversion. arch/arm/src/tiva/cc13xx: First round of name changes to get ROM function-like defines consistent with NuttX coding standard arch/arm/src/tiva/cc13xx: Remove ROM_ prefix from function-like defines.
2019-01-22 22:21:58 +01:00
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <debug.h>
#include <nuttx/board.h>
#include "tiva_gpio.h"
#include "launchxl-cc1310.h"
#include <arch/board/board.h>
#ifdef CONFIG_ARCH_LEDS
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_autoled_initialize
****************************************************************************/
void board_autoled_initialize(void)
{
tiva_configgpio(&g_gpio_gled);
tiva_configgpio(&g_gpio_rled);
arch/arm/src/tiva/cc13xx: The trim files from the TI DriverLib now compile successfully. This merge also brings in the ROM files from the TI DriverLib which do NOT year compile correctly. This is still a work in progress. There merge also adds unverified support for the LaunchXL-CC1310. Squashed commit of the following: confgs/launchxl-cc1310: Add board support for the LaunchXL-CC1310. This is a work in progress and does not yet build error free. arch/arm/src/tiva/cc13xx: cc13x0_trim.c now compiles; Make xxx_rom.h header files conform a little more closely to the NuttX coding style. arch/arm/src/tiva/cc13xx: CC13x2 (V1 and V2) rom.c files now build with no errors or warnings. Still have to work through the CC13x0 version. arch/arm/src/tiva/hardware: Add CC13x0/CC13x2_CC26x2 AON BATMON register definition header file. arch/arm/src/tiva/cc13xx: A little more progress converting TI DriverLib ROM code to NuttX coding style. Lots of possibilities for breakage here! arch/arm/src/tiva/cc13xx: Remove functions from cc13x._rom.c that are defined from ROM access in cc13x._rom.h; Add prototypes in cc13x._rom.h for functions in cc13x._rom.c that are not defined in cc13x._rom.h. arch/arm/src/tiva/cc13xx: Remove some dangling whitespace at the end of lines. arch/arm/src/tiva/cc13xx: Second (and final) round of name changes to get ROM function-like defines consistent with NuttX coding standard arch/arm/src/tiva/cc13xx: Fix a few errors in last big name conversion. arch/arm/src/tiva/cc13xx: First round of name changes to get ROM function-like defines consistent with NuttX coding standard arch/arm/src/tiva/cc13xx: Remove ROM_ prefix from function-like defines.
2019-01-22 22:21:58 +01:00
}
/****************************************************************************
* Name: board_autoled_on
****************************************************************************/
void board_autoled_on(int led)
{
bool gled_change = true; /* True: Change GLED */
bool gled_on = false; /* High output illuminates */
bool rled_on = false;
/* SYMBOL VAL MEANING GLED RLED
* ---------------- --- ----------------------- ---- -----
* LED_STARTED 0 NuttX has been started OFF OFF
* LED_HEAPALLOCATE 1 Heap has been allocated OFF ON
* LED_IRQSENABLED 1 Interrupts enabled OFF ON
* LED_STACKCREATED 2 Idle stack created ON OFF
* LED_INIRQ 3 In an interrupt N/C GLOW
* LED_SIGNAL 3 In a signal handler N/C GLOW
* LED_ASSERTION 3 An assertion failed N/C GLOW
* LED_PANIC 4 The system has crashed OFF BLINK
*/
switch (led)
{
case 0: /* GLED=OFF RLED=OFF */
break;
case 3: /* GLED=N/C RLED=ON */
gled_change = false;
/* Fall through */
case 1: /* GLED=OFF RLED=ON */
case 4: /* GLED=OFF RLED=ON */
rled_on = true;
break;
case 2: /* GLED=ON RLED=OFF */
gled_on = true;
break;
default:
return;
}
/* Set the new state of the GLED (unless is is N/C) */
if (gled_change)
{
tiva_gpiowrite(&g_gpio_gled, gled_on);
}
/* Set the new state of the RLED */
tiva_gpiowrite(&g_gpio_rled, rled_on);
arch/arm/src/tiva/cc13xx: The trim files from the TI DriverLib now compile successfully. This merge also brings in the ROM files from the TI DriverLib which do NOT year compile correctly. This is still a work in progress. There merge also adds unverified support for the LaunchXL-CC1310. Squashed commit of the following: confgs/launchxl-cc1310: Add board support for the LaunchXL-CC1310. This is a work in progress and does not yet build error free. arch/arm/src/tiva/cc13xx: cc13x0_trim.c now compiles; Make xxx_rom.h header files conform a little more closely to the NuttX coding style. arch/arm/src/tiva/cc13xx: CC13x2 (V1 and V2) rom.c files now build with no errors or warnings. Still have to work through the CC13x0 version. arch/arm/src/tiva/hardware: Add CC13x0/CC13x2_CC26x2 AON BATMON register definition header file. arch/arm/src/tiva/cc13xx: A little more progress converting TI DriverLib ROM code to NuttX coding style. Lots of possibilities for breakage here! arch/arm/src/tiva/cc13xx: Remove functions from cc13x._rom.c that are defined from ROM access in cc13x._rom.h; Add prototypes in cc13x._rom.h for functions in cc13x._rom.c that are not defined in cc13x._rom.h. arch/arm/src/tiva/cc13xx: Remove some dangling whitespace at the end of lines. arch/arm/src/tiva/cc13xx: Second (and final) round of name changes to get ROM function-like defines consistent with NuttX coding standard arch/arm/src/tiva/cc13xx: Fix a few errors in last big name conversion. arch/arm/src/tiva/cc13xx: First round of name changes to get ROM function-like defines consistent with NuttX coding standard arch/arm/src/tiva/cc13xx: Remove ROM_ prefix from function-like defines.
2019-01-22 22:21:58 +01:00
}
/****************************************************************************
* Name: board_autoled_off
****************************************************************************/
void board_autoled_off(int led)
{
/* SYMBOL VAL MEANING GLED RLED
* ---------------- --- ----------------------- ---- -----
* LED_STARTED 0 NuttX has been started OFF OFF
* LED_HEAPALLOCATE 1 Heap has been allocated OFF ON
* LED_IRQSENABLED 1 Interrupts enabled OFF ON
* LED_STACKCREATED 2 Idle stack created ON OFF
* LED_INIRQ 3 In an interrupt N/C GLOW
* LED_SIGNAL 3 In a signal handler N/C GLOW
* LED_ASSERTION 3 An assertion failed N/C GLOW
* LED_PANIC 4 The system has crashed OFF BLINK
*/
switch (led)
{
case 4: /* GLED=OFF RLED=OFF */
tiva_gpiowrite(&g_gpio_gled, false);
/* Fall through */
case 3: /* GLED=N/C RLED=OFF */
tiva_gpiowrite(&g_gpio_rled, false);
break;
case 0: /* Should not happen */
case 1: /* Should not happen */
case 2: /* Should not happen */
default:
return;
}
arch/arm/src/tiva/cc13xx: The trim files from the TI DriverLib now compile successfully. This merge also brings in the ROM files from the TI DriverLib which do NOT year compile correctly. This is still a work in progress. There merge also adds unverified support for the LaunchXL-CC1310. Squashed commit of the following: confgs/launchxl-cc1310: Add board support for the LaunchXL-CC1310. This is a work in progress and does not yet build error free. arch/arm/src/tiva/cc13xx: cc13x0_trim.c now compiles; Make xxx_rom.h header files conform a little more closely to the NuttX coding style. arch/arm/src/tiva/cc13xx: CC13x2 (V1 and V2) rom.c files now build with no errors or warnings. Still have to work through the CC13x0 version. arch/arm/src/tiva/hardware: Add CC13x0/CC13x2_CC26x2 AON BATMON register definition header file. arch/arm/src/tiva/cc13xx: A little more progress converting TI DriverLib ROM code to NuttX coding style. Lots of possibilities for breakage here! arch/arm/src/tiva/cc13xx: Remove functions from cc13x._rom.c that are defined from ROM access in cc13x._rom.h; Add prototypes in cc13x._rom.h for functions in cc13x._rom.c that are not defined in cc13x._rom.h. arch/arm/src/tiva/cc13xx: Remove some dangling whitespace at the end of lines. arch/arm/src/tiva/cc13xx: Second (and final) round of name changes to get ROM function-like defines consistent with NuttX coding standard arch/arm/src/tiva/cc13xx: Fix a few errors in last big name conversion. arch/arm/src/tiva/cc13xx: First round of name changes to get ROM function-like defines consistent with NuttX coding standard arch/arm/src/tiva/cc13xx: Remove ROM_ prefix from function-like defines.
2019-01-22 22:21:58 +01:00
}
#endif /* CONFIG_ARCH_LEDS */