Standardize naming of user LEDs interface functions

This commit is contained in:
Gregory Nutt
2015-11-01 12:45:58 -06:00
parent f56ed529e5
commit b28bd72a48
113 changed files with 642 additions and 723 deletions
+2 -2
View File
@@ -82,7 +82,7 @@ void weak_function atmega_spiinitialize(void);
#endif #endif
/************************************************************************************ /************************************************************************************
* Name: atmega_ledinit * Name: atmega_led_initialize
* *
* Description: * Description:
* Configure on-board LEDs if LED support has been selected. * Configure on-board LEDs if LED support has been selected.
@@ -90,7 +90,7 @@ void weak_function atmega_spiinitialize(void);
************************************************************************************/ ************************************************************************************/
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
void atmega_ledinit(void); void atmega_led_initialize(void);
#endif #endif
#undef EXTERN #undef EXTERN
+1 -1
View File
@@ -87,6 +87,6 @@ void atmega_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */ /* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
atmega_ledinit(); atmega_led_initialize();
#endif #endif
} }
+7 -7
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/arduino-due/src/sam_userleds.c * configs/arduino-due/src/sam_userleds.c
* *
* Copyright (C) 2013 Gregory Nutt. All rights reserved. * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -88,10 +88,10 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: sam_ledinit * Name: board_userled_initialize
****************************************************************************/ ****************************************************************************/
void sam_ledinit(void) void board_userled_initialize(void)
{ {
/* Configure LED1-2 GPIOs for output */ /* Configure LED1-2 GPIOs for output */
@@ -101,10 +101,10 @@ void sam_ledinit(void)
} }
/**************************************************************************** /****************************************************************************
* Name: sam_setled * Name: board_userled
****************************************************************************/ ****************************************************************************/
void sam_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
uint32_t ledcfg; uint32_t ledcfg;
@@ -131,10 +131,10 @@ void sam_setled(int led, bool ledon)
} }
/**************************************************************************** /****************************************************************************
* Name: sam_setleds * Name: board_userled_all
****************************************************************************/ ****************************************************************************/
void sam_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
bool ledon; bool ledon;
@@ -121,7 +121,7 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: cc3200_ledinit * Name: cc3200_led_initialize
* *
* Description: * Description:
* Called to initialize the on-board LEDs. * Called to initialize the on-board LEDs.
+1 -1
View File
@@ -104,7 +104,7 @@ void tiva_boardinitialize(void)
cc3200_print("\r\nCC3200 init\r\n"); cc3200_print("\r\nCC3200 init\r\n");
cc3200_ledinit(); cc3200_led_initialize();
} }
/**************************************************************************** /****************************************************************************
+2 -2
View File
@@ -19,10 +19,10 @@
#define LED3_GPIO 11 #define LED3_GPIO 11
/**************************************************************************** /****************************************************************************
* Name: cc3200_ledinit * Name: cc3200_led_initialize
****************************************************************************/ ****************************************************************************/
void cc3200_ledinit(void) void cc3200_led_initialize(void)
{ {
uint32_t led1_port; uint32_t led1_port;
uint8_t led1_pin; uint8_t led1_pin;
+7 -7
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/cloudctrl/src/stm32_userleds.c * configs/cloudctrl/src/stm32_userleds.c
* *
* Copyright (C) 2012 Gregory Nutt. All rights reserved. * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* Darcy Gong <darcy.gong@gmail.com> * Darcy Gong <darcy.gong@gmail.com>
* *
@@ -89,10 +89,10 @@ static uint32_t g_ledcfg[BOARD_NLEDS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: stm32_ledinit * Name: board_userled_initialize
****************************************************************************/ ****************************************************************************/
void stm32_ledinit(void) void board_userled_initialize(void)
{ {
/* Configure LED1-3 GPIOs for output */ /* Configure LED1-3 GPIOs for output */
@@ -103,10 +103,10 @@ void stm32_ledinit(void)
} }
/**************************************************************************** /****************************************************************************
* Name: stm32_setled * Name: board_userled
****************************************************************************/ ****************************************************************************/
void stm32_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
if ((unsigned)led < BOARD_NLEDS) if ((unsigned)led < BOARD_NLEDS)
{ {
@@ -115,10 +115,10 @@ void stm32_setled(int led, bool ledon)
} }
/**************************************************************************** /****************************************************************************
* Name: stm32_setleds * Name: board_userled_all
****************************************************************************/ ****************************************************************************/
void stm32_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
stm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0); stm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0);
stm32_gpiowrite(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0); stm32_gpiowrite(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0);
+2 -2
View File
@@ -148,7 +148,7 @@
void weak_function tm4c_ssiinitialize(void); void weak_function tm4c_ssiinitialize(void);
/**************************************************************************** /****************************************************************************
* Name: tm4c_ledinit * Name: tm4c_led_initialize
* *
* Description: * Description:
* Called to initialize the on-board LEDs. * Called to initialize the on-board LEDs.
@@ -156,7 +156,7 @@ void weak_function tm4c_ssiinitialize(void);
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
void tm4c_ledinit(void); void tm4c_led_initialize(void);
#endif #endif
/**************************************************************************** /****************************************************************************
+2 -2
View File
@@ -52,7 +52,7 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: tm4c_ledinit * Name: tm4c_led_initialize
* *
* Description: * Description:
* Called to initialize the on-board LEDs. * Called to initialize the on-board LEDs.
@@ -60,7 +60,7 @@
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
void tm4c_ledinit(void) void tm4c_led_initialize(void)
{ {
/* Configure LED PIOs for output */ /* Configure LED PIOs for output */
+1 -1
View File
@@ -88,7 +88,7 @@ void tiva_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */ /* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
tm4c_ledinit(); tm4c_led_initialize();
#endif #endif
} }
+7 -7
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/dk-tm4c129x/src/tm4c_userleds.c * configs/dk-tm4c129x/src/tm4c_userleds.c
* *
* Copyright (C) 2014 Gregory Nutt. All rights reserved. * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -83,10 +83,10 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: tiva_ledinit * Name: board_userled_initialize
****************************************************************************/ ****************************************************************************/
void tiva_ledinit(void) void board_userled_initialize(void)
{ {
/* Configure LED PIOs for output */ /* Configure LED PIOs for output */
@@ -96,10 +96,10 @@ void tiva_ledinit(void)
} }
/**************************************************************************** /****************************************************************************
* Name: tiva_setled * Name: board_userled
****************************************************************************/ ****************************************************************************/
void tiva_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
uint32_t ledcfg; uint32_t ledcfg;
@@ -124,10 +124,10 @@ void tiva_setled(int led, bool ledon)
} }
/**************************************************************************** /****************************************************************************
* Name: tiva_setleds * Name: board_userled_all
****************************************************************************/ ****************************************************************************/
void tiva_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
bool ledon; bool ledon;
+7 -7
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/efm32-g8xx-stk/src/efm32_userleds.c * configs/efm32-g8xx-stk/src/efm32_userleds.c
* *
* Copyright (C) 2014 Gregory Nutt. All rights reserved. * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -188,10 +188,10 @@ static int led_pm_prepare(struct pm_callback_s *cb , enum pm_state_e pmstate)
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: efm32_ledinit * Name: board_userled_initialize
****************************************************************************/ ****************************************************************************/
void efm32_ledinit(void) void board_userled_initialize(void)
{ {
/* Configure LED0-4 GPIOs for output */ /* Configure LED0-4 GPIOs for output */
@@ -202,10 +202,10 @@ void efm32_ledinit(void)
} }
/**************************************************************************** /****************************************************************************
* Name: efm32_setled * Name: board_userled
****************************************************************************/ ****************************************************************************/
void efm32_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
if ((unsigned)led < BOARD_NLEDS) if ((unsigned)led < BOARD_NLEDS)
{ {
@@ -214,10 +214,10 @@ void efm32_setled(int led, bool ledon)
} }
/**************************************************************************** /****************************************************************************
* Name: efm32_setleds * Name: board_userled_all
****************************************************************************/ ****************************************************************************/
void efm32_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
efm32_gpiowrite(GPIO_LED0, (ledset & BOARD_LED0_BIT) != 0); efm32_gpiowrite(GPIO_LED0, (ledset & BOARD_LED0_BIT) != 0);
efm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) != 0); efm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) != 0);
+8 -24
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/efm32gg-stk3700/include/efm32_userleds.c * configs/efm32gg-stk3700/include/efm32_userleds.c
* *
* Copyright (C) 2014 Gregory Nutt. All rights reserved. * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -82,31 +82,15 @@
# define ledvdbg(x...) # define ledvdbg(x...)
#endif #endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: efm32_ledinit * Name: board_userled_initialize
****************************************************************************/ ****************************************************************************/
void efm32_ledinit(void) void board_userled_initialize(void)
{ {
/* Configure LED PIOs for output */ /* Configure LED PIOs for output */
@@ -115,10 +99,10 @@ void efm32_ledinit(void)
} }
/**************************************************************************** /****************************************************************************
* Name: efm32_setled * Name: board_userled
****************************************************************************/ ****************************************************************************/
void efm32_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
uint32_t ledcfg; uint32_t ledcfg;
@@ -139,12 +123,12 @@ void efm32_setled(int led, bool ledon)
} }
/**************************************************************************** /****************************************************************************
* Name: efm32_setleds * Name: board_userled_all
****************************************************************************/ ****************************************************************************/
void efm32_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
/* Hight illuminates */ /* High illuminates */
efm32_gpiowrite(GPIO_LED0, (ledset & BOARD_LED0_BIT) != 0); efm32_gpiowrite(GPIO_LED0, (ledset & BOARD_LED0_BIT) != 0);
efm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) != 0); efm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) != 0);
+7 -7
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/fire-stm32v2/src/stm32_userleds.c * configs/fire-stm32v2/src/stm32_userleds.c
* *
* Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Copyright (C) 2012-2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -88,10 +88,10 @@ static uint32_t g_ledcfg[BOARD_NLEDS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: stm32_ledinit * Name: board_userled_initialize
****************************************************************************/ ****************************************************************************/
void stm32_ledinit(void) void board_userled_initialize(void)
{ {
/* Configure LED1-4 GPIOs for output */ /* Configure LED1-4 GPIOs for output */
@@ -101,7 +101,7 @@ void stm32_ledinit(void)
} }
/**************************************************************************** /****************************************************************************
* Name: stm32_setled * Name: board_userled
* *
* Description: * Description:
* Set one LED to the 'ledon' state. The LEDs are pulled up and, hence, * Set one LED to the 'ledon' state. The LEDs are pulled up and, hence,
@@ -109,7 +109,7 @@ void stm32_ledinit(void)
* *
****************************************************************************/ ****************************************************************************/
void stm32_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
if ((unsigned)led < BOARD_NLEDS) if ((unsigned)led < BOARD_NLEDS)
{ {
@@ -118,7 +118,7 @@ void stm32_setled(int led, bool ledon)
} }
/**************************************************************************** /****************************************************************************
* Name: stm32_setleds * Name: board_userled_all
* *
* Description: * Description:
* Set each LED to the bit encoded state. The LEDs are pulled up and, * Set each LED to the bit encoded state. The LEDs are pulled up and,
@@ -126,7 +126,7 @@ void stm32_setled(int led, bool ledon)
* *
****************************************************************************/ ****************************************************************************/
void stm32_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
stm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0); stm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0);
stm32_gpiowrite(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0); stm32_gpiowrite(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0);
+2 -2
View File
@@ -126,7 +126,7 @@ void weak_function kl_usbinitialize(void);
#endif #endif
/**************************************************************************************************** /****************************************************************************************************
* Name: kl_ledinit * Name: kl_led_initialize
* *
* Description: * Description:
* Initialize the on-board LED * Initialize the on-board LED
@@ -134,7 +134,7 @@ void weak_function kl_usbinitialize(void);
****************************************************************************************************/ ****************************************************************************************************/
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
void kl_ledinit(void); void kl_led_initialize(void);
#endif #endif
@@ -99,7 +99,7 @@ void kl_boardinitialize(void)
/* Configure on-board LED if LED support has been selected. */ /* Configure on-board LED if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
kl_ledinit(); kl_led_initialize();
#endif #endif
} }
+2 -2
View File
@@ -118,14 +118,14 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: kl_ledinit * Name: kl_led_initialize
* *
* Description: * Description:
* Initialize the on-board LED * Initialize the on-board LED
* *
****************************************************************************/ ****************************************************************************/
void kl_ledinit(void) void kl_led_initialize(void)
{ {
kl_configgpio(GPIO_LED_R); kl_configgpio(GPIO_LED_R);
kl_configgpio(GPIO_LED_G); kl_configgpio(GPIO_LED_G);
+2 -2
View File
@@ -125,7 +125,7 @@ void weak_function kl_usbinitialize(void);
#endif #endif
/**************************************************************************************************** /****************************************************************************************************
* Name: kl_ledinit * Name: kl_led_initialize
* *
* Description: * Description:
* Initialize the on-board LED * Initialize the on-board LED
@@ -133,7 +133,7 @@ void weak_function kl_usbinitialize(void);
****************************************************************************************************/ ****************************************************************************************************/
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
void kl_ledinit(void); void kl_led_initialize(void);
#endif #endif
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
@@ -98,7 +98,7 @@ void kl_boardinitialize(void)
/* Configure on-board LED if LED support has been selected. */ /* Configure on-board LED if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
kl_ledinit(); kl_led_initialize();
#endif #endif
} }
+2 -2
View File
@@ -118,14 +118,14 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: kl_ledinit * Name: kl_led_initialize
* *
* Description: * Description:
* Initialize the on-board LED * Initialize the on-board LED
* *
****************************************************************************/ ****************************************************************************/
void kl_ledinit(void) void kl_led_initialize(void)
{ {
kl_configgpio(GPIO_LED_R); kl_configgpio(GPIO_LED_R);
kl_configgpio(GPIO_LED_G); kl_configgpio(GPIO_LED_G);
@@ -130,7 +130,7 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: lm4f_ledinit * Name: lm4f_led_initialize
* *
* Description: * Description:
* Called to initialize the on-board LEDs. * Called to initialize the on-board LEDs.
@@ -138,17 +138,17 @@
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
void lm4f_ledinit(void) void lm4f_led_initialize(void)
{ {
leddbg("Initializing\n"); leddbg("Initializing\n");
/* Configure Port E, Bit 1 as an output, initial value=OFF */ /* Configure Port E, Bit 1 as an output, initial value=OFF */
led_dumpgpio("lm4f_ledinit before tiva_configgpio()"); led_dumpgpio("lm4f_led_initialize before tiva_configgpio()");
tiva_configgpio(GPIO_LED_R); tiva_configgpio(GPIO_LED_R);
tiva_configgpio(GPIO_LED_G); tiva_configgpio(GPIO_LED_G);
tiva_configgpio(GPIO_LED_B); tiva_configgpio(GPIO_LED_B);
led_dumpgpio("lm4f_ledinit after tiva_configgpio()"); led_dumpgpio("lm4f_led_initialize after tiva_configgpio()");
} }
/**************************************************************************** /****************************************************************************
+1 -1
View File
@@ -88,6 +88,6 @@ void tiva_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */ /* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
lm4f_ledinit(); lm4f_led_initialize();
#endif #endif
} }
@@ -137,7 +137,7 @@
void weak_function lm4f_ssiinitialize(void); void weak_function lm4f_ssiinitialize(void);
/**************************************************************************** /****************************************************************************
* Name: lm4f_ledinit * Name: lm4f_led_initialize
* *
* Description: * Description:
* Called to initialize the on-board LEDs. * Called to initialize the on-board LEDs.
@@ -145,7 +145,7 @@ void weak_function lm4f_ssiinitialize(void);
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
void lm4f_ledinit(void); void lm4f_led_initialize(void);
#endif #endif
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
+3 -3
View File
@@ -84,9 +84,9 @@
* control of the application. The following interfaces are then available * control of the application. The following interfaces are then available
* for application control of the LEDs: * for application control of the LEDs:
* *
* void lpc43_ledinit(void); * void board_userled_initialize(void);
* void lpc43_setled(int led, bool ledon); * void board_userled(int led, bool ledon);
* void lpc43_setleds(uint8_t ledset); * void board_userled_all(uint8_t ledset);
*/ */
/* Debug definitions ********************************************************/ /* Debug definitions ********************************************************/
+9 -9
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/lpc4330-xplorer/src/lpc43_userleds.c * configs/lpc4330-xplorer/src/lpc43_userleds.c
* *
* Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Copyright (C) 2012-2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -113,14 +113,14 @@ static void led_dumppins(FAR const char *msg)
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: lpc43_ledinit * Name: board_userled_initialize
****************************************************************************/ ****************************************************************************/
void lpc43_ledinit(void) void board_userled_initialize(void)
{ {
/* Configure all LED GPIO lines */ /* Configure all LED GPIO lines */
led_dumppins("lpc43_ledinit() Entry)"); led_dumppins("board_userled_initialize() Entry)");
/* Configure LED pins as GPIOs, then configure GPIOs as outputs */ /* Configure LED pins as GPIOs, then configure GPIOs as outputs */
@@ -130,24 +130,24 @@ void lpc43_ledinit(void)
lpc43_pin_config(PINCONFIG_LED2); lpc43_pin_config(PINCONFIG_LED2);
lpc43_gpio_config(GPIO_LED2); lpc43_gpio_config(GPIO_LED2);
led_dumppins("lpc43_ledinit() Exit"); led_dumppins("board_userled_initialize() Exit");
} }
/**************************************************************************** /****************************************************************************
* Name: lpc43_setled * Name: board_userled
****************************************************************************/ ****************************************************************************/
void lpc43_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
uint16_t gpiocfg = (led == BOARD_LED1 ? GPIO_LED1 : GPIO_LED2); uint16_t gpiocfg = (led == BOARD_LED1 ? GPIO_LED1 : GPIO_LED2);
lpc43_gpio_write(gpiocfg, !ledon); lpc43_gpio_write(gpiocfg, !ledon);
} }
/**************************************************************************** /****************************************************************************
* Name: lpc43_setleds * Name: board_userled_all
****************************************************************************/ ****************************************************************************/
void lpc43_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
lpc43_gpio_write(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0); lpc43_gpio_write(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0);
lpc43_gpio_write(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0); lpc43_gpio_write(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0);
+3 -3
View File
@@ -577,9 +577,9 @@ LED and Pushbuttons
control of the application. The following interfaces are then available control of the application. The following interfaces are then available
for application control of the LEDs: for application control of the LEDs:
void lpc43_ledinit(void); void board_userled_initialize(void);
void lpc43_setled(int led, bool ledon); void board_userled(int led, bool ledon);
void lpc43_setleds(uint8_t ledset); void board_userled_all(uint8_t ledset);
Pushbuttons Pushbuttons
----------- -----------
+12 -12
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/lpc4357-evb/src/lpc43_userleds.c * configs/lpc4357-evb/src/lpc43_userleds.c
* *
* Copyright (C) 2014 Gregory Nutt. All rights reserved. * Copyright (C) 2014, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -72,9 +72,9 @@
* control of the application. The following interfaces are then available * control of the application. The following interfaces are then available
* for application control of the LEDs: * for application control of the LEDs:
* *
* void lpc43_ledinit(void); * void board_userled_initialize(void);
* void lpc43_setled(int led, bool ledon); * void board_userled(int led, bool ledon);
* void lpc43_setleds(uint8_t ledset); * void board_userled_all(uint8_t ledset);
*/ */
/* Debug definitions ********************************************************/ /* Debug definitions ********************************************************/
@@ -124,28 +124,28 @@ static void led_dumppins(FAR const char *msg)
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: lpc43_ledinit * Name: board_userled_initialize
****************************************************************************/ ****************************************************************************/
void lpc43_ledinit(void) void board_userled_initialize(void)
{ {
/* Configure LED pin as a GPIO outputs */ /* Configure LED pin as a GPIO outputs */
led_dumppins("lpc43_ledinit() Entry)"); led_dumppins("board_userled_initialize() Entry)");
/* Configure LED pin as a GPIO, then configure GPIO as an outputs */ /* Configure LED pin as a GPIO, then configure GPIO as an outputs */
lpc43_pin_config(PINCONFIG_LED); lpc43_pin_config(PINCONFIG_LED);
lpc43_gpio_config(GPIO_LED); lpc43_gpio_config(GPIO_LED);
led_dumppins("lpc43_ledinit() Exit"); led_dumppins("board_userled_initialize() Exit");
} }
/**************************************************************************** /****************************************************************************
* Name: lpc43_setled * Name: board_userled
****************************************************************************/ ****************************************************************************/
void lpc43_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
if (led == BOARD_LED) if (led == BOARD_LED)
{ {
@@ -154,10 +154,10 @@ void lpc43_setled(int led, bool ledon)
} }
/**************************************************************************** /****************************************************************************
* Name: lpc43_setleds * Name: board_userled_all
****************************************************************************/ ****************************************************************************/
void lpc43_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
lpc43_gpio_write(GPIO_LED, (ledset & BOARD_LED_BIT) == 0); lpc43_gpio_write(GPIO_LED, (ledset & BOARD_LED_BIT) == 0);
} }
+3 -3
View File
@@ -580,9 +580,9 @@ LED and Pushbuttons
control of the application. The following interfaces are then available control of the application. The following interfaces are then available
for application control of the LEDs: for application control of the LEDs:
void lpc43_ledinit(void); void board_userled_initialize(void);
void lpc43_setled(int led, bool ledon); void board_userled(int led, bool ledon);
void lpc43_setleds(uint8_t ledset); void board_userled_all(uint8_t ledset);
Pushbuttons Pushbuttons
----------- -----------
+8 -8
View File
@@ -106,28 +106,28 @@ static void led_dumppins(FAR const char *msg)
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: lpc43_ledinit * Name: board_userled_initialize
****************************************************************************/ ****************************************************************************/
void lpc43_ledinit(void) void board_userled_initialize(void)
{ {
/* Configure LED pin as a GPIO outputs */ /* Configure LED pin as a GPIO outputs */
led_dumppins("lpc43_ledinit() Entry)"); led_dumppins("board_userled_initialize() Entry)");
/* Configure LED pin as a GPIO, then configure GPIO as an outputs */ /* Configure LED pin as a GPIO, then configure GPIO as an outputs */
lpc43_pin_config(PINCONFIG_LED); lpc43_pin_config(PINCONFIG_LED);
lpc43_gpio_config(GPIO_LED); lpc43_gpio_config(GPIO_LED);
led_dumppins("lpc43_ledinit() Exit"); led_dumppins("board_userled_initialize() Exit");
} }
/**************************************************************************** /****************************************************************************
* Name: lpc43_setled * Name: board_userled
****************************************************************************/ ****************************************************************************/
void lpc43_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
if (led == BOARD_LED) if (led == BOARD_LED)
{ {
@@ -136,10 +136,10 @@ void lpc43_setled(int led, bool ledon)
} }
/**************************************************************************** /****************************************************************************
* Name: lpc43_setleds * Name: board_userled_all
****************************************************************************/ ****************************************************************************/
void lpc43_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
lpc43_gpio_write(GPIO_LED, (ledset & BOARD_LED_BIT) == 0); lpc43_gpio_write(GPIO_LED, (ledset & BOARD_LED_BIT) == 0);
} }
+1 -1
View File
@@ -87,6 +87,6 @@ void at90usb_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */ /* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
at90usb_ledinit(); at90usb_led_initialize();
#endif #endif
} }
@@ -81,7 +81,7 @@ EXTERN void weak_function at90usb_spiinitialize(void);
#endif #endif
/************************************************************************************ /************************************************************************************
* Name: at90usb_ledinit * Name: at90usb_led_initialize
* *
* Description: * Description:
* Configure on-board LEDs if LED support has been selected. * Configure on-board LEDs if LED support has been selected.
@@ -89,7 +89,7 @@ EXTERN void weak_function at90usb_spiinitialize(void);
************************************************************************************/ ************************************************************************************/
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
EXTERN void at90usb_ledinit(void); EXTERN void at90usb_led_initialize(void);
#endif #endif
#undef EXTERN #undef EXTERN
+6 -5
View File
@@ -63,7 +63,8 @@
#ifdef __cplusplus #ifdef __cplusplus
#define EXTERN extern "C" #define EXTERN extern "C"
extern "C" { extern "C"
{
#else #else
#define EXTERN extern #define EXTERN extern
#endif #endif
@@ -77,11 +78,11 @@ extern "C" {
************************************************************************************/ ************************************************************************************/
#ifdef CONFIG_PIC32MX_SPI2 #ifdef CONFIG_PIC32MX_SPI2
EXTERN void weak_function pic32mx_spi2initialize(void); void weak_function pic32mx_spi2initialize(void);
#endif #endif
/************************************************************************************ /************************************************************************************
* Name: pic32mx_ledinit * Name: pic32mx_autoled_initialize
* *
* Description: * Description:
* Configure on-board LEDs if LED support has been selected. * Configure on-board LEDs if LED support has been selected.
@@ -89,7 +90,7 @@ EXTERN void weak_function pic32mx_spi2initialize(void);
************************************************************************************/ ************************************************************************************/
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
EXTERN void pic32mx_ledinit(void); void pic32mx_autoled_initialize(void);
#endif #endif
/**************************************************************************** /****************************************************************************
@@ -101,7 +102,7 @@ EXTERN void pic32mx_ledinit(void);
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_PIC32MX_ADC #ifdef CONFIG_PIC32MX_ADC
/* EXTERN int pic32mx_adcinitialize(void); not used */ /* int pic32mx_adcinitialize(void); not used */
#endif #endif
#undef EXTERN #undef EXTERN
+1 -1
View File
@@ -155,6 +155,6 @@ void pic32mx_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */ /* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
pic32mx_ledinit(); pic32mx_autoled_initialize();
#endif #endif
} }
+29 -13
View File
@@ -163,11 +163,11 @@ static const uint16_t g_ledpincfg[PIC32MX_MIRTOO_NLEDS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_setleds * Name: pic32mx_setleds
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
void up_setleds(FAR const struct led_setting_s *setting) static void pic32mx_setleds(FAR const struct led_setting_s *setting)
{ {
/* LEDs are pulled up so writing a low value (false) illuminates them */ /* LEDs are pulled up so writing a low value (false) illuminates them */
@@ -188,23 +188,25 @@ void up_setleds(FAR const struct led_setting_s *setting)
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: pic32mx_ledinit * Name: board_userled_initialize
****************************************************************************/ ****************************************************************************/
void pic32mx_ledinit(void) #ifndef CONFIG_ARCH_LEDS
void board_userled_initialize(void)
{ {
/* Configure output pins */ /* Configure output pins */
pic32mx_configgpio(GPIO_LED_0); pic32mx_configgpio(GPIO_LED_0);
pic32mx_configgpio(GPIO_LED_1); pic32mx_configgpio(GPIO_LED_1);
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: pic32mx_setled * Name: board_userled
****************************************************************************/ ****************************************************************************/
#ifndef CONFIG_ARCH_LEDS #ifndef CONFIG_ARCH_LEDS
void pic32mx_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
/* LEDs are pulled up so writing a low value (false) illuminates them */ /* LEDs are pulled up so writing a low value (false) illuminates them */
@@ -216,16 +218,30 @@ void pic32mx_setled(int led, bool ledon)
#endif #endif
/**************************************************************************** /****************************************************************************
* Name: pic32mx_setleds * Name: board_userled_all
****************************************************************************/ ****************************************************************************/
#ifndef CONFIG_ARCH_LEDS #ifndef CONFIG_ARCH_LEDS
void pic32mx_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
/* Call pic32mx_setled() with ledon == true to illuminated the LED */ /* Call board_userled() with ledon == true to illuminated the LED */
pic32mx_setled(PIC32MX_MIRTOO_LED0, (ledset & PIC32MX_MIRTOO_LED0_BIT) != 0); board_userled(PIC32MX_MIRTOO_LED0, (ledset & PIC32MX_MIRTOO_LED0_BIT) != 0);
pic32mx_setled(PIC32MX_MIRTOO_LED1, (ledset & PIC32MX_MIRTOO_LED1_BIT) != 0); board_userled(PIC32MX_MIRTOO_LED1, (ledset & PIC32MX_MIRTOO_LED1_BIT) != 0);
}
#endif
/****************************************************************************
* Name: pic32mx_autoled_initialize
****************************************************************************/
#ifndef CONFIG_ARCH_LEDS
void pic32mx_autoled_initialize(void)
{
/* Configure output pins */
pic32mx_configgpio(GPIO_LED_0);
pic32mx_configgpio(GPIO_LED_1);
} }
#endif #endif
@@ -238,7 +254,7 @@ void board_autoled_on(int led)
{ {
if ((unsigned)led < LED_NVALUES) if ((unsigned)led < LED_NVALUES)
{ {
up_setleds(&g_ledonvalues[led]); pic32mx_setleds(&g_ledonvalues[led]);
} }
} }
#endif #endif
@@ -252,7 +268,7 @@ void board_autoled_off(int led)
{ {
if ((unsigned)led < LED_NVALUES) if ((unsigned)led < LED_NVALUES)
{ {
up_setleds(&g_ledoffvalues[led]); pic32mx_setleds(&g_ledoffvalues[led]);
} }
} }
#endif #endif
+1 -1
View File
@@ -87,6 +87,6 @@ void atmega_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */ /* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
atmega_ledinit(); atmega_led_initialize();
#endif #endif
} }
+2 -2
View File
@@ -88,10 +88,10 @@ static bool g_ncoff;
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: atmega_ledinit * Name: atmega_led_initialize
****************************************************************************/ ****************************************************************************/
void atmega_ledinit(void) void atmega_led_initialize(void)
{ {
/* The MoteinoMEGA's single LED is on Port D, Pin 7. Configure this pin as an /* The MoteinoMEGA's single LED is on Port D, Pin 7. Configure this pin as an
* output and turn it OFF. The "other" side of the LED is onnected to * output and turn it OFF. The "other" side of the LED is onnected to
+2 -2
View File
@@ -82,7 +82,7 @@ void weak_function atmega_spiinitialize(void);
#endif #endif
/************************************************************************************ /************************************************************************************
* Name: atmega_ledinit * Name: atmega_led_initialize
* *
* Description: * Description:
* Configure on-board LEDs if LED support has been selected. * Configure on-board LEDs if LED support has been selected.
@@ -90,7 +90,7 @@ void weak_function atmega_spiinitialize(void);
************************************************************************************/ ************************************************************************************/
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
void atmega_ledinit(void); void atmega_led_initialize(void);
#endif #endif
#undef EXTERN #undef EXTERN
+7 -19
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/nucleo-f303re/src/stm32_userleds.c * configs/nucleo-f303re/src/stm32_userleds.c
* *
* Copyright (C) 2014 Gregory Nutt. All rights reserved. * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2015 Omni Hoverboards Inc. All rights reserved. * Copyright (C) 2015 Omni Hoverboards Inc. All rights reserved.
* Authors: Gregory Nutt <gnutt@nuttx.org> * Authors: Gregory Nutt <gnutt@nuttx.org>
* Paul Alexander Patience <paul-a.patience@polymtl.ca> * Paul Alexander Patience <paul-a.patience@polymtl.ca>
@@ -68,27 +68,15 @@
# define ledvdbg(x...) # define ledvdbg(x...)
#endif #endif
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: stm32_ledinit * Name: board_userled_initialize
****************************************************************************/ ****************************************************************************/
void stm32_ledinit(void) void board_userled_initialize(void)
{ {
/* Configure LED1 GPIO for output */ /* Configure LED1 GPIO for output */
@@ -96,10 +84,10 @@ void stm32_ledinit(void)
} }
/**************************************************************************** /****************************************************************************
* Name: stm32_setled * Name: board_userled
****************************************************************************/ ****************************************************************************/
void stm32_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
if (led == BOARD_LED1) if (led == BOARD_LED1)
{ {
@@ -108,10 +96,10 @@ void stm32_setled(int led, bool ledon)
} }
/**************************************************************************** /****************************************************************************
* Name: stm32_setleds * Name: board_userled_all
****************************************************************************/ ****************************************************************************/
void stm32_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
stm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) != 0); stm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) != 0);
} }
+7 -7
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/nucleo-f4x1re/src/stm32_userleds.c * configs/nucleo-f4x1re/src/stm32_userleds.c
* *
* Copyright (C) 2014 Gregory Nutt. All rights reserved. * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -181,10 +181,10 @@ static int led_pm_prepare(struct pm_callback_s *cb , enum pm_state_e pmstate)
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: stm32_ledinit * Name: board_userled_initialize
****************************************************************************/ ****************************************************************************/
void stm32_ledinit(void) void board_userled_initialize(void)
{ {
/* Configure LD2 GPIO for output */ /* Configure LD2 GPIO for output */
@@ -192,10 +192,10 @@ void stm32_ledinit(void)
} }
/**************************************************************************** /****************************************************************************
* Name: stm32_setled * Name: board_userled
****************************************************************************/ ****************************************************************************/
void stm32_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
if (led == 1) if (led == 1)
{ {
@@ -204,10 +204,10 @@ void stm32_setled(int led, bool ledon)
} }
/**************************************************************************** /****************************************************************************
* Name: stm32_setleds * Name: board_userled_all
****************************************************************************/ ****************************************************************************/
void stm32_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
if (led == 1) if (led == 1)
{ {
@@ -97,6 +97,6 @@ void nuc_boardinitialize(void)
/* Configure on-board LED if LED support has been selected. */ /* Configure on-board LED if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
nuc_ledinit(); nuc_led_initialize();
#endif #endif
} }
+2 -2
View File
@@ -113,14 +113,14 @@
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: nuc_ledinit * Name: nuc_led_initialize
* *
* Description: * Description:
* Initialize the on-board LED * Initialize the on-board LED
* *
****************************************************************************/ ****************************************************************************/
void nuc_ledinit(void) void nuc_led_initialize(void)
{ {
led_dumpgpio("Before configuration"); led_dumpgpio("Before configuration");
nuc_configgpio(GPIO_LED); nuc_configgpio(GPIO_LED);
+2 -2
View File
@@ -114,7 +114,7 @@ void weak_function nuc_usbinitialize(void);
#endif #endif
/**************************************************************************************************** /****************************************************************************************************
* Name: nuc_ledinit * Name: nuc_led_initialize
* *
* Description: * Description:
* Initialize the on-board LED * Initialize the on-board LED
@@ -122,7 +122,7 @@ void weak_function nuc_usbinitialize(void);
****************************************************************************************************/ ****************************************************************************************************/
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
void nuc_ledinit(void); void nuc_led_initialize(void);
#endif #endif
+10 -5
View File
@@ -182,7 +182,7 @@ void board_autoled_off(int led)
#endif #endif
/************************************************************************************ /************************************************************************************
* Name: lpc31_setled, and lpc31_setleds * Name: board_userled_initialize, board_userled, and board_userled_all
* *
* Description: * Description:
* These interfaces allow user control of the board LEDs. * These interfaces allow user control of the board LEDs.
@@ -196,7 +196,12 @@ void board_autoled_off(int led)
* *
************************************************************************************/ ************************************************************************************/
void lpc31_setled(int led, bool ledon) void board_userled_initialize(void)
{
/* All initialization performed in board_autoled_initialize() */
}
void board_userled(int led, bool ledon)
{ {
uint32_t bit; uint32_t bit;
@@ -226,10 +231,10 @@ void lpc31_setled(int led, bool ledon)
} }
} }
void lpc31_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
#ifndef CONFIG_ARCH_LEDS #ifndef CONFIG_ARCH_LEDS
lpc31_setled(BOARD_LED1, (ledset & BOARD_LED1_BIT) != 0); board_userled(BOARD_LED1, (ledset & BOARD_LED1_BIT) != 0);
#endif #endif
lpc31_setled(BOARD_LED2, (ledset & BOARD_LED2_BIT) != 0); board_userled(BOARD_LED2, (ledset & BOARD_LED2_BIT) != 0);
} }
+8 -8
View File
@@ -99,31 +99,31 @@ static bool g_uninitialized = true;
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: lpc17_ledinit/board_autoled_initialize * Name: board_userled_initialize/board_autoled_initialize
****************************************************************************/ ****************************************************************************/
#ifndef CONFIG_ARCH_LEDS #ifndef CONFIG_ARCH_LEDS
void lpc17_ledinit(void) /* Name when invoked externally */ void board_userled_initialize(void) /* Name when invoked externally */
#else #else
void board_autoled_initialize(void) /* Name when invoked via lpc17_boot.c */ void board_autoled_initialize(void) /* Name when invoked via lpc17_boot.c */
#endif #endif
{ {
/* Configure all LED GPIO lines */ /* Configure all LED GPIO lines */
led_dumpgpio("board_autoled_initialize() Entry)"); led_dumpgpio("board_*led_initialize() Entry)");
lpc17_configgpio(LPC1766STK_LED1); lpc17_configgpio(LPC1766STK_LED1);
lpc17_configgpio(LPC1766STK_LED2); lpc17_configgpio(LPC1766STK_LED2);
led_dumpgpio("board_autoled_initialize() Exit"); led_dumpgpio("board_*led_initialize() Exit");
} }
/**************************************************************************** /****************************************************************************
* Name: lpc17_setled * Name: board_userled
****************************************************************************/ ****************************************************************************/
#ifndef CONFIG_ARCH_LEDS #ifndef CONFIG_ARCH_LEDS
void lpc17_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
if (led == BOARD_LED1) if (led == BOARD_LED1)
{ {
@@ -137,11 +137,11 @@ void lpc17_setled(int led, bool ledon)
#endif #endif
/**************************************************************************** /****************************************************************************
* Name: lpc17_setleds * Name: board_userled_all
****************************************************************************/ ****************************************************************************/
#ifndef CONFIG_ARCH_LEDS #ifndef CONFIG_ARCH_LEDS
void lpc17_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
lpc17_gpiowrite(LPC1766STK_LED1, (ledset & BOARD_LED1_BIT) == 0); lpc17_gpiowrite(LPC1766STK_LED1, (ledset & BOARD_LED1_BIT) == 0);
lpc17_gpiowrite(LPC1766STK_LED2, (ledset & BOARD_LED2_BIT) == 0); lpc17_gpiowrite(LPC1766STK_LED2, (ledset & BOARD_LED2_BIT) == 0);
+7 -19
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/olimex-stm32-h405/src/stm32_leds.c * configs/olimex-stm32-h405/src/stm32_leds.c
* *
* Copyright (C) 2014 Gregory Nutt. All rights reserved. * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -74,27 +74,15 @@ static uint32_t g_ledcfg[BOARD_NLEDS] =
GPIO_LED_STATUS GPIO_LED_STATUS
}; };
/****************************************************************************
* Private Function Protototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: stm32_ledinit * Name: board_userled_initialize
****************************************************************************/ ****************************************************************************/
void stm32_ledinit(void) void board_userled_initialize(void)
{ {
/* Configure LED1-4 GPIOs for output */ /* Configure LED1-4 GPIOs for output */
@@ -102,10 +90,10 @@ void stm32_ledinit(void)
} }
/**************************************************************************** /****************************************************************************
* Name: stm32_setled * Name: board_userled
****************************************************************************/ ****************************************************************************/
void stm32_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
if ((unsigned)led < BOARD_NLEDS) if ((unsigned)led < BOARD_NLEDS)
{ {
@@ -114,10 +102,10 @@ void stm32_setled(int led, bool ledon)
} }
/**************************************************************************** /****************************************************************************
* Name: stm32_setleds * Name: board_userled_all
****************************************************************************/ ****************************************************************************/
void stm32_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
stm32_gpiowrite(GPIO_LED_STATUS, (ledset & BOARD_LED1_BIT) != 0); stm32_gpiowrite(GPIO_LED_STATUS, (ledset & BOARD_LED1_BIT) != 0);
} }
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/olimex-stm32-p207/src/stm32_userleds.c * configs/olimex-stm32-p207/src/stm32_userleds.c
* *
* Copyright (C) 2011 Gregory Nutt. All rights reserved. * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -91,10 +91,10 @@ static uint32_t g_ledcfg[BOARD_NLEDS] =
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: stm32_ledinit * Name: board_userled_initialize
****************************************************************************/ ****************************************************************************/
void stm32_ledinit(void) void board_userled_initialize(void)
{ {
/* Configure LED1-4 GPIOs for output */ /* Configure LED1-4 GPIOs for output */
@@ -105,10 +105,10 @@ void stm32_ledinit(void)
} }
/**************************************************************************** /****************************************************************************
* Name: stm32_setled * Name: board_userled
****************************************************************************/ ****************************************************************************/
void stm32_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
if ((unsigned)led < BOARD_NLEDS) if ((unsigned)led < BOARD_NLEDS)
{ {
@@ -117,10 +117,10 @@ void stm32_setled(int led, bool ledon)
} }
/**************************************************************************** /****************************************************************************
* Name: stm32_setleds * Name: board_userled_all
****************************************************************************/ ****************************************************************************/
void stm32_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
stm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) != 0); stm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) != 0);
stm32_gpiowrite(GPIO_LED2, (ledset & BOARD_LED2_BIT) != 0); stm32_gpiowrite(GPIO_LED2, (ledset & BOARD_LED2_BIT) != 0);
+9 -9
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* configs/olimex-strp711/src/str71_leds.c * configs/olimex-strp711/src/str71_leds.c
* *
* Copyright (C) 2008-2009, 2015 Gregory Nutt. All rights reserved. * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -74,10 +74,10 @@ static uint16_t g_led2clr;
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: up_setleds * Name: str71_setleds
****************************************************************************/ ****************************************************************************/
static void up_setleds(uint16_t setbits, uint16_t clearbits) static void str71_setleds(uint16_t setbits, uint16_t clearbits)
{ {
uint16_t reg16; uint16_t reg16;
@@ -154,23 +154,23 @@ void board_autoled_on(int led)
{ {
default: default:
case LED_STARTED: case LED_STARTED:
up_setleds(0, STR71X_LED1GPIO1_BIT|STR71X_LED2GPIO1_BIT); /* Clear LED1&2 */ str71_setleds(0, STR71X_LED1GPIO1_BIT|STR71X_LED2GPIO1_BIT); /* Clear LED1&2 */
break; break;
case LED_HEAPALLOCATE: case LED_HEAPALLOCATE:
case LED_IRQSENABLED: case LED_IRQSENABLED:
case LED_STACKCREATED: case LED_STACKCREATED:
up_setleds(STR71X_LED1GPIO1_BIT, STR71X_LED2GPIO1_BIT); /* Set LED1, clear LED2 */ str71_setleds(STR71X_LED1GPIO1_BIT, STR71X_LED2GPIO1_BIT); /* Set LED1, clear LED2 */
break; break;
case LED_INIRQ: case LED_INIRQ:
case LED_SIGNAL: case LED_SIGNAL:
case LED_ASSERTION: case LED_ASSERTION:
up_setleds(STR71X_LED1GPIO1_BIT|STR71X_LED2GPIO1_BIT, 0); /* Set LED1&2 */ str71_setleds(STR71X_LED1GPIO1_BIT|STR71X_LED2GPIO1_BIT, 0); /* Set LED1&2 */
break; break;
case LED_PANIC: case LED_PANIC:
up_setleds(STR71X_LED2GPIO1_BIT|g_led2set, g_led2set); /* Set LED1, preserve LED2 */ str71_setleds(STR71X_LED2GPIO1_BIT|g_led2set, g_led2set); /* Set LED1, preserve LED2 */
break; break;
} }
} }
@@ -209,11 +209,11 @@ void board_autoled_off(int led)
case LED_INIRQ: case LED_INIRQ:
case LED_SIGNAL: case LED_SIGNAL:
case LED_ASSERTION: case LED_ASSERTION:
up_setleds(STR71X_LED1GPIO1_BIT, STR71X_LED2GPIO1_BIT); /* Set LED1, clear LED2 */ str71_setleds(STR71X_LED1GPIO1_BIT, STR71X_LED2GPIO1_BIT); /* Set LED1, clear LED2 */
break; break;
case LED_PANIC: case LED_PANIC:
up_setleds(g_led2set, STR71X_LED1GPIO1_BIT|g_led2clr); /* Clear LED1, preserve LED2 */ str71_setleds(g_led2set, STR71X_LED1GPIO1_BIT|g_led2clr); /* Clear LED1, preserve LED2 */
break; break;
} }
} }
+10 -8
View File
@@ -95,29 +95,31 @@ static bool g_initialized = false;
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: stm32_led_initialize * Name: stm32_led_initialize/board_userled_initialize
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
void stm32_led_initialize(void) void stm32_led_initialize(void)
#else
void board_userled_initialize(void)
#endif
{ {
/* Configure all LED GPIO lines */ /* Configure all LED GPIO lines */
led_dumpgpio("stm32_led_initialize() Entry)"); led_dumpgpio("board_*led_initialize() Entry)");
stm32_configgpio(GPIO_LED_YELLOW); stm32_configgpio(GPIO_LED_YELLOW);
stm32_configgpio(GPIO_LED_GREEN); stm32_configgpio(GPIO_LED_GREEN);
led_dumpgpio("stm32_led_initialize() Exit"); led_dumpgpio("board_*led_initialize() Exit");
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: stm32_setled * Name: board_userled
****************************************************************************/ ****************************************************************************/
#ifndef CONFIG_ARCH_LEDS #ifndef CONFIG_ARCH_LEDS
void stm32_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
if (led == BOARD_LED_GREEN) if (led == BOARD_LED_GREEN)
{ {
@@ -131,11 +133,11 @@ void stm32_setled(int led, bool ledon)
#endif #endif
/**************************************************************************** /****************************************************************************
* Name: stm32_setleds * Name: board_userled_all
****************************************************************************/ ****************************************************************************/
#ifndef CONFIG_ARCH_LEDS #ifndef CONFIG_ARCH_LEDS
void stm32_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
stm32_gpiowrite(GPIO_LED_GREEN, (ledset & BOARD_LED_YELLOW_BIT) == 0); stm32_gpiowrite(GPIO_LED_GREEN, (ledset & BOARD_LED_YELLOW_BIT) == 0);
stm32_gpiowrite(GPIO_LED_YELLOW, (ledset & BOARD_LED_YELLOW_BIT) == 0); stm32_gpiowrite(GPIO_LED_YELLOW, (ledset & BOARD_LED_YELLOW_BIT) == 0);
+7 -19
View File
@@ -2,7 +2,7 @@
* configs/open1788/src/lpc17_userleds.c * configs/open1788/src/lpc17_userleds.c
* arch/arm/src/board/lpc17_userleds.c * arch/arm/src/board/lpc17_userleds.c
* *
* Copyright (C) 2013 Gregory Nutt. All rights reserved. * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -94,27 +94,15 @@ static uint32_t g_ledcfg[BOARD_NLEDS] =
GPIO_LED1, GPIO_LED2, GPIO_LED3, GPIO_LED4 GPIO_LED1, GPIO_LED2, GPIO_LED3, GPIO_LED4
}; };
/****************************************************************************
* Private Function Protototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: lpc17_ledinit * Name: board_userled_initialize
****************************************************************************/ ****************************************************************************/
void lpc17_ledinit(void) void board_userled_initialize(void)
{ {
/* Configure LED1-4 GPIOs for output */ /* Configure LED1-4 GPIOs for output */
@@ -125,10 +113,10 @@ void lpc17_ledinit(void)
} }
/**************************************************************************** /****************************************************************************
* Name: lpc17_setled * Name: board_userled
****************************************************************************/ ****************************************************************************/
void lpc17_setled(int led, bool ledon) void board_userled(int led, bool ledon)
{ {
if ((unsigned)led < BOARD_NLEDS) if ((unsigned)led < BOARD_NLEDS)
{ {
@@ -137,10 +125,10 @@ void lpc17_setled(int led, bool ledon)
} }
/**************************************************************************** /****************************************************************************
* Name: lpc17_setleds * Name: board_userled_all
****************************************************************************/ ****************************************************************************/
void lpc17_setleds(uint8_t ledset) void board_userled_all(uint8_t ledset)
{ {
lpc17_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0); lpc17_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0);
lpc17_gpiowrite(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0); lpc17_gpiowrite(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0);
@@ -81,7 +81,7 @@ EXTERN void weak_function pic32mx_spiinitialize(void);
#endif #endif
/************************************************************************************ /************************************************************************************
* Name: pic32mx_ledinit * Name: pic32mx_led_initialize
* *
* Description: * Description:
* Configure on-board LEDs if LED support has been selected. * Configure on-board LEDs if LED support has been selected.
@@ -89,7 +89,7 @@ EXTERN void weak_function pic32mx_spiinitialize(void);
************************************************************************************/ ************************************************************************************/
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
EXTERN void pic32mx_ledinit(void); EXTERN void pic32mx_led_initialize(void);
#endif #endif
#undef EXTERN #undef EXTERN

Some files were not shown because too many files have changed in this diff Show More