Fix nxstyle issue

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2020-06-06 21:16:53 +08:00
committed by Abdelatif Guettouche
parent 7a18ebe459
commit 24262a4ddb
68 changed files with 251 additions and 262 deletions
+3 -3
View File
@@ -82,9 +82,9 @@
* LED_PANIC The system has crashed N/C N/C 2Hz Flashing * LED_PANIC The system has crashed N/C N/C 2Hz Flashing
* LED_IDLE MCU is is sleep mode Not used * LED_IDLE MCU is is sleep mode Not used
* *
* After booting, LED1 and 3 are not longer used by the system and can be used * After booting, LED1 and 3 are not longer used by the system and can be
* for other purposes by the application (Of course, all LEDs are available to * used for other purposes by the application (Of course, all LEDs are
* the application if CONFIG_ARCH_LEDS is not defined. * available to the application if CONFIG_ARCH_LEDS is not defined.
*/ */
/**************************************************************************** /****************************************************************************
@@ -32,6 +32,7 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
****************************************************************************/ ****************************************************************************/
/* The EFM32 Giant Gecko Start Kit has two yellow LEDs marked LED0 and LED1. /* The EFM32 Giant Gecko Start Kit has two yellow LEDs marked LED0 and LED1.
* These LEDs are controlled by GPIO pins on the EFM32. The LEDs are * These LEDs are controlled by GPIO pins on the EFM32. The LEDs are
* connected to pins PE2 and PE3 in an active high configuration: * connected to pins PE2 and PE3 in an active high configuration:
@@ -52,7 +52,7 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* Clocking ****************************************************************/ /* Clocking *****************************************************************/
/* NOTE: The following definitions require lpc17_40_syscon.h. /* NOTE: The following definitions require lpc17_40_syscon.h.
* It is not included here because the including C file may not have that * It is not included here because the including C file may not have that
@@ -66,23 +66,24 @@
/* This is the clock setup we configure for: /* This is the clock setup we configure for:
* *
* SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Main oscillator for source
* PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1 * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> multipler=20, pre-divider=1
* CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 * CCLCK = 480MHz / 6 = 80MHz -> divider = 6
*/ */
#define LPC17_40_CCLK 80000000 /* 80Mhz*/ #define LPC17_40_CCLK 80000000 /* 80Mhz*/
/* Select the main oscillator as the frequency source. SYSCLK is then the frequency /* Select the main oscillator as the frequency source. SYSCLK is then the
* of the main oscillator. * frequency of the main oscillator.
*/ */
#undef CONFIG_LPC17_40_MAINOSC #undef CONFIG_LPC17_40_MAINOSC
#define CONFIG_LPC17_40_MAINOSC 1 #define CONFIG_LPC17_40_MAINOSC 1
#define BOARD_SCS_VALUE SYSCON_SCS_OSCEN #define BOARD_SCS_VALUE SYSCON_SCS_OSCEN
/* Select the main oscillator and CCLK divider. The output of the divider is CCLK. /* Select the main oscillator and CCLK divider. The output of the divider is
* The input to the divider (PLLCLK) will be determined by the PLL output. * CCLK. The input to the divider (PLLCLK) will be determined by the PLL
* output.
*/ */
#define BOARD_CCLKCFG_DIVIDER 6 #define BOARD_CCLKCFG_DIVIDER 6
@@ -134,7 +135,7 @@
#define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV20 #define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV20
/* LED definitions *********************************************************/ /* Clocking *****************************************************************/
/* The Lincoln 60 has 2 LEDs along the bottom of the board. Green or off. /* The Lincoln 60 has 2 LEDs along the bottom of the board. Green or off.
* If CONFIG_ARCH_LEDS is defined, the LEDs will be controlled as follows * If CONFIG_ARCH_LEDS is defined, the LEDs will be controlled as follows
@@ -142,6 +143,7 @@
* *
* During the boot phases. LED1 and LED2 will show boot status. * During the boot phases. LED1 and LED2 will show boot status.
*/ */
/* LED1 LED2 */ /* LED1 LED2 */
#define LED_STARTED 0 /* OFF OFF */ #define LED_STARTED 0 /* OFF OFF */
#define LED_HEAPALLOCATE 1 /* GREEN OFF */ #define LED_HEAPALLOCATE 1 /* GREEN OFF */
@@ -152,6 +154,7 @@
* They are available for use the application software using lpc17_40_led * They are available for use the application software using lpc17_40_led
* (prototyped below) * (prototyped below)
*/ */
/* LED1 LED2 LED3 LED4 */ /* LED1 LED2 LED3 LED4 */
#define LED_INIRQ 4 /* NC NC NC ON (momentary) */ #define LED_INIRQ 4 /* NC NC NC ON (momentary) */
#define LED_SIGNAL 5 /* NC NC NC ON (momentary) */ #define LED_SIGNAL 5 /* NC NC NC ON (momentary) */
@@ -36,12 +36,12 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
*****************************************************************************/ ****************************************************************************/
#ifndef __BOARDS_ARM_LPC17XX_40XX_PNEV5180B_INCLUDE_BOARD_H #ifndef __BOARDS_ARM_LPC17XX_40XX_PNEV5180B_INCLUDE_BOARD_H
#define __BOARDS_ARM_LPC17XX_40XX_PNEV5180B_INCLUDE_BOARD_H #define __BOARDS_ARM_LPC17XX_40XX_PNEV5180B_INCLUDE_BOARD_H
/***************************************************************************** /****************************************************************************
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
@@ -53,11 +53,11 @@
# include <nuttx/irq.h> # include <nuttx/irq.h>
#endif #endif
/***************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
*****************************************************************************/ ****************************************************************************/
/* Clocking ******************************************************************/ /* Clocking *****************************************************************/
/* NOTE: The following definitions require lpc17_40_syscon.h. It is not /* NOTE: The following definitions require lpc17_40_syscon.h. It is not
* included here because the including C file may not have that file in its * included here because the including C file may not have that file in its
@@ -138,13 +138,15 @@
#define CONFIG_LP17_FLASH 1 #define CONFIG_LP17_FLASH 1
#define BOARD_FLASHCFG_VALUE 0x0000403a #define BOARD_FLASHCFG_VALUE 0x0000403a
/* LED definitions ***********************************************************/ /* LED definitions **********************************************************/
/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LEDs on the /* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LEDs on the
* PNEV5180B board. The following definitions describe how NuttX controls the * PNEV5180B board. The following definitions describe how NuttX controls
* LEDs: * the LEDs:
*/ */
/* LD201 LD200 LD202 LD203 */ /* LD201 LD200 LD202 LD203 */
/* RED ORANGE BLUE GREEN */ /* RED ORANGE BLUE GREEN */
#define LED_STARTED 0 /* ON ON ON ON */ #define LED_STARTED 0 /* ON ON ON ON */
#define LED_HEAPALLOCATE 1 /* OFF OFF OFF ON */ #define LED_HEAPALLOCATE 1 /* OFF OFF OFF ON */
@@ -155,7 +157,7 @@
#define LED_ASSERTION 6 /* OFF ON OFF OFF (momentary) */ #define LED_ASSERTION 6 /* OFF ON OFF OFF (momentary) */
#define LED_PANIC 7 /* ON OFF OFF OFF (1Hz flashing) */ #define LED_PANIC 7 /* ON OFF OFF OFF (1Hz flashing) */
/* Alternate pin selections **************************************************/ /* Alternate pin selections *************************************************/
/* Pin Description On Board Connector /* Pin Description On Board Connector
* -------------------------------- ---------------- ------------- * -------------------------------- ---------------- -------------
@@ -180,15 +182,15 @@
* P3.26/STCLK/MAT0.1/PWM1.3 LD202 BLUE LED * P3.26/STCLK/MAT0.1/PWM1.3 LD202 BLUE LED
*/ */
/***************************************************************************** /****************************************************************************
* Public Types * Public Types
*****************************************************************************/ ****************************************************************************/
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
/***************************************************************************** /****************************************************************************
* Public Data * Public Data
*****************************************************************************/ ****************************************************************************/
#undef EXTERN #undef EXTERN
#if defined(__cplusplus) #if defined(__cplusplus)
@@ -199,30 +201,30 @@ extern "C"
#define EXTERN extern #define EXTERN extern
#endif #endif
/***************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
*****************************************************************************/ ****************************************************************************/
/***************************************************************************** /****************************************************************************
* Name: lpc17_40_boardinitialize * Name: lpc17_40_boardinitialize
* *
* Description: * Description:
* All LPC17xx/LPC40xx architectures must provide the following entry point. * All LPC17xx/LPC40xx architectures must provide the following entry
* This entry point is called early in the initialization -- after all * point. This entry point is called early in the initialization -- after
* memory has been configured and mapped but before any devices have * all memory has been configured and mapped but before any devices have
* been initialized. * been initialized.
* *
*****************************************************************************/ ****************************************************************************/
void lpc17_40_boardinitialize(void); void lpc17_40_boardinitialize(void);
/***************************************************************************** /****************************************************************************
* Name: lpc17_40_led * Name: lpc17_40_led
* *
* Description: * Description:
* Once the system has booted, these functions can be used to control LED 1 * Once the system has booted, these functions can be used to control LED 1
* *
*****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
void lpc17_40_led(int lednum, int state); void lpc17_40_led(int lednum, int state);
+11 -11
View File
@@ -3,7 +3,7 @@
* *
* Copyright (C) 2016 Gregory Nutt. All rights reserved. * Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@googlegroups.com> * Alan Carvalho de Assis acassis@gmail.com
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@@ -52,7 +52,7 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* Clocking ****************************************************************/ /* Clocking *****************************************************************/
/* NOTE: The following definitions require lpc43_cgu.h. It is not included /* NOTE: The following definitions require lpc43_cgu.h. It is not included
* here because the including C file may not have that file in its include * here because the including C file may not have that file in its include
@@ -146,9 +146,9 @@
/* This is the clock setup we configure for: /* This is the clock setup we configure for:
* *
* SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Main oscillator for source
* PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1 * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> multipler=20, pre-divider=1
* CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 * CCLCK = 480MHz / 6 = 80MHz -> divider = 6
*/ */
#define LPC43_CCLK BOARD_FCLKOUT_FREQUENCY #define LPC43_CCLK BOARD_FCLKOUT_FREQUENCY
@@ -185,7 +185,7 @@
#define BOARD_SDIO_CLKSRC BASE_SDIO_CLKSEL_PLL1 #define BOARD_SDIO_CLKSRC BASE_SDIO_CLKSEL_PLL1
/* USB0 ********************************************************************/ /* USB0 *********************************************************************/
/* Settings needed in lpc43_cpu.c */ /* Settings needed in lpc43_cpu.c */
@@ -193,7 +193,7 @@
#define BOARD_USB0_MDIV 0x06167ffa /* Table 149 datsheet, valid for 12Mhz Fclkin */ #define BOARD_USB0_MDIV 0x06167ffa /* Table 149 datsheet, valid for 12Mhz Fclkin */
#define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */ #define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */
/* SPIFI clocking **********************************************************/ /* SPIFI clocking ***********************************************************/
/* The SPIFI will receive clocking from a divider per the settings provided /* The SPIFI will receive clocking from a divider per the settings provided
* in this file. The NuttX code will configure PLL1 as the input clock * in this file. The NuttX code will configure PLL1 as the input clock
@@ -261,7 +261,7 @@
#define BOARD_CLKDIV_SDWIDEXFR BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 25000000) #define BOARD_CLKDIV_SDWIDEXFR BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 25000000)
#define BOARD_CLKDIV_SDXFR BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 25000000) #define BOARD_CLKDIV_SDXFR BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 25000000)
/* UART clocking ***********************************************************/ /* UART clocking ************************************************************/
/* Configure all U[S]ARTs to use the XTAL input frequency */ /* Configure all U[S]ARTs to use the XTAL input frequency */
@@ -277,7 +277,7 @@
#define BOARD_USART3_CLKSRC BASE_USART3_CLKSEL_XTAL #define BOARD_USART3_CLKSRC BASE_USART3_CLKSEL_XTAL
#define BOARD_USART3_BASEFREQ BOARD_XTAL_FREQUENCY #define BOARD_USART3_BASEFREQ BOARD_XTAL_FREQUENCY
/* LED definitions *********************************************************/ /* Clocking *****************************************************************/
/* The Bambino 200E has 2 user-controllable LEDs labeled LED1 and LED2 in the /* The Bambino 200E has 2 user-controllable LEDs labeled LED1 and LED2 in the
* schematic and on bus referred to has GPIO3[7] and GPIO5[5], respectively. * schematic and on bus referred to has GPIO3[7] and GPIO5[5], respectively.
@@ -309,7 +309,7 @@
* void board_userled(int led, bool ledon); * void board_userled(int led, bool ledon);
* void board_userled_all(uint32_t ledset); * void board_userled_all(uint32_t ledset);
*/ */
/* ON OFF */
/* LED1 LED2 LED1 LED2 */ /* LED1 LED2 LED1 LED2 */
#define LED_STARTED 0 /* OFF OFF - - */ #define LED_STARTED 0 /* OFF OFF - - */
#define LED_HEAPALLOCATE 1 /* ON OFF - - */ #define LED_HEAPALLOCATE 1 /* ON OFF - - */
@@ -354,7 +354,7 @@
#define PINCONF_U3_RXD PINCONF_U3_RXD_2 #define PINCONF_U3_RXD PINCONF_U3_RXD_2
#define PINCONF_U3_DIR PINCONF_U3_DIR_2 #define PINCONF_U3_DIR PINCONF_U3_DIR_2
/* SPI Pins ****************************************************************/ /* SPI Pins *****************************************************************/
/* The Bambino 200E has SPI peripheral pins reserved for SPIFI. /* The Bambino 200E has SPI peripheral pins reserved for SPIFI.
* SSP0 and SSP1 are available on Socket 1 and 10, respectively: * SSP0 and SSP1 are available on Socket 1 and 10, respectively:
@@ -3,7 +3,7 @@
* *
* Copyright (C) 2016 Gregory Nutt. All rights reserved. * Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@googlegroups.com> * Alan Carvalho de Assis acassis@gmail.com
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@@ -3,7 +3,7 @@
* *
* Copyright (C) 2016 Gregory Nutt. All rights reserved. * Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* Alan Carvalho de Assis acassis@gmail.com [nuttx] <nuttx@googlegroups.com> * Alan Carvalho de Assis acassis@gmail.com
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@@ -51,7 +51,7 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* Clocking ****************************************************************/ /* Clocking *****************************************************************/
/* NOTE: The following definitions require lpc43_cgu.h. It is not included /* NOTE: The following definitions require lpc43_cgu.h. It is not included
* here because the including C file may not have that file in its include * here because the including C file may not have that file in its include
@@ -144,9 +144,9 @@
/* This is the clock setup we configure for: /* This is the clock setup we configure for:
* *
* SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Main oscillator for source
* PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1 * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> multipler=20, pre-divider=1
* CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 * CCLCK = 480MHz / 6 = 80MHz -> divider = 6
*/ */
#define LPC43_CCLK BOARD_FCLKOUT_FREQUENCY #define LPC43_CCLK BOARD_FCLKOUT_FREQUENCY
@@ -179,7 +179,7 @@
#define BOARD_SSP1_CLKSRC BASE_SSP1_CLKSEL_IDIVA #define BOARD_SSP1_CLKSRC BASE_SSP1_CLKSEL_IDIVA
#define BOARD_SSP1_BASEFREQ BOARD_IDIVA_FREQUENCY #define BOARD_SSP1_BASEFREQ BOARD_IDIVA_FREQUENCY
/* USB0 ********************************************************************/ /* USB0 *********************************************************************/
/* Settings needed in lpc43_cpu.c */ /* Settings needed in lpc43_cpu.c */
@@ -187,7 +187,7 @@
#define BOARD_USB0_MDIV 0x06167ffa /* Table 149 datsheet, valid for 12Mhz Fclkin */ #define BOARD_USB0_MDIV 0x06167ffa /* Table 149 datsheet, valid for 12Mhz Fclkin */
#define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */ #define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */
/* SPIFI clocking **********************************************************/ /* SPIFI clocking ***********************************************************/
/* The SPIFI will receive clocking from a divider per the settings provided /* The SPIFI will receive clocking from a divider per the settings provided
* in this file. The NuttX code will configure PLL1 as the input clock * in this file. The NuttX code will configure PLL1 as the input clock
@@ -219,7 +219,7 @@
# define BOARD_SPIFI_FREQUENCY (102000000) /* 204MHz / 14 = 14.57MHz */ # define BOARD_SPIFI_FREQUENCY (102000000) /* 204MHz / 14 = 14.57MHz */
#endif #endif
/* SD/MMC or SDIO interface ************************************************/ /* SD/MMC or SDIO interface *************************************************/
#define BOARD_SDMMC_CEIL(a,b) (((a) + (b) - 1) / (b)) #define BOARD_SDMMC_CEIL(a,b) (((a) + (b) - 1) / (b))
@@ -248,7 +248,7 @@
#define BOARD_CLKDIV_SDWIDEXFR BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 25000000) #define BOARD_CLKDIV_SDWIDEXFR BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 25000000)
#define BOARD_CLKDIV_SDXFR BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 25000000) #define BOARD_CLKDIV_SDXFR BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 25000000)
/* UART clocking ***********************************************************/ /* UART clocking ************************************************************/
/* Configure all U[S]ARTs to use the XTAL input frequency */ /* Configure all U[S]ARTs to use the XTAL input frequency */
@@ -264,7 +264,7 @@
#define BOARD_USART3_CLKSRC BASE_USART3_CLKSEL_XTAL #define BOARD_USART3_CLKSRC BASE_USART3_CLKSEL_XTAL
#define BOARD_USART3_BASEFREQ BOARD_XTAL_FREQUENCY #define BOARD_USART3_BASEFREQ BOARD_XTAL_FREQUENCY
/* LED definitions *********************************************************/ /* Clocking *****************************************************************/
/* The LPC4330-Xplorer has 2 user-controllable LEDs labeled D2 an D3 in the /* The LPC4330-Xplorer has 2 user-controllable LEDs labeled D2 an D3 in the
* schematic and on but referred to has LED1 and LED2 here, respectively. * schematic and on but referred to has LED1 and LED2 here, respectively.
@@ -296,7 +296,7 @@
* void board_userled(int led, bool ledon); * void board_userled(int led, bool ledon);
* void board_userled_all(uint32_t ledset); * void board_userled_all(uint32_t ledset);
*/ */
/* ON OFF */
/* LED1 LED2 LED1 LED2 */ /* LED1 LED2 LED1 LED2 */
#define LED_STARTED 0 /* OFF OFF - - */ #define LED_STARTED 0 /* OFF OFF - - */
#define LED_HEAPALLOCATE 1 /* ON OFF - - */ #define LED_HEAPALLOCATE 1 /* ON OFF - - */
@@ -51,7 +51,7 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* Clocking ****************************************************************/ /* Clocking *****************************************************************/
/* NOTE: The following definitions require lpc43_cgu.h. It is not included /* NOTE: The following definitions require lpc43_cgu.h. It is not included
* here because the including C file may not have that file in its include * here because the including C file may not have that file in its include
@@ -162,7 +162,7 @@
#define BOARD_IDIVA_CLKSRC IDIVA_CLKSEL_PLL1 #define BOARD_IDIVA_CLKSRC IDIVA_CLKSEL_PLL1
#define BOARD_IDIVA_FREQUENCY (BOARD_FCLKOUT_FREQUENCY/BOARD_IDIVA_DIVIDER) #define BOARD_IDIVA_FREQUENCY (BOARD_FCLKOUT_FREQUENCY/BOARD_IDIVA_DIVIDER)
/* USB0 ********************************************************************/ /* USB0 *********************************************************************/
/* Settings needed in lpc43_cpu.c */ /* Settings needed in lpc43_cpu.c */
@@ -170,7 +170,7 @@
#define BOARD_USB0_MDIV 0x06167ffa /* Table 149 datsheet, valid for 12Mhz Fclkin */ #define BOARD_USB0_MDIV 0x06167ffa /* Table 149 datsheet, valid for 12Mhz Fclkin */
#define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */ #define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */
/* SPIFI clocking **********************************************************/ /* SPIFI clocking ***********************************************************/
/* The SPIFI will receive clocking from a divider per the settings provided /* The SPIFI will receive clocking from a divider per the settings provided
* in this file. The NuttX code will configure PLL1 as the input clock * in this file. The NuttX code will configure PLL1 as the input clock
@@ -223,7 +223,7 @@
# define SPIFI_DEVICE_REQUENCY_DIVIDER 2 /* PLL1 clock divider */ # define SPIFI_DEVICE_REQUENCY_DIVIDER 2 /* PLL1 clock divider */
#endif #endif
/* UART clocking ***********************************************************/ /* UART clocking ************************************************************/
/* Configure all U[S]ARTs to use the XTAL input frequency */ /* Configure all U[S]ARTs to use the XTAL input frequency */
@@ -255,7 +255,7 @@
#define BOARD_SSP1_CLKSRC BASE_SSP1_CLKSEL_IDIVA #define BOARD_SSP1_CLKSRC BASE_SSP1_CLKSEL_IDIVA
#define BOARD_SSP1_BASEFREQ BOARD_IDIVA_FREQUENCY #define BOARD_SSP1_BASEFREQ BOARD_IDIVA_FREQUENCY
/* LED definitions *********************************************************/ /* Clocking *****************************************************************/
/* LED1 K2 GPIO0[8] /* LED1 K2 GPIO0[8]
* *
@@ -279,6 +279,7 @@
* void board_userled(int led, bool ledon); * void board_userled(int led, bool ledon);
* void board_userled_all(uint32_t ledset); * void board_userled_all(uint32_t ledset);
*/ */
/* LED */ /* LED */
#define LED_STARTED 0 /* OFF */ #define LED_STARTED 0 /* OFF */
#define LED_HEAPALLOCATE 0 /* OFF */ #define LED_HEAPALLOCATE 0 /* OFF */
@@ -51,7 +51,7 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* Clocking ****************************************************************/ /* Clocking *****************************************************************/
/* NOTE: The following definitions require lpc43_cgu.h. It is not included /* NOTE: The following definitions require lpc43_cgu.h. It is not included
* here because the including C file may not have that file in its include * here because the including C file may not have that file in its include
@@ -144,14 +144,14 @@
/* This is the clock setup we configure for: /* This is the clock setup we configure for:
* *
* SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Main oscillator for source
* PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1 * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz-> multipler=20, pre-divider=1
* CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 * CCLCK = 480MHz / 6 = 80MHz -> divider = 6
*/ */
#define LPC43_CCLK BOARD_FCLKOUT_FREQUENCY #define LPC43_CCLK BOARD_FCLKOUT_FREQUENCY
/* USB0 ********************************************************************/ /* USB0 *********************************************************************/
/* Settings needed in lpc43_cpu.c */ /* Settings needed in lpc43_cpu.c */
@@ -159,7 +159,7 @@
#define BOARD_USB0_MDIV 0x06167ffa /* Table 149 datsheet, valid for 12Mhz Fclkin */ #define BOARD_USB0_MDIV 0x06167ffa /* Table 149 datsheet, valid for 12Mhz Fclkin */
#define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */ #define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */
/* SPIFI clocking **********************************************************/ /* SPIFI clocking ***********************************************************/
/* The SPIFI will receive clocking from a divider per the settings provided /* The SPIFI will receive clocking from a divider per the settings provided
* in this file. The NuttX code will configure PLL1 as the input clock * in this file. The NuttX code will configure PLL1 as the input clock
@@ -191,7 +191,7 @@
# define BOARD_SPIFI_FREQUENCY (102000000) /* 204MHz / 14 = 14.57MHz */ # define BOARD_SPIFI_FREQUENCY (102000000) /* 204MHz / 14 = 14.57MHz */
#endif #endif
/* UART clocking ***********************************************************/ /* UART clocking ************************************************************/
/* Configure all U[S]ARTs to use the XTAL input frequency */ /* Configure all U[S]ARTs to use the XTAL input frequency */
@@ -207,7 +207,7 @@
#define BOARD_USART3_CLKSRC BASE_USART3_CLKSEL_XTAL #define BOARD_USART3_CLKSRC BASE_USART3_CLKSEL_XTAL
#define BOARD_USART3_BASEFREQ BOARD_XTAL_FREQUENCY #define BOARD_USART3_BASEFREQ BOARD_XTAL_FREQUENCY
/* LED definitions *********************************************************/ /* Clocking *****************************************************************/
/* The LPC4357-EVB has one user-controllable LED labelled D6 controlled /* The LPC4357-EVB has one user-controllable LED labelled D6 controlled
* by the signal LED_3V3: * by the signal LED_3V3:
@@ -233,6 +233,7 @@
/* If CONFIG_ARCH_LEDS is defined, the LED will be controlled as follows /* If CONFIG_ARCH_LEDS is defined, the LED will be controlled as follows
* for NuttX debug functionality (where NC means "No Change"). * for NuttX debug functionality (where NC means "No Change").
*/ */
/* LED */ /* LED */
#define LED_STARTED 0 /* OFF */ #define LED_STARTED 0 /* OFF */
#define LED_HEAPALLOCATE 0 /* OFF */ #define LED_HEAPALLOCATE 0 /* OFF */
@@ -51,7 +51,7 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* Clocking ****************************************************************/ /* Clocking *****************************************************************/
/* NOTE: The following definitions require lpc43_cgu.h. It is not included /* NOTE: The following definitions require lpc43_cgu.h. It is not included
* here because the including C file may not have that file in its include * here because the including C file may not have that file in its include
@@ -157,7 +157,7 @@
#define BOARD_IDIVA_CLKSRC IDIVA_CLKSEL_PLL1 #define BOARD_IDIVA_CLKSRC IDIVA_CLKSEL_PLL1
#define BOARD_IDIVA_FREQUENCY (BOARD_FCLKOUT_FREQUENCY/BOARD_IDIVA_DIVIDER) #define BOARD_IDIVA_FREQUENCY (BOARD_FCLKOUT_FREQUENCY/BOARD_IDIVA_DIVIDER)
/* USB0 ********************************************************************/ /* USB0 *********************************************************************/
/* Settings needed in lpc43_cpu.c */ /* Settings needed in lpc43_cpu.c */
@@ -165,7 +165,7 @@
#define BOARD_USB0_MDIV 0x06167ffa /* Table 149 datsheet, valid for 12Mhz Fclkin */ #define BOARD_USB0_MDIV 0x06167ffa /* Table 149 datsheet, valid for 12Mhz Fclkin */
#define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */ #define BOARD_USB0_NP_DIV 0x00302062 /* Table 149 datsheet, valid for 12Mhz Fclkin */
/* SPIFI clocking **********************************************************/ /* SPIFI clocking ***********************************************************/
/* The SPIFI will receive clocking from a divider per the settings provided /* The SPIFI will receive clocking from a divider per the settings provided
* in this file. The NuttX code will configure PLL1 as the input clock * in this file. The NuttX code will configure PLL1 as the input clock
@@ -218,7 +218,7 @@
# define SPIFI_DEVICE_REQUENCY_DIVIDER 2 /* PLL1 clock divider */ # define SPIFI_DEVICE_REQUENCY_DIVIDER 2 /* PLL1 clock divider */
#endif #endif
/* UART clocking ***********************************************************/ /* UART clocking ************************************************************/
/* Configure all U[S]ARTs to use the XTAL input frequency */ /* Configure all U[S]ARTs to use the XTAL input frequency */
@@ -250,7 +250,7 @@
#define BOARD_SSP1_CLKSRC BASE_SSP1_CLKSEL_IDIVA #define BOARD_SSP1_CLKSRC BASE_SSP1_CLKSEL_IDIVA
#define BOARD_SSP1_BASEFREQ BOARD_IDIVA_FREQUENCY #define BOARD_SSP1_BASEFREQ BOARD_IDIVA_FREQUENCY
/* LED definitions *********************************************************/ /* Clocking *****************************************************************/
/* LED1 K2 GPIO0[8] /* LED1 K2 GPIO0[8]
* *
@@ -274,6 +274,7 @@
* void board_userled(int led, bool ledon); * void board_userled(int led, bool ledon);
* void board_userled_all(uint32_t ledset); * void board_userled_all(uint32_t ledset);
*/ */
/* LED */ /* LED */
#define LED_STARTED 0 /* OFF */ #define LED_STARTED 0 /* OFF */
#define LED_HEAPALLOCATE 0 /* OFF */ #define LED_HEAPALLOCATE 0 /* OFF */
@@ -46,7 +46,7 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* Clocking ****************************************************************/ /* Clocking *****************************************************************/
#undef BOARD_180MHz #undef BOARD_180MHz
#define BOARD_220MHz 1 #define BOARD_220MHz 1
@@ -248,7 +248,7 @@
#define BOARD_CLKDIV_SDWIDEXFR BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 25000000) #define BOARD_CLKDIV_SDWIDEXFR BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 25000000)
#define BOARD_CLKDIV_SDXFR BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 25000000) #define BOARD_CLKDIV_SDXFR BOARD_SDMMC_CEIL(BOARD_SDMMC_FREQUENCY, 25000000)
/* LED definitions *********************************************************/ /* Clocking *****************************************************************/
/* The LPCXpress-LPC54628 has three user LEDs: D9, D11, and D12. These /* The LPCXpress-LPC54628 has three user LEDs: D9, D11, and D12. These
* LEDs are for application use. They are illuminated when the driving * LEDs are for application use. They are illuminated when the driving
@@ -280,6 +280,7 @@
* include/board.h and src/lpc54_autoleds.c. The LEDs are used to encode * include/board.h and src/lpc54_autoleds.c. The LEDs are used to encode
* OS-related events as follows: * OS-related events as follows:
*/ */
/* D9 D11 D12 */ /* D9 D11 D12 */
#define LED_STARTED 0 /* OFF OFF OFF */ #define LED_STARTED 0 /* OFF OFF OFF */
#define LED_HEAPALLOCATE 1 /* ON OFF OFF */ #define LED_HEAPALLOCATE 1 /* ON OFF OFF */
@@ -327,8 +328,8 @@
/* Flexcomm0/USART0 /* Flexcomm0/USART0
* *
* USART0 connects to the serial bridge on LPC4322JET100 and is typically used * USART0 connects to the serial bridge on LPC4322JET100 and is typically
* for the serial console. * used for the serial console.
* *
* BRIDGE_UART_RXD -> P0_29-ISP_FC0_RXD -> P0.29 GPIO_FC0_RXD_SDA_MOSI_2 * BRIDGE_UART_RXD -> P0_29-ISP_FC0_RXD -> P0.29 GPIO_FC0_RXD_SDA_MOSI_2
* BRIDGE_UART_TXD <- P0_30-ISP_FC0_TXD <- P0.30 GPIO_FC0_TXD_SCL_MISO_2 * BRIDGE_UART_TXD <- P0_30-ISP_FC0_TXD <- P0.30 GPIO_FC0_TXD_SCL_MISO_2
@@ -51,11 +51,11 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* Clocking ****************************************************************/ /* Clocking *****************************************************************/
#define BOARD_SYSTICK_CLOCK (64000000) #define BOARD_SYSTICK_CLOCK (64000000)
/* LED definitions *********************************************************/ /* Clocking *****************************************************************/
/* A low output illuminates the LED. /* A low output illuminates the LED.
* *
+2 -2
View File
@@ -51,11 +51,11 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* Clocking ****************************************************************/ /* Clocking *****************************************************************/
#define BOARD_SYSTICK_CLOCK (64000000) #define BOARD_SYSTICK_CLOCK (64000000)
/* LED definitions *********************************************************/ /* LED definitions **********************************************************/
/* A low output illuminates the LED. /* A low output illuminates the LED.
* *
+2 -2
View File
@@ -51,11 +51,11 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* Clocking ****************************************************************/ /* Clocking *****************************************************************/
#define BOARD_SYSTICK_CLOCK (64000000) #define BOARD_SYSTICK_CLOCK (64000000)
/* LED definitions *********************************************************/ /* LED definitions **********************************************************/
/* A low output illuminates the LED. /* A low output illuminates the LED.
* *
@@ -51,11 +51,11 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* Clocking ****************************************************************/ /* Clocking *****************************************************************/
#define BOARD_SYSTICK_CLOCK (64000000) #define BOARD_SYSTICK_CLOCK (64000000)
/* LED definitions *********************************************************/ /* LED definitions **********************************************************/
/* A low output illuminates the LED. /* A low output illuminates the LED.
* *
@@ -32,6 +32,7 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
****************************************************************************/ ****************************************************************************/
/* There are three LEDs on board the SAM4L Xplained Pro board: The EDBG /* There are three LEDs on board the SAM4L Xplained Pro board: The EDBG
* controls two of the LEDs, a power LED and a status LED. There is only * controls two of the LEDs, a power LED and a status LED. There is only
* one user controllable LED, a yellow LED labeled LED0 near the SAM4L USB * one user controllable LED, a yellow LED labeled LED0 near the SAM4L USB
@@ -106,8 +107,8 @@ void board_userled(int led, bool ledon)
* *
* Description: * Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board * If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is * LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled_all()
* available to control the LED0 from user application logic. NOTE: since * 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. * there is only a single LED on-board, this is function is not very useful.
* *
****************************************************************************/ ****************************************************************************/
@@ -86,7 +86,8 @@ void board_userled(int led, bool ledon)
void board_userled_all(uint32_t ledset) void board_userled_all(uint32_t ledset)
{ {
sam_gpiowrite(GPIO_D301, (ledset & BOARD_D301_BIT) ? LED_D301_ON : LED_D301_OFF); sam_gpiowrite(GPIO_D301,
(ledset & BOARD_D301_BIT) ? LED_D301_ON : LED_D301_OFF);
} }
#endif /* !CONFIG_ARCH_LEDS */ #endif /* !CONFIG_ARCH_LEDS */
@@ -32,6 +32,7 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
****************************************************************************/ ****************************************************************************/
/* There are two LEDs on the SAMA5D3 series-CM board that can be controlled /* There are two LEDs on the SAMA5D3 series-CM board that can be controlled
* by software. A blue LED is controlled via PIO pins. A red LED normally * by software. A blue LED is controlled via PIO pins. A red LED normally
* provides an indication that power is supplied to the board but can also * provides an indication that power is supplied to the board but can also
@@ -32,6 +32,7 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
****************************************************************************/ ****************************************************************************/
/* There are two LEDs on the SAMA5D3 series-CM board that can be controlled /* There are two LEDs on the SAMA5D3 series-CM board that can be controlled
* by software. A blue LED is controlled via PIO pins. A red LED normally * by software. A blue LED is controlled via PIO pins. A red LED normally
* provides an indication that power is supplied to the board but can also * provides an indication that power is supplied to the board but can also
@@ -35,13 +35,13 @@
/* There are 3 LEDs on the SAMA5D4-EK: /* There are 3 LEDs on the SAMA5D4-EK:
* *
* ------------------------------ ------------------- ----------------------- * -------------------------- ------------------- -----------------------
* SAMA5D4 PIO SIGNAL USAGE * SAMA5D4 PIO SIGNAL USAGE
* ------------------------------ ------------------- ----------------------- * -------------------------- ------------------- -----------------------
* PE28/NWAIT/RTS4/A19 1Wire_PE28 1-WIRE ROM, LCD, D8 (green) * PE28/NWAIT/RTS4/A19 1Wire_PE28 1-WIRE ROM, LCD, D8 (green)
* PE8/A8/TCLK3/PWML3 LED_USER_PE8 LED_USER (D10) * PE8/A8/TCLK3/PWML3 LED_USER_PE8 LED_USER (D10)
* PE9/A9/TIOA2 LED_POWER_PE9 LED_POWER (D9, Red) * PE9/A9/TIOA2 LED_POWER_PE9 LED_POWER (D9, Red)
* ------------------------------ ------------------- ----------------------- * -------------------------- ------------------- -----------------------
* *
* - D8: D8 is shared with other functions and cannot be used if the * - D8: D8 is shared with other functions and cannot be used if the
* 1-Wire ROM is used. * 1-Wire ROM is used.
@@ -35,8 +35,8 @@
/* There is a LED on board the Arduino M0. /* There is a LED on board the Arduino M0.
* *
* This LED is controlled by PA17 and the LED can be activated by driving PA17 * This LED is controlled by PA17 and the LED can be activated by driving
* to High. * PA17 to High.
* *
* When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will * When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will
* control the LED. Otherwise, the LED can be controlled from user * control the LED. Otherwise, the LED can be controlled from user
@@ -107,7 +107,7 @@ void board_userled(int led, bool ledon)
* LEDs. * LEDs.
* If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is * If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is
* available to control the LED from user application logic. NOTE: since * 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. * there is only a single LED on-board, this is function isn't very useful.
* *
****************************************************************************/ ****************************************************************************/
@@ -38,8 +38,8 @@
* one user controllable LED, a yellow LED labeled STATUS near the SAMD20 USB * one user controllable LED, a yellow LED labeled STATUS near the SAMD20 USB
* connector. * connector.
* *
* This LED is controlled by PA14 and the LED can be activated by driving PA14 * This LED is controlled by PA14 and the LED can be activated by driving
* to GND. * PA14 to GND.
* *
* When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will * When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will
* control the LED. Otherwise, the LED can be controlled from user * control the LED. Otherwise, the LED can be controlled from user
@@ -35,11 +35,11 @@
/* There are three LEDs on board the SAMD21 Xplained Pro board: The EDBG /* There are three LEDs on board the SAMD21 Xplained Pro board: The EDBG
* controls two of the LEDs, a power LED and a status LED. There is only * controls two of the LEDs, a power LED and a status LED. There is only
* one user controllable LED, a yellow LED labelled STATUS near the SAMD21 USB * one user controllable LED, a yellow LED labelled STATUS near the SAMD21
* connector. * USB connector.
* *
* This LED is controlled by PB30 and the LED can be activated by driving PB30 * This LED is controlled by PB30 and the LED can be activated by driving
* to GND. * PB30 to GND.
* *
* When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will * When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will
* control the LED. Otherwise, the LED can be controlled from user * control the LED. Otherwise, the LED can be controlled from user
@@ -110,7 +110,7 @@ void board_userled(int led, bool ledon)
* LEDs. * LEDs.
* If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is * If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is
* available to control the LED from user application logic. NOTE: since * 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. * there is only a single LED on-board, this is function isn't very useful.
* *
****************************************************************************/ ****************************************************************************/
@@ -32,13 +32,14 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
****************************************************************************/ ****************************************************************************/
/* There are three LEDs on board the SAML21 Xplained Pro board: The EDBG /* There are three LEDs on board the SAML21 Xplained Pro board: The EDBG
* controls two of the LEDs, a power LED and a status LED. There is only * controls two of the LEDs, a power LED and a status LED. There is only
* one user controllable LED, a yellow LED labeled STATUS near the SAML21 USB * one user controllable LED, a yellow LED labeled STATUS near the SAML21 USB
* connector. * connector.
* *
* This LED is controlled by PB10 and the LED can be activated by driving PB10 * This LED is controlled by PB10 and the LED can be activated by driving
* to GND. * PB10 to GND.
* *
* When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will * When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will
* control the LED. * control the LED.
@@ -110,7 +111,7 @@ void board_userled(int led, bool ledon)
* LEDs. * LEDs.
* If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is * If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is
* available to control the LED from user application logic. NOTE: since * 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. * there is only a single LED on-board, this is function isn't very useful.
* *
****************************************************************************/ ****************************************************************************/
@@ -33,7 +33,8 @@
* *
****************************************************************************/ ****************************************************************************/
/* The SAME54 Xplained Pro has three LEDs, but only one is controllable by software: /* The SAME54 Xplained Pro has three LEDs, but only one is controllable by
* software:
* *
* 1. LED0 near the edge of the board * 1. LED0 near the edge of the board
* *
@@ -48,6 +48,10 @@
#ifndef CONFIG_ARCH_LEDS #ifndef CONFIG_ARCH_LEDS
/****************************************************************************
* Public Functions
****************************************************************************/
/**************************************************************************** /****************************************************************************
* Name: board_userled_initialize * Name: board_userled_initialize
****************************************************************************/ ****************************************************************************/
@@ -57,6 +57,7 @@
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* This array maps an LED number to GPIO pin configuration */ /* This array maps an LED number to GPIO pin configuration */
static uint32_t g_ledcfg[BOARD_NLEDS] = static uint32_t g_ledcfg[BOARD_NLEDS] =
@@ -56,6 +56,7 @@
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* This array maps an LED number to GPIO pin configuration */ /* This array maps an LED number to GPIO pin configuration */
static uint32_t g_ledcfg[BOARD_NLEDS] = static uint32_t g_ledcfg[BOARD_NLEDS] =
@@ -123,8 +123,8 @@ void board_userled(int led, bool ledon)
* *
* Description: * Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board * If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is * LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled_all()
* available to control the LED from user application logic. NOTE: since * 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. * there is only a single LED on-board, this is function is not very useful.
* *
****************************************************************************/ ****************************************************************************/
@@ -123,8 +123,8 @@ void board_userled(int led, bool ledon)
* *
* Description: * Description:
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board * If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board
* LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is * LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled_all()
* available to control the LED from user application logic. NOTE: since * 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. * there is only a single LED on-board, this is function is not very useful.
* *
****************************************************************************/ ****************************************************************************/
@@ -101,35 +101,30 @@ static void led_pm_notify(struct pm_callback_s *cb, int domain,
case(PM_NORMAL): case(PM_NORMAL):
{ {
/* Restore normal LEDs operation */ /* Restore normal LEDs operation */
} }
break; break;
case(PM_IDLE): case(PM_IDLE):
{ {
/* Entering IDLE mode - Turn leds off */ /* Entering IDLE mode - Turn leds off */
} }
break; break;
case(PM_STANDBY): case(PM_STANDBY):
{ {
/* Entering STANDBY mode - Logic for PM_STANDBY goes here */ /* Entering STANDBY mode - Logic for PM_STANDBY goes here */
} }
break; break;
case(PM_SLEEP): case(PM_SLEEP):
{ {
/* Entering SLEEP mode - Logic for PM_SLEEP goes here */ /* Entering SLEEP mode - Logic for PM_SLEEP goes here */
} }
break; break;
default: default:
{ {
/* Should not get here */ /* Should not get here */
} }
break; break;
} }
@@ -101,35 +101,30 @@ static void led_pm_notify(struct pm_callback_s *cb, int domain,
case(PM_NORMAL): case(PM_NORMAL):
{ {
/* Restore normal LEDs operation */ /* Restore normal LEDs operation */
} }
break; break;
case(PM_IDLE): case(PM_IDLE):
{ {
/* Entering IDLE mode - Turn leds off */ /* Entering IDLE mode - Turn leds off */
} }
break; break;
case(PM_STANDBY): case(PM_STANDBY):
{ {
/* Entering STANDBY mode - Logic for PM_STANDBY goes here */ /* Entering STANDBY mode - Logic for PM_STANDBY goes here */
} }
break; break;
case(PM_SLEEP): case(PM_SLEEP):
{ {
/* Entering SLEEP mode - Logic for PM_SLEEP goes here */ /* Entering SLEEP mode - Logic for PM_SLEEP goes here */
} }
break; break;
default: default:
{ {
/* Should not get here */ /* Should not get here */
} }
break; break;
} }
@@ -102,35 +102,30 @@ static void led_pm_notify(struct pm_callback_s *cb, int domain,
case(PM_NORMAL): case(PM_NORMAL):
{ {
/* Restore normal LEDs operation */ /* Restore normal LEDs operation */
} }
break; break;
case(PM_IDLE): case(PM_IDLE):
{ {
/* Entering IDLE mode - Turn leds off */ /* Entering IDLE mode - Turn leds off */
} }
break; break;
case(PM_STANDBY): case(PM_STANDBY):
{ {
/* Entering STANDBY mode - Logic for PM_STANDBY goes here */ /* Entering STANDBY mode - Logic for PM_STANDBY goes here */
} }
break; break;
case(PM_SLEEP): case(PM_SLEEP):
{ {
/* Entering SLEEP mode - Logic for PM_SLEEP goes here */ /* Entering SLEEP mode - Logic for PM_SLEEP goes here */
} }
break; break;
default: default:
{ {
/* Should not get here */ /* Should not get here */
} }
break; break;
} }
@@ -60,6 +60,7 @@
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* This array maps an LED number to GPIO pin configuration */ /* This array maps an LED number to GPIO pin configuration */
static uint32_t g_ledcfg[BOARD_NLEDS] = static uint32_t g_ledcfg[BOARD_NLEDS] =
@@ -51,6 +51,7 @@
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* This array maps an LED number to GPIO pin configuration */ /* This array maps an LED number to GPIO pin configuration */
static uint32_t g_ledcfg[BOARD_NLEDS] = static uint32_t g_ledcfg[BOARD_NLEDS] =
@@ -56,6 +56,7 @@
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* This array maps an LED number to GPIO pin configuration */ /* This array maps an LED number to GPIO pin configuration */
static uint32_t g_ledcfg[BOARD_NLEDS] = static uint32_t g_ledcfg[BOARD_NLEDS] =
@@ -51,6 +51,7 @@
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* This array maps an LED number to GPIO pin configuration */ /* This array maps an LED number to GPIO pin configuration */
static uint32_t g_ledcfg[BOARD_NLEDS] = static uint32_t g_ledcfg[BOARD_NLEDS] =
@@ -51,6 +51,7 @@
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* This array maps an LED number to GPIO pin configuration */ /* This array maps an LED number to GPIO pin configuration */
static uint32_t g_ledcfg[BOARD_NLEDS] = static uint32_t g_ledcfg[BOARD_NLEDS] =
@@ -117,35 +117,30 @@ static void led_pm_notify(struct pm_callback_s *cb, int domain,
case(PM_NORMAL): case(PM_NORMAL):
{ {
/* Restore normal LEDs operation */ /* Restore normal LEDs operation */
} }
break; break;
case(PM_IDLE): case(PM_IDLE):
{ {
/* Entering IDLE mode - Turn leds off */ /* Entering IDLE mode - Turn leds off */
} }
break; break;
case(PM_STANDBY): case(PM_STANDBY):
{ {
/* Entering STANDBY mode - Logic for PM_STANDBY goes here */ /* Entering STANDBY mode - Logic for PM_STANDBY goes here */
} }
break; break;
case(PM_SLEEP): case(PM_SLEEP):
{ {
/* Entering SLEEP mode - Logic for PM_SLEEP goes here */ /* Entering SLEEP mode - Logic for PM_SLEEP goes here */
} }
break; break;
default: default:
{ {
/* Should not get here */ /* Should not get here */
} }
break; break;
} }
@@ -56,6 +56,7 @@
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* This array maps an LED number to GPIO pin configuration */ /* This array maps an LED number to GPIO pin configuration */
static uint32_t g_ledcfg[BOARD_NLEDS] = static uint32_t g_ledcfg[BOARD_NLEDS] =
@@ -56,6 +56,7 @@
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* This array maps an LED number to GPIO pin configuration */ /* This array maps an LED number to GPIO pin configuration */
static uint32_t g_ledcfg[BOARD_NLEDS] = static uint32_t g_ledcfg[BOARD_NLEDS] =
@@ -56,6 +56,7 @@
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* This array maps an LED number to GPIO pin configuration */ /* This array maps an LED number to GPIO pin configuration */
static uint32_t g_ledcfg[BOARD_NLEDS] = static uint32_t g_ledcfg[BOARD_NLEDS] =
@@ -1,4 +1,4 @@
/***************************************************************************** /****************************************************************************
* boards/arm/stm32/stm32butterfly2/src/stm32_leds.c * boards/arm/stm32/stm32butterfly2/src/stm32_leds.c
* *
* Copyright (C) 2016 Michał Łyszczek. All rights reserved. * Copyright (C) 2016 Michał Łyszczek. All rights reserved.
@@ -32,7 +32,7 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/ ****************************************************************************/
/***************************************************************************** /****************************************************************************
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
@@ -44,7 +44,7 @@
#include "stm32_gpio.h" #include "stm32_gpio.h"
/***************************************************************************** /****************************************************************************
* Pre-processor definitions * Pre-processor definitions
****************************************************************************/ ****************************************************************************/
@@ -57,7 +57,7 @@
#define GPIO_LED4 (GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz |\ #define GPIO_LED4 (GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz |\
GPIO_OUTPUT_SET | GPIO_PORTC | GPIO_PIN5) GPIO_OUTPUT_SET | GPIO_PORTC | GPIO_PIN5)
/***************************************************************************** /****************************************************************************
* Private Types * Private Types
****************************************************************************/ ****************************************************************************/
@@ -69,11 +69,11 @@ enum led_state
LED_OFF = true LED_OFF = true
}; };
/***************************************************************************** /****************************************************************************
* Private Functions * Private Functions
****************************************************************************/ ****************************************************************************/
/***************************************************************************** /****************************************************************************
* Name: led_state * Name: led_state
* *
* Description: * Description:
@@ -103,11 +103,11 @@ static void led_state(enum led_state state, unsigned int leds)
} }
} }
/***************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
/***************************************************************************** /****************************************************************************
* Name: stm32_led_initialize * Name: stm32_led_initialize
* *
* Description: * Description:
@@ -124,14 +124,14 @@ void stm32_led_initialize(void)
#ifdef CONFIG_ARCH_LEDS #ifdef CONFIG_ARCH_LEDS
/***************************************************************************** /****************************************************************************
* Name: board_autoled_on * Name: board_autoled_on
* *
* Description: * Description:
* Drives board leds when specific RTOS state led occurs. * Drives board leds when specific RTOS state led occurs.
* *
* Input Parameters: * Input Parameters:
* led - This is actually an RTOS state not led number of anything like that * led - This is actually RTOS state not led number of anything like that
****************************************************************************/ ****************************************************************************/
void board_autoled_on(int led) void board_autoled_on(int led)
@@ -167,14 +167,14 @@ void board_autoled_on(int led)
} }
} }
/***************************************************************************** /****************************************************************************
* Name: board_autoled_off * Name: board_autoled_off
* *
* Description: * Description:
* Drives board leds when specific RTOS state led ends * Drives board leds when specific RTOS state led ends
* *
* Input Parameters: * Input Parameters:
* led - This is actually an RTOS state not led number of anything like that * led - This is actually RTOS state not led number of anything like that
****************************************************************************/ ****************************************************************************/
void board_autoled_off(int led) void board_autoled_off(int led)
@@ -204,14 +204,14 @@ void board_autoled_off(int led)
} }
#endif #endif
/***************************************************************************** /****************************************************************************
* Name: board_userled_initialize * Name: board_userled_initialize
* *
* Description: * Description:
* This function should initialize leds for user use, but on RTOS start we * This function should initialize leds for user use, but on RTOS start we
* initialize every led for use by RTOS and at end, when RTOS is fully * initialize every led for use by RTOS and at end, when RTOS is fully
* booted up, we give control of these specific leds for user. So that's why * booted up, we give control of these specific leds for user. So that's
* this function is empty. * why this function is empty.
****************************************************************************/ ****************************************************************************/
uint32_t board_userled_initialize(void) uint32_t board_userled_initialize(void)
@@ -221,7 +221,7 @@ uint32_t board_userled_initialize(void)
return BOARD_NLEDS; return BOARD_NLEDS;
} }
/***************************************************************************** /****************************************************************************
* Name: board_userled * Name: board_userled
* *
* Description: * Description:
@@ -247,7 +247,7 @@ void board_userled(int led, bool ledon)
led_state(ledon, ledbit); led_state(ledon, ledbit);
} }
/***************************************************************************** /****************************************************************************
* Name: board_userled_all * Name: board_userled_all
* *
* Description: * Description:
@@ -264,6 +264,6 @@ void board_userled_all(uint32_t ledset)
led_state(LED_OFF, ~(ledset | BOARD_LED4_BIT)); led_state(LED_OFF, ~(ledset | BOARD_LED4_BIT));
#else #else
led_state(LED_ON, ledset); led_state(LED_ON, ledset);
led_state(led_OFF, ~ledset); led_state(LED_OFF, ~ledset);
#endif #endif
} }
@@ -54,6 +54,7 @@
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* This array maps an LED number to GPIO pin configuration */ /* This array maps an LED number to GPIO pin configuration */
static const uint32_t g_ledcfg[BOARD_NLEDS] = static const uint32_t g_ledcfg[BOARD_NLEDS] =
@@ -54,6 +54,7 @@
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* This array maps an LED number to GPIO pin configuration */ /* This array maps an LED number to GPIO pin configuration */
static const uint32_t g_ledcfg[BOARD_NLEDS] = static const uint32_t g_ledcfg[BOARD_NLEDS] =
@@ -57,6 +57,7 @@
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* This array maps an LED number to GPIO pin configuration */ /* This array maps an LED number to GPIO pin configuration */
static uint32_t g_ledcfg[BOARD_NLEDS] = static uint32_t g_ledcfg[BOARD_NLEDS] =
@@ -77,7 +78,6 @@ static int led_pm_prepare(struct pm_callback_s *cb, int domain,
enum pm_state_e pmstate); enum pm_state_e pmstate);
#endif #endif
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
@@ -112,35 +112,30 @@ static void led_pm_notify(struct pm_callback_s *cb, int domain,
case(PM_NORMAL): case(PM_NORMAL):
{ {
/* Restore normal LEDs operation */ /* Restore normal LEDs operation */
} }
break; break;
case(PM_IDLE): case(PM_IDLE):
{ {
/* Entering IDLE mode - Turn leds off */ /* Entering IDLE mode - Turn leds off */
} }
break; break;
case(PM_STANDBY): case(PM_STANDBY):
{ {
/* Entering STANDBY mode - Logic for PM_STANDBY goes here */ /* Entering STANDBY mode - Logic for PM_STANDBY goes here */
} }
break; break;
case(PM_SLEEP): case(PM_SLEEP):
{ {
/* Entering SLEEP mode - Logic for PM_SLEEP goes here */ /* Entering SLEEP mode - Logic for PM_SLEEP goes here */
} }
break; break;
default: default:
{ {
/* Should not get here */ /* Should not get here */
} }
break; break;
} }
@@ -59,6 +59,7 @@
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
/* This array maps an LED number to GPIO pin configuration */ /* This array maps an LED number to GPIO pin configuration */
static uint32_t g_ledcfg[BOARD_NLEDS] = static uint32_t g_ledcfg[BOARD_NLEDS] =
@@ -79,7 +80,6 @@ static int led_pm_prepare(struct pm_callback_s *cb, int domain,
enum pm_state_e pmstate); enum pm_state_e pmstate);
#endif #endif
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
@@ -114,35 +114,30 @@ static void led_pm_notify(struct pm_callback_s *cb, int domain,
case(PM_NORMAL): case(PM_NORMAL):
{ {
/* Restore normal LEDs operation */ /* Restore normal LEDs operation */
} }
break; break;
case(PM_IDLE): case(PM_IDLE):
{ {
/* Entering IDLE mode - Turn leds off */ /* Entering IDLE mode - Turn leds off */
} }
break; break;
case(PM_STANDBY): case(PM_STANDBY):
{ {
/* Entering STANDBY mode - Logic for PM_STANDBY goes here */ /* Entering STANDBY mode - Logic for PM_STANDBY goes here */
} }
break; break;
case(PM_SLEEP): case(PM_SLEEP):
{ {
/* Entering SLEEP mode - Logic for PM_SLEEP goes here */ /* Entering SLEEP mode - Logic for PM_SLEEP goes here */
} }
break; break;
default: default:
{ {
/* Should not get here */ /* Should not get here */
} }
break; break;
} }
@@ -164,22 +164,22 @@ void board_autoled_on(int led)
switch (led) switch (led)
{ {
case 0: case 0:
led_offbits(BOARD_LED2_BIT | BOARD_LED3_BIT |BOARD_LED4_BIT); led_offbits(BOARD_LED2_BIT | BOARD_LED3_BIT | BOARD_LED4_BIT);
led_onbits(BOARD_LED1_BIT); led_onbits(BOARD_LED1_BIT);
break; break;
case 1: case 1:
led_offbits(BOARD_LED1_BIT | BOARD_LED3_BIT |BOARD_LED4_BIT); led_offbits(BOARD_LED1_BIT | BOARD_LED3_BIT | BOARD_LED4_BIT);
led_onbits(BOARD_LED2_BIT); led_onbits(BOARD_LED2_BIT);
break; break;
case 2: case 2:
led_offbits(BOARD_LED3_BIT |BOARD_LED4_BIT); led_offbits(BOARD_LED3_BIT | BOARD_LED4_BIT);
led_onbits(BOARD_LED1_BIT | BOARD_LED2_BIT); led_onbits(BOARD_LED1_BIT | BOARD_LED2_BIT);
break; break;
case 3: case 3:
led_offbits(BOARD_LED1_BIT | BOARD_LED2_BIT |BOARD_LED4_BIT); led_offbits(BOARD_LED1_BIT | BOARD_LED2_BIT | BOARD_LED4_BIT);
led_onbits(BOARD_LED3_BIT); led_onbits(BOARD_LED3_BIT);
break; break;
@@ -235,12 +235,12 @@ void board_autoled_off(int led)
* Description: * Description:
* These interfaces allow user control of the board LEDs. * These interfaces allow user control of the board LEDs.
* *
* If CONFIG_ARCH_LEDS is defined, then NuttX will control both on-board LEDs up * If CONFIG_ARCH_LEDS is defined, then NuttX will control both on-board
* until the completion of boot. The it will continue to control LED2; LED1 is * LEDs up until the completion of boot. The it will continue to control
* available for application use. * LED2; LED1 is available for application use.
* *
* If CONFIG_ARCH_LEDS is not defined, then both LEDs are available for application * If CONFIG_ARCH_LEDS is not defined, then both LEDs are available for
* use. * application use.
* *
****************************************************************************/ ****************************************************************************/
@@ -101,35 +101,30 @@ static void led_pm_notify(struct pm_callback_s *cb, int domain,
case(PM_NORMAL): case(PM_NORMAL):
{ {
/* Restore normal LEDs operation */ /* Restore normal LEDs operation */
} }
break; break;
case(PM_IDLE): case(PM_IDLE):
{ {
/* Entering IDLE mode - Turn leds off */ /* Entering IDLE mode - Turn leds off */
} }
break; break;
case(PM_STANDBY): case(PM_STANDBY):
{ {
/* Entering STANDBY mode - Logic for PM_STANDBY goes here */ /* Entering STANDBY mode - Logic for PM_STANDBY goes here */
} }
break; break;
case(PM_SLEEP): case(PM_SLEEP):
{ {
/* Entering SLEEP mode - Logic for PM_SLEEP goes here */ /* Entering SLEEP mode - Logic for PM_SLEEP goes here */
} }
break; break;
default: default:
{ {
/* Should not get here */ /* Should not get here */
} }
break; break;
} }

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