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

View File

@ -82,7 +82,7 @@ void weak_function atmega_spiinitialize(void);
#endif
/************************************************************************************
* Name: atmega_ledinit
* Name: atmega_led_initialize
*
* Description:
* Configure on-board LEDs if LED support has been selected.
@ -90,7 +90,7 @@ void weak_function atmega_spiinitialize(void);
************************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void atmega_ledinit(void);
void atmega_led_initialize(void);
#endif
#undef EXTERN

View File

@ -87,6 +87,6 @@ void atmega_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
atmega_ledinit();
atmega_led_initialize();
#endif
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* 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 */
@ -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;
@ -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;

View File

@ -121,7 +121,7 @@
****************************************************************************/
/****************************************************************************
* Name: cc3200_ledinit
* Name: cc3200_led_initialize
*
* Description:
* Called to initialize the on-board LEDs.

View File

@ -104,7 +104,7 @@ void tiva_boardinitialize(void)
cc3200_print("\r\nCC3200 init\r\n");
cc3200_ledinit();
cc3200_led_initialize();
}
/****************************************************************************

View File

@ -19,10 +19,10 @@
#define LED3_GPIO 11
/****************************************************************************
* Name: cc3200_ledinit
* Name: cc3200_led_initialize
****************************************************************************/
void cc3200_ledinit(void)
void cc3200_led_initialize(void)
{
uint32_t led1_port;
uint8_t led1_pin;

View File

@ -1,7 +1,7 @@
/****************************************************************************
* 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>
* 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 */
@ -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)
{
@ -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_LED2, (ledset & BOARD_LED2_BIT) == 0);

View File

@ -148,7 +148,7 @@
void weak_function tm4c_ssiinitialize(void);
/****************************************************************************
* Name: tm4c_ledinit
* Name: tm4c_led_initialize
*
* Description:
* Called to initialize the on-board LEDs.
@ -156,7 +156,7 @@ void weak_function tm4c_ssiinitialize(void);
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void tm4c_ledinit(void);
void tm4c_led_initialize(void);
#endif
/****************************************************************************

View File

@ -52,7 +52,7 @@
****************************************************************************/
/****************************************************************************
* Name: tm4c_ledinit
* Name: tm4c_led_initialize
*
* Description:
* Called to initialize the on-board LEDs.
@ -60,7 +60,7 @@
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void tm4c_ledinit(void)
void tm4c_led_initialize(void)
{
/* Configure LED PIOs for output */

View File

@ -88,7 +88,7 @@ void tiva_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
tm4c_ledinit();
tm4c_led_initialize();
#endif
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* 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 */
@ -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;
@ -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;

View File

@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* 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 */
@ -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)
{
@ -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_LED1, (ledset & BOARD_LED1_BIT) != 0);

View File

@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@ -82,31 +82,15 @@
# define ledvdbg(x...)
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: efm32_ledinit
* Name: board_userled_initialize
****************************************************************************/
void efm32_ledinit(void)
void board_userled_initialize(void)
{
/* 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;
@ -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_LED1, (ledset & BOARD_LED1_BIT) != 0);

View File

@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* 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 */
@ -101,7 +101,7 @@ void stm32_ledinit(void)
}
/****************************************************************************
* Name: stm32_setled
* Name: board_userled
*
* Description:
* 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)
{
@ -118,7 +118,7 @@ void stm32_setled(int led, bool ledon)
}
/****************************************************************************
* Name: stm32_setleds
* Name: board_userled_all
*
* Description:
* 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_LED2, (ledset & BOARD_LED2_BIT) == 0);

View File

@ -126,7 +126,7 @@ void weak_function kl_usbinitialize(void);
#endif
/****************************************************************************************************
* Name: kl_ledinit
* Name: kl_led_initialize
*
* Description:
* Initialize the on-board LED
@ -134,7 +134,7 @@ void weak_function kl_usbinitialize(void);
****************************************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void kl_ledinit(void);
void kl_led_initialize(void);
#endif

View File

@ -99,7 +99,7 @@ void kl_boardinitialize(void)
/* Configure on-board LED if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
kl_ledinit();
kl_led_initialize();
#endif
}

View File

@ -118,14 +118,14 @@
****************************************************************************/
/****************************************************************************
* Name: kl_ledinit
* Name: kl_led_initialize
*
* Description:
* Initialize the on-board LED
*
****************************************************************************/
void kl_ledinit(void)
void kl_led_initialize(void)
{
kl_configgpio(GPIO_LED_R);
kl_configgpio(GPIO_LED_G);

View File

@ -125,7 +125,7 @@ void weak_function kl_usbinitialize(void);
#endif
/****************************************************************************************************
* Name: kl_ledinit
* Name: kl_led_initialize
*
* Description:
* Initialize the on-board LED
@ -133,7 +133,7 @@ void weak_function kl_usbinitialize(void);
****************************************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void kl_ledinit(void);
void kl_led_initialize(void);
#endif
#endif /* __ASSEMBLY__ */

View File

@ -98,7 +98,7 @@ void kl_boardinitialize(void)
/* Configure on-board LED if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
kl_ledinit();
kl_led_initialize();
#endif
}

View File

@ -118,14 +118,14 @@
****************************************************************************/
/****************************************************************************
* Name: kl_ledinit
* Name: kl_led_initialize
*
* Description:
* Initialize the on-board LED
*
****************************************************************************/
void kl_ledinit(void)
void kl_led_initialize(void)
{
kl_configgpio(GPIO_LED_R);
kl_configgpio(GPIO_LED_G);

View File

@ -130,7 +130,7 @@
****************************************************************************/
/****************************************************************************
* Name: lm4f_ledinit
* Name: lm4f_led_initialize
*
* Description:
* Called to initialize the on-board LEDs.
@ -138,17 +138,17 @@
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void lm4f_ledinit(void)
void lm4f_led_initialize(void)
{
leddbg("Initializing\n");
/* 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_G);
tiva_configgpio(GPIO_LED_B);
led_dumpgpio("lm4f_ledinit after tiva_configgpio()");
led_dumpgpio("lm4f_led_initialize after tiva_configgpio()");
}
/****************************************************************************

View File

@ -88,6 +88,6 @@ void tiva_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
lm4f_ledinit();
lm4f_led_initialize();
#endif
}

View File

@ -137,7 +137,7 @@
void weak_function lm4f_ssiinitialize(void);
/****************************************************************************
* Name: lm4f_ledinit
* Name: lm4f_led_initialize
*
* Description:
* Called to initialize the on-board LEDs.
@ -145,7 +145,7 @@ void weak_function lm4f_ssiinitialize(void);
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void lm4f_ledinit(void);
void lm4f_led_initialize(void);
#endif
#endif /* __ASSEMBLY__ */

View File

@ -84,9 +84,9 @@
* control of the application. The following interfaces are then available
* for application control of the LEDs:
*
* void lpc43_ledinit(void);
* void lpc43_setled(int led, bool ledon);
* void lpc43_setleds(uint8_t ledset);
* void board_userled_initialize(void);
* void board_userled(int led, bool ledon);
* void board_userled_all(uint8_t ledset);
*/
/* Debug definitions ********************************************************/

View File

@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* 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 */
led_dumppins("lpc43_ledinit() Entry)");
led_dumppins("board_userled_initialize() Entry)");
/* Configure LED pins as GPIOs, then configure GPIOs as outputs */
@ -130,24 +130,24 @@ void lpc43_ledinit(void)
lpc43_pin_config(PINCONFIG_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);
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_LED2, (ledset & BOARD_LED2_BIT) == 0);

View File

@ -577,9 +577,9 @@ LED and Pushbuttons
control of the application. The following interfaces are then available
for application control of the LEDs:
void lpc43_ledinit(void);
void lpc43_setled(int led, bool ledon);
void lpc43_setleds(uint8_t ledset);
void board_userled_initialize(void);
void board_userled(int led, bool ledon);
void board_userled_all(uint8_t ledset);
Pushbuttons
-----------

View File

@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* 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
* for application control of the LEDs:
*
* void lpc43_ledinit(void);
* void lpc43_setled(int led, bool ledon);
* void lpc43_setleds(uint8_t ledset);
* void board_userled_initialize(void);
* void board_userled(int led, bool ledon);
* void board_userled_all(uint8_t ledset);
*/
/* 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 */
led_dumppins("lpc43_ledinit() Entry)");
led_dumppins("board_userled_initialize() Entry)");
/* Configure LED pin as a GPIO, then configure GPIO as an outputs */
lpc43_pin_config(PINCONFIG_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)
{
@ -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);
}

View File

@ -580,9 +580,9 @@ LED and Pushbuttons
control of the application. The following interfaces are then available
for application control of the LEDs:
void lpc43_ledinit(void);
void lpc43_setled(int led, bool ledon);
void lpc43_setleds(uint8_t ledset);
void board_userled_initialize(void);
void board_userled(int led, bool ledon);
void board_userled_all(uint8_t ledset);
Pushbuttons
-----------

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 */
led_dumppins("lpc43_ledinit() Entry)");
led_dumppins("board_userled_initialize() Entry)");
/* Configure LED pin as a GPIO, then configure GPIO as an outputs */
lpc43_pin_config(PINCONFIG_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)
{
@ -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);
}

View File

@ -87,6 +87,6 @@ void at90usb_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
at90usb_ledinit();
at90usb_led_initialize();
#endif
}

View File

@ -81,7 +81,7 @@ EXTERN void weak_function at90usb_spiinitialize(void);
#endif
/************************************************************************************
* Name: at90usb_ledinit
* Name: at90usb_led_initialize
*
* Description:
* 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
EXTERN void at90usb_ledinit(void);
EXTERN void at90usb_led_initialize(void);
#endif
#undef EXTERN

View File

@ -63,7 +63,8 @@
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -77,11 +78,11 @@ extern "C" {
************************************************************************************/
#ifdef CONFIG_PIC32MX_SPI2
EXTERN void weak_function pic32mx_spi2initialize(void);
void weak_function pic32mx_spi2initialize(void);
#endif
/************************************************************************************
* Name: pic32mx_ledinit
* Name: pic32mx_autoled_initialize
*
* Description:
* 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
EXTERN void pic32mx_ledinit(void);
void pic32mx_autoled_initialize(void);
#endif
/****************************************************************************
@ -101,7 +102,7 @@ EXTERN void pic32mx_ledinit(void);
****************************************************************************/
#ifdef CONFIG_PIC32MX_ADC
/* EXTERN int pic32mx_adcinitialize(void); not used */
/* int pic32mx_adcinitialize(void); not used */
#endif
#undef EXTERN

View File

@ -155,6 +155,6 @@ void pic32mx_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
pic32mx_ledinit();
pic32mx_autoled_initialize();
#endif
}

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
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 */
@ -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 */
pic32mx_configgpio(GPIO_LED_0);
pic32mx_configgpio(GPIO_LED_1);
}
#endif
/****************************************************************************
* Name: pic32mx_setled
* Name: board_userled
****************************************************************************/
#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 */
@ -216,16 +218,30 @@ void pic32mx_setled(int led, bool ledon)
#endif
/****************************************************************************
* Name: pic32mx_setleds
* Name: board_userled_all
****************************************************************************/
#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);
pic32mx_setled(PIC32MX_MIRTOO_LED1, (ledset & PIC32MX_MIRTOO_LED1_BIT) != 0);
board_userled(PIC32MX_MIRTOO_LED0, (ledset & PIC32MX_MIRTOO_LED0_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
@ -238,7 +254,7 @@ void board_autoled_on(int led)
{
if ((unsigned)led < LED_NVALUES)
{
up_setleds(&g_ledonvalues[led]);
pic32mx_setleds(&g_ledonvalues[led]);
}
}
#endif
@ -252,7 +268,7 @@ void board_autoled_off(int led)
{
if ((unsigned)led < LED_NVALUES)
{
up_setleds(&g_ledoffvalues[led]);
pic32mx_setleds(&g_ledoffvalues[led]);
}
}
#endif

View File

@ -87,6 +87,6 @@ void atmega_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
atmega_ledinit();
atmega_led_initialize();
#endif
}

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
* output and turn it OFF. The "other" side of the LED is onnected to

View File

@ -82,7 +82,7 @@ void weak_function atmega_spiinitialize(void);
#endif
/************************************************************************************
* Name: atmega_ledinit
* Name: atmega_led_initialize
*
* Description:
* Configure on-board LEDs if LED support has been selected.
@ -90,7 +90,7 @@ void weak_function atmega_spiinitialize(void);
************************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void atmega_ledinit(void);
void atmega_led_initialize(void);
#endif
#undef EXTERN

View File

@ -1,7 +1,7 @@
/****************************************************************************
* 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.
* Authors: Gregory Nutt <gnutt@nuttx.org>
* Paul Alexander Patience <paul-a.patience@polymtl.ca>
@ -68,27 +68,15 @@
# define ledvdbg(x...)
#endif
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: stm32_ledinit
* Name: board_userled_initialize
****************************************************************************/
void stm32_ledinit(void)
void board_userled_initialize(void)
{
/* 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)
{
@ -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);
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* 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 */
@ -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)
{
@ -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)
{

View File

@ -97,6 +97,6 @@ void nuc_boardinitialize(void)
/* Configure on-board LED if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
nuc_ledinit();
nuc_led_initialize();
#endif
}

View File

@ -113,14 +113,14 @@
****************************************************************************/
/****************************************************************************
* Name: nuc_ledinit
* Name: nuc_led_initialize
*
* Description:
* Initialize the on-board LED
*
****************************************************************************/
void nuc_ledinit(void)
void nuc_led_initialize(void)
{
led_dumpgpio("Before configuration");
nuc_configgpio(GPIO_LED);

View File

@ -114,7 +114,7 @@ void weak_function nuc_usbinitialize(void);
#endif
/****************************************************************************************************
* Name: nuc_ledinit
* Name: nuc_led_initialize
*
* Description:
* Initialize the on-board LED
@ -122,7 +122,7 @@ void weak_function nuc_usbinitialize(void);
****************************************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void nuc_ledinit(void);
void nuc_led_initialize(void);
#endif

View File

@ -182,7 +182,7 @@ void board_autoled_off(int led)
#endif
/************************************************************************************
* Name: lpc31_setled, and lpc31_setleds
* Name: board_userled_initialize, board_userled, and board_userled_all
*
* Description:
* 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;
@ -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
lpc31_setled(BOARD_LED1, (ledset & BOARD_LED1_BIT) != 0);
board_userled(BOARD_LED1, (ledset & BOARD_LED1_BIT) != 0);
#endif
lpc31_setled(BOARD_LED2, (ledset & BOARD_LED2_BIT) != 0);
board_userled(BOARD_LED2, (ledset & BOARD_LED2_BIT) != 0);
}

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
void lpc17_ledinit(void) /* Name when invoked externally */
void board_userled_initialize(void) /* Name when invoked externally */
#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
{
/* Configure all LED GPIO lines */
led_dumpgpio("board_autoled_initialize() Entry)");
led_dumpgpio("board_*led_initialize() Entry)");
lpc17_configgpio(LPC1766STK_LED1);
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
void lpc17_setled(int led, bool ledon)
void board_userled(int led, bool ledon)
{
if (led == BOARD_LED1)
{
@ -137,11 +137,11 @@ void lpc17_setled(int led, bool ledon)
#endif
/****************************************************************************
* Name: lpc17_setleds
* Name: board_userled_all
****************************************************************************/
#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_LED2, (ledset & BOARD_LED2_BIT) == 0);

View File

@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* 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
};
/****************************************************************************
* Private Function Protototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private 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 */
@ -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)
{
@ -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);
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* 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 */
@ -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)
{
@ -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_LED2, (ledset & BOARD_LED2_BIT) != 0);

View File

@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* 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;
@ -154,23 +154,23 @@ void board_autoled_on(int led)
{
default:
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;
case LED_HEAPALLOCATE:
case LED_IRQSENABLED:
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;
case LED_INIRQ:
case LED_SIGNAL:
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;
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;
}
}
@ -209,11 +209,11 @@ void board_autoled_off(int led)
case LED_INIRQ:
case LED_SIGNAL:
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;
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;
}
}

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
void stm32_led_initialize(void)
#else
void board_userled_initialize(void)
#endif
{
/* 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_GREEN);
led_dumpgpio("stm32_led_initialize() Exit");
led_dumpgpio("board_*led_initialize() Exit");
}
#endif
/****************************************************************************
* Name: stm32_setled
* Name: board_userled
****************************************************************************/
#ifndef CONFIG_ARCH_LEDS
void stm32_setled(int led, bool ledon)
void board_userled(int led, bool ledon)
{
if (led == BOARD_LED_GREEN)
{
@ -131,11 +133,11 @@ void stm32_setled(int led, bool ledon)
#endif
/****************************************************************************
* Name: stm32_setleds
* Name: board_userled_all
****************************************************************************/
#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_YELLOW, (ledset & BOARD_LED_YELLOW_BIT) == 0);

View File

@ -2,7 +2,7 @@
* configs/open1788/src/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>
*
* 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
};
/****************************************************************************
* Private Function Protototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private 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 */
@ -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)
{
@ -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_LED2, (ledset & BOARD_LED2_BIT) == 0);

View File

@ -81,7 +81,7 @@ EXTERN void weak_function pic32mx_spiinitialize(void);
#endif
/************************************************************************************
* Name: pic32mx_ledinit
* Name: pic32mx_led_initialize
*
* Description:
* 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
EXTERN void pic32mx_ledinit(void);
EXTERN void pic32mx_led_initialize(void);
#endif
#undef EXTERN

View File

@ -87,6 +87,6 @@ void pic32mx_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
pic32mx_ledinit();
pic32mx_led_initialize();
#endif
}

View File

@ -225,7 +225,7 @@ void board_autoled_off(int led)
#endif
/************************************************************************************
* Name: a1x_setled and a1x_setleds
* Name: board_userled_initialize, board_userled, and board_userled_all
*
* Description:
* These interfaces allow user control of the board LEDs.
@ -239,7 +239,12 @@ void board_autoled_off(int led)
*
************************************************************************************/
void a1x_setled(int led, bool ledon)
void board_userled_initialize(void)
{
/* Initialization already performed in a1x_led_initialize */
}
void board_userled(int led, bool ledon)
{
switch (led)
{
@ -259,11 +264,11 @@ void a1x_setled(int led, bool ledon)
}
}
void a1x_setleds(uint8_t ledset)
void board_userled_all(uint8_t ledset)
{
a1x_setled(BOARD_LED1, (ledset & BOARD_LED1) != 0);
a1x_setled(BOARD_LED3, (ledset & BOARD_LED3) != 0);
board_userled(BOARD_LED1, (ledset & BOARD_LED1) != 0);
board_userled(BOARD_LED3, (ledset & BOARD_LED3) != 0);
#ifndef CONFIG_ARCH_LEDS
a1x_setled(BOARD_LED4, (ledset & BOARD_LED4) != 0);
board_userled(BOARD_LED4, (ledset & BOARD_LED4) != 0);
#endif
}

View File

@ -103,7 +103,7 @@ void weak_function pic32mx_spiinitialize(void);
#endif
/************************************************************************************
* Name: pic32mx_ledinit
* Name: pic32mx_led_initialize
*
* Description:
* Configure on-board LEDs if LED support has been selected.
@ -111,7 +111,7 @@ void weak_function pic32mx_spiinitialize(void);
************************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void pic32mx_ledinit(void);
void pic32mx_led_initialize(void);
#endif
#undef EXTERN

View File

@ -85,9 +85,9 @@ void pic32mx_boardinitialize(void)
}
#endif
#ifdef CONFIG_ARCH_LEDS
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
pic32mx_ledinit();
pic32mx_led_initialize();
#endif
}

View File

@ -198,10 +198,11 @@ static void pic32mx_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 */
@ -209,13 +210,14 @@ void pic32mx_ledinit(void)
pic32mx_configgpio(GPIO_LED_2);
pic32mx_configgpio(GPIO_LED_3);
}
#endif
/****************************************************************************
* Name: pic32mx_setled
* Name: board_userled
****************************************************************************/
#ifndef CONFIG_ARCH_LEDS
void pic32mx_setled(int led, bool ledon)
void board_userled(int led, bool ledon)
{
if ((unsigned)led < PIC32MX_STARTERKIT_NLEDS)
{
@ -225,15 +227,30 @@ void pic32mx_setled(int led, bool ledon)
#endif
/****************************************************************************
* Name: pic32mx_setleds
* Name: board_userled_all
****************************************************************************/
#ifndef CONFIG_ARCH_LEDS
void pic32mx_setleds(uint8_t ledset)
void board_userled_all(uint8_t ledset)
{
pic32mx_setled(PIC32MX_STARTERKIT_LED1, (ledset & PIC32MX_STARTERKIT_LED1_BIT) != 0);
pic32mx_setled(PIC32MX_STARTERKIT_LED2, (ledset & PIC32MX_STARTERKIT_LED2_BIT) != 0);
pic32mx_setled(PIC32MX_STARTERKIT_LED3, (ledset & PIC32MX_STARTERKIT_LED3_BIT) != 0);
board_userled(PIC32MX_STARTERKIT_LED1, (ledset & PIC32MX_STARTERKIT_LED1_BIT) != 0);
board_userled(PIC32MX_STARTERKIT_LED2, (ledset & PIC32MX_STARTERKIT_LED2_BIT) != 0);
board_userled(PIC32MX_STARTERKIT_LED3, (ledset & PIC32MX_STARTERKIT_LED3_BIT) != 0);
}
#endif
/****************************************************************************
* Name: pic32mx_led_initialize
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void pic32mx_led_initialize(void)
{
/* Configure output pins */
pic32mx_configgpio(GPIO_LED_1);
pic32mx_configgpio(GPIO_LED_2);
pic32mx_configgpio(GPIO_LED_3);
}
#endif

View File

@ -92,9 +92,9 @@ void pic32mx_boardinitialize(void)
pic32mx_lcdinitialize();
#ifdef CONFIG_ARCH_LEDS
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
pic32mx_ledinit();
pic32mx_led_initialize();
#endif
}

View File

@ -173,11 +173,11 @@ static const uint16_t g_ledpincfg[PIC32MX_PIC32MX7MMB_NLEDS] =
****************************************************************************/
/****************************************************************************
* Name: up_setleds
* Name: pic32mx_setleds
****************************************************************************/
#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 */
@ -203,10 +203,11 @@ 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 */
@ -214,13 +215,14 @@ void pic32mx_ledinit(void)
pic32mx_configgpio(GPIO_LED_1);
pic32mx_configgpio(GPIO_LED_2);
}
#endif
/****************************************************************************
* Name: pic32mx_setled
* Name: board_userled
****************************************************************************/
#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 */
@ -232,17 +234,32 @@ void pic32mx_setled(int led, bool ledon)
#endif
/****************************************************************************
* Name: pic32mx_setleds
* Name: board_userled_all
****************************************************************************/
#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_PIC32MX7MMB_LED0, (ledset & PIC32MX_PIC32MX7MMB_LED0_BIT) != 0);
pic32mx_setled(PIC32MX_PIC32MX7MMB_LED1, (ledset & PIC32MX_PIC32MX7MMB_LED1_BIT) != 0);
pic32mx_setled(PIC32MX_PIC32MX7MMB_LED2, (ledset & PIC32MX_PIC32MX7MMB_LED2_BIT) != 0);
board_userled(PIC32MX_PIC32MX7MMB_LED0, (ledset & PIC32MX_PIC32MX7MMB_LED0_BIT) != 0);
board_userled(PIC32MX_PIC32MX7MMB_LED1, (ledset & PIC32MX_PIC32MX7MMB_LED1_BIT) != 0);
board_userled(PIC32MX_PIC32MX7MMB_LED2, (ledset & PIC32MX_PIC32MX7MMB_LED2_BIT) != 0);
}
#endif
/****************************************************************************
* Name: pic32mx_led_initialize
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void pic32mx_led_initialize(void)
{
/* Configure output pins */
pic32mx_configgpio(GPIO_LED_0);
pic32mx_configgpio(GPIO_LED_1);
pic32mx_configgpio(GPIO_LED_2);
}
#endif
@ -255,7 +272,7 @@ void board_autoled_on(int led)
{
if ((unsigned)led < LED_NVALUES)
{
up_setleds(&g_ledonvalues[led]);
pic32mx_setleds(&g_ledonvalues[led]);
}
}
#endif
@ -269,7 +286,7 @@ void board_autoled_off(int led)
{
if ((unsigned)led < LED_NVALUES)
{
up_setleds(&g_ledoffvalues[led]);
pic32mx_setleds(&g_ledoffvalues[led]);
}
}
#endif

View File

@ -130,11 +130,11 @@ extern "C" {
#if defined(CONFIG_PIC32MX_SPI1) || defined(CONFIG_PIC32MX_SPI2) || \
defined(CONFIG_PIC32MX_SPI3) || defined(CONFIG_PIC32MX_SPI4)
EXTERN void weak_function pic32mx_spiinitialize(void);
void weak_function pic32mx_spiinitialize(void);
#endif
/************************************************************************************
* Name: pic32mx_ledinit
* Name: pic32mx_led_initialize
*
* Description:
* Configure on-board LEDs if LED support has been selected.
@ -142,7 +142,7 @@ EXTERN void weak_function pic32mx_spiinitialize(void);
************************************************************************************/
#ifdef CONFIG_ARCH_LEDS
EXTERN void pic32mx_ledinit(void);
void pic32mx_led_initialize(void);
#endif
/****************************************************************************
@ -155,7 +155,7 @@ EXTERN void pic32mx_ledinit(void);
*
****************************************************************************/
EXTERN void pic32mx_lcdinitialize(void);
void pic32mx_lcdinitialize(void);
#undef EXTERN
#ifdef __cplusplus

View File

@ -189,7 +189,7 @@ void weak_function pic32mz_spiinitialize(void);
#endif
/************************************************************************************
* Name: pic32mz_ledinit
* Name: pic32mz_led_initialize
*
* Description:
* Configure on-board LEDs if LED support has been selected.
@ -197,7 +197,7 @@ void weak_function pic32mz_spiinitialize(void);
************************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void pic32mz_ledinit(void);
void pic32mz_led_initialize(void);
#endif
/****************************************************************************

View File

@ -177,10 +177,10 @@ static void pic32mz_setleds(FAR const struct led_setting_s *setting)
****************************************************************************/
/****************************************************************************
* Name: pic32mz_ledinit
* Name: pic32mz_led_initialize
****************************************************************************/
void pic32mz_ledinit(void)
void pic32mz_led_initialize(void)
{
/* Configure output pins */

View File

@ -84,7 +84,7 @@ void pic32mz_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
pic32mz_ledinit();
pic32mz_led_initialize();
#endif
}

View File

@ -105,10 +105,10 @@ static const uint16_t g_ledpincfg[PIC32MZ_STARTERKIT_NLEDS] =
****************************************************************************/
/****************************************************************************
* Name: pic32mz_ledinit
* Name: board_userled_initialize
****************************************************************************/
void pic32mz_ledinit(void)
void board_userled_initialize(void)
{
/* Configure output pins */
@ -118,10 +118,10 @@ void pic32mz_ledinit(void)
}
/****************************************************************************
* Name: pic32mz_setled
* Name: board_userled
****************************************************************************/
void pic32mz_setled(int led, bool ledon)
void board_userled(int led, bool ledon)
{
if ((unsigned)led < PIC32MZ_STARTERKIT_NLEDS)
{
@ -130,17 +130,17 @@ void pic32mz_setled(int led, bool ledon)
}
/****************************************************************************
* Name: pic32mz_setleds
* Name: board_userled_all
****************************************************************************/
void pic32mz_setleds(uint8_t ledset)
void board_userled_all(uint8_t ledset)
{
pic32mz_setled(PIC32MZ_STARTERKIT_LED1,
(ledset & PIC32MZ_STARTERKIT_LED1_BIT) != 0);
pic32mz_setled(PIC32MZ_STARTERKIT_LED2,
(ledset & PIC32MZ_STARTERKIT_LED2_BIT) != 0);
pic32mz_setled(PIC32MZ_STARTERKIT_LED3,
(ledset & PIC32MZ_STARTERKIT_LED3_BIT) != 0);
board_userled(PIC32MZ_STARTERKIT_LED1,
(ledset & PIC32MZ_STARTERKIT_LED1_BIT) != 0);
board_userled(PIC32MZ_STARTERKIT_LED2,
(ledset & PIC32MZ_STARTERKIT_LED2_BIT) != 0);
board_userled(PIC32MZ_STARTERKIT_LED3,
(ledset & PIC32MZ_STARTERKIT_LED3_BIT) != 0);
}
#endif /* !CONFIG_ARCH_LEDS */

View File

@ -123,10 +123,10 @@ static const uint8_t g_ledoff[8] =
****************************************************************************/
/****************************************************************************
* Name: up_setled
* Name: sam_setled
****************************************************************************/
static void up_setled(uint16_t pinset, uint8_t state)
static void sam_setled(uint16_t pinset, uint8_t state)
{
/* Assume active high. Initial state == 0 means active high */
@ -148,14 +148,14 @@ static void up_setled(uint16_t pinset, uint8_t state)
}
/****************************************************************************
* Name: up_setleds
* Name: sam_setleds
****************************************************************************/
static void up_setleds(uint8_t state)
static void sam_setleds(uint8_t state)
{
up_setled(GPIO_LED0, (state >> LED0_SHIFT) & LED_MASK);
up_setled(GPIO_LED1, (state >> LED1_SHIFT) & LED_MASK);
up_setled(GPIO_LED2, (state >> LED2_SHIFT) & LED_MASK);
sam_setled(GPIO_LED0, (state >> LED0_SHIFT) & LED_MASK);
sam_setled(GPIO_LED1, (state >> LED1_SHIFT) & LED_MASK);
sam_setled(GPIO_LED2, (state >> LED2_SHIFT) & LED_MASK);
}
/****************************************************************************
@ -179,7 +179,7 @@ void board_autoled_initialize(void)
void board_autoled_on(int led)
{
up_setleds(g_ledon[led & 7]);
sam_setleds(g_ledon[led & 7]);
}
/****************************************************************************
@ -188,7 +188,7 @@ void board_autoled_on(int led)
void board_autoled_off(int led)
{
up_setleds(g_ledoff[led & 7]);
sam_setleds(g_ledoff[led & 7]);
}
#endif /* CONFIG_ARCH_LEDS */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/sam4l-xplained/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>
*
* Redistribution and use in source and binary forms, with or without
@ -78,44 +78,37 @@
# define ledvdbg(x...)
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: sam_ledinit
* Name: board_userled_initialize
*
* Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the sam_ledinit() is
* available to initialize the LED0 from user application logic.
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the
* board_userled_initialize() is available to initialize the LED0 from
* user application logic.
*
****************************************************************************/
void sam_ledinit(void)
void board_userled_initialize(void)
{
(void)sam_configgpio(GPIO_LED0);
}
/****************************************************************************
* Name: sam_setled
* Name: board_userled
*
* Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the sam_setled() is
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled() is
* available to control the LED0 from user application logic.
*
****************************************************************************/
void sam_setled(int led, bool ledon)
void board_userled(int led, bool ledon)
{
if (led == BOARD_LED0)
{
@ -124,19 +117,19 @@ void sam_setled(int led, bool ledon)
}
/****************************************************************************
* Name: sam_setled
* Name: board_userled_all
*
* Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the sam_setleds() is
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is
* available to control the LED0 from user application logic. NOTE: since
* there is only a single LED on-board, this is function is not very useful.
*
****************************************************************************/
void sam_setleds(uint8_t ledset)
void board_userled_all(uint8_t ledset)
{
sam_setled(BOARD_LED0, (ledset & BOARD_LED0_BIT) != 0);
board_userled(BOARD_LED0, (ledset & BOARD_LED0_BIT) != 0);
}
#endif /* !CONFIG_ARCH_LEDS */

View File

@ -103,7 +103,7 @@ void board_initialize(void)
#ifndef CONFIG_ARCH_LEDS
/* Initialize user led */
sam_ledinit();
sam_led_initialize();
#endif
#ifdef CONFIG_TIMER

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/sam4s-xplained-pro/src/sam_userleds.c
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2014-2015 Gregory Nutt. All rights reserved.
* Authors: Gregory Nutt <gnutt@nuttx.org>
* Bob Doiron
*
@ -68,31 +68,15 @@
# define ledvdbg(x...)
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: sam_ledinit
* Name: board_userled_initialize
****************************************************************************/
void sam_ledinit(void)
void board_userled_initialize(void)
{
/* Configure D301 GPIO for output */
@ -100,10 +84,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)
{
if (led == BOARD_D301)
{
@ -112,10 +96,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)
{
sam_gpiowrite(GPIO_D301, (ledset & BOARD_D301_BIT) ? LED_D301_ON : LED_D301_OFF);
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/sam4s-xplained/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>
*
* Redistribution and use in source and binary forms, with or without
@ -67,31 +67,15 @@
# define ledvdbg(x...)
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Function Protototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: sam_ledinit
* Name: board_userled_initialize
****************************************************************************/
void sam_ledinit(void)
void board_userled_initialize(void)
{
/* Configure D9-2 GPIOs for output */
@ -100,10 +84,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;
@ -124,10 +108,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;

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/sama5d2-xult/src/sam_userleds.c
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -82,10 +82,10 @@
****************************************************************************/
/****************************************************************************
* Name: sam_ledinit
* Name: board_userled_initialize
****************************************************************************/
void sam_ledinit(void)
void board_userled_initialize(void)
{
/* Configure LED PIOs for output */
@ -96,10 +96,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;
@ -125,10 +125,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;

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/sama5d3-xplained/src/sam_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>
*
* Redistribution and use in source and binary forms, with or without
@ -79,31 +79,15 @@
# define ledvdbg(x...)
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Function Protototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: sam_ledinit
* Name: board_userled_initialize
****************************************************************************/
void sam_ledinit(void)
void board_userled_initialize(void)
{
/* Configure LED PIOs for output */
@ -112,10 +96,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;
@ -141,10 +125,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;

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/sama5d3x-ek/src/sam_userleds.c
*
* Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2013-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -79,31 +79,15 @@
# define ledvdbg(x...)
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Function Protototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: sam_ledinit
* Name: board_userled_initialize
****************************************************************************/
void sam_ledinit(void)
void board_userled_initialize(void)
{
/* Configure LED PIOs for output */
@ -114,10 +98,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;
@ -145,10 +129,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;

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/sama5d4-ek/src/sam_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>
*
* 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 LED PIOs for output */
@ -100,10 +100,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;
@ -129,10 +129,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;

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/samd20-xplained/src/sam_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>
*
* Redistribution and use in source and binary forms, with or without
@ -91,31 +91,32 @@
****************************************************************************/
/****************************************************************************
* Name: sam_ledinit
* Name: board_userled_initialize
*
* Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the sam_ledinit() is
* available to initialize the LED from user application logic.
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the
* board_userled_initialize() is available to initialize the LED from user
* application logic.
*
****************************************************************************/
void sam_ledinit(void)
void board_userled_initialize(void)
{
(void)sam_configport(PORT_STATUS_LED);
}
/****************************************************************************
* Name: sam_setled
* Name: board_userled
*
* Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the sam_setled() is
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled() is
* available to control the LED from user application logic.
*
****************************************************************************/
void sam_setled(int led, bool ledon)
void board_userled(int led, bool ledon)
{
if (led == BOARD_STATUS_LED)
{
@ -124,19 +125,19 @@ void sam_setled(int led, bool ledon)
}
/****************************************************************************
* Name: sam_setled
* Name: board_userled_all
*
* Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the sam_setleds() is
* available to control the LED from user application logic. NOTE: since
* there is only a single LED on-board, this is function is not very useful.
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is
* available to control the LED from user application logic. NOTE: since
* there is only a single LED on-board, this is function is not very useful.
*
****************************************************************************/
void sam_setleds(uint8_t ledset)
void board_userled_all(uint8_t ledset)
{
sam_setled(BOARD_STATUS_LED, (ledset & BOARD_STATUS_LED_BIT) != 0);
board_userled(BOARD_STATUS_LED, (ledset & BOARD_STATUS_LED_BIT) != 0);
}
#endif /* !CONFIG_ARCH_LEDS */

View File

@ -91,31 +91,32 @@
****************************************************************************/
/****************************************************************************
* Name: sam_ledinit
* Name: board_userled_initialize
*
* Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the sam_ledinit() is
* available to initialize the LED from user application logic.
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the
* board_userled_initialize() is available to initialize the LED from user
* application logic.
*
****************************************************************************/
void sam_ledinit(void)
void board_userled_initialize(void)
{
(void)sam_configport(PORT_STATUS_LED);
}
/****************************************************************************
* Name: sam_setled
* Name: board_userled
*
* Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the sam_setled() is
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled() is
* available to control the LED from user application logic.
*
****************************************************************************/
void sam_setled(int led, bool ledon)
void board_userled(int led, bool ledon)
{
if (led == BOARD_STATUS_LED)
{
@ -124,19 +125,19 @@ void sam_setled(int led, bool ledon)
}
/****************************************************************************
* Name: sam_setled
* Name: board_userled_all
*
* Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the sam_setleds() is
* available to control the LED from user application logic. NOTE: since
* there is only a single LED on-board, this is function is not very useful.
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is
* available to control the LED from user application logic. NOTE: since
* there is only a single LED on-board, this is function is not very useful.
*
****************************************************************************/
void sam_setleds(uint8_t ledset)
void board_userled_all(uint8_t ledset)
{
sam_setled(BOARD_STATUS_LED, (ledset & BOARD_STATUS_LED_BIT) != 0);
board_userled(BOARD_STATUS_LED, (ledset & BOARD_STATUS_LED_BIT) != 0);
}
#endif /* !CONFIG_ARCH_LEDS */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/saml21-xplained/src/sam_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>
*
* Redistribution and use in source and binary forms, with or without
@ -91,31 +91,32 @@
****************************************************************************/
/****************************************************************************
* Name: sam_ledinit
* Name: board_userled_initialize
*
* Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the sam_ledinit() is
* available to initialize the LED from user application logic.
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the
* board_userled_initialize() is available to initialize the LED from user
* application logic.
*
****************************************************************************/
void sam_ledinit(void)
void board_userled_initialize(void)
{
(void)sam_configport(PORT_STATUS_LED);
}
/****************************************************************************
* Name: sam_setled
* Name: board_userled
*
* Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the sam_setled() is
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled() is
* available to control the LED from user application logic.
*
****************************************************************************/
void sam_setled(int led, bool ledon)
void board_userled(int led, bool ledon)
{
if (led == BOARD_STATUS_LED)
{
@ -124,19 +125,19 @@ void sam_setled(int led, bool ledon)
}
/****************************************************************************
* Name: sam_setled
* Name: board_userled_all
*
* Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the sam_setleds() is
* available to control the LED from user application logic. NOTE: since
* there is only a single LED on-board, this is function is not very useful.
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is
* available to control the LED from user application logic. NOTE: since
* there is only a single LED on-board, this is function is not very useful.
*
****************************************************************************/
void sam_setleds(uint8_t ledset)
void board_userled_all(uint8_t ledset)
{
sam_setled(BOARD_STATUS_LED, (ledset & BOARD_STATUS_LED_BIT) != 0);
board_userled(BOARD_STATUS_LED, (ledset & BOARD_STATUS_LED_BIT) != 0);
}
#endif /* !CONFIG_ARCH_LEDS */

View File

@ -59,11 +59,12 @@
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: sam_ledinit
* Name: board_userled_initialize
****************************************************************************/
void sam_ledinit(void)
void board_userled_initialize(void)
{
/* Configure LED PIOs for output */
@ -72,10 +73,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;
@ -96,10 +97,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)
{
/* Low illuminates */

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/shenzhou/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>
*
* Redistribution and use in source and binary forms, with or without
@ -79,33 +79,29 @@ static uint32_t g_ledcfg[BOARD_NLEDS] =
GPIO_LED1, GPIO_LED2, GPIO_LED3, GPIO_LED4
};
/****************************************************************************
* Private 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 */
stm32_configgpio(GPIO_LED1);
stm32_configgpio(GPIO_LED2);
stm32_configgpio(GPIO_LED3);
stm32_configgpio(GPIO_LED4);
stm32_configgpio(GPIO_LED1);
stm32_configgpio(GPIO_LED2);
stm32_configgpio(GPIO_LED3);
stm32_configgpio(GPIO_LED4);
}
/****************************************************************************
* 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)
{
@ -114,10 +110,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_LED2, (ledset & BOARD_LED2_BIT) == 0);

View File

@ -108,10 +108,10 @@ static uint8_t g_nestlevel;
************************************************************************************/
/************************************************************************************
* Name: board_autoled_initialize
* Name: m16c_setleds
************************************************************************************/
static void up_setleds(uint8_t gybits, uint8_t rbit)
static void m16c_setleds(uint8_t gybits, uint8_t rbit)
{
uint8_t regval;
@ -174,14 +174,14 @@ void board_autoled_on(int led)
if (led == LED_ASSERTION)
{
ledset = g_ledstate[g_prevled[g_nestlevel]];
up_setleds(ledset & GREENYELLOW_LED_MASK, RED_LED_ON);
m16c_setleds(ledset & GREENYELLOW_LED_MASK, RED_LED_ON);
}
else if (led < LED_ASSERTION)
{
/* Otherwise, just show the LEDs corresponding to this state */
ledset = g_ledstate[led];
up_setleds(ledset & GREENYELLOW_LED_MASK, ledset & RED_LED_MASK);
m16c_setleds(ledset & GREENYELLOW_LED_MASK, ledset & RED_LED_MASK);
/* If this was a nested states (INIRQ, SIGNAL, or ASSERTION) then
* stack up the previous value.
@ -220,7 +220,8 @@ void board_autoled_off(int led)
{
ledset = g_ledstate[g_prevled[0]];
}
up_setleds(ledset & GREENYELLOW_LED_MASK, RED_LED_OFF);
m16c_setleds(ledset & GREENYELLOW_LED_MASK, RED_LED_OFF);
}
else if (led > 0 && led < LED_ASSERTION)
{
@ -241,7 +242,7 @@ void board_autoled_off(int led)
}
ledset = g_ledstate[led];
up_setleds(ledset & GREENYELLOW_LED_MASK, ledset & RED_LED_MASK);
m16c_setleds(ledset & GREENYELLOW_LED_MASK, ledset & RED_LED_MASK);
g_prevled[g_nestlevel]= led;
}
}

View File

@ -270,12 +270,12 @@ static void led_setonoff(unsigned int bits)
void board_autoled_initialize(void)
{
/* Configure LED1-4 GPIOs for output */
/* Configure LED1-4 GPIOs for output */
stm32_configgpio(GPIO_LED1);
stm32_configgpio(GPIO_LED2);
stm32_configgpio(GPIO_LED3);
stm32_configgpio(GPIO_LED4);
stm32_configgpio(GPIO_LED1);
stm32_configgpio(GPIO_LED2);
stm32_configgpio(GPIO_LED3);
stm32_configgpio(GPIO_LED4);
}
/****************************************************************************

View File

@ -99,8 +99,6 @@ void stm32_boardinitialize(void)
#if defined(CONFIG_USBDEV) && defined(CONFIG_STM32_USB)
stm32_usbinitialize();
#endif
}
/****************************************************************************

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/spark/src/stm32_userleds.c
*
* Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -80,33 +80,29 @@ static uint32_t g_ledcfg[BOARD_NLEDS] =
GPIO_LED1, GPIO_LED2, GPIO_LED3, GPIO_LED4
};
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: board_autoled_initialize
* Name: board_userled_initialize
****************************************************************************/
void board_autoled_initialize(void)
void board_userled_initialize(void)
{
/* Configure LED1-4 GPIOs for output */
/* Configure LED1-4 GPIOs for output */
stm32_configgpio(GPIO_LED1);
stm32_configgpio(GPIO_LED2);
stm32_configgpio(GPIO_LED3);
stm32_configgpio(GPIO_LED4);
stm32_configgpio(GPIO_LED1);
stm32_configgpio(GPIO_LED2);
stm32_configgpio(GPIO_LED3);
stm32_configgpio(GPIO_LED4);
}
/****************************************************************************
* Name: up_setled
* Name: board_userled
****************************************************************************/
void up_setled(int led, bool ledon)
void board_userled(int led, bool ledon)
{
if ((unsigned)led < BOARD_NLEDS)
{
@ -116,7 +112,7 @@ void up_setled(int led, bool ledon)
}
/****************************************************************************
* Name: up_setleds
* Name: board_userled_all
* Description:
* This function will be called to set the state of the Leds on the board
*
@ -128,7 +124,7 @@ void up_setled(int led, bool ledon)
*
****************************************************************************/
void up_setleds(uint8_t ledset, uint8_t led_states_set)
void board_userled_all(uint8_t ledset, uint8_t led_states_set)
{
led_states_set ^= LED_ACTIVE_LOW;
if ((ledset & BOARD_USR_LED_BIT) == 0)

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/stm3220g_eval/src/stm32_leds.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>
*
* Redistribution and use in source and binary forms, with or without
@ -79,33 +79,29 @@ static uint32_t g_ledcfg[BOARD_NLEDS] =
GPIO_LED1, GPIO_LED2, GPIO_LED3, GPIO_LED4
};
/****************************************************************************
* Private 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 */
stm32_configgpio(GPIO_LED1);
stm32_configgpio(GPIO_LED2);
stm32_configgpio(GPIO_LED3);
stm32_configgpio(GPIO_LED4);
stm32_configgpio(GPIO_LED1);
stm32_configgpio(GPIO_LED2);
stm32_configgpio(GPIO_LED3);
stm32_configgpio(GPIO_LED4);
}
/****************************************************************************
* 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)
{
@ -114,10 +110,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_LED2, (ledset & BOARD_LED2_BIT) == 0);

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/stm3240g_eval/src/stm32_userleds.c
*
* Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -79,33 +79,29 @@ static uint32_t g_ledcfg[BOARD_NLEDS] =
GPIO_LED1, GPIO_LED2, GPIO_LED3, GPIO_LED4
};
/****************************************************************************
* Private 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 */
stm32_configgpio(GPIO_LED1);
stm32_configgpio(GPIO_LED2);
stm32_configgpio(GPIO_LED3);
stm32_configgpio(GPIO_LED4);
stm32_configgpio(GPIO_LED1);
stm32_configgpio(GPIO_LED2);
stm32_configgpio(GPIO_LED3);
stm32_configgpio(GPIO_LED4);
}
/****************************************************************************
* 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)
{
@ -114,10 +110,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_LED2, (ledset & BOARD_LED2_BIT) == 0);

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/stm32f3discovery/src/stm32_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>
*
* Redistribution and use in source and binary forms, with or without
@ -78,27 +78,15 @@ static const uint32_t g_ledcfg[BOARD_NLEDS] =
GPIO_LED5, GPIO_LED6, GPIO_LED7, GPIO_LED8
};
/****************************************************************************
* Private Function Protototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: stm32_ledinit
* Name: board_userled_initialize
****************************************************************************/
void stm32_ledinit(void)
void board_userled_initialize(void)
{
int i;
@ -111,10 +99,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)
{
@ -123,10 +111,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)
{
int i;

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/stm32f429i-disco/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>
*
* 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: stm32_ledinit
* Name: board_userled_initialize
****************************************************************************/
void stm32_ledinit(void)
void board_userled_initialize(void)
{
/* Configure LED1-4 GPIOs for output */
@ -200,10 +200,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)
{
@ -212,10 +212,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_LED2, (ledset & BOARD_LED2_BIT) == 0);

View File

@ -189,10 +189,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 LED1-4 GPIOs for output */
@ -203,10 +203,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)
{
@ -215,10 +215,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_LED2, (ledset & BOARD_LED2_BIT) == 0);

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/stm32f746g-disco/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>
*
* Redistribution and use in source and binary forms, with or without
@ -68,31 +68,32 @@
****************************************************************************/
/****************************************************************************
* Name: stm32_ledinit
* Name: board_userled_initialize
*
* Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the stm32_ledinit() is
* available to initialize the LED from user application logic.
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the
* board_userled_initialize() is available to initialize the LED from user
* application logic.
*
****************************************************************************/
void stm32_ledinit(void)
void board_userled_initialize(void)
{
stm32_configgpio(GPIO_LD1);
}
/****************************************************************************
* Name: stm32_setled
* Name: board_userled
*
* Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the stm32_setled() is
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled() is
* available to control the LED from user application logic.
*
****************************************************************************/
void stm32_setled(int led, bool ledon)
void board_userled(int led, bool ledon)
{
if (led == BOARD_STATUS_LED)
{
@ -101,17 +102,17 @@ void stm32_setled(int led, bool ledon)
}
/****************************************************************************
* Name: stm32_setled
* Name: board_userled_all
*
* Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the stm32_setleds() is
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is
* available to control the LED from user application logic. NOTE: since
* there is only a single LED on-board, this is function is not very useful.
*
****************************************************************************/
void stm32_setleds(uint8_t ledset)
void board_userled_all(uint8_t ledset)
{
stm32_gpiowrite(GPIO_LD1, (ledset & BOARD_STATUS_LED_BIT) != 0);
}

View File

@ -1,7 +1,7 @@
/****************************************************************************
* configs/stm32ldiscovery/src/stm32_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>
*
* Redistribution and use in source and binary forms, with or without
@ -67,31 +67,15 @@
# define ledvdbg(x...)
#endif
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Function Protototypes
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: stm32_ledinit
* Name: board_userled_initialize
****************************************************************************/
void stm32_ledinit(void)
void board_userled_initialize(void)
{
/* Configure LED1-2 GPIOs for output */
@ -100,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)
{
uint32_t ledcfg;
@ -124,10 +108,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)
{
bool ledon;

View File

@ -66,6 +66,6 @@ void stm32_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
stm32_ledinit();
stm32_led_initialize();
#endif
}

View File

@ -75,11 +75,11 @@
****************************************************************************/
/****************************************************************************
* Name: stm32_ledinit
* Name: stm32_led_initialize
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void stm32_ledinit(void)
void stm32_led_initialize(void)
{
stm32_configgpio(GPIO_LED1); /* Configure LED1 GPIO for output */
}

View File

@ -60,7 +60,7 @@
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void stm32_ledinit(void);
void stm32_led_initialize(void);
#endif
#endif /* __CONFIGS_STM32VL_DISCOVERY_SRC_STM32VLDISCOVERY_H */

View File

@ -143,10 +143,10 @@ static const struct led_setting_s g_ledoffvalues[LED_NVALUES] =
****************************************************************************/
/****************************************************************************
* Name: up_setleds
* Name: pic32mx_setleds
****************************************************************************/
void up_setleds(FAR const struct led_setting_s *setting)
static void pic32mx_setleds(FAR const struct led_setting_s *setting)
{
if (setting->usb != LED_NC)
{
@ -174,10 +174,10 @@ void up_setleds(FAR const struct led_setting_s *setting)
****************************************************************************/
/****************************************************************************
* Name: pic32mx_ledinit
* Name: pic32mx_led_initialize
****************************************************************************/
void pic32mx_ledinit(void)
void pic32mx_led_initialize(void)
{
/* Configure output pins */
@ -195,7 +195,7 @@ void board_autoled_on(int led)
{
if (led < LED_NVALUES)
{
up_setleds(&g_ledonvalues[led]);
pic32mx_setleds(&g_ledonvalues[led]);
}
}
@ -207,7 +207,7 @@ void board_autoled_off(int led)
{
if (led < LED_NVALUES)
{
up_setleds(&g_ledoffvalues[led]);
pic32mx_setleds(&g_ledoffvalues[led]);
}
}
#endif /* CONFIG_ARCH_LEDS */

View File

@ -96,6 +96,6 @@ void pic32mx_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
pic32mx_ledinit();
pic32mx_led_initialize();
#endif
}

View File

@ -153,7 +153,7 @@ void weak_function pic32mx_usbdevinitialize(void);
#endif
/************************************************************************************
* Name: pic32mx_ledinit
* Name: pic32mx_led_initialize
*
* Description:
* Configure on-board LEDs if LED support has been selected.
@ -161,7 +161,7 @@ void weak_function pic32mx_usbdevinitialize(void);
************************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void pic32mx_ledinit(void);
void pic32mx_led_initialize(void);
#endif
#undef EXTERN

View File

@ -87,6 +87,6 @@ void at90usb_boardinitialize(void)
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
at90usb_ledinit();
at90usb_led_initialize();
#endif
}

View File

@ -88,10 +88,10 @@ static bool g_ncoff;
****************************************************************************/
/****************************************************************************
* Name: at90usb_ledinit
* Name: at90usb_led_initialize
****************************************************************************/
void at90usb_ledinit(void)
void at90usb_led_initialize(void)
{
/* The Teensy's single LED is on Port D, Pin 6. Configur this pin as an
* output and turn it OFF. The "other" side of the LED is onnected to

View File

@ -82,7 +82,7 @@ void weak_function at90usb_spiinitialize(void);
#endif
/************************************************************************************
* Name: at90usb_ledinit
* Name: at90usb_led_initialize
*
* Description:
* Configure on-board LEDs if LED support has been selected.
@ -90,7 +90,7 @@ void weak_function at90usb_spiinitialize(void);
************************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void at90usb_ledinit(void);
void at90usb_led_initialize(void);
#endif
#undef EXTERN

View File

@ -47,28 +47,24 @@
#ifndef CONFIG_ARCH_LEDS
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: kinetis_ledinit
* Name: board_userled_initialize
****************************************************************************/
void kinetis_ledinit(void)
void board_userled_initialize(void)
{
kinetis_pinconfig(GPIO_LED);
}
/****************************************************************************
* Name: kinetis_setled
* Name: board_userled
****************************************************************************/
void kinetis_setled(int led, bool ledon)
void board_userled(int led, bool ledon)
{
if (led == BOARD_LED)
{
@ -77,10 +73,10 @@ void kinetis_setled(int led, bool ledon)
}
/****************************************************************************
* Name: kinetis_setleds
* Name: board_userled_all
****************************************************************************/
void kinetis_setleds(uint8_t ledset)
void board_userled_all(uint8_t ledset)
{
kinetis_gpiowrite(GPIO_LED, (ledset & BOARD_LED_BIT) != 0);
}

View File

@ -110,7 +110,7 @@ void kl_boardinitialize(void)
/* Configure on-board LED if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
kl_ledinit();
kl_led_initialize();
#endif
}

View File

@ -85,14 +85,14 @@
****************************************************************************/
/****************************************************************************
* Name: kl_ledinit
* Name: kl_led_initialize
*
* Description:
* Initialize the on-board LED
*
****************************************************************************/
void kl_ledinit(void)
void kl_led_initialize(void)
{
kl_configgpio(GPIO_LED);
}

View File

@ -80,7 +80,7 @@
void weak_function kl_spiinitialize(void);
/****************************************************************************
* Name: kl_ledinit
* Name: kl_led_initialize
*
* Description:
* Initialize the on-board LED
@ -88,7 +88,7 @@ void weak_function kl_spiinitialize(void);
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void kl_ledinit(void);
void kl_led_initialize(void);
#endif
#endif /* __ASSEMBLY__ */

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