diff --git a/boards/arm/kl/freedom-kl25z/include/board.h b/boards/arm/kl/freedom-kl25z/include/board.h index eeeab288d1..721546d016 100644 --- a/boards/arm/kl/freedom-kl25z/include/board.h +++ b/boards/arm/kl/freedom-kl25z/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/kwikstik-k40/include/board.h +/**************************************************************************** + * boards/arm/kl/freedom-kl25z/include/board.h * include/arch/board/board.h * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -32,30 +32,31 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H +#ifndef __BOARDS_ARM_KL_FREEDOM_KL25Z_INCLUDE_BOARD_H +#define __BOARDS_ARM_KL_FREEDOM_KL25Z_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #ifndef __ASSEMBLY__ # include #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* Clocking *****************************************************************/ -/* Clocking *************************************************************************/ /* The Kwikstik-K40 has a 4MHz crystal on board */ -#undef BOARD_EXTCLOCK /* Crystal */ -#define BOARD_XTAL_FREQ 8000000 /* 8MHz crystal frequency (REFCLK) */ -#define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator */ +#undef BOARD_EXTCLOCK /* Crystal */ +#define BOARD_XTAL_FREQ 8000000 /* 8MHz crystal frequency (REFCLK) */ +#define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator */ /* PLL Configuration. * @@ -64,15 +65,16 @@ * MCGPLLCLK Frequency: MCGPLLCLK = 96MHz */ -#define BOARD_PRDIV0 2 /* PLL External Reference Divider */ -#define BOARD_VDIV0 24 /* PLL VCO Divider (frequency multiplier) */ +#define BOARD_PRDIV0 2 /* PLL External Reference Divider */ +#define BOARD_VDIV0 24 /* PLL VCO Divider (frequency multiplier) */ #define BOARD_PLLIN_FREQ (BOARD_XTAL_FREQ / BOARD_PRDIV0) #define BOARD_PLLOUT_FREQ (BOARD_PLLIN_FREQ * BOARD_VDIV0) #define BOARD_MCGPLLCLK_FREQ BOARD_PLLOUT_FREQ -/* MCGOUTCLK: MCG output of either IRC, MCGFLLCLK, MCGPLLCLK, or MCG's external - * reference clock that sources the core, system, bus, and flash clock. +/* MCGOUTCLK: MCG output of either IRC, MCGFLLCLK, MCGPLLCLK, or MCG's + * external reference clock that sources the core, system, bus, and + * flash clock. * * MCGOUTCLK = MCGPLLCLK = 96MHz */ @@ -88,20 +90,21 @@ * System clock divided by OUTDIV4, clocks the bus slaves and peripherals. */ -#define BOARD_OUTDIV1 2 /* Core/system = MCGOUTCLK / 2, 48MHz */ -#define BOARD_OUTDIV4 2 /* Bus clock = System clock / 2, 24MHz */ +#define BOARD_OUTDIV1 2 /* Core/system = MCGOUTCLK / 2, 48MHz */ +#define BOARD_OUTDIV4 2 /* Bus clock = System clock / 2, 24MHz */ #define BOARD_CORECLK_FREQ (BOARD_MCGOUTCLK_FREQ / BOARD_OUTDIV1) #define BOARD_BUSCLK_FREQ (BOARD_CORECLK_FREQ / BOARD_OUTDIV4) -/* SDHC clocking ********************************************************************/ +/* SDHC clocking ************************************************************/ -/* SDCLK configurations corresponding to various modes of operation. Formula is: +/* SDCLK configurations corresponding to various modes of operation. + * Formula is: * * SDCLK frequency = (base clock) / (prescaler * divisor) * - * The SDHC module is always configure configured so that the core clock is the base - * clock. + * The SDHC module is always configure configured so that the core clock is + * the base clock. */ /* Identification mode: 400KHz = 96MHz / ( 16 * 15) */ @@ -134,6 +137,7 @@ #endif /* PWM Configuration */ + /* TPM0 Channels */ #define GPIO_TPM0_CH0OUT PIN_TPM0_CH0_3 //PIN_TPM0_CH0_1 @@ -153,7 +157,8 @@ #define GPIO_TPM2_CH0OUT PIN_TPM2_CH0_1 #define GPIO_TPM2_CH1OUT PIN_TPM2_CH1_1 -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* The Freedom KL25Z has a single RGB LED driven by the KL25Z as follows: * * ------------- -------- @@ -163,10 +168,12 @@ * Green Cathode PTB19 * Blue Cathode PTD1 * - * NOTE: PTD1 is also connected to the I/O header on J2 pin 10 (also known as D13). + * NOTE: + * PTD1 is also connected to the I/O header on J2 pin 10 (also known as D13). * - * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the - * Freedom KL25Z. The following definitions describe how NuttX controls the LEDs: + * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board + * the Freedom KL25Z. + * The following definitions describe how NuttX controls the LEDs: * * SYMBOL Meaning LED state * Initially all LED is OFF @@ -191,15 +198,17 @@ #define LED_ASSERTION 6 #define LED_PANIC 7 -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* The Freedom KL25Z board has no standard GPIO contact buttons */ -/* Alternative pin resolution *******************************************************/ -/* If there are alternative configurations for various pins in the k25z128_pinmux.h - * header file, those alternative pins will be labeled with a suffix like _1, _2, - * etc. The logic in this file must select the correct pin configuration for the - * board by defining a pin configuration (with no suffix) that maps to the correct - * alternative. +/* Alternative pin resolution ***********************************************/ + +/* If there are alternative configurations for various pins in the + * k25z128_pinmux.h header file, those alternative pins will be labeled with + * a suffix like _1, _2, etc. The logic in this file must select the correct + * pin configuration for the board by defining a pin configuration + * (with no suffix) that maps to the correct alternative. */ /* SPI0 Pinout @@ -227,33 +236,35 @@ #define GPIO_ADXL345_INT1 (GPIO_INPUT | PIN_PORTA | PIN_INT_RISING | PIN16) #define GPIO_ADXL345_CS (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTD | PIN0) -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kl_tsi_initialize * * Description: - * Initialize the TSI hardware and interface for the sliders on board the Freedom - * KL25Z board. Register a character driver at /dev/tsi that may be used to read - * from each sensor. + * Initialize the TSI hardware and interface for the sliders on board the + * Freedom KL25Z board. + * Register a character driver at /dev/tsi that may be used to read from + * each sensor. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_KL_TSI void kl_tsi_initialize(void); @@ -265,4 +276,4 @@ void kl_tsi_initialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __BOARDS_ARM_KL_FREEDOM_KL25Z_INCLUDE_BOARD_H */ diff --git a/boards/arm/kl/freedom-kl25z/scripts/Make.defs b/boards/arm/kl/freedom-kl25z/scripts/Make.defs index 0132a90c95..fde82e09b9 100644 --- a/boards/arm/kl/freedom-kl25z/scripts/Make.defs +++ b/boards/arm/kl/freedom-kl25z/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/freedom-kl25z/scripts/Make.defs +# boards/arm/kl/freedom-kl25z/scripts/Make.defs # # Copyright (C) 2013m, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kl/freedom-kl25z/scripts/freedom-kl25z.ld b/boards/arm/kl/freedom-kl25z/scripts/freedom-kl25z.ld index 5e51861c0d..472d52cf99 100644 --- a/boards/arm/kl/freedom-kl25z/scripts/freedom-kl25z.ld +++ b/boards/arm/kl/freedom-kl25z/scripts/freedom-kl25z.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/kwikstik-k40/scripts/freedom-kl25z.ld + * boards/arm/kl/freedom-kl25z/scripts/freedom-kl25z.ld * * Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kl/freedom-kl25z/src/Makefile b/boards/arm/kl/freedom-kl25z/src/Makefile index 8729796164..a3627cfcbb 100644 --- a/boards/arm/kl/freedom-kl25z/src/Makefile +++ b/boards/arm/kl/freedom-kl25z/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/freedom-kl25z/src/Makefile +# boards/arm/kl/freedom-kl25z/src/Makefile # # Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kl/freedom-kl25z/src/freedom-kl25z.h b/boards/arm/kl/freedom-kl25z/src/freedom-kl25z.h index 4a759b4c13..7af0216060 100644 --- a/boards/arm/kl/freedom-kl25z/src/freedom-kl25z.h +++ b/boards/arm/kl/freedom-kl25z/src/freedom-kl25z.h @@ -1,5 +1,5 @@ -/**************************************************************************************************** - * boards/freedom-kl25z/src/freedom-kl25z.h +/**************************************************************************** + * boards/arm/kl/freedom-kl25z/src/freedom-kl25z.h * * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,25 +31,27 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ****************************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_FREEDOM_KL25Z_SRC_FREEDOM_KL25Z_H -#define __BOARDS_ARM_FREEDOM_KL25Z_SRC_FREEDOM_KL25Z_H +#ifndef __BOARDS_ARM_KL_FREEDOM_KL25Z_SRC_FREEDOM_KL25Z_H +#define __BOARDS_ARM_KL_FREEDOM_KL25Z_SRC_FREEDOM_KL25Z_H -/**************************************************************************************************** +/**************************************************************************** * Included Files - ****************************************************************************************************/ + ****************************************************************************/ #include #include #include -/**************************************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ****************************************************************************************************/ -/* Configuration ************************************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ + +/* Freedom KL25Z GPIOs ******************************************************/ -/* Freedom KL25Z GPIOs ******************************************************************************/ /* The Freedom KL25Z has a single RGB LED driven by the KL25Z as follows: * * ------------- -------- @@ -59,10 +61,12 @@ * Green Cathode PTB19 * Blue Cathode PTD1 * - * NOTE: PTD1 is also connected to the I/O header on J2 pin 10 (also known as D13). + * NOTE: + * PTD1 is also connected to the I/O header on J2 pin 10 (also known as D13). * - * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the - * Freedom KL25Z. The following definitions describe how NuttX controls the LEDs: + * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board + * the Freedom KL25Z. + * The following definitions describe how NuttX controls the LEDs: * * SYMBOL Meaning LED state * Initially all LED is OFF @@ -82,72 +86,73 @@ #define GPIO_LED_G (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTB | PIN19) #define GPIO_LED_B (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTD | PIN1) -/* Button definitions *******************************************************************************/ +/* Button definitions *******************************************************/ + /* The Freedom KL25Z has no buttons */ -/* Chip selects ************************************************************************************/ +/* Chip selects *************************************************************/ -/**************************************************************************************************** +/**************************************************************************** * Public Types - ****************************************************************************************************/ + ****************************************************************************/ -/**************************************************************************************************** +/**************************************************************************** * Public data - ****************************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/**************************************************************************************************** +/**************************************************************************** * Public Functions - ****************************************************************************************************/ + ****************************************************************************/ -/**************************************************************************************************** +/**************************************************************************** * Name: kl_spidev_initialize * * Description: - * Called to configure SPI chip select GPIO pins for the Freedom KL25Z board. + * Called to configure SPI chip select GPIO pins for the Freedom KL25Z + * board. * - ****************************************************************************************************/ + ****************************************************************************/ void weak_function kl_spidev_initialize(void); -/**************************************************************************************************** +/**************************************************************************** * Name: kl_usbinitialize * * Description: - * Called from kl_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the Freedom KL25Z board. + * Called from kl_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the Freedom KL25Z board. * - ****************************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_USB void weak_function kl_usbinitialize(void); #endif -/**************************************************************************************************** +/**************************************************************************** * Name: kl_led_initialize * * Description: * Initialize the on-board LED * - ****************************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ARCH_LEDS void kl_led_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: kl_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PWM int kl_pwm_setup(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_FREEDOM_KL25Z_SRC_FREEDOM_KL25Z_H */ - +#endif /* __BOARDS_ARM_KL_FREEDOM_KL25Z_SRC_FREEDOM_KL25Z_H */ diff --git a/boards/arm/kl/freedom-kl25z/src/kl_adxl345.c b/boards/arm/kl/freedom-kl25z/src/kl_adxl345.c index 46557c35c5..437864208c 100644 --- a/boards/arm/kl/freedom-kl25z/src/kl_adxl345.c +++ b/boards/arm/kl/freedom-kl25z/src/kl_adxl345.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-kl25z/src/kl_adxl345.c +/**************************************************************************** + * boards/arm/kl/freedom-kl25z/src/kl_adxl345.c * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Included Files @@ -55,6 +55,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifdef CONFIG_SENSORS_ADXL345 @@ -153,6 +154,7 @@ static struct kl_adxl345config_s g_adxl345config = /**************************************************************************** * Private Functions ****************************************************************************/ + /* This is the ADXL345 Interrupt handler */ int adxl345_interrupt(int irq, FAR void *context) @@ -181,7 +183,8 @@ int adxl345_interrupt(int irq, FAR void *context) static int adxl345_attach(FAR struct adxl345_config_s *state, adxl345_handler_t handler, FAR void *arg) { - FAR struct kl_adxl345config_s *priv = (FAR struct kl_adxl345config_s *)state; + FAR struct kl_adxl345config_s *priv = + (FAR struct kl_adxl345config_s *)state; sninfo("Saving handler %p\n", handler); DEBUGASSERT(priv); @@ -197,7 +200,8 @@ static int adxl345_attach(FAR struct adxl345_config_s *state, static void adxl345_enable(FAR struct adxl345_config_s *state, bool enable) { - FAR struct kl_adxl345config_s *priv = (FAR struct kl_adxl345config_s *)state; + FAR struct kl_adxl345config_s *priv = + (FAR struct kl_adxl345config_s *)state; irqstate_t flags; /* Attach and enable, or detach and disable. Enabling and disabling GPIO @@ -275,7 +279,8 @@ int adxl345_archinitialize(int minor) dev = kl_spibus_initialize(CONFIG_ADXL345_SPIDEV); if (!dev) { - snerr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_ADXL345_SPIDEV); + snerr("ERROR: Failed to initialize SPI bus %d\n", + CONFIG_ADXL345_SPIDEV); return -ENODEV; } diff --git a/boards/arm/kl/freedom-kl25z/src/kl_appinit.c b/boards/arm/kl/freedom-kl25z/src/kl_appinit.c index 5686f6e014..bd2a4e3316 100644 --- a/boards/arm/kl/freedom-kl25z/src/kl_appinit.c +++ b/boards/arm/kl/freedom-kl25z/src/kl_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/stm32f4discovery/src/kl_appinit.c + * boards/arm/kl/freedom-kl25z/src/kl_appinit.c * * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kl/freedom-kl25z/src/kl_boardinitialize.c b/boards/arm/kl/freedom-kl25z/src/kl_boardinitialize.c index 5bc4d154d6..54124b5695 100644 --- a/boards/arm/kl/freedom-kl25z/src/kl_boardinitialize.c +++ b/boards/arm/kl/freedom-kl25z/src/kl_boardinitialize.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-kl25z/src/kl_boardinitialize.c +/**************************************************************************** + * boards/arm/kl/freedom-kl25z/src/kl_boardinitialize.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -47,32 +47,33 @@ #include "up_arch.h" #include "freedom-kl25z.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kl_boardinitialize * * Description: - * All K25Z architectures must provide the following entry point. This entry point - * is called early in the initialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All K25Z architectures must provide the following entry point. + * This entry point is called early in the initialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void kl_boardinitialize(void) { - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * kl_spidev_initialize() has been brought into the link. + /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak + * function kl_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_KL_SPI0) || defined(CONFIG_KL_SPI1) @@ -126,6 +127,5 @@ void board_late_initialize(void) #if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL) (void)board_app_initialize(0); #endif - } #endif diff --git a/boards/arm/kl/freedom-kl25z/src/kl_led.c b/boards/arm/kl/freedom-kl25z/src/kl_led.c index e4bda8f7e7..5b564b488d 100644 --- a/boards/arm/kl/freedom-kl25z/src/kl_led.c +++ b/boards/arm/kl/freedom-kl25z/src/kl_led.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-kl25z/src/kl_led.c + * boards/arm/kl/freedom-kl25z/src/kl_led.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -32,6 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ + /* The Freedom KL25Z has a single RGB LED driven by the KL25Z as follows: * * ------------- -------- @@ -41,8 +42,9 @@ * Green Cathode PTB19 * Blue Cathode PTD1 * - * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the - * Freedom KL25Z. The following definitions describe how NuttX controls the LEDs: + * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board + * the Freedom KL25Z. + * The following definitions describe how NuttX controls the LEDs: * * SYMBOL Meaning LED state * Initially all LED is OFF diff --git a/boards/arm/kl/freedom-kl25z/src/kl_pwm.c b/boards/arm/kl/freedom-kl25z/src/kl_pwm.c index 2d2ebbf93f..b3904e5cbb 100644 --- a/boards/arm/kl/freedom-kl25z/src/kl_pwm.c +++ b/boards/arm/kl/freedom-kl25z/src/kl_pwm.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-kl25z/src/kl_pwm.c +/**************************************************************************** + * boards/arm/kl/freedom-kl25z/src/kl_pwm.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -32,11 +32,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -53,10 +53,12 @@ #include "up_arch.h" #include "kl_pwm.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration *******************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ + /* PWM * * The Kinetis Freedom board provides a LED on GPIO. @@ -66,21 +68,21 @@ extern struct pwm_lowerhalf_s *kl_pwminitialize(int timer); -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kl_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ int kl_pwm_setup(void) { diff --git a/boards/arm/kl/freedom-kl25z/src/kl_spi.c b/boards/arm/kl/freedom-kl25z/src/kl_spi.c index 4d41878514..155b6e11bd 100644 --- a/boards/arm/kl/freedom-kl25z/src/kl_spi.c +++ b/boards/arm/kl/freedom-kl25z/src/kl_spi.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-kl25z/src/kl_spi.c + * boards/arm/kl/freedom-kl25z/src/kl_spi.c * * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -101,12 +101,13 @@ void weak_function kl_spidev_initialize(void) * the way your board is configured. * 3. Add a call to kl_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by kl_spibus_initialize() may then be used to bind - * the SPI driver to higher level logic (e.g., calling + * 4. The handle returned by kl_spibus_initialize() may then be used to + * bind the SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). * ****************************************************************************/ + /**************************************************************************** * Name: kl_spi[n]select * diff --git a/boards/arm/kl/freedom-kl25z/src/kl_tsi.c b/boards/arm/kl/freedom-kl25z/src/kl_tsi.c index 9d2b7f813b..a97ae8279b 100644 --- a/boards/arm/kl/freedom-kl25z/src/kl_tsi.c +++ b/boards/arm/kl/freedom-kl25z/src/kl_tsi.c @@ -1,13 +1,14 @@ /**************************************************************************** - * boards/freedom-kl25z/src/kl_tsi.c + * boards/arm/kl/freedom-kl25z/src/kl_tsi.c * * Copyright (C) 2013 Alan Carvalho de Assis * Author: Alan Carvalho de Assis * with adaptions from Gregory Nutt * - * Reference: https://community.freescale.com/community/ - * the-embedded-beat/blog/2012/10/15/ - * using-the-touch-interface-on-the-freescale-freedom-development-platform + * Reference: + * https://community.freescale.com/community/ + * the-embedded-beat/blog/2012/10/15/ + * using-the-touch-interface-on-the-freescale-freedom-development-platform * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -75,7 +76,8 @@ ****************************************************************************/ static void tsi_calibrate(void); -static ssize_t tsi_read(FAR struct file *filep, FAR char *buffer, size_t buflen); +static ssize_t tsi_read(FAR struct file *filep, + FAR char *buffer, size_t buflen); /**************************************************************************** * Private Data @@ -135,7 +137,7 @@ static void tsi_calibrate(void) while (!(getreg32(KL_TSI_GENCS) & TSI_GENCS_EOSF)); g_defcap[i] = getreg32(KL_TSI_DATA) & TSI_DATA_TSICNT_MASK; - iinfo("Sensor %d = %d\n", i+1, g_defcap[i]); + iinfo("Sensor %d = %d\n", i + 1, g_defcap[i]); } } @@ -171,7 +173,7 @@ static ssize_t tsi_read(FAR struct file *filep, FAR char *buf, size_t buflen) regval |= TSI_DATA_SWTS; putreg32(regval, KL_TSI_DATA); - /* Wait until the conversion is done*/ + /* Wait until the conversion is done */ while (!(getreg32(KL_TSI_GENCS) & TSI_GENCS_EOSF)); diff --git a/boards/arm/kl/freedom-kl26z/include/board.h b/boards/arm/kl/freedom-kl26z/include/board.h index 135f1181fe..5b04c052e7 100644 --- a/boards/arm/kl/freedom-kl26z/include/board.h +++ b/boards/arm/kl/freedom-kl26z/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-kl26z/include/board.h +/**************************************************************************** + * boards/arm/kl/freedom-kl26z/include/board.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,25 +31,26 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_FREEDOME_KL26Z_BOARD_H -#define __BOARDS_ARM_FREEDOME_KL26Z_BOARD_H +#ifndef __BOARDS_ARM_KL_FREEDOM_KL26Z_INCLUDE_BOARD_H +#define __BOARDS_ARM_KL_FREEDOM_KL26Z_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #ifndef __ASSEMBLY__ # include #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* Clocking *****************************************************************/ -/* Clocking *************************************************************************/ /* The KL26Z has an 8MHz crystal on board */ #undef BOARD_EXTCLOCK /* Crystal */ @@ -63,14 +64,15 @@ * MCGPLLCLK Frequency: MCGPLLCLK = 96MHz */ -#define BOARD_PRDIV0 2 /* PLL External Reference Divider */ -#define BOARD_VDIV0 24 /* PLL VCO Divider (frequency multiplier) */ +#define BOARD_PRDIV0 2 /* PLL External Reference Divider */ +#define BOARD_VDIV0 24 /* PLL VCO Divider (frequency multiplier) */ #define BOARD_PLLIN_FREQ (BOARD_XTAL_FREQ / BOARD_PRDIV0) #define BOARD_PLLOUT_FREQ (BOARD_PLLIN_FREQ * BOARD_VDIV0) #define BOARD_MCGPLLCLK_FREQ BOARD_PLLOUT_FREQ -/* MCGOUTCLK: MCG output of either IRC, MCGFLLCLK, MCGPLLCLK, or MCG's external +/* MCGOUTCLK: + * MCG output of either IRC, MCGFLLCLK, MCGPLLCLK, or MCG's external * reference clock that sources the core, system, bus, and flash clock. * * MCGOUTCLK = MCGPLLCLK = 96MHz @@ -87,20 +89,21 @@ * System clock divided by OUTDIV4, clocks the bus slaves and peripherals. */ -#define BOARD_OUTDIV1 2 /* Core/system = MCGOUTCLK / 2, 48MHz */ -#define BOARD_OUTDIV4 2 /* Bus clock = System clock / 2, 24MHz */ +#define BOARD_OUTDIV1 2 /* Core/system = MCGOUTCLK / 2, 48MHz */ +#define BOARD_OUTDIV4 2 /* Bus clock = System clock / 2, 24MHz */ #define BOARD_CORECLK_FREQ (BOARD_MCGOUTCLK_FREQ / BOARD_OUTDIV1) #define BOARD_BUSCLK_FREQ (BOARD_CORECLK_FREQ / BOARD_OUTDIV4) -/* SDHC clocking ********************************************************************/ +/* SDHC clocking ************************************************************/ -/* SDCLK configurations corresponding to various modes of operation. Formula is: +/* SDCLK configurations corresponding to various modes of operation. + * Formula is: * * SDCLK frequency = (base clock) / (prescaler * divisor) * - * The SDHC module is always configure configured so that the core clock is the base - * clock. + * The SDHC module is always configure configured so that the core clock is + * the base clock. */ /* Identification mode: 400KHz = 96MHz / ( 16 * 15) */ @@ -133,6 +136,7 @@ #endif /* PWM Configuration */ + /* TPM0 Channels */ #define GPIO_TPM0_CH0OUT PIN_TPM0_CH0_3 //PIN_TPM0_CH0_1 @@ -152,7 +156,8 @@ #define GPIO_TPM2_CH0OUT PIN_TPM2_CH0_1 #define GPIO_TPM2_CH1OUT PIN_TPM2_CH1_1 -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* The Freedom KL26Z has a single RGB LED driven by the KL26Z as follows: * * ------------- -------- @@ -162,10 +167,12 @@ * Green Cathode PTE31 * Blue Cathode PTD5 * - * NOTE: PTD5 is also connected to the I/O header on J2 pin 12 (also known as D13). + * NOTE: + * PTD5 is also connected to the I/O header on J2 pin 12 (also known as D13). * - * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the - * Freedom KL26Z. The following definitions describe how NuttX controls the LEDs: + * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board + * the Freedom KL26Z. + * The following definitions describe how NuttX controls the LEDs: * * SYMBOL Meaning LED state * Initially all LED is OFF @@ -190,15 +197,18 @@ #define LED_ASSERTION 6 #define LED_PANIC 7 -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* The Freedom KL26Z board has no standard GPIO contact buttons */ -/* Alternative pin resolution *******************************************************/ -/* If there are alternative configurations for various pins in the k26z128_pinmux.h - * header file, those alternative pins will be labeled with a suffix like _1, _2, - * etc. The logic in this file must select the correct pin configuration for the - * board by defining a pin configuration (with no suffix) that maps to the correct - * alternative. +/* Alternative pin resolution ***********************************************/ + +/* If there are alternative configurations for various pins in the + * k26z128_pinmux.h header file, those alternative pins will be labeled with + * a suffix like _1, _2, etc. + * The logic in this file must select the correct pin configuration for the + * board by defining a pin configuration (with no suffix) that maps to the + * correct alternative. */ /* SPI0 Pinout @@ -217,9 +227,9 @@ #define PIN_SPI1_MISO (PIN_SPI1_MISO_3 | PIN_ALT2_PULLUP) #define PIN_SPI1_MOSI (PIN_SPI0_MOSI_7 | PIN_ALT2_PULLUP) -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ @@ -232,19 +242,19 @@ extern "C" #define EXTERN extern #endif -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kl_tsi_initialize * * Description: - * Initialize the TSI hardware and interface for the sliders on board the Freedom - * KL26Z board. Register a character driver at /dev/tsi that may be used to read - * from each sensor. + * Initialize the TSI hardware and interface for the sliders on board the + * Freedom KL26Z board. Register a character driver at /dev/tsi that may + * be used to read from each sensor. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_KL_TSI void kl_tsi_initialize(void); @@ -256,4 +266,4 @@ void kl_tsi_initialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_FREEDOME_KL26Z_BOARD_H */ +#endif /* __BOARDS_ARM_KL_FREEDOM_KL26Z_INCLUDE_BOARD_H */ diff --git a/boards/arm/kl/freedom-kl26z/scripts/Make.defs b/boards/arm/kl/freedom-kl26z/scripts/Make.defs index b1d739900a..3aaf7e7229 100644 --- a/boards/arm/kl/freedom-kl26z/scripts/Make.defs +++ b/boards/arm/kl/freedom-kl26z/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/freedom-kl26z/scripts/Make.defs +# boards/arm/kl/freedom-kl26z/scripts/Make.defs # # Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kl/freedom-kl26z/scripts/freedom-kl26z.ld b/boards/arm/kl/freedom-kl26z/scripts/freedom-kl26z.ld index a0a5b42501..00d609df2c 100644 --- a/boards/arm/kl/freedom-kl26z/scripts/freedom-kl26z.ld +++ b/boards/arm/kl/freedom-kl26z/scripts/freedom-kl26z.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-kl26z/scripts/freedom-kl26z.ld + * boards/arm/kl/freedom-kl26z/scripts/freedom-kl26z.ld * * Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kl/freedom-kl26z/src/Makefile b/boards/arm/kl/freedom-kl26z/src/Makefile index 482ecb5523..70953d89d4 100644 --- a/boards/arm/kl/freedom-kl26z/src/Makefile +++ b/boards/arm/kl/freedom-kl26z/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/freedom-kl26z/src/Makefile +# boards/arm/kl/freedom-kl26z/src/Makefile # # Copyright (C) 2015 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kl/freedom-kl26z/src/freedom-kl26z.h b/boards/arm/kl/freedom-kl26z/src/freedom-kl26z.h index b338ce69d8..53a953f803 100644 --- a/boards/arm/kl/freedom-kl26z/src/freedom-kl26z.h +++ b/boards/arm/kl/freedom-kl26z/src/freedom-kl26z.h @@ -1,5 +1,5 @@ -/**************************************************************************************************** - * boards/freedom-kl26z/src/freedom-kl26z.h +/**************************************************************************** + * boards/arm/kl/freedom-kl26z/src/freedom-kl26z.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,25 +31,27 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ****************************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_FREEDOM_KL26Z_SRC_FREEDOM_KL26Z_H -#define __BOARDS_ARM_FREEDOM_KL26Z_SRC_FREEDOM_KL26Z_H +#ifndef __BOARDS_ARM_KL_FREEDOM_KL26Z_SRC_FREEDOM_KL26Z_H +#define __BOARDS_ARM_KL_FREEDOM_KL26Z_SRC_FREEDOM_KL26Z_H -/**************************************************************************************************** +/**************************************************************************** * Included Files - ****************************************************************************************************/ + ****************************************************************************/ #include #include #include -/**************************************************************************************************** +/**************************************************************************** * Pre-processor Definitions - ****************************************************************************************************/ -/* Configuration ************************************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ + +/* Freedom KL26Z GPIOs ******************************************************/ -/* Freedom KL26Z GPIOs ******************************************************************************/ /* The Freedom KL26Z has a single RGB LED driven by the KL26Z as follows: * * ------------- -------- @@ -59,10 +61,12 @@ * Green Cathode PTE31 * Blue Cathode PTD5 * - * NOTE: PTD5 is also connected to the I/O header on J2 pin 12 (also known as D13). + * NOTE: + * PTD5 is also connected to the I/O header on J2 pin 12 (also known as D13). * - * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the - * Freedom KL26Z. The following definitions describe how NuttX controls the LEDs: + * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board + * the Freedom KL26Z. + * The following definitions describe how NuttX controls the LEDs: * * SYMBOL Meaning LED state * Initially all LED is OFF @@ -82,71 +86,73 @@ #define GPIO_LED_G (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTE | PIN31) #define GPIO_LED_B (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTD | PIN5) -/* Button definitions *******************************************************************************/ +/* Button definitions *******************************************************/ + /* The Freedom KL26Z has no buttons */ -/* Chip selects ************************************************************************************/ +/* Chip selects *************************************************************/ -/**************************************************************************************************** +/**************************************************************************** * Public Types - ****************************************************************************************************/ + ****************************************************************************/ -/**************************************************************************************************** +/**************************************************************************** * Public data - ****************************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/**************************************************************************************************** +/**************************************************************************** * Public Functions - ****************************************************************************************************/ + ****************************************************************************/ -/**************************************************************************************************** +/**************************************************************************** * Name: kl_spidev_initialize * * Description: - * Called to configure SPI chip select GPIO pins for the Freedom KL26Z board. + * Called to configure SPI chip select GPIO pins for the Freedom KL26Z + * board. * - ****************************************************************************************************/ + ****************************************************************************/ void weak_function kl_spidev_initialize(void); -/**************************************************************************************************** +/**************************************************************************** * Name: kl_usbinitialize * * Description: - * Called from kl_usbinitialize very early in inialization to setup USB-related - * GPIO pins for the Freedom KL26Z board. + * Called from kl_usbinitialize very early in inialization to setup + * USB-related GPIO pins for the Freedom KL26Z board. * - ****************************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_STM32_USB void weak_function kl_usbinitialize(void); #endif -/**************************************************************************************************** +/**************************************************************************** * Name: kl_led_initialize * * Description: * Initialize the on-board LED * - ****************************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ARCH_LEDS void kl_led_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: kl_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PWM int kl_pwm_setup(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_FREEDOM_KL26Z_SRC_FREEDOM_KL26Z_H */ +#endif /* __BOARDS_ARM_KL_FREEDOM_KL26Z_SRC_FREEDOM_KL26Z_H */ diff --git a/boards/arm/kl/freedom-kl26z/src/kl_appinit.c b/boards/arm/kl/freedom-kl26z/src/kl_appinit.c index d4b1824b3a..c0d4481160 100644 --- a/boards/arm/kl/freedom-kl26z/src/kl_appinit.c +++ b/boards/arm/kl/freedom-kl26z/src/kl_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/stm32f4discovery/src/kl_appinit.c + * boards/arm/kl/freedom-kl26z/src/kl_appinit.c * * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kl/freedom-kl26z/src/kl_boardinitialize.c b/boards/arm/kl/freedom-kl26z/src/kl_boardinitialize.c index 98d3c6e019..99ea254d7c 100644 --- a/boards/arm/kl/freedom-kl26z/src/kl_boardinitialize.c +++ b/boards/arm/kl/freedom-kl26z/src/kl_boardinitialize.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-kl26z/src/kl_boardinitialize.c +/**************************************************************************** + * boards/arm/kl/freedom-kl26z/src/kl_boardinitialize.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -47,24 +47,25 @@ #include "up_arch.h" #include "freedom-kl26z.h" -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kl_boardinitialize * * Description: - * All K25Z architectures must provide the following entry point. This entry point - * is called early in the initialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All K25Z architectures must provide the following entry point. + * This entry point is called early in the initialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void kl_boardinitialize(void) { - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * kl_spidev_initialize() has been brought into the link. + /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak + * function kl_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_KL_SPI0) || defined(CONFIG_KL_SPI1) @@ -100,9 +101,9 @@ void kl_boardinitialize(void) * Description: * If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional * initialization call will be performed in the boot-up sequence to a - * function called board_late_initialize(). board_late_initialize() will be - * called immediately after up_intitialize() is called and just before the - * initial application is started. This additional initialization phase + * function called board_late_initialize(). board_late_initialize() will + * be called immediately after up_intitialize() is called and just before + * the initial application is started. This additional initialization phase * may be used, for example, to initialize board-specific device drivers. * ****************************************************************************/ @@ -111,8 +112,8 @@ void kl_boardinitialize(void) void board_late_initialize(void) { /* Perform NSH initialization here instead of from the NSH. This - * alternative NSH initialization is necessary when NSH is ran in user-space - * but the initialization function must run in kernel space. + * alternative NSH initialization is necessary when NSH is ran in + * user-space but the initialization function must run in kernel space. */ #if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL) diff --git a/boards/arm/kl/freedom-kl26z/src/kl_led.c b/boards/arm/kl/freedom-kl26z/src/kl_led.c index cc891cb9e2..e1301d86ed 100644 --- a/boards/arm/kl/freedom-kl26z/src/kl_led.c +++ b/boards/arm/kl/freedom-kl26z/src/kl_led.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-kl26z/src/kl_led.c + * boards/arm/kl/freedom-kl26z/src/kl_led.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -41,8 +41,9 @@ * Green Cathode PTE31 * Blue Cathode PTD5 * - * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the - * Freedom KL26Z. The following definitions describe how NuttX controls the LEDs: + * If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board + * the Freedom KL26Z. + * The following definitions describe how NuttX controls the LEDs: * * SYMBOL Meaning LED state * Initially all LED is OFF diff --git a/boards/arm/kl/freedom-kl26z/src/kl_pwm.c b/boards/arm/kl/freedom-kl26z/src/kl_pwm.c index 318aaaae93..aa73da8d0f 100644 --- a/boards/arm/kl/freedom-kl26z/src/kl_pwm.c +++ b/boards/arm/kl/freedom-kl26z/src/kl_pwm.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-kl26z/src/kl_pwm.c +/**************************************************************************** + * boards/arm/kl/freedom-kl26z/src/kl_pwm.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -32,11 +32,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -53,10 +53,12 @@ #include "up_arch.h" #include "kl_pwm.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration *******************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ + /* PWM * * The Kinetis Freedom board provides a LED on GPIO. @@ -66,17 +68,17 @@ extern struct pwm_lowerhalf_s *kl_pwminitialize(int timer); -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kl_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ int kl_pwm_setup(void) { diff --git a/boards/arm/kl/freedom-kl26z/src/kl_spi.c b/boards/arm/kl/freedom-kl26z/src/kl_spi.c index b609785fe1..90613d7c9d 100644 --- a/boards/arm/kl/freedom-kl26z/src/kl_spi.c +++ b/boards/arm/kl/freedom-kl26z/src/kl_spi.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-kl26z/src/kl_spi.c + * boards/arm/kl/freedom-kl26z/src/kl_spi.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -104,6 +104,7 @@ void weak_function kl_spidev_initialize(void) * the SPI MMC/SD driver). * ****************************************************************************/ + /**************************************************************************** * Name: kl_spi[n]select * @@ -207,5 +208,4 @@ int kl_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) } #endif #endif - #endif /* CONFIG_KL_SPI */ diff --git a/boards/arm/kl/freedom-kl26z/src/kl_tsi.c b/boards/arm/kl/freedom-kl26z/src/kl_tsi.c index ad28f3656e..a6484c668f 100644 --- a/boards/arm/kl/freedom-kl26z/src/kl_tsi.c +++ b/boards/arm/kl/freedom-kl26z/src/kl_tsi.c @@ -1,13 +1,14 @@ /**************************************************************************** - * boards/freedom-kl26z/src/kl_tsi.c + * boards/arm/kl/freedom-kl26z/src/kl_tsi.c * * Copyright (C) 2013 Alan Carvalho de Assis * Author: Alan Carvalho de Assis * with adaptations from Gregory Nutt * - * Reference: https://community.freescale.com/community/ - * the-embedded-beat/blog/2012/10/15/ - * using-the-touch-interface-on-the-freescale-freedom-development-platform + * Reference: + * https://community.freescale.com/community/ + * the-embedded-beat/blog/2012/10/15/ + * using-the-touch-interface-on-the-freescale-freedom-development-platform * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -75,7 +76,8 @@ ****************************************************************************/ static void tsi_calibrate(void); -static ssize_t tsi_read(FAR struct file *filep, FAR char *buffer, size_t buflen); +static ssize_t tsi_read(FAR struct file *filep, + FAR char *buffer, size_t buflen); /**************************************************************************** * Private Data @@ -135,7 +137,7 @@ static void tsi_calibrate(void) while (!(getreg32(KL_TSI_GENCS) & TSI_GENCS_EOSF)); g_defcap[i] = getreg32(KL_TSI_DATA) & TSI_DATA_TSICNT_MASK; - iinfo("Sensor %d = %d\n", i+1, g_defcap[i]); + iinfo("Sensor %d = %d\n", i + 1, g_defcap[i]); } } @@ -171,7 +173,7 @@ static ssize_t tsi_read(FAR struct file *filep, FAR char *buf, size_t buflen) regval |= TSI_DATA_SWTS; putreg32(regval, KL_TSI_DATA); - /* Wait until the conversion is done*/ + /* Wait until the conversion is done */ while (!(getreg32(KL_TSI_GENCS) & TSI_GENCS_EOSF)); diff --git a/boards/arm/kl/teensy-lc/include/board.h b/boards/arm/kl/teensy-lc/include/board.h index 86c635d3db..ed55de3f4e 100644 --- a/boards/arm/kl/teensy-lc/include/board.h +++ b/boards/arm/kl/teensy-lc/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/teensy-lc/include/board.h +/**************************************************************************** + * boards/arm/kl/teensy-lc/include/board.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,29 +31,30 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H +#ifndef __BOARDS_ARM_KL_TEENSY_LC_INCLUDE_BOARD_H +#define __BOARDS_ARM_KL_TEENSY_LC_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #ifndef __ASSEMBLY__ # include #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* Clocking *****************************************************************/ -/* Clocking *************************************************************************/ /* The board has a 16MHz crystal. */ -#undef BOARD_EXTCLOCK /* Crystal */ -#define BOARD_XTAL_FREQ 16000000 /* 16 MHz crystal frequency (REFCLK) */ +#undef BOARD_EXTCLOCK /* Crystal */ +#define BOARD_XTAL_FREQ 16000000 /* 16 MHz crystal frequency (REFCLK) */ /* PLL Configuration. * @@ -62,14 +63,15 @@ * MCGPLLCLK Frequency: MCGPLLCLK = 96MHz */ -#define BOARD_PRDIV0 4 /* PLL External Reference Divider */ -#define BOARD_VDIV0 24 /* PLL VCO Divider (frequency multiplier) */ +#define BOARD_PRDIV0 4 /* PLL External Reference Divider */ +#define BOARD_VDIV0 24 /* PLL VCO Divider (frequency multiplier) */ #define BOARD_PLLIN_FREQ (BOARD_XTAL_FREQ / BOARD_PRDIV0) #define BOARD_PLLOUT_FREQ (BOARD_PLLIN_FREQ * BOARD_VDIV0) #define BOARD_MCGPLLCLK_FREQ BOARD_PLLOUT_FREQ -/* MCGOUTCLK: MCG output of either IRC, MCGFLLCLK, MCGPLLCLK, or MCG's external +/* MCGOUTCLK: + * MCG output of either IRC, MCGFLLCLK, MCGPLLCLK, or MCG's external * reference clock that sources the core, system, bus, and flash clock. * * MCGOUTCLK = MCGPLLCLK = 96MHz @@ -86,13 +88,14 @@ * System clock divided by OUTDIV4, clocks the bus slaves and peripherals. */ -#define BOARD_OUTDIV1 2 /* Core/system = MCGOUTCLK / 2 = 48 MHz */ -#define BOARD_OUTDIV4 2 /* Bus clock = System clock / 2 = 24 MHz */ +#define BOARD_OUTDIV1 2 /* Core/system = MCGOUTCLK / 2 = 48 MHz */ +#define BOARD_OUTDIV4 2 /* Bus clock = System clock / 2 = 24 MHz */ #define BOARD_CORECLK_FREQ (BOARD_MCGOUTCLK_FREQ / BOARD_OUTDIV1) #define BOARD_BUSCLK_FREQ (BOARD_CORECLK_FREQ / BOARD_OUTDIV4) /* PWM Configuration */ + /* TPM0 Channels */ #define GPIO_TPM0_CH0OUT PIN_TPM0_CH0_2 // Pin 22: PTC1 @@ -112,8 +115,10 @@ #define GPIO_TPM2_CH0OUT PIN_TPM2_CH0_1 // Pin 3: PTA1 #define GPIO_TPM2_CH1OUT PIN_TPM2_CH1_1 // Pin 4: PTA2 -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* The Teensy LC has a single LED. */ + #define LED_STARTED 0 /* LED off */ #define LED_HEAPALLOCATE 0 /* LED off */ #define LED_IRQSENABLED 0 /* LED off */ @@ -129,7 +134,9 @@ */ /* Note that the Teensy maps SCK0 to pin 13 which conflicts with the - * LED. Use pin 14 instead. */ + * LED. Use pin 14 instead. + */ + #define PIN_SPI0_SCK (PIN_SPI0_SCK_3 | PIN_ALT2_PULLUP) // Pin 14: PTD1 #define PIN_SPI0_MISO (PIN_SPI0_MISO_4 | PIN_ALT2_PULLUP) // Pin 12: PTC7 #define PIN_SPI0_MOSI (PIN_SPI0_MOSI_3 | PIN_ALT2_PULLUP) // Pin 11: PTC6 @@ -138,4 +145,4 @@ #define PIN_SPI1_MISO (PIN_SPI1_MISO_2 | PIN_ALT2_PULLUP) // Pin 1: PTB17 #define PIN_SPI1_MOSI (PIN_SPI0_MOSI_1 | PIN_ALT2_PULLUP) // Pin 0: PTB16 -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __BOARDS_ARM_KL_TEENSY_LC_INCLUDE_BOARD_H */ diff --git a/boards/arm/kl/teensy-lc/scripts/Make.defs b/boards/arm/kl/teensy-lc/scripts/Make.defs index f232457ee6..86ca32a655 100644 --- a/boards/arm/kl/teensy-lc/scripts/Make.defs +++ b/boards/arm/kl/teensy-lc/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/teensy-lc/scripts/Make.defs +# boards/arm/kl/teensy-lc/scripts/Make.defs # # Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kl/teensy-lc/scripts/teensy-lc.ld b/boards/arm/kl/teensy-lc/scripts/teensy-lc.ld index 90fc9c48ce..34d01b7ab2 100644 --- a/boards/arm/kl/teensy-lc/scripts/teensy-lc.ld +++ b/boards/arm/kl/teensy-lc/scripts/teensy-lc.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/teensy-lc/scripts/teensy-lc.ld + * boards/arm/kl/teensy-lc/scripts/teensy-lc.ld * * Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kl/teensy-lc/src/Makefile b/boards/arm/kl/teensy-lc/src/Makefile index f1f8a6699e..c227e190e9 100644 --- a/boards/arm/kl/teensy-lc/src/Makefile +++ b/boards/arm/kl/teensy-lc/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/teensy-lc/src/Makefile +# boards/arm/kl/teensy-lc/src/Makefile # # Copyright (C) 2015 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kl/teensy-lc/src/kl_appinit.c b/boards/arm/kl/teensy-lc/src/kl_appinit.c index 6bcf8bbd0f..ef8b4a8c93 100644 --- a/boards/arm/kl/teensy-lc/src/kl_appinit.c +++ b/boards/arm/kl/teensy-lc/src/kl_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/teensy-lc/src/kl_appinit.c + * boards/arm/kl/teensy-lc/src/kl_appinit.c * * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kl/teensy-lc/src/kl_boardinitialize.c b/boards/arm/kl/teensy-lc/src/kl_boardinitialize.c index 5752794189..66ce79ff53 100644 --- a/boards/arm/kl/teensy-lc/src/kl_boardinitialize.c +++ b/boards/arm/kl/teensy-lc/src/kl_boardinitialize.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/teensy-lc/src/kl_boardinitialize.c +/**************************************************************************** + * boards/arm/kl/teensy-lc/src/kl_boardinitialize.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -50,27 +50,28 @@ #include "up_arch.h" #include "teensy-lc.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kl_boardinitialize * * Description: - * All K25Z architectures must provide the following entry point. This entry point - * is called early in the initialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All K25Z architectures must provide the following entry point. + * This entry point is called early in the initialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void kl_boardinitialize(void) { @@ -83,8 +84,8 @@ void kl_boardinitialize(void) kl_configgpio(PIN_UART0_TX_3); #endif - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * kl_spidev_initialize() has been brought into the link. + /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak + * function kl_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_KL_SPI0) || defined(CONFIG_KL_SPI1) diff --git a/boards/arm/kl/teensy-lc/src/kl_led.c b/boards/arm/kl/teensy-lc/src/kl_led.c index 70461dbe7d..6e6de63c47 100644 --- a/boards/arm/kl/teensy-lc/src/kl_led.c +++ b/boards/arm/kl/teensy-lc/src/kl_led.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/teensy-lc/src/kl_led.c + * boards/arm/kl/teensy-lc/src/kl_led.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kl/teensy-lc/src/kl_pwm.c b/boards/arm/kl/teensy-lc/src/kl_pwm.c index d80d14e945..730472b2da 100644 --- a/boards/arm/kl/teensy-lc/src/kl_pwm.c +++ b/boards/arm/kl/teensy-lc/src/kl_pwm.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/teensy-lc/src/kl_pwm.c +/**************************************************************************** + * boards/arm/kl/teensy-lc/src/kl_pwm.c * * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -32,11 +32,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -53,10 +53,12 @@ #include "up_arch.h" #include "kl_pwm.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration *******************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ + /* PWM * * The Kinetis Freedom board provides a LED on GPIO. @@ -66,17 +68,17 @@ extern struct pwm_lowerhalf_s *kl_pwminitialize(int timer); -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kl_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ int kl_pwm_setup(void) { diff --git a/boards/arm/kl/teensy-lc/src/kl_spi.c b/boards/arm/kl/teensy-lc/src/kl_spi.c index 5df06303e1..b4803ce797 100644 --- a/boards/arm/kl/teensy-lc/src/kl_spi.c +++ b/boards/arm/kl/teensy-lc/src/kl_spi.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/teensy-lc/src/kl_spi.c + * boards/arm/kl/teensy-lc/src/kl_spi.c * * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -104,6 +104,7 @@ void weak_function kl_spidev_initialize(void) * the SPI MMC/SD driver). * ****************************************************************************/ + /**************************************************************************** * Name: kl_spi[n]select * @@ -207,5 +208,4 @@ int kl_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) } #endif #endif - #endif /* CONFIG_KL_SPI */ diff --git a/boards/arm/kl/teensy-lc/src/teensy-lc.h b/boards/arm/kl/teensy-lc/src/teensy-lc.h index 52fd26439c..2f83a0f326 100644 --- a/boards/arm/kl/teensy-lc/src/teensy-lc.h +++ b/boards/arm/kl/teensy-lc/src/teensy-lc.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/teensy-lc/src/teensy-lc.h + * boards/arm/kl/teensy-lc/src/teensy-lc.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_TEENSY_LC_SRC_TEENSY_LC_H -#define __BOARDS_ARM_TEENSY_LC_SRC_TEENSY_LC_H +#ifndef __BOARDS_ARM_KL_TEENSY_LC_SRC_TEENSY_LC_H +#define __BOARDS_ARM_KL_TEENSY_LC_SRC_TEENSY_LC_H /**************************************************************************** * Included Files @@ -47,6 +47,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #define GPIO_LED (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTC | PIN5) @@ -79,13 +80,13 @@ void weak_function kl_spidev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: kl_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PWM int kl_pwm_setup(void); @@ -104,5 +105,5 @@ void kl_led_initialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_TEENSY_LC_SRC_TEENSY_LC_H */ +#endif /* __BOARDS_ARM_KL_TEENSY_LC_SRC_TEENSY_LC_H */ diff --git a/boards/arm/lc823450/lc823450-xgevk/include/board.h b/boards/arm/lc823450/lc823450-xgevk/include/board.h index 85653a04ce..739da95fc6 100644 --- a/boards/arm/lc823450/lc823450-xgevk/include/board.h +++ b/boards/arm/lc823450/lc823450-xgevk/include/board.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/include/board.h + * boards/arm/lc823450/lc823450-xgevk/include/board.h * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa @@ -33,14 +33,14 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_LC823450_XGEVK_INCLUDE_BOARD_H -#define __BOARDS_ARM_LC823450_XGEVK_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LC823450_LC823450_XGEVK_INCLUDE_BOARD_H +#define __BOARDS_ARM_LC823450_LC823450_XGEVK_INCLUDE_BOARD_H #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #define LED_STARTED 0 /* N/A */ #define LED_HEAPALLOCATE 1 /* N/A */ @@ -53,9 +53,10 @@ #define LED_CPU0 8 /* LED0 (D9) */ #define LED_CPU1 9 /* LED1 (D10) */ -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ + #ifndef __ASSEMBLY__ #if defined(__cplusplus) @@ -68,9 +69,9 @@ extern "C" extern unsigned int XT1OSC_CLK; -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ void up_init_default_mux(void); @@ -80,4 +81,4 @@ void up_init_default_mux(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_LC823450_XGEVK_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LC823450_LC823450_XGEVK_INCLUDE_BOARD_H */ diff --git a/boards/arm/lc823450/lc823450-xgevk/kernel/Makefile b/boards/arm/lc823450/lc823450-xgevk/kernel/Makefile index d74770d5a7..be599f16c3 100644 --- a/boards/arm/lc823450/lc823450-xgevk/kernel/Makefile +++ b/boards/arm/lc823450/lc823450-xgevk/kernel/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lc823450-xgevk/kernel/Makefile +# boards/arm/lc823450/lc823450-xgevk/kernel/Makefile # # Copyright 2018 Sony Video & Sound Products Inc. # Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/kernel/lc823450_userspace.c b/boards/arm/lc823450/lc823450-xgevk/kernel/lc823450_userspace.c index ddf539bdc4..b42fc785c7 100644 --- a/boards/arm/lc823450/lc823450-xgevk/kernel/lc823450_userspace.c +++ b/boards/arm/lc823450/lc823450-xgevk/kernel/lc823450_userspace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/kernel/lc823450_userspace.c + * boards/arm/lc823450/lc823450-xgevk/kernel/lc823450_userspace.c * * Copyright 2018 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa @@ -53,6 +53,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifndef CONFIG_NUTTX_USERSPACE diff --git a/boards/arm/lc823450/lc823450-xgevk/scripts/Make.defs b/boards/arm/lc823450/lc823450-xgevk/scripts/Make.defs index cf6b1158d2..c6dc165588 100644 --- a/boards/arm/lc823450/lc823450-xgevk/scripts/Make.defs +++ b/boards/arm/lc823450/lc823450-xgevk/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/lc823450-xgevk/scripts/Make.defs +# boards/arm/lc823450/lc823450-xgevk/scripts/Make.defs # # Copyright 2017,2018 Sony Video & Sound Products Inc. # Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/scripts/gnu-elf.ld b/boards/arm/lc823450/lc823450-xgevk/scripts/gnu-elf.ld index 8c01213d98..c330dac5e7 100644 --- a/boards/arm/lc823450/lc823450-xgevk/scripts/gnu-elf.ld +++ b/boards/arm/lc823450/lc823450-xgevk/scripts/gnu-elf.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/scripts/gnu-elf.ld + * boards/arm/lc823450/lc823450-xgevk/scripts/gnu-elf.ld * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/scripts/ld-ipl2.script b/boards/arm/lc823450/lc823450-xgevk/scripts/ld-ipl2.script index d01fe91d72..79ff75008a 100644 --- a/boards/arm/lc823450/lc823450-xgevk/scripts/ld-ipl2.script +++ b/boards/arm/lc823450/lc823450-xgevk/scripts/ld-ipl2.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/scripts/ld-ipl2.script + * boards/arm/lc823450/lc823450-xgevk/scripts/ld-ipl2.script * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/scripts/ld-spif-boot.script b/boards/arm/lc823450/lc823450-xgevk/scripts/ld-spif-boot.script index 1decf0c1a5..2297ce1b7b 100644 --- a/boards/arm/lc823450/lc823450-xgevk/scripts/ld-spif-boot.script +++ b/boards/arm/lc823450/lc823450-xgevk/scripts/ld-spif-boot.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/scripts/ld-spif-boot.script + * boards/arm/lc823450/lc823450-xgevk/scripts/ld-spif-boot.script * * Copyright 2019 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/scripts/ld.script b/boards/arm/lc823450/lc823450-xgevk/scripts/ld.script index 84e7a7d779..d73710c304 100644 --- a/boards/arm/lc823450/lc823450-xgevk/scripts/ld.script +++ b/boards/arm/lc823450/lc823450-xgevk/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/scripts/ld.script + * boards/arm/lc823450/lc823450-xgevk/scripts/ld.script * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/scripts/memory.ld b/boards/arm/lc823450/lc823450-xgevk/scripts/memory.ld index 629216bd5d..07a172b417 100644 --- a/boards/arm/lc823450/lc823450-xgevk/scripts/memory.ld +++ b/boards/arm/lc823450/lc823450-xgevk/scripts/memory.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/scripts/memory.ld + * boards/arm/lc823450/lc823450-xgevk/scripts/memory.ld * * Copyright 2018 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/scripts/user-space.ld b/boards/arm/lc823450/lc823450-xgevk/scripts/user-space.ld index f018d2fec6..85e4cef5c8 100644 --- a/boards/arm/lc823450/lc823450-xgevk/scripts/user-space.ld +++ b/boards/arm/lc823450/lc823450-xgevk/scripts/user-space.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/scripts/user-space.ld + * boards/arm/lc823450/lc823450-xgevk/scripts/user-space.ld * * Copyright 2018 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/src/Makefile b/boards/arm/lc823450/lc823450-xgevk/src/Makefile index dd07f0b5c6..99e3ce35be 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/Makefile +++ b/boards/arm/lc823450/lc823450-xgevk/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lc823450-xgevk/src/Makefile +# boards/arm/lc823450/lc823450-xgevk/src/Makefile # # Copyright 2017 Sony Video & Sound Products Inc. # Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450-xgevk.h b/boards/arm/lc823450/lc823450-xgevk/src/lc823450-xgevk.h index 93fed90062..f719224b7c 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450-xgevk.h +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450-xgevk.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/src/lc823450-xgevk.h + * boards/arm/lc823450/lc823450-xgevk/src/lc823450-xgevk.h * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_LC823450_XGEVK_SRC_LC823450_XGEVK_H -#define __BOARDS_ARM_LC823450_XGEVK_SRC_LC823450_XGEVK_H +#ifndef __BOARDS_ARM_LC823450_LC823450_XGEVK_SRC_LC823450_XGEVK_H +#define __BOARDS_ARM_LC823450_LC823450_XGEVK_SRC_LC823450_XGEVK_H /**************************************************************************** * Included Files @@ -99,4 +99,4 @@ int lc823450_wm8776initialize(int minor); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_LC823450_XGEVK_SRC_LC823450_XGEVK_H */ +#endif /* __BOARDS_ARM_LC823450_LC823450_XGEVK_SRC_LC823450_XGEVK_H */ diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450-xgevk_mux.h b/boards/arm/lc823450/lc823450-xgevk/src/lc823450-xgevk_mux.h index 2fdbd8b909..81cf8a5e53 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450-xgevk_mux.h +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450-xgevk_mux.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/src/lc823450-xgevk_mux.h + * boards/arm/lc823450/lc823450-xgevk/src/lc823450-xgevk_mux.h * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masatoshi Tateishi @@ -34,8 +34,8 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_LC823450_XGEVK_SRC_LC823450_XGEVK_MUX_H -#define __BOARDS_ARM_LC823450_XGEVK_SRC_LC823450_XGEVK_MUX_H +#ifndef __BOARDS_ARM_LC823450_LC823450_XGEVK_SRC_LC823450_XGEVK_MUX_H +#define __BOARDS_ARM_LC823450_LC823450_XGEVK_SRC_LC823450_XGEVK_MUX_H /**************************************************************************** * Pre-processor Definitions @@ -135,7 +135,6 @@ 0 << 14 | /* GPIO0E 0:0, 1:1 */ \ 0 << 15 /* GPIO0F 0:0, 1:1 */ \ - /**************************************************************************** * PORT1 ****************************************************************************/ @@ -576,7 +575,6 @@ 0 << 8 | /* GPIO58 0:0, 1:1 */ \ 0 << 9 /* GPIO59 0:0, 1:1 */ - /**************************************************************************** * PORT6 ****************************************************************************/ @@ -605,4 +603,4 @@ 0 << 22 | /* XTALI0 0:2mA, 1:---, 2:4mA, 3:8mA */ \ 0 << 24 /* XTALI1 0:2mA, 1:---, 2:4mA, 3:8mA */ -#endif /* __BOARDS_ARM_LC823450_XGEVK_SRC_LC823450_XGEVK_MUX_H */ +#endif /* __BOARDS_ARM_LC823450_LC823450_XGEVK_SRC_LC823450_XGEVK_MUX_H */ diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_adc.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_adc.c index ad46e7b100..121c132935 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_adc.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_adc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/src/lc823450_adc.c + * boards/arm/lc823450/lc823450-xgevk/src/lc823450_adc.c * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa @@ -51,13 +51,13 @@ #include "lc823450-xgevk.h" #include "lc823450_adc.h" -/************************************************************************************ +/**************************************************************************** * Name: lc823450_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ int lc823450_adc_setup(void) { diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_appinit.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_appinit.c index 8ebe73e162..43658dae9e 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_appinit.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/src/lc823450_appinit.c + * boards/arm/lc823450/lc823450-xgevk/src/lc823450_appinit.c * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_autoleds.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_autoleds.c index ec5b8f9859..f2a42b7edc 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_autoleds.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/src/lc823450_autoleds.c + * boards/arm/lc823450/lc823450-xgevk/src/lc823450_autoleds.c * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_boot.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_boot.c index ab86554893..03e9aa5fec 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_boot.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_boot.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/src/lc823450_boot.c + * boards/arm/lc823450/lc823450-xgevk/src/lc823450_boot.c * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_bringup.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_bringup.c index 3c0643f49b..b6e02d7625 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_bringup.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/src/lc823450_bringup.c + * boards/arm/lc823450/lc823450-xgevk/src/lc823450_bringup.c * * Copyright 2017,2018 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_bt.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_bt.c index aceccfc621..6b9438b73d 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_bt.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_bt.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/src/lc823450_bt.c + * boards/arm/lc823450/lc823450-xgevk/src/lc823450_bt.c * * Copyright 2018 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_mux.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_mux.c index 39bb4361af..1c121ef290 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_mux.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_mux.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/src/lc823450_mux.c + * boards/arm/lc823450/lc823450-xgevk/src/lc823450_mux.c * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masatoshi Tateishi diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_netinit.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_netinit.c index 246786efe8..7d09b181ba 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_netinit.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_netinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/src/lc823450_netinit.c + * boards/arm/lc823450/lc823450-xgevk/src/lc823450_netinit.c * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_reset.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_reset.c index e0dc503bc9..8279e60d3e 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_reset.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_reset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/src/lc823450_reset.c + * boards/arm/lc823450/lc823450-xgevk/src/lc823450_reset.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_sdif.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_sdif.c index 77f9fb84d5..3361455d61 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_sdif.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_sdif.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/src/lc823450_sdif.c + * boards/arm/lc823450/lc823450-xgevk/src/lc823450_sdif.c * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_spi.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_spi.c index ebf9e1ca14..a5b8a43543 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_spi.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_spi.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/src/lc823450_spi.c + * boards/arm/lc823450/lc823450-xgevk/src/lc823450_spi.c * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa @@ -56,7 +56,8 @@ * ****************************************************************************/ -void lc823450_spiselect(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lc823450_spiselect(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { /* no need */ } diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_st7565.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_st7565.c index b1dc8babb2..19047b8f39 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_st7565.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_st7565.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/src/lc823450_st7565.c + * boards/arm/lc823450/lc823450-xgevk/src/lc823450_st7565.c * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa @@ -75,12 +75,13 @@ static void lc823450_st7565_reset(FAR struct st7565_lcd_s *lcd, bool on); static void lc823450_st7565_select(FAR struct st7565_lcd_s *lcd); static void lc823450_st7565_deselect(FAR struct st7565_lcd_s *lcd); -static void lc823450_st7565_cmddata(FAR struct st7565_lcd_s *lcd, const uint8_t cmd); -static int lc823450_st7565_senddata(FAR struct st7565_lcd_s *lcd, FAR const uint8_t *data, +static void lc823450_st7565_cmddata(FAR struct st7565_lcd_s *lcd, + const uint8_t cmd); +static int lc823450_st7565_senddata(FAR struct st7565_lcd_s *lcd, + FAR const uint8_t *data, int size); static int lc823450_st7565_backlight(FAR struct st7565_lcd_s *lcd, int level); - static FAR struct spi_dev_s *g_spidev; static FAR struct lcd_dev_s *g_lcddev; @@ -136,7 +137,8 @@ static void lc823450_st7565_deselect(FAR struct st7565_lcd_s *lcd) * Name: lc823450_st7565_cmddata ****************************************************************************/ -static void lc823450_st7565_cmddata(FAR struct st7565_lcd_s *lcd, const uint8_t cmd) +static void lc823450_st7565_cmddata(FAR struct st7565_lcd_s *lcd, + const uint8_t cmd) { lc823450_gpio_write(GPIO_LCD_A0, !cmd); } diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_usbmsc.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_usbmsc.c index 12c5ce4e53..056ae25c69 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_usbmsc.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_usbmsc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/src/lc823450_usbmsc.c + * boards/arm/lc823450/lc823450-xgevk/src/lc823450_usbmsc.c * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa diff --git a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_wm8776.c b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_wm8776.c index 876c80522d..0c8ac23391 100644 --- a/boards/arm/lc823450/lc823450-xgevk/src/lc823450_wm8776.c +++ b/boards/arm/lc823450/lc823450-xgevk/src/lc823450_wm8776.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lc823450-xgevk/src/lc823450_wm8776.c + * boards/arm/lc823450/lc823450-xgevk/src/lc823450_wm8776.c * * Copyright 2017 Sony Video & Sound Products Inc. * Author: Masayuki Ishikawa @@ -73,7 +73,6 @@ static struct wm8776_lower_s g_wm8776info = .frequency = 400000, }; - /**************************************************************************** * Name: lc823450_wm8776initialize ****************************************************************************/ diff --git a/boards/arm/lpc17xx_40xx/lincoln60/include/board.h b/boards/arm/lpc17xx_40xx/lincoln60/include/board.h index e56c1cb447..9bcc956ce0 100644 --- a/boards/arm/lpc17xx_40xx/lincoln60/include/board.h +++ b/boards/arm/lpc17xx_40xx/lincoln60/include/board.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lincoln60/include/board.h + * boards/arm/lpc17xx_40xx/lincoln60/include/board.h * include/arch/board/board.h * * Copyright (C) 2012 Gregory Nutt. All rights reserved. @@ -34,8 +34,8 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_LINCOLN60_INCLUDE_BOARD_H -#define __BOARDS_ARM_LINCOLN60_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_LINCOLN60_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC17XX_40XX_LINCOLN60_INCLUDE_BOARD_H /**************************************************************************** * Included Files @@ -53,8 +53,10 @@ ****************************************************************************/ /* Clocking ****************************************************************/ -/* 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 include path. + +/* 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 include path. */ #define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency */ @@ -133,6 +135,7 @@ #define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV20 /* LED definitions *********************************************************/ + /* 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 * for NuttX debug functionality (where NC means "No Change"). @@ -218,4 +221,4 @@ void lpc17_40_led(int lednum, int state); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_LINCOLN60_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_LINCOLN60_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc17xx_40xx/lincoln60/scripts/Make.defs b/boards/arm/lpc17xx_40xx/lincoln60/scripts/Make.defs index bd7b46d4c2..823c3e1d5e 100644 --- a/boards/arm/lpc17xx_40xx/lincoln60/scripts/Make.defs +++ b/boards/arm/lpc17xx_40xx/lincoln60/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/lincoln60/scripts/Make.defs +# boards/arm/lpc17xx_40xx/lincoln60/scripts/Make.defs # # Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lincoln60/scripts/ld.script b/boards/arm/lpc17xx_40xx/lincoln60/scripts/ld.script index 78fd09d276..da87ce5894 100644 --- a/boards/arm/lpc17xx_40xx/lincoln60/scripts/ld.script +++ b/boards/arm/lpc17xx_40xx/lincoln60/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lincoln60/scripts/ld.script + * boards/arm/lpc17xx_40xx/lincoln60/scripts/ld.script * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lincoln60/src/Makefile b/boards/arm/lpc17xx_40xx/lincoln60/src/Makefile index 116265108f..cdda8b9325 100644 --- a/boards/arm/lpc17xx_40xx/lincoln60/src/Makefile +++ b/boards/arm/lpc17xx_40xx/lincoln60/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lincoln60/src/Makefile +# boards/arm/lpc17xx_40xx/lincoln60/src/Makefile # # Copyright (C) 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lincoln60/src/lincoln60.h b/boards/arm/lpc17xx_40xx/lincoln60/src/lincoln60.h index a4021c2736..e00af7f1fd 100644 --- a/boards/arm/lpc17xx_40xx/lincoln60/src/lincoln60.h +++ b/boards/arm/lpc17xx_40xx/lincoln60/src/lincoln60.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lincoln60/src/lincoln60.h + * boards/arm/lpc17xx_40xx/lincoln60/src/lincoln60.h * * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_appinit.c b/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_appinit.c index fed1d0db60..180f35eebf 100644 --- a/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_appinit.c +++ b/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lincoln60/src/lpc17_40_appinit.c + * boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_appinit.c * * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_boot.c b/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_boot.c index 2972b05b42..ad685647f3 100644 --- a/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_boot.c +++ b/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lincoln60/src/lpc17_40_boot.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_boot.c * * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,27 +49,28 @@ #include "lincoln60.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_boardinitialize * * Description: - * All LPC17xx/LPC40xx architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All LPC17xx/LPC40xx architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc17_40_boardinitialize(void) { diff --git a/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_buttons.c b/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_buttons.c index c5e4089694..85d51da268 100644 --- a/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_buttons.c +++ b/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lincoln60/src/lpc17_40_buttons.c + * boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_buttons.c * * Copyright (C) 2012-2013, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -92,10 +92,10 @@ static uint8_t g_buttonirq[NUM_BUTTONS] = * Name: board_button_initialize * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_buttons() may be called to collect the current state of all - * buttons or board_button_irq() may be called to register button interrupt - * handlers. + * board_button_initialize() must be called to initialize button resources. + * After that, board_buttons() may be called to collect the current state + * of all buttons or board_button_irq() may be called to register button + * interrupt handlers. * ****************************************************************************/ @@ -115,9 +115,9 @@ void board_button_initialize(void) * Name: board_buttons * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_buttons() may be called to collect the current state of all - * buttons. + * board_button_initialize() must be called to initialize button resources. + * After that, board_buttons() may be called to collect the current state + * of all buttons. * * board_buttons() may be called at any time to harvest the state of every * button. The state of the buttons is returned as a bitset with one @@ -136,16 +136,16 @@ uint32_t board_buttons(void) for (i = 0; i < NUM_BUTTONS; i++) { - /* A LOW value means that the key is pressed. */ + /* A LOW value means that the key is pressed. */ - bool released = lpc17_40_gpioread(g_buttoncfg[i]); + bool released = lpc17_40_gpioread(g_buttoncfg[i]); - /* Accumulate the set of depressed (not released) keys */ + /* Accumulate the set of depressed (not released) keys */ - if (!released) - { + if (!released) + { ret |= (1 << i); - } + } } return ret; @@ -155,19 +155,21 @@ uint32_t board_buttons(void) * Button support. * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_button_irq() may be called to register button interrupt handlers. + * board_button_initialize() must be called to initialize button resources. + * After that, board_button_irq() may be called to register button interrupt + * handlers. * - * board_button_irq() may be called to register an interrupt handler that will - * be called when a button is depressed or released. The ID value is a - * button enumeration value that uniquely identifies a button resource. See the - * BOARD_BUTTON_* and BOARD_JOYSTICK_* definitions in board.h for the meaning - * of enumeration values. + * board_button_irq() may be called to register an interrupt handler that + * will be called when a button is depressed or released. The ID value is + * a button enumeration value that uniquely identifies a button resource. + * See the BOARD_BUTTON_* and BOARD_JOYSTICK_* definitions in board.h for + * the meaning of enumeration values. * - * Note that board_button_irq() also enables button interrupts. Button - * interrupts will remain enabled after the interrupt handler is attached. - * Interrupts may be disabled (and detached) by calling board_button_irq with - * irqhandler equal to NULL. + * Note that board_button_irq() also enables button interrupts. + * Button interrupts will remain enabled after the interrupt handler is + * attached. + * Interrupts may be disabled (and detached) by calling board_button_irq + * with irqhandler equal to NULL. * ****************************************************************************/ @@ -211,5 +213,4 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) return OK; } #endif - #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_leds.c b/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_leds.c index 2c69828b20..217c742977 100644 --- a/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_leds.c +++ b/boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lincoln60/src/lpc17_40_leds.c + * boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_leds.c * * Copyright (C) 2012-2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -72,23 +72,22 @@ * Private Data ****************************************************************************/ -/* LED definitions ****************************************************************** +/* LED definitions **********************************************************/ -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 for NuttX -debug functionality (where NC means "No Change"). - -During the boot phases. LED1 and LED2 will show boot status. - - LED1 LED2 -STARTED OFF OFF -HEAPALLOCATE BLUE OFF -IRQSENABLED OFF BLUE -STACKCREATED OFF OFF - -After the system is booted, this logic will no longer use LEDs 1 & 2. They -are available for use by applications using lpc17_40_led (prototyped below) -*/ +/* 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 for + * NuttXdebug functionality (where NC means "No Change"). + * During the boot phases. LED1 and LED2 will show boot status. + * + * LED1 LED2 + * STARTED OFF OFF + * HEAPALLOCATE BLUE OFF + * IRQSENABLED OFF BLUE + * STACKCREATED OFF OFF + * + * After the system is booted, this logic will no longer use LEDs 1 & 2. They + * are available for use by applications using lpc17_40_led (prototyped below) + */ static bool g_initialized; static int g_nestcount; @@ -144,8 +143,8 @@ void board_autoled_on(int led) case LED_IRQSENABLED: led2 = 1; } - lpc17_40_led(LINCOLN60_LED1,led1); - lpc17_40_led(LINCOLN60_LED2,led2); + lpc17_40_led(LINCOLN60_LED1, led1); + lpc17_40_led(LINCOLN60_LED2, led2); } /* We will always control the HB LED */ @@ -183,13 +182,14 @@ void board_autoled_off(int led) } } -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_led * * Description: - * Once the system has booted, these functions can be used to control the LEDs + * Once the system has booted, these functions can be used to control the + * LEDs * - ************************************************************************************/ + ****************************************************************************/ void lpc17_40_led(int lednum, int state) diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/README.txt b/boards/arm/lpc17xx_40xx/lpc4088-devkit/README.txt index f2cf0c3f09..deb1cc0f85 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/README.txt +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/README.txt @@ -108,7 +108,7 @@ Using OpenOCD with the Olimex ARM-USB-OCD I have been using the Olimex ARM-USB-OCD debugger. OpenOCD requires a configuration file. I keep the one I used last here: - boards/lpc4088-devkit/tools/lpc4088-devkit.cfg + boards/arm/lpc17xx_40xx/lpc4088-devkit/tools/lpc4088-devkit.cfg However, the "correct" configuration script to use with OpenOCD may change as the features of OpenOCD evolve. So you should at least @@ -136,7 +136,7 @@ Using OpenOCD with the Olimex ARM-USB-OCD installations. They could be most anywhwere if you are using a windows version of OpenOCD. - boards/lpc4088-devkit/tools/lpc4088-devkit.cfg + boards/arm/lpc17xx_40xx/lpc4088-devkit/tools/lpc4088-devkit.cfg This is simply openocd-usb.cfg, lpc40xx.cfg, and lpc1xxx.cfg concatenated into one file for convenience. Don't use it unless you have to. @@ -147,20 +147,21 @@ Using OpenOCD with the Olimex ARM-USB-OCD - Possibly the value of OPENOCD_PATH and TARGET_PATH - It assumes that the correct script to use is the one at - boards/lpc4088-devkit/tools/lpc4088-devkit.cfg + boards/arm/lpc17xx_40xx/lpc4088-devkit/tools/lpc4088-devkit.cfg Starting OpenOCD Then you should be able to start the OpenOCD daemon as follows. This assumes that you have already CD'ed to the NuttX build directory and - that you have set the full path to the boards/lpc4088-devkit/tools in your - PATH environment variable: + that you have set the full path to the + boards/arm/lpc17xx_40xx/lpc4088-devkit/tools in your PATH environment + variable: oocd.sh $PWD or, if the PATH variable is not so configured: - boards/lpc4088-devkit/tools/oocd.sh $PWD + boards/arm/lpc17xx_40xx/lpc4088-devkit/tools/oocd.sh $PWD Connecting GDB diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/include/board.h b/boards/arm/lpc17xx_40xx/lpc4088-devkit/include/board.h index 600255df40..7f9c45c238 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/include/board.h +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4088-devkit/include/board.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpc4088-devkit/include/board.h * include/arch/board/board.h * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -32,14 +32,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_LPC4088_DEVKIT_INCLUDE_BOARD_H -#define __BOARDS_ARM_LPC4088_DEVKIT_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_LPC4088_DEVKIT_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC17XX_40XX_LPC4088_DEVKIT_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,12 +49,16 @@ # include #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Clocking *************************************************************************/ -/* 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 include path. + ****************************************************************************/ + +/* Clocking *****************************************************************/ + +/* 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 include path. */ #define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency */ @@ -65,27 +69,28 @@ /* This is the clock setup we configure for: * - * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source - * PLL0CLK = (10 * SYSCLK) / 1 = 120MHz -> PLL0 multipler=10, pre-divider=1 - * CCLCK = 120MHz -> CCLK divider = 1 + * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source + * PLL0CLK = (10 * SYSCLK) / 1 = 120MHz -> PLL0 multipler=10, pre-divider=1 + * CCLCK = 120MHz -> CCLK divider = 1 */ -#define LPC17_40_CCLK 120000000 /* 120Mhz */ -#define BOARD_PCLKDIV 2 /* Peripheral clock = LPC17_40_CCLK/2 */ +#define LPC17_40_CCLK 120000000 /* 120Mhz */ +#define BOARD_PCLKDIV 2 /* Peripheral clock = LPC17_40_CCLK/2 */ #define BOARD_PCLK_FREQUENCY (LPC17_40_CCLK / BOARD_PCLKDIV) -/* Select the main oscillator as the frequency source. SYSCLK is then the frequency - * of the main oscillator. +/* Select the main oscillator as the frequency source. + * SYSCLK is then the frequency of the main oscillator. * - * If BOARD_XTAL_FREQUENCY > 15000000, then the SCS OSCRS bit (bit 4) should also - * be set in the BOARD_SCS_VALUE. + * If BOARD_XTAL_FREQUENCY > 15000000, then the SCS OSCRS bit (bit 4) + * should also be set in the BOARD_SCS_VALUE. */ #undef CONFIG_LPC17_40_MAINOSC #define CONFIG_LPC17_40_MAINOSC 1 #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 CCLK. * The input to the divider (PLLCLK) will be determined by the PLL output. */ @@ -121,10 +126,11 @@ ((BOARD_PLL1CFG_PSEL-1) << SYSCON_PLLCFG_PSEL_SHIFT)) #ifdef CONFIG_LPC17_40_EMC + /* EMC clock selection. * - * The EMC clock should not be driven above 80MHz. As a result the EMC - * uses the CPU clock divided by two. + * The EMC clock should not be driven above 80MHz. + * As a result the EMC uses the CPU clock divided by two. */ # define BOARD_EMCCLKSEL_DIVIDER 2 @@ -133,7 +139,9 @@ #endif #if defined(CONFIG_LPC17_40_USBHOST) || (CONFIG_LPC17_40_USBDEV) -/* USB divider. The output of the PLL is used as the USB clock + +/* USB divider. + * The output of the PLL is used as the USB clock * * USBCLK = PLL1CLK = (SYSCLK * 4) = 48MHz */ @@ -157,9 +165,11 @@ #define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV48 #ifdef CONFIG_LPC17_40_SDCARD -/* SDIO dividers. Note that slower clocking is required when DMA is disabled - * in order to avoid RX overrun/TX underrun errors due to delayed responses - * to service FIFOs in interrupt driven mode. + +/* SDIO dividers. + * Note that slower clocking is required when DMA is disabled in order to + * avoid RX overrun/TX underrun errors due to delayed responses to + * service FIFOs in interrupt driven mode. * SDCARD_CLOCK=PCLK/(2*(SDCARD_CLKDIV+1)) */ @@ -214,14 +224,16 @@ #endif #endif -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in * any way. The following definitions are used to access individual LEDs. * * LED1 : Connected to P2[26] * LED2 : Connected to P2[27] * - * These LEDs are connected to ground so a high output value will illuminate them. + * These LEDs are connected to ground so a high output value will illuminate + * them. */ /* LED index values for use with board_userled() */ @@ -236,25 +248,29 @@ #define BOARD_LED2_BIT (1 << BOARD_LED2) /* If CONFIG_ARCH_LEDs is defined, then NuttX will control the two LEDs - * on the LPC4088 OEM Board. The following definitions describe how NuttX - * controls the LEDs: + * on the LPC4088 OEM Board. + * The following definitions describe how NuttX controls the LEDs: */ /* LED1 LED2 LED3 LED4 */ #define LED_STARTED 0 /* OFF OFF OFF OFF */ #define LED_HEAPALLOCATE 1 /* ON OFF OFF OFF */ #define LED_IRQSENABLED 2 /* OFF ON OFF OFF */ #define LED_STACKCREATED 3 /* ON ON OFF OFF */ -#define LED_INIRQ 4 /* LED3 glows, on while in interrupt */ +#define LED_INIRQ 4 /* LED3 glows, on while in interrupt */ #define LED_SIGNAL 4 /* LED3 glows, on while in signal handler */ #define LED_ASSERTION 4 /* LED3 glows, on while in assertion */ #define LED_PANIC 4 /* LED3 Flashes at 2Hz */ -#define LED_IDLE 5 /* LED4 glows: ON while active * - * OFF while sleeping */ +#define LED_IDLE 5 /* LED4 glows: ON while active + * OFF while sleeping + */ /* Button definitions ***************************************************************/ -/* The LPC4088 Developer's Kit supports several buttons. All have external - * pullup resistors. When closed, the pins will be pulled to ground. So the buttons - * will read "1" when open and "0" when closed. All are capable of generating interrupts. + +/* The LPC4088 Developer's Kit supports several buttons. + * All have external pullup resistors. + * When closed, the pins will be pulled to ground. + * So the buttons will read "1" when open and "0" when closed. + * All are capable of generating interrupts. * * USER1 -- Connected to P2[10] * @@ -266,11 +282,10 @@ * JOY_D -- Connected to P2[27] * JOY_CTR -- Connected to P2[22] * - * For the interrupting buttons, interrupts are generated on both edges (press and - * release). + * For the interrupting buttons, interrupts are generated on both edges + * (press and release). */ - #define BOARD_BUTTON_USER1 0 #define BOARD_JOYSTICK_A 1 @@ -289,7 +304,7 @@ #define BOARD_JOYSTICK_D_BIT (1 << BOARD_JOYSTICK_D) #define BOARD_JOYSTICK_CTR_BIT (1 << BOARD_JOYSTICK_CTR) -/* Alternate pin selections *********************************************************/ +/* Alternate pin selections *************************************************/ /* UART0: * @@ -303,7 +318,8 @@ /* UART1: * * All pin options are controlled by jumpers on the board. - * RXD is set with JP12, TXD is set with JP13, modem control lines are set with JP11. + * RXD is set with JP12, TXD is set with JP13, modem control lines are set + * with JP11. * * RTS --- Connected to P3[30] * RI --- Connected to P3[22] @@ -349,9 +365,9 @@ #define GPIO_ENET_MDC GPIO_ENET_MDC_1 #define GPIO_ENET_MDIO GPIO_ENET_MDIO_1 - /* External LCD is currently untested. - * These pins will probably need to be updated before using the LCD. */ + * These pins will probably need to be updated before using the LCD. + */ #if 0 /* LCD R: @@ -416,24 +432,22 @@ /* XPT2046 Touchscreen: * -/* -------------- -------------------- ------------ -------------------------------- + * -------------- -------------------- ------------ ------------------------- * XTPT2046 Module Module * Signal Connector Connector - * -------------- -------------------- ------------ --------------------------------- + * -------------- -------------------- ------------ ------------------------- * Pin 11 PENIRQ\ PENIRQ (pulled high) PORT3 Pin 1 P2.15 PENIRQ * Pin 12 DOUT MISO PORT3 Pin 4 P1.18 MISO1 (Also USB HOST UP LED) * Pin 13 BUSY BUSY (pulled high) PORT3 Pin 9 P2.14 BUSY * Pin 14 DIN MOSI PORT3 Pin 3 P0.13 MOSI1 (Also USB Device up LED and SD CD pin) * Pin 15 CS\ SSEL (pulled high) PORT3 Pin 6 P1.8 GPIO (Also RMII_CRS_DV) * Pin 16 DCLK SCK PORT3 Pin 5 P1.19 SCK1 - * -------------- -------------------- ------------ --------------------------------- + * -------------- -------------------- ------------ ------------------------- */ - #define GPIO_SSP1_MISO GPIO_SSP1_MISO_3 #define GPIO_SSP1_MOSI GPIO_SSP1_MOSI_2 #define GPIO_SSP1_SCK GPIO_SSP1_SCK_2 #endif - -#endif /* __BOARDS_ARM_LPC4088_DEVKIT_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_LPC4088_DEVKIT_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/Makefile b/boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/Makefile index 1be51140ac..79e02d6887 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/Makefile +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpc4088-devkit/kernel/Makefile +# boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/Makefile # # Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/lpc17_40_userspace.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/lpc17_40_userspace.c index c07af4f8b8..30204a06d5 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/lpc17_40_userspace.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/lpc17_40_userspace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-devkit/kernel/lpc17_40_userspace.c + * boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/lpc17_40_userspace.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -50,6 +50,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifndef CONFIG_NUTTX_USERSPACE @@ -64,14 +65,14 @@ * Public Data ****************************************************************************/ -/* These 'addresses' of these values are setup by the linker script. They are - * not actual uint32_t storage locations! They are only used meaningfully in the - * following way: +/* These 'addresses' of these values are setup by the linker script. + * They are not actual uint32_t storage locations! + * They are only used meaningfully in the following way: * * - The linker script defines, for example, the symbol_sdata. * - The declareion extern uint32_t _sdata; makes C happy. C will believe - * that the value _sdata is the address of a uint32_t variable _data (it is - * not!). + * that the value _sdata is the address of a uint32_t variable _data + * (it is not!). * - We can recoved the linker value then by simply taking the address of * of _data. like: uint32_t *pdata = &_sdata; */ diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/Make.defs b/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/Make.defs index 70efeffed9..4f18588c81 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/Make.defs +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpc4088-devkit/scripts/Make.defs +# boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/Make.defs # # Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/kernel-space.ld b/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/kernel-space.ld index 5f3099ee88..a7b8933598 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/kernel-space.ld +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/kernel-space.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-devkit/scripts/kernel-space.ld + * boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/kernel-space.ld * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/ld.script b/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/ld.script index bb60bad656..5225be2404 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/ld.script +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-devkit/scripts/ld.script + * boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/ld.script * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Rommel Marcelo diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/memory.ld b/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/memory.ld index da6fbb7dec..3cd3153049 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/memory.ld +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/memory.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-devkit/scripts/memory.ld + * boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/memory.ld * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -41,9 +41,10 @@ * * For MPU support, the kernel-mode NuttX section is assumed to be 256KB of * FLASH and 4KB of SRAM. That, of course, can be optimized as needed (See - * also boards/lpc4088-devkit/scripts/kernel-space.ld); 256KB is probably much - * more than is needed by the RTOS! That size is selected only because it - * is available due to alignment issues for the user space FLASH memory. + * also boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/kernel-space.ld); + * 256KB is probably much more than is needed by the RTOS! + * That size is selected only because it is available due to alignment + * issues for the user space FLASH memory. * * Alignment of the user space FLASH partition is a critical factor: The * user space FLASH partition will be spanned with a single region of size diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/user-space.ld b/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/user-space.ld index 1a174d8a9d..85d7a4c705 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/user-space.ld +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/user-space.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-devkit/scripts/user-space.ld + * boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/user-space.ld * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/Makefile b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/Makefile index 0ebee08aa5..e5d8c2dce6 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/Makefile +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpc4088-devkit/src/Makefile +# boards/arm/lpc17xx_40xx/lpc4088-devkit/src/Makefile # # Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_appinit.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_appinit.c index 89b5f748ce..6378a546ea 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_appinit.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lpc4088-devkit/src/lpc17_40_appinit.c + * boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_appinit.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_autoleds.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_autoleds.c index 7c24ca9f40..1748577fd6 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_autoleds.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-devkit/src/lpc17_40_autoleds.c + * boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_autoleds.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -65,11 +65,12 @@ * LED3 -- Connected to P1[13] * LED4 -- Connected to P4[27] * - * These LEDs are connected to ground so a high output value will illuminate them. + * These LEDs are connected to ground so a high output value will illuminate + * them. * * If CONFIG_ARCH_LEDs is defined, then NuttX will control the two LEDs - * on the LPC4088 Developer's Kit. The following definitions describe how NuttX - * controls the LEDs: + * on the LPC4088 Developer's Kit. The following definitions describe how + * NuttX controls the LEDs: * * LED1 LED2 LED3 LED4 * LED_STARTED 0 OFF OFF OFF OFF diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_boardinitialize.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_boardinitialize.c index 2d458945f1..92b523c18b 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_boardinitialize.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_boardinitialize.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4088-devkit/src/lpc17_40_boardinitialize.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_boardinitialize.c * * Copyright (C) 2013, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -51,27 +51,28 @@ #include "lpc4088-devkit.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_boardinitialize * * Description: - * All LPC17xx/LPC40xx architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All LPC17xx/LPC40xx architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc17_40_boardinitialize(void) { @@ -96,8 +97,8 @@ void lpc17_40_boardinitialize(void) #if defined(CONFIG_LPC17_40_SSP0) || defined(CONFIG_LPC17_40_SSP1) || \ defined(CONFIG_LPC17_40_SSP2) /* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) - * the weak function lpc4088_devkit_sspdev_initialize() has been brought into - * the link. + * the weak function lpc4088_devkit_sspdev_initialize() has been brought + * into the link. */ if (lpc4088_devkit_sspdev_initialize) diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c index 17d9dd6d0d..1be0e90f3d 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lpc4088-devkit/src/lpc17_40_bringup.c + * boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c * * Copyright (C) 2013, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -62,6 +62,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #define NSH_HAVE_MMCSD 1 @@ -83,7 +84,9 @@ # undef NSH_HAVE_MMCSD #endif -/* MMC/SD support requires that an SPI support is enabled and an SPI port is selected */ +/* MMC/SD support requires that an SPI support is enabled + * and an SPI port is selected + */ #ifdef NSH_HAVE_MMCSD # if !defined(CONFIG_NSH_MMCSDSLOTNO) @@ -176,7 +179,7 @@ static int nsh_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; syslog(LOG_INFO, "nsh_waiter: Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -287,7 +290,8 @@ static int nsh_usbhostinitialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to register the mass storage class: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -297,7 +301,8 @@ static int nsh_usbhostinitialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); } #endif @@ -355,7 +360,7 @@ int lpc4088_devkit_bringup(void) } #endif - /* Initialize SD Card*/ + /* Initialize SD Card */ ret = nsh_sdinitialize(); if (ret == OK) @@ -371,7 +376,8 @@ int lpc4088_devkit_bringup(void) ret = fb_register(0, 0); if (ret < 0) { - syslog(LOG_ERR, "ERROR: fb_register() failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: fb_register() failed: %d\n", + ret); } #endif @@ -381,7 +387,8 @@ int lpc4088_devkit_bringup(void) ret = lpc4088_devkit_tsc_setup(0); if (ret < 0) { - syslog(LOG_ERR, "ERROR: lpc4088_devkit_tsc_setup failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: lpc4088_devkit_tsc_setup failed: %d\n", + ret); } #endif @@ -391,7 +398,8 @@ int lpc4088_devkit_bringup(void) ret = lpc17_40_djoy_initialization(); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to register the joystick driver: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to register the joystick driver: %d\n", + ret); return ret; } #endif diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_buttons.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_buttons.c index 542ae4e58f..0c2063dc4a 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_buttons.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-devkit/src/lpc17_40_buttons.c + * boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_buttons.c * * Copyright (C) 2013, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -106,10 +106,10 @@ static const uint8_t g_buttonirq[NUM_BUTTONS] = * Name: board_button_initialize * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_buttons() may be called to collect the current state of all - * buttons or board_button_irq() may be called to register button interrupt - * handlers. + * board_button_initialize() must be called to initialize button resources. + * After that, board_buttons() may be called to collect the current state + * of all buttons or board_button_irq() may be called to register button + * interrupt handlers. * ****************************************************************************/ @@ -150,16 +150,16 @@ uint32_t board_buttons(void) for (i = 0; i < NUM_BUTTONS; i++) { - /* A LOW value means that the key is pressed. */ + /* A LOW value means that the key is pressed. */ - bool released = lpc17_40_gpioread(g_buttoncfg[i]); + bool released = lpc17_40_gpioread(g_buttoncfg[i]); - /* Accumulate the set of depressed (not released) keys */ + /* Accumulate the set of depressed (not released) keys */ - if (!released) - { + if (!released) + { ret |= (1 << i); - } + } } return ret; @@ -181,8 +181,8 @@ uint32_t board_buttons(void) * * Note that board_button_irq() also enables button interrupts. Button * interrupts will remain enabled after the interrupt handler is attached. - * Interrupts may be disabled (and detached) by calling board_button_irq with - * irqhandler equal to NULL. + * Interrupts may be disabled (and detached) by calling board_button_irq + * with irqhandler equal to NULL. * ****************************************************************************/ diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_djoystick.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_djoystick.c index d26d42385d..c0095f2416 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_djoystick.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_djoystick.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-devkit/src/lpc17_40_djoystick.c + * boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_djoystick.c * * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -53,7 +53,8 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -/* The LPC4088 Developer's Kit supports several buttons. All will read "1" + +/* The LPC4088 Developer's Kit supports several buttons. All will read "1" * when open and "0" when closed * * USER1 -- Connected to P2[10] @@ -93,13 +94,13 @@ static void djoy_enable(FAR const struct djoy_lowerhalf_s *lower, djoy_buttonset_t press, djoy_buttonset_t release, djoy_interrupt_t handler, FAR void *arg); - static void djoy_disable(void); static int djoy_interrupt(int irq, FAR void *context, FAR void *arg); /**************************************************************************** * Private Data ****************************************************************************/ + /* Pin configuration for each LPC4088 Developer's Kit joystick "button." * Indexed using DJOY_* definitions in include/nuttx/input/djoystick.h. */ @@ -172,16 +173,16 @@ static djoy_buttonset_t djoy_sample(FAR const struct djoy_lowerhalf_s *lower) for (i = 0; i < DJOY_NGPIOS; i++) { - /* A LOW value means that the key is pressed. */ + /* A LOW value means that the key is pressed. */ - bool released = lpc17_40_gpioread(g_joygpio[i]); + bool released = lpc17_40_gpioread(g_joygpio[i]); - /* Accumulate the set of depressed (not released) keys */ + /* Accumulate the set of depressed (not released) keys */ - if (!released) - { + if (!released) + { ret |= (1 << i); - } + } } iinfo("Returning: %02x\n", DJOY_ALLBITS); diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_lcd.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_lcd.c index 492a85aad9..29ccee7d75 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_lcd.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_lcd.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4088-devkit/src/lpc17_40_lcd.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_lcd.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,34 +49,35 @@ #ifdef CONFIG_LPC17_40_LCD -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_devkit_lcd_initialize * * Description: * Initialize the LCD. Setup backlight (initially off) * - ************************************************************************************/ + ****************************************************************************/ void lpc4088_devkit_lcd_initialize(void) { /* Configure the LCD backlight (and turn the backlight off) */ + #ifdef CONFIG_LPC17_40_LCD_BACKLIGHT lpc17_40_configgpio(GPIO_LCD_BL); #endif } -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_backlight * * Description: - * If CONFIG_LPC17_40_LCD_BACKLIGHT is defined, then the board-specific logic must - * provide this interface to turn the backlight on and off. + * If CONFIG_LPC17_40_LCD_BACKLIGHT is defined, then the board-specific + * logic must provide this interface to turn the backlight on and off. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_LCD_BACKLIGHT void lpc17_40_backlight(bool blon) @@ -84,5 +85,4 @@ void lpc17_40_backlight(bool blon) lpc17_40_gpiowrite(GPIO_LCD_BL, blon); } #endif - #endif /* CONFIG_LPC17_40_LCD */ diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_nandinitialize.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_nandinitialize.c index 193914fdde..f7aecc1887 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_nandinitialize.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_nandinitialize.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4088-devkit/src/lpc17_40_nandinitialize.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_nandinitialize.c * arch/arm/src/board/lpc17_40_nandinitialize.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -32,11 +32,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -51,17 +51,17 @@ #if defined(CONFIG_LPC17_40_EMC) && defined(CONFIG_LPC17_40_EXTNAND) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_devkit_nand_initialize * * Description: * Initialize NAND FLASH * - ************************************************************************************/ + ****************************************************************************/ void lpc4088_devkit_nand_initialize(void) { diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_norinitialize.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_norinitialize.c index 18d3e76d87..518985d205 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_norinitialize.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_norinitialize.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4088-devkit/src/lpc17_40_norinitialize.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_norinitialize.c * arch/arm/src/board/lpc17_40_norinitialize.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -32,11 +32,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -51,17 +51,17 @@ #if defined(CONFIG_LPC17_40_EMC) && defined(CONFIG_LPC17_40_EXTNOR) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_devkit_nor_initialize * * Description: * Initialize NOR FLASH * - ************************************************************************************/ + ****************************************************************************/ void lpc4088_devkit_nor_initialize(void) { diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_sdraminitialize.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_sdraminitialize.c index b6483d28da..1b9a0ebdd4 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_sdraminitialize.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_sdraminitialize.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4088-devkit/src/lpc17_40_sdraminitialize.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_sdraminitialize.c * arch/arm/src/board/lpc17_40_sdraminitialize.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -32,11 +32,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -54,12 +54,13 @@ #if defined(CONFIG_LPC17_40_EMC) && defined(CONFIG_LPC17_40_EXTDRAM) -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* The core clock is LPC17_40_EMCCLK which may be either LPC17_40_CCLK* (undivided), or - * LPC17_40_CCLK / 2 as determined by settings in the board.h header file. +/* The core clock is LPC17_40_EMCCLK which may be either LPC17_40_CCLK* + * (undivided), or LPC17_40_CCLK / 2 as determined by settings in the board.h + * header file. * * For example: * LPC17_40_CCLCK = 120,000,000 @@ -97,17 +98,17 @@ #define SDRAM_BASE 0xa0000000 /* CS0 */ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_devkit_sdram_initialize * * Description: * Initialize SDRAM * - ************************************************************************************/ + ****************************************************************************/ void lpc4088_devkit_sdram_initialize(void) { @@ -143,7 +144,7 @@ void lpc4088_devkit_sdram_initialize(void) putreg32( 1, LPC17_40_EMC_DYNAMICAPR); /* TAPR = 2 clocks? */ putreg32(EMC_NS2CLK(20) + 2, LPC17_40_EMC_DYNAMICDAL); /* TDAL = TRP + TDPL = 20ns + 2clk */ putreg32( 1, LPC17_40_EMC_DYNAMICWR); /* TWR = 2 clocks */ - putreg32( EMC_NS2CLK(63), LPC17_40_EMC_DYNAMICRC); /* H57V2562GTR-75C TRC = 63ns(min)*/ + putreg32( EMC_NS2CLK(63), LPC17_40_EMC_DYNAMICRC); /* H57V2562GTR-75C TRC = 63ns(min) */ putreg32( EMC_NS2CLK(63), LPC17_40_EMC_DYNAMICRFC); /* H57V2562GTR-75C TRFC = TRC */ putreg32( 15, LPC17_40_EMC_DYNAMICXSR); /* Exit self-refresh to active */ putreg32( EMC_NS2CLK(63), LPC17_40_EMC_DYNAMICRRD); /* 3 clock, TRRD = 15ns (min) */ @@ -158,27 +159,29 @@ void lpc4088_devkit_sdram_initialize(void) putreg32(MDKCFG_RASCAS0VAL, LPC17_40_EMC_DYNAMICRASCAS0); #ifdef CONFIG_LPC17_40_SDRAM_16BIT - /* For Manley lpc1778 SDRAM: H57V2562GTR-75C, 256Mb, 16Mx16, 4 banks, row=13, column=9: - * - * 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC - */ + + /* For Manley lpc1778 SDRAM: + * H57V2562GTR-75C, 256Mb, 16Mx16, 4 banks, row=13, column=9: + * + * 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC + */ putreg32(EMC_DYNAMICCONFIG_MD_SDRAM | EMC_DYNAMICCONFIG_AM0(13), LPC17_40_EMC_DYNAMICCONFIG0); #elif defined CONFIG_LPC17_40_SDRAM_32BIT - /* 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC */ + /* 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC */ - putreg32(EMC_DYNAMICCONFIG_MD_SDRAM | EMC_DYNAMICCONFIG_AM0(13) | EMC_DYNAMICCONFIG_AM1, - LPC17_40_EMC_DYNAMICCONFIG0); + putreg32(EMC_DYNAMICCONFIG_MD_SDRAM | EMC_DYNAMICCONFIG_AM0(13) | + EMC_DYNAMICCONFIG_AM1, LPC17_40_EMC_DYNAMICCONFIG0); #endif up_mdelay(100); /* Issue NOP command */ - putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | EMC_DYNAMICCONTROL_I_NOP, - LPC17_40_EMC_DYNAMICCONTROL); + putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | + EMC_DYNAMICCONTROL_I_NOP, LPC17_40_EMC_DYNAMICCONTROL); /* Wait 200 Msec */ @@ -186,8 +189,8 @@ void lpc4088_devkit_sdram_initialize(void) /* Issue PALL command */ - putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | EMC_DYNAMICCONTROL_I_PALL, - LPC17_40_EMC_DYNAMICCONTROL); + putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | + EMC_DYNAMICCONTROL_I_PALL, LPC17_40_EMC_DYNAMICCONTROL); putreg32(2, LPC17_40_EMC_DYNAMICREFRESH); /* ( n * 16 ) -> 32 clock cycles */ @@ -195,7 +198,7 @@ void lpc4088_devkit_sdram_initialize(void) for (i = 0; i < 128; i++); - /* 64ms/8192 = 7.8125us, nx16x8.33ns < 7.8125us, n < 58.6*/ + /* 64ms/8192 = 7.8125us, nx16x8.33ns < 7.8125us, n < 58.6 */ regval = 64000000 / (1 << 13); regval -= 16; @@ -205,8 +208,8 @@ void lpc4088_devkit_sdram_initialize(void) /* Issue MODE command */ - putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | EMC_DYNAMICCONTROL_I_MODE, - LPC17_40_EMC_DYNAMICCONTROL); + putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | + EMC_DYNAMICCONTROL_I_MODE, LPC17_40_EMC_DYNAMICCONTROL); #ifdef CONFIG_LPC17_40_SDRAM_16BIT (void)getreg16(SDRAM_BASE | (0x33 << 12)); /* 8 burst, 3 CAS latency */ diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_ssp.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_ssp.c index ab650036f6..01d4ea9551 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_ssp.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_ssp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-devkit/src/lpc17_40_ssp.c + * boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_ssp.c * arch/arm/src/board/lpc17_40_ssp.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -104,35 +104,39 @@ void weak_function lpc4088_devkit_sspdev_initialize(void) #endif } -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_ssp0/1/2select and lpc17_40_ssp0/1/2status * * Description: - * The external functions, lpc17_40_ssp0/1/2select and lpc17_40_ssp0/1/2status - * must be provided by board-specific logic. They are implementations of the select - * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including lpc17_40_sspbus_initialize()) - * are provided by common LPC17xx/LPC40xx logic. To use this common SPI logic on your - * board: + * The external functions, lpc17_40_ssp0/1/2select and + * lpc17_40_ssp0/1/2status must be provided by board-specific logic. + * They are implementations of the select and status methods of the SPI + * interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). + * All other methods (including lpc17_40_sspbus_initialize()) + * are provided by common LPC17xx/LPC40xx logic. + * To use this common SPI logic on your board: * - * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip select - * pins. - * 2. Provide lpc17_40_ssp0/1/2select() and lpc17_40_ssp0/1/2status() functions - * in your board-specific logic. These functions will perform chip selection - * and status operations using GPIOs in the way your board is configured. - * 3. Add a calls to lpc17_40_sspbus_initialize() in your low level application - * initialization logic - * 4. The handle returned by lpc17_40_sspbus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip + * select pins. + * 2. Provide lpc17_40_ssp0/1/2select() and lpc17_40_ssp0/1/2status() + * functions in your board-specific logic. These functions will perform + * chip selection and status operations using GPIOs in the way your + * board is configured. + * 3. Add a calls to lpc17_40_sspbus_initialize() in your low level + * application initialization logic + * 4. The handle returned by lpc17_40_sspbus_initialize() may then be used + * to bind the SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_SSP0 -void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); } uint8_t lpc17_40_ssp0status(FAR struct spi_dev_s *dev, uint32_t devid) @@ -143,9 +147,11 @@ uint8_t lpc17_40_ssp0status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_LPC17_40_SSP1 -void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); if (devid == SPIDEV_TOUCHSCREEN(0)) { /* Assert/de-assert the CS pin to the touchscreen */ @@ -164,9 +170,11 @@ uint8_t lpc17_40_ssp1status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_LPC17_40_SSP2 -void lpc17_40_ssp2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp2select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); } uint8_t lpc17_40_ssp2status(FAR struct spi_dev_s *dev, uint32_t devid) diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_touchscreen.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_touchscreen.c index cd857246b6..d572b44009 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_touchscreen.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_touchscreen.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4088-devkit/src/lpc17_40_touchscreen.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_touchscreen.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Included Files @@ -178,7 +178,8 @@ static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable) iinfo("enable:%d\n", enable); if (enable) { - /* Enable PENIRQ interrupts. NOTE: The pin interrupt is enabled from worker thread + /* Enable PENIRQ interrupts. + * NOTE: The pin interrupt is enabled from worker thread * logic after completion of processing of the touchscreen interrupt. */ @@ -186,7 +187,8 @@ static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable) } else { - /* Disable PENIRQ interrupts. NOTE: The PENIRQ interrupt will be disabled from + /* Disable PENIRQ interrupts. + * NOTE: The PENIRQ interrupt will be disabled from * interrupt handling logic. */ @@ -196,7 +198,8 @@ static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable) static void tsc_clear(FAR struct ads7843e_config_s *state) { - /* Does nothing. The interrupt is cleared automatically in the GPIO + /* Does nothing. + * The interrupt is cleared automatically in the GPIO * logic for the LPC17xx/LPC40xx family. */ } @@ -293,7 +296,8 @@ int lpc4088_devkit_tsc_setup(int minor) dev = lpc17_40_sspbus_initialize(CONFIG_ADS7843E_SPIDEV); if (!dev) { - ierr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV); + ierr("ERROR: Failed to initialize SPI bus %d\n", + CONFIG_ADS7843E_SPIDEV); return -ENODEV; } @@ -304,7 +308,9 @@ int lpc4088_devkit_tsc_setup(int minor) { ierr("ERROR: Failed to register touchscreen device minor=%d\n", CONFIG_ADS7843E_DEVMINOR); + /* up_spiuninitialize(dev); */ + return -ENODEV; } diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_userleds.c b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_userleds.c index ed9e0da90a..c22925952b 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_userleds.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-devkit/src/lpc17_40_userleds.c + * boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_userleds.c * arch/arm/src/board/lpc17_40_userleds.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. diff --git a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc4088-devkit.h b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc4088-devkit.h index 126319ca54..0f29334ebf 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc4088-devkit.h +++ b/boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc4088-devkit.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4088-devkit/src/lpc4088-devkit.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc4088-devkit.h * arch/arm/src/board/lpc4088-devkit.h * * Copyright (C) 2013, 2017-2018 Gregory Nutt. All rights reserved. @@ -32,23 +32,24 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef _CONFIGS_LPC4088_DEVKIT_SRC_LPC4088_DEVKIT_H -#define _CONFIGS_LPC4088_DEVKIT_SRC_LPC4088_DEVKIT_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_LPC4088_DEVKIT_SRC_LPC4088_DEVKIT_H +#define __BOARDS_ARM_LPC17XX_40XX_LPC4088_DEVKIT_SRC_LPC4088_DEVKIT_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* LPC4088 Developer's Kit GPIO Pin Definitions *****************************/ -/* LPC4088 Developer's Kit GPIO Pin Definitions *************************************/ /* GPIO P2[21] connects to the Ready/Busy pin of the NAND part. We need to * reconfigure this pin as normal GPIO input if NAND is used. */ @@ -63,7 +64,8 @@ * LED3 -- Connected to P1[13] * LED4 -- Connected to P4[27] * - * These LEDs are connecte to ground so a high output value will illuminate them. + * These LEDs are connecte to ground so a high output value will illuminate + * them. */ #define GPIO_LED1 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT1 | GPIO_PIN14) @@ -71,11 +73,13 @@ #define GPIO_LED3 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT1 | GPIO_PIN13) #define GPIO_LED4 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT4 | GPIO_PIN27) -/* Button definitions ***************************************************************/ -/* The LPC4088 Developer's Kit supports several buttons. All are pulled up externally. - * When closed, the pins will be pulled to ground. So the buttons will read "1" - * when open and "0" when closed. All are capable of generating - * interrupts. +/* Button definitions *******************************************************/ + +/* The LPC4088 Developer's Kit supports several buttons. + * All are pulled up externally. + * When closed, the pins will be pulled to ground. + * So the buttons will read "1" when open and "0" when closed. + * All are capable of generating interrupts. * * USER1 -- Connected to P2[10] * @@ -87,8 +91,8 @@ * JOY_D -- Connected to P2[27] * JOY_CTR -- Connected to P2[22] * - * For the interrupting buttons, interrupts are generated on both edges (press and - * release). + * For the interrupting buttons, interrupts are generated on both edges + * (press and release). */ #define GPIO_USER1 (GPIO_INPUT | GPIO_PULLUP | GPIO_PORT4 | GPIO_PIN26) @@ -108,37 +112,43 @@ #define GPIO_JOY_D_IRQ LPC17_40_IRQ_P2p27 #define GPIO_JOY_CTR_IRQ LPC17_40_IRQ_P2p22 -/* SD Card **************************************************************************/ -/* The SD card detect (CD) signal is on bit 4 of the PCA9532 port expander U8. - * Support for this is not currently set up. - * The SD card's power is controlled through a P-channel MOSFET connected to P1[5]. - * This pin must be driven LOW in order to enable the SD card.*/ +/* SD Card ******************************************************************/ + +/* The SD card detect (CD) signal is on bit 4 of the PCA9532 port expander + * U8. Support for this is not currently set up. + * The SD card's power is controlled through a P-channel MOSFET connected + * to P1[5]. This pin must be driven LOW in order to enable the SD card. + */ #define GPIO_SD_PWR (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT1 | GPIO_PIN5) -/* More work is required to complete implementation of LCD support on this board. */ +/* More work is required to complete implementation of LCD support + * on this board. + */ #if 0 -/* LCD ******************************************************************************/ +/* LCD **********************************************************************/ + /* Backlight enable, P2[1]. Initial state is OFF (zero) */ #define GPIO_LCD_BL (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT2 | GPIO_PIN1) -/* XPT2046 Touchscreen **************************************************************/ -/* -------------- -------------------- ------------ -------------------------------- +/* XPT2046 Touchscreen ******************************************************/ + +/* -------------- -------------------- ------------ ------------------------- * XTPT2046 Module Module LPC4088 Developer's Kit LED * Signal Connector Connector - * -------------- -------------------- ------------ --------------------------------- + * -------------- -------------------- ------------ ------------------------- * Pin 11 PENIRQ\ PENIRQ (pulled high) PORT3 Pin 1 P2.15 PENIRQ * Pin 12 DOUT MISO PORT3 Pin 4 P1.18 MISO1 (Also USB HOST UP LED) * Pin 13 BUSY BUSY (pulled high) PORT3 Pin 9 P2.14 BUSY * Pin 14 DIN MOSI PORT3 Pin 3 P0.13 MOSI1 (Also USB Device up LED and SD CD pin) * Pin 15 CS\ SSEL (pulled high) PORT3 Pin 6 P1.8 GPIO (Also RMII_CRS_DV) * Pin 16 DCLK SCK PORT3 Pin 5 P1.19 SCK1 - * -------------- -------------------- ------------ --------------------------------- + * -------------- -------------------- ------------ ------------------------- * - * Pins should not need to be configured as pull-ups because, according to the LCD - * schematic, the are pulled-up on board the LCD module. + * Pins should not need to be configured as pull-ups because, according to + * the LCD schematic, the are pulled-up on board the LCD module. */ #define GPIO_TC_PENIRQ (GPIO_INTBOTH | GPIO_FLOAT | GPIO_PORT2 | GPIO_PIN15) @@ -149,17 +159,17 @@ #endif -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_devkit_bringup * * Description: @@ -171,102 +181,103 @@ * CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y : * Called from the NSH library via boardctl() * - ************************************************************************************/ + ****************************************************************************/ int lpc4088_devkit_bringup(void); -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_devkit_sspdev_initialize * * Description: - * Called to configure SPI chip select GPIO pins for the LPC4088 Developer's Kit board. + * Called to configure SPI chip select GPIO pins for the LPC4088 Developer's + * Kit board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lpc4088_devkit_sspdev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_devkit_sdram_initialize * * Description: * Initialize SDRAM * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_EMC #ifdef CONFIG_LPC17_40_EXTDRAM void lpc4088_devkit_sdram_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_devkit_nor_initialize * * Description: * Initialize NOR FLASH * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_EXTNOR void lpc4088_devkit_nor_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_devkit_nand_initialize * * Description: * Initialize NAND FLASH * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_EXTNAND void lpc4088_devkit_nand_initialize(void); #endif #endif /* CONFIG_LPC17_40_EMC */ -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_devkit_lcd_initialize * * Description: * Initialize the LCD. Setup backlight (initially off) * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_LCD void lpc4088_devkit_lcd_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_devkit_tsc_setup * * Description: - * This function is called by board-bringup logic to configure the touchscreen - * device. This function will register the driver as /dev/inputN where N is the - * minor device number. + * This function is called by board-bringup logic to configure the + * touchscreen device. This function will register the driver as + * /dev/inputN where N is the minor device number. * * Input Parameters: * minor - The input device minor number * * Returned Value: - * Zero is returned on success. Otherwise, a negated errno value is returned to - * indicate the nature of the failure. + * Zero is returned on success. Otherwise, a negated errno value is + * returned to indicate the nature of the failure. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_INPUT_ADS7843E int lpc4088_devkit_tsc_setup(int minor); #endif -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_djoy_initialization * * Description: * Initialize and register the discrete joystick driver * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC4088_DEVKIT_DJOYSTICK int lpc17_40_djoy_initialization(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_LPC4088_DEVKIT_SRC_LPC4088_DEVKIT_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_LPC4088_DEVKIT_SRC_LPC4088_DEVKIT_H */ diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/README.txt b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/README.txt index 0fb495912e..b7d5d2ca93 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/README.txt +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/README.txt @@ -93,7 +93,7 @@ Using OpenOCD with the Olimex ARM-USB-OCD I have been using the Olimex ARM-USB-OCD debugger. OpenOCD requires a configuration file. I keep the one I used last here: - boards/lpc4088-quickstart/tools/lpc4088-quickstart.cfg + boards/arm/lpc17xx_40xx/lpc4088-quickstart/tools/lpc4088-quickstart.cfg However, the "correct" configuration script to use with OpenOCD may change as the features of OpenOCD evolve. So you should at least @@ -121,7 +121,7 @@ Using OpenOCD with the Olimex ARM-USB-OCD installations. They could be most anywhwere if you are using a windows version of OpenOCD. - boards/lpc4088-quickstart/tools/lpc4088-quickstart.cfg + boards/arm/lpc17xx_40xx/lpc4088-quickstart/tools/lpc4088-quickstart.cfg This is simply openocd-usb.cfg, lpc40xx.cfg, and lpc1xxx.cfg concatenated into one file for convenience. Don't use it unless you have to. @@ -132,20 +132,21 @@ Using OpenOCD with the Olimex ARM-USB-OCD - Possibly the value of OPENOCD_PATH and TARGET_PATH - It assumes that the correct script to use is the one at - boards/lpc4088-quickstart/tools/lpc4088-quickstart.cfg + boards/arm/lpc17xx_40xx/lpc4088-quickstart/tools/lpc4088-quickstart.cfg Starting OpenOCD Then you should be able to start the OpenOCD daemon as follows. This assumes that you have already CD'ed to the NuttX build directory and - that you have set the full path to the boards/lpc4088-quickstart/tools + that you have set the full path to the + boards/arm/lpc17xx_40xx/lpc4088-quickstart/tools in your PATH environment variable: oocd.sh $PWD or, if the PATH variable is not so configured: - boards/lpc4088-quickstart/tools/oocd.sh $PWD + boards/arm/lpc17xx_40xx/lpc4088-quickstart/tools/oocd.sh $PWD Connecting GDB diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/include/board.h b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/include/board.h index a668391a8c..6666ee688d 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/include/board.h +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4088-quickstart/include/board.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpc4088-quickstart/include/board.h * include/arch/board/board.h * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -32,14 +32,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_LPC4088_QUICKSTART_INCLUDE_BOARD_H -#define __BOARDS_ARM_LPC4088_QUICKSTART_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_LPC4088_QUICKSTART_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC17XX_40XX_LPC4088_QUICKSTART_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,12 +49,15 @@ # include #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Clocking *************************************************************************/ -/* 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 include path. + ****************************************************************************/ + +/* Clocking *****************************************************************/ + +/* 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 include path. */ #define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency */ @@ -65,27 +68,28 @@ /* This is the clock setup we configure for: * - * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source - * PLL0CLK = (10 * SYSCLK) / 1 = 120MHz -> PLL0 multipler=10, pre-divider=1 - * CCLCK = 120MHz -> CCLK divider = 1 + * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source + * PLL0CLK = (10 * SYSCLK) / 1 = 120MHz -> PLL0 multipler=10, pre-divider=1 + * CCLCK = 120MHz -> CCLK divider = 1 */ -#define LPC17_40_CCLK 120000000 /* 120Mhz */ +#define LPC17_40_CCLK 120000000 /* 120Mhz */ #define BOARD_PCLKDIV 2 /* Peripheral clock = LPC17_40_CCLK/2 */ #define BOARD_PCLK_FREQUENCY (LPC17_40_CCLK / BOARD_PCLKDIV) -/* Select the main oscillator as the frequency source. SYSCLK is then the frequency - * of the main oscillator. +/* Select the main oscillator as the frequency source. + * SYSCLK is then the frequency of the main oscillator. * - * If BOARD_XTAL_FREQUENCY > 15000000, then the SCS OSCRS bit (bit 4) should also - * be set in the BOARD_SCS_VALUE. + * If BOARD_XTAL_FREQUENCY > 15000000, then the SCS OSCRS bit (bit 4) should + * also be set in the BOARD_SCS_VALUE. */ #undef CONFIG_LPC17_40_MAINOSC #define CONFIG_LPC17_40_MAINOSC 1 #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 CCLK. * The input to the divider (PLLCLK) will be determined by the PLL output. */ @@ -188,16 +192,19 @@ #endif #endif -/* LED definitions ******************************************************************/ -/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in - * any way. The following definitions are used to access individual LEDs. +/* LED definitions **********************************************************/ + +/* If CONFIG_ARCH_LEDS is not defined, then the user can control + * the LEDs in any way. + * The following definitions are used to access individual LEDs. * * LED1 : Connected to P1[18] * LED2 : Connected to P0[13] * LED3 : Connected to P1[13] * LED4 : Connected to P2[19] * - * These LEDs are connecte to ground so a high output value will illuminate them. + * These LEDs are connecte to ground so a high output value will illuminate + * them. */ /* LED index values for use with board_userled() */ @@ -216,8 +223,8 @@ #define BOARD_LED4_BIT (1 << BOARD_LED4) /* If CONFIG_ARCH_LEDs is defined, then NuttX will control the four LEDs - * on the LPC4088 QuickStart board. The following definitions describe how NuttX - * controls the LEDs: + * on the LPC4088 QuickStart board. + * The following definitions describe how NuttX controls the LEDs: */ /* LED1 LED2 LED3 LED4 */ #define LED_STARTED 0 /* OFF OFF OFF OFF */ @@ -228,29 +235,31 @@ #define LED_SIGNAL 4 /* LED3 glows, on while in signal handler */ #define LED_ASSERTION 4 /* LED3 glows, on while in assertion */ #define LED_PANIC 4 /* LED3 Flashes at 2Hz */ -#define LED_IDLE 5 /* LED4 glows: ON while active * - * OFF while sleeping */ +#define LED_IDLE 5 /* LED4 glows: ON while active + * OFF while sleeping + */ -/* Button definitions ***************************************************************/ -/* The LPC4088 QuickStart supports a single button. It must be pulled up by the MCU. - * When closed, the pin will be pulled to ground. So the button will read "1" - * when open and "0" when closed. The button is capable of generating an - * interrupt. +/* Button definitions *******************************************************/ + +/* The LPC4088 QuickStart supports a single button. + * It must be pulled up by the MCU. + * When closed, the pin will be pulled to ground. + * So the button will read "1" when open and "0" when closed. + * The button is capable of generating an interrupt. * * USER1 -- Connected to P2[10] * - * For the interrupting buttons, interrupts are generated on both edges (press and - * release). + * For the interrupting buttons, interrupts are generated on both edges + * (press and release). */ - #define BOARD_BUTTON_USER1 0 #define NUM_BUTTONS 1 #define BOARD_BUTTON_USER1_BIT (1 << BOARD_BUTTON_USER1) -/* Alternate pin selections *********************************************************/ +/* Alternate pin selections *************************************************/ /* UART0: * @@ -290,9 +299,9 @@ #define GPIO_ENET_MDC GPIO_ENET_MDC_1 #define GPIO_ENET_MDIO GPIO_ENET_MDIO_1 - /* External LCD is currently untested. - * These pins will probably need to be updated before using the LCD. */ + * These pins will probably need to be updated before using the LCD. + */ #if 0 /* LCD R: @@ -357,24 +366,22 @@ /* XPT2046 Touchscreen: * -/* -------------- -------------------- ------------ -------------------------------- + * -------------- -------------------- ------------ ------------------------- * XTPT2046 Module Module * Signal Connector Connector - * -------------- -------------------- ------------ --------------------------------- + * -------------- -------------------- ------------ ------------------------- * Pin 11 PENIRQ\ PENIRQ (pulled high) PORT3 Pin 1 P2.15 PENIRQ * Pin 12 DOUT MISO PORT3 Pin 4 P1.18 MISO1 (Also USB HOST UP LED) * Pin 13 BUSY BUSY (pulled high) PORT3 Pin 9 P2.14 BUSY * Pin 14 DIN MOSI PORT3 Pin 3 P0.13 MOSI1 (Also USB Device up LED and SD CD pin) * Pin 15 CS\ SSEL (pulled high) PORT3 Pin 6 P1.8 GPIO (Also RMII_CRS_DV) * Pin 16 DCLK SCK PORT3 Pin 5 P1.19 SCK1 - * -------------- -------------------- ------------ --------------------------------- + * -------------- -------------------- ------------ ------------------------- */ - #define GPIO_SSP1_MISO GPIO_SSP1_MISO_3 #define GPIO_SSP1_MOSI GPIO_SSP1_MOSI_2 #define GPIO_SSP1_SCK GPIO_SSP1_SCK_2 #endif - -#endif /* __BOARDS_ARM_LPC4088_QUICKSTART_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_LPC4088_QUICKSTART_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/Makefile b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/Makefile index 820007544f..b7f87f29c9 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/Makefile +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpc4088-quickstart/kernel/Makefile +# boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/Makefile # # Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/lpc17_40_userspace.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/lpc17_40_userspace.c index 411f753890..f0ba0b6cf5 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/lpc17_40_userspace.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/lpc17_40_userspace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-quickstart/kernel/lpc17_40_userspace.c + * boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/lpc17_40_userspace.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -50,6 +50,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifndef CONFIG_NUTTX_USERSPACE @@ -64,14 +65,14 @@ * Public Data ****************************************************************************/ -/* These 'addresses' of these values are setup by the linker script. They are - * not actual uint32_t storage locations! They are only used meaningfully in the - * following way: +/* These 'addresses' of these values are setup by the linker script. + * They are not actual uint32_t storage locations! + * They are only used meaningfully in the following way: * * - The linker script defines, for example, the symbol_sdata. * - The declareion extern uint32_t _sdata; makes C happy. C will believe - * that the value _sdata is the address of a uint32_t variable _data (it is - * not!). + * that the value _sdata is the address of a uint32_t variable _data + * (it is not!). * - We can recoved the linker value then by simply taking the address of * of _data. like: uint32_t *pdata = &_sdata; */ diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/Make.defs b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/Make.defs index 994b5329fe..9c16741ad9 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/Make.defs +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpc4088-quickstart/scripts/Make.defs +# boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/Make.defs # # Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/kernel-space.ld b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/kernel-space.ld index ebc0677159..b0b5dfcec0 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/kernel-space.ld +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/kernel-space.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-quickstart/scripts/kernel-space.ld + * boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/kernel-space.ld * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/ld.script b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/ld.script index 6364ef9f0d..5c510db2c4 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/ld.script +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-quickstart/scripts/ld.script + * boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/ld.script * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Rommel Marcelo diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/memory.ld b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/memory.ld index c4dd383a3f..55b97e6221 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/memory.ld +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/memory.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-quickstart/scripts/memory.ld + * boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/memory.ld * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -41,9 +41,10 @@ * * For MPU support, the kernel-mode NuttX section is assumed to be 256KB of * FLASH and 4KB of SRAM. That, of course, can be optimized as needed (See - * also boards/lpc4088-quickstart/scripts/kernel-space.ld); 256KB is probably much - * more than is needed by the RTOS! That size is selected only because it - * is available due to alignment issues for the user space FLASH memory. + * also boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/kernel-space.ld); + * 256KB is probably much more than is needed by the RTOS! + * That size is selected only because it is available due to alignment issues + * for the user space FLASH memory. * * Alignment of the user space FLASH partition is a critical factor: The * user space FLASH partition will be spanned with a single region of size diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/user-space.ld b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/user-space.ld index 73822135b8..60ae9e13ce 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/user-space.ld +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/user-space.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-quickstart/scripts/user-space.ld + * boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/user-space.ld * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/Makefile b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/Makefile index 52bab7da94..1f375750f2 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/Makefile +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpc4088-quickstart/src/Makefile +# boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/Makefile # # Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_appinit.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_appinit.c index 775d569f1b..369a1cf0f3 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_appinit.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lpc4088-quickstart/src/lpc17_40_appinit.c + * boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_appinit.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_autoleds.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_autoleds.c index fed3d3095e..cbe11e9984 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_autoleds.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-quickstart/src/lpc17_40_autoleds.c + * boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_autoleds.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -60,13 +60,14 @@ /* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in * any way. The following definitions are used to access individual LEDs. * - * These LEDs are driven through a PNP transistor so a low output value will + * These LEDs are driven through a PNP transistor so a low output value will * illuminate them. - + * * LED1 : Connected to P1[18] * LED2 : Connected to P0[13] * - * These LEDs are connected to ground so a high output value will illuminate them. + * These LEDs are connected to ground so a high output value will illuminate + * them. * * LED3 : Connected to P1[13] * LED4 : Connected to P2[19] @@ -74,8 +75,8 @@ * * If CONFIG_ARCH_LEDs is defined, then NuttX will control the four LEDs - * on the LPC4088 Quickstart Board. The following definitions describe how NuttX - * controls the LEDs: + * on the LPC4088 Quickstart Board. The following definitions describe how + * NuttX controls the LEDs: * * LED1 LED2 LED3 LED4 * LED_STARTED 0 OFF OFF OFF OFF diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_boardinitialize.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_boardinitialize.c index ea518727f1..002cd8250b 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_boardinitialize.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_boardinitialize.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4088_quickstart/src/lpc17_40_boardinitialize.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpc4088_quickstart/src/lpc17_40_boardinitialize.c * * Copyright (C) 2013, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -51,27 +51,28 @@ #include "lpc4088-quickstart.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_boardinitialize * * Description: - * All LPC17xx/LPC40xx architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All LPC17xx/LPC40xx architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc17_40_boardinitialize(void) { @@ -92,8 +93,8 @@ void lpc17_40_boardinitialize(void) #if defined(CONFIG_LPC17_40_SSP0) || defined(CONFIG_LPC17_40_SSP1) || \ defined(CONFIG_LPC17_40_SSP2) /* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) - * the weak function lpc4088_quickstart_sspdev_initialize() has been brought - * into the link. + * the weak function lpc4088_quickstart_sspdev_initialize() has been + * brought into the link. */ if (lpc4088_quickstart_sspdev_initialize) @@ -107,7 +108,6 @@ void lpc17_40_boardinitialize(void) board_autoled_initialize(); #endif - } /**************************************************************************** diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c index e4cb1a99da..5a6eff27ad 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lpc4088_quickstart/src/lpc17_40_bringup.c + * boards/arm/lpc17xx_40xx/lpc4088_quickstart/src/lpc17_40_bringup.c * * Copyright (C) 2013, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -62,6 +62,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #define NSH_HAVE_MMCSD 0 @@ -83,7 +84,9 @@ # undef NSH_HAVE_MMCSD #endif -/* MMC/SD support requires that an SPI support is enabled and an SPI port is selected */ +/* MMC/SD support requires that an SPI support is enabled and an SPI port is + * selected + */ #ifdef NSH_HAVE_MMCSD # if !defined(CONFIG_NSH_MMCSDSLOTNO) @@ -99,9 +102,11 @@ # endif #endif -/* The SD card detect (CD) signal is on P0[13]. This signal is shared. It is also - * used for MOSI1 and USB_UP_LED. The CD pin may be disconnected. There is a jumper - * on board that enables the CD pin. +/* The SD card detect (CD) signal is on P0[13]. + * This signal is shared. + * It is also used for MOSI1 and USB_UP_LED. + * The CD pin may be disconnected. + * There is a jumper on board that enables the CD pin. */ #ifdef NSH_HAVE_MMCSD @@ -180,7 +185,7 @@ static int nsh_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; syslog(LOG_INFO, "nsh_waiter: Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -252,8 +257,8 @@ static int nsh_sdinitialize(void) * inserted or deleted. */ - (void)irq_attach(LPC17_40_IRQ_P0p13, nsh_cdinterrupt, NULL); - up_enable_irq(LPC17_40_IRQ_P0p13); + (void)irq_attach(LPC17_40_IRQ_P0p13, nsh_cdinterrupt, NULL); + up_enable_irq(LPC17_40_IRQ_P0p13); #endif #endif @@ -321,7 +326,8 @@ static int nsh_usbhostinitialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to register the mass storage class: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -331,7 +337,8 @@ static int nsh_usbhostinitialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); } #endif diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_buttons.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_buttons.c index d742f98bde..8969e8f998 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_buttons.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-quickstart/src/lpc17_40_buttons.c + * boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_buttons.c * * Copyright (C) 2013, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -58,8 +58,8 @@ * Private Data ****************************************************************************/ -/* The LPC4088 Quickstart supports several buttons. All will read "1" when - * open and "0" when closed +/* The LPC4088 Quickstart supports several buttons. + * All will read "1" when open and "0" when closed * * USER1 -- Connected to P2[10] * @@ -95,10 +95,10 @@ static const uint8_t g_buttonirq[NUM_BUTTONS] = * Name: board_button_initialize * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_buttons() may be called to collect the current state of all - * buttons or board_button_irq() may be called to register button interrupt - * handlers. + * board_button_initialize() must be called to initialize button resources. + * After that, board_buttons() may be called to collect the current state + * of all buttons or board_button_irq() may be called to register button + * interrupt handlers. * ****************************************************************************/ @@ -139,16 +139,16 @@ uint32_t board_buttons(void) for (i = 0; i < NUM_BUTTONS; i++) { - /* A LOW value means that the key is pressed. */ + /* A LOW value means that the key is pressed. */ - bool released = lpc17_40_gpioread(g_buttoncfg[i]); + bool released = lpc17_40_gpioread(g_buttoncfg[i]); - /* Accumulate the set of depressed (not released) keys */ + /* Accumulate the set of depressed (not released) keys */ - if (!released) - { + if (!released) + { ret |= (1 << i); - } + } } return ret; @@ -170,8 +170,8 @@ uint32_t board_buttons(void) * * Note that board_button_irq() also enables button interrupts. Button * interrupts will remain enabled after the interrupt handler is attached. - * Interrupts may be disabled (and detached) by calling board_button_irq with - * irqhandler equal to NULL. + * Interrupts may be disabled (and detached) by calling board_button_irq + * with irqhandler equal to NULL. * ****************************************************************************/ diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_lcd.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_lcd.c index 18e3ebd7e7..0cd856bfdd 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_lcd.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_lcd.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4088-quickstart/src/lpc17_40_lcd.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_lcd.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,34 +49,35 @@ #ifdef CONFIG_LPC17_40_LCD -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_devkit_lcd_initialize * * Description: * Initialize the LCD. Setup backlight (initially off) * - ************************************************************************************/ + ****************************************************************************/ void lpc4088_devkit_lcd_initialize(void) { /* Configure the LCD backlight (and turn the backlight off) */ + #ifdef CONFIG_LPC17_40_LCD_BACKLIGHT lpc17_40_configgpio(GPIO_LCD_BL); #endif } -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_backlight * * Description: - * If CONFIG_LPC17_40_LCD_BACKLIGHT is defined, then the board-specific logic must - * provide this interface to turn the backlight on and off. + * If CONFIG_LPC17_40_LCD_BACKLIGHT is defined, then the board-specific + * logic must provide this interface to turn the backlight on and off. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_LCD_BACKLIGHT void lpc17_40_backlight(bool blon) diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_nandinitialize.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_nandinitialize.c index dc811a9b5e..7a40083ad0 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_nandinitialize.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_nandinitialize.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4088-quickstart/src/lpc17_40_nandinitialize.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_nandinitialize.c * arch/arm/src/board/lpc17_40_nandinitialize.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -32,11 +32,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -51,17 +51,17 @@ #if defined(CONFIG_LPC17_40_SPIFI) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_quickstart_nand_initialize * * Description: * Initialize NAND FLASH * - ************************************************************************************/ + ****************************************************************************/ void _lpc4088_quickstart_nand_initialize(void) { @@ -83,8 +83,8 @@ void _lpc4088_quickstart_nand_initialize(void) putreg32(31, LPC17_40_EMC_STATICWAITWR1); putreg32(31, LPC17_40_EMC_STATICWAITTURN1); - /* GPIO P2[21] connects to the Ready/Busy pin of the NAND part. We need to - * reconfigure this pin as normal GPIO input. + /* GPIO P2[21] connects to the Ready/Busy pin of the NAND part. + * We need to reconfigure this pin as normal GPIO input. */ lpc17_40_gpioconfig(GPIO_NAND_RB); diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_sdraminitialize.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_sdraminitialize.c index 1c979f724c..8d2355f7c3 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_sdraminitialize.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_sdraminitialize.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4088-quickstart/src/lpc17_40_sdraminitialize.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_sdraminitialize.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -53,12 +53,13 @@ #if defined(CONFIG_LPC17_40_EMC) && defined(CONFIG_LPC17_40_EXTDRAM) -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* The core clock is LPC17_40_EMCCLK which may be either LPC17_40_CCLK* (undivided), or - * LPC17_40_CCLK / 2 as determined by settings in the board.h header file. +/* The core clock is LPC17_40_EMCCLK which may be either LPC17_40_CCLK* + * (undivided), or LPC17_40_CCLK / 2 as determined by settings in the + * board.h header file. * * For example: * LPC17_40_CCLCK = 120,000,000 @@ -96,17 +97,17 @@ #define SDRAM_BASE 0xa0000000 /* CS0 */ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_quickstart_sdram_initialize * * Description: * Initialize SDRAM * - ************************************************************************************/ + ****************************************************************************/ void lpc4088_quickstart_sdram_initialize(void) { @@ -142,7 +143,7 @@ void lpc4088_quickstart_sdram_initialize(void) putreg32( 1, LPC17_40_EMC_DYNAMICAPR); /* TAPR = 2 clocks? */ putreg32(EMC_NS2CLK(20) + 2, LPC17_40_EMC_DYNAMICDAL); /* TDAL = TRP + TDPL = 20ns + 2clk */ putreg32( 1, LPC17_40_EMC_DYNAMICWR); /* TWR = 2 clocks */ - putreg32( EMC_NS2CLK(63), LPC17_40_EMC_DYNAMICRC); /* H57V2562GTR-75C TRC = 63ns(min)*/ + putreg32( EMC_NS2CLK(63), LPC17_40_EMC_DYNAMICRC); /* H57V2562GTR-75C TRC = 63ns(min) */ putreg32( EMC_NS2CLK(63), LPC17_40_EMC_DYNAMICRFC); /* H57V2562GTR-75C TRFC = TRC */ putreg32( 15, LPC17_40_EMC_DYNAMICXSR); /* Exit self-refresh to active */ putreg32( EMC_NS2CLK(63), LPC17_40_EMC_DYNAMICRRD); /* 3 clock, TRRD = 15ns (min) */ @@ -157,27 +158,28 @@ void lpc4088_quickstart_sdram_initialize(void) putreg32(MDKCFG_RASCAS0VAL, LPC17_40_EMC_DYNAMICRASCAS0); #ifdef CONFIG_LPC17_40_SDRAM_16BIT - /* For Manley lpc1778 SDRAM: H57V2562GTR-75C, 256Mb, 16Mx16, 4 banks, row=13, column=9: - * - * 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC - */ + /* For Manley lpc1778 SDRAM: + * H57V2562GTR-75C, 256Mb, 16Mx16, 4 banks, row=13, column=9: + * + * 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC + */ putreg32(EMC_DYNAMICCONFIG_MD_SDRAM | EMC_DYNAMICCONFIG_AM0(13), LPC17_40_EMC_DYNAMICCONFIG0); #elif defined CONFIG_LPC17_40_SDRAM_32BIT - /* 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC */ + /* 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC */ - putreg32(EMC_DYNAMICCONFIG_MD_SDRAM | EMC_DYNAMICCONFIG_AM0(13) | EMC_DYNAMICCONFIG_AM1, - LPC17_40_EMC_DYNAMICCONFIG0); + putreg32(EMC_DYNAMICCONFIG_MD_SDRAM | EMC_DYNAMICCONFIG_AM0(13) | + EMC_DYNAMICCONFIG_AM1, LPC17_40_EMC_DYNAMICCONFIG0); #endif up_mdelay(100); /* Issue NOP command */ - putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | EMC_DYNAMICCONTROL_I_NOP, - LPC17_40_EMC_DYNAMICCONTROL); + putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | + EMC_DYNAMICCONTROL_I_NOP, LPC17_40_EMC_DYNAMICCONTROL); /* Wait 200 Msec */ @@ -185,8 +187,8 @@ void lpc4088_quickstart_sdram_initialize(void) /* Issue PALL command */ - putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | EMC_DYNAMICCONTROL_I_PALL, - LPC17_40_EMC_DYNAMICCONTROL); + putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | + EMC_DYNAMICCONTROL_I_PALL, LPC17_40_EMC_DYNAMICCONTROL); putreg32(2, LPC17_40_EMC_DYNAMICREFRESH); /* ( n * 16 ) -> 32 clock cycles */ @@ -194,7 +196,7 @@ void lpc4088_quickstart_sdram_initialize(void) for (i = 0; i < 128; i++); - /* 64ms/8192 = 7.8125us, nx16x8.33ns < 7.8125us, n < 58.6*/ + /* 64ms/8192 = 7.8125us, nx16x8.33ns < 7.8125us, n < 58.6 */ regval = 64000000 / (1 << 13); regval -= 16; @@ -204,8 +206,8 @@ void lpc4088_quickstart_sdram_initialize(void) /* Issue MODE command */ - putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | EMC_DYNAMICCONTROL_I_MODE, - LPC17_40_EMC_DYNAMICCONTROL); + putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | + EMC_DYNAMICCONTROL_I_MODE, LPC17_40_EMC_DYNAMICCONTROL); #ifdef CONFIG_LPC17_40_SDRAM_16BIT (void)getreg16(SDRAM_BASE | (0x33 << 12)); /* 8 burst, 3 CAS latency */ diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_ssp.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_ssp.c index 77373e82ac..062ae79cc5 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_ssp.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_ssp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-quickstart/src/lpc17_40_ssp.c + * boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_ssp.c * arch/arm/src/board/lpc17_40_ssp.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -104,35 +104,39 @@ void weak_function lpc4088_quickstart_sspdev_initialize(void) #endif } -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_ssp0/1/2select and lpc17_40_ssp0/1/2status * * Description: - * The external functions, lpc17_40_ssp0/1/2select and lpc17_40_ssp0/1/2status - * must be provided by board-specific logic. They are implementations of the select - * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including lpc17_40_sspbus_initialize()) - * are provided by common LPC17xx/LPC40xx logic. To use this common SPI logic on your - * board: + * The external functions, lpc17_40_ssp0/1/2select and + * lpc17_40_ssp0/1/2status must be provided by board-specific logic. + * They are implementations of the select and status methods of the SPI + * interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). + * All other methods (including lpc17_40_sspbus_initialize()) + * are provided by common LPC17xx/LPC40xx logic. + * To use this common SPI logic on your board: * - * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip select - * pins. - * 2. Provide lpc17_40_ssp0/1/2select() and lpc17_40_ssp0/1/2status() functions - * in your board-specific logic. These functions will perform chip selection - * and status operations using GPIOs in the way your board is configured. - * 3. Add a calls to lpc17_40_sspbus_initialize() in your low level application - * initialization logic - * 4. The handle returned by lpc17_40_sspbus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP + * chip select pins. + * 2. Provide lpc17_40_ssp0/1/2select() and lpc17_40_ssp0/1/2status() + * functions in your board-specific logic. + * These functions will perform chip selection and status operations + * using GPIOs in the way your board is configured. + * 3. Add a calls to lpc17_40_sspbus_initialize() in your low level + * application initialization logic + * 4. The handle returned by lpc17_40_sspbus_initialize() may then be + * used to bind the SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_SSP0 -void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); } uint8_t lpc17_40_ssp0status(FAR struct spi_dev_s *dev, uint32_t devid) @@ -143,9 +147,11 @@ uint8_t lpc17_40_ssp0status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_LPC17_40_SSP1 -void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); } uint8_t lpc17_40_ssp1status(FAR struct spi_dev_s *dev, uint32_t devid) @@ -156,9 +162,11 @@ uint8_t lpc17_40_ssp1status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_LPC17_40_SSP2 -void lpc17_40_ssp2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp2select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); } uint8_t lpc17_40_ssp2status(FAR struct spi_dev_s *dev, uint32_t devid) diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_userleds.c b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_userleds.c index 52435daa38..58dbd8153f 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_userleds.c +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpc4088-quickstart/src/lpc17_40_userleds.c + * boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc17_40_userleds.c * arch/arm/src/board/lpc17_40_userleds.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. @@ -106,21 +106,21 @@ void board_userled(int led, bool ledon) switch ((unsigned)led) { case BOARD_LED1: - + /* LED1 and LED2 are inverted */ - + case BOARD_LED2: lpc17_40_gpiowrite(g_ledcfg[led], !ledon); break; - + case BOARD_LED3: - + /* LED3 and LED4 are driven normally */ - + case BOARD_LED4: lpc17_40_gpiowrite(g_ledcfg[led], ledon); break; - + default: break; } diff --git a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc4088-quickstart.h b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc4088-quickstart.h index 2e4aa0452c..930c9d90a5 100644 --- a/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc4088-quickstart.h +++ b/boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc4088-quickstart.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpc4088-quickstart/src/lpc4088-quickstart.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpc4088-quickstart/src/lpc4088-quickstart.h * arch/arm/src/board/lpc4088-quickstart.h * * Copyright (C) 2013, 2017-2018 Gregory Nutt. All rights reserved. @@ -32,23 +32,24 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef _CONFIGS_LPC4088_QUICKSTART_SRC_LPC4088_QUICKSTART_H -#define _CONFIGS_LPC4088_QUICKSTART_SRC_LPC4088_QUICKSTART_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_LPC4088_QUICKSTART_SRC_LPC4088_QUICKSTART_H +#define __BOARDS_ARM_LPC17XX_40XX_LPC4088_QUICKSTART_SRC_LPC4088_QUICKSTART_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* LPC4088 QuickStart GPIO Pin Definitions **********************************/ -/* LPC4088 QuickStart GPIO Pin Definitions ****************************************************/ /* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in * any way. The following definitions are used to access individual LEDs. * @@ -64,21 +65,24 @@ #define GPIO_LED1 (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT1 | GPIO_PIN18) #define GPIO_LED2 (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN13) -/* - * These LEDs are connected to ground so a high output value will illuminate them. +/* These LEDs are connected to ground so a high output value will illuminate + * them. */ + #define GPIO_LED3 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT1 | GPIO_PIN13) #define GPIO_LED4 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT2 | GPIO_PIN19) -/* Button definitions ***************************************************************/ -/* The LPC4088 QuickStart supports a single button. It must be pulled up by the MCU. - * When closed, the pin will be pulled to ground. So the button will read "1" - * when open and "0" when closed. The button is capable of generating an - * interrupt. +/* Button definitions *******************************************************/ + +/* The LPC4088 QuickStart supports a single button. + * It must be pulled up by the MCU. + * When closed, the pin will be pulled to ground. + * So the button will read "1" when open and "0" when closed. + * The button is capable of generating an interrupt. * * USER1 -- Connected to P2[10] - * For the interrupting buttons, interrupts are generated on both edges (press and - * release). + * For the interrupting buttons, interrupts are generated on both edges + * (press and release). */ #define GPIO_USER1 (GPIO_INPUT | GPIO_PULLUP | GPIO_PORT2 | GPIO_PIN10) @@ -87,17 +91,17 @@ #define GPIO_USER2_IRQ LPC17_40_IRQ_P2p10 -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_quickstart_bringup * * Description: @@ -109,17 +113,17 @@ * CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y : * Called from the NSH library via boardctl() * - ************************************************************************************/ + ****************************************************************************/ int lpc4088_quickstart_bringup(void); -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_quickstart_sdram_initialize * * Description: * Initialize SDRAM * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_EMC #ifdef CONFIG_LPC17_40_EXTDRAM @@ -127,17 +131,17 @@ void lpc4088_quickstart_sdram_initialize(void); #endif #endif /* CONFIG_LPC17_40_EMC */ -/************************************************************************************ +/**************************************************************************** * Name: lpc4088_quickstart_flash_initialize * * Description: * Initialize SPIFI FLASH * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_SPIFI void lpc4088_quickstart_flash_initialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_LPC4088_QUICKSTART_SRC_LPC4088_QUICKSTART_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_LPC4088_QUICKSTART_SRC_LPC4088_QUICKSTART_H */ diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/README.txt b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/README.txt index b641854219..fe174affae 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/README.txt +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/README.txt @@ -323,7 +323,7 @@ Code Red IDE -------------- All of the above steps are automated in the bash script flash.sh that can - be found in the boards/lpcxpresso/tools directory. + be found in the boards/arm/lpc17xx_40xx/lpcxpresso/tools directory. LEDs ^^^^ @@ -331,12 +331,14 @@ LEDs If CONFIG_ARCH_LEDS is defined, then support for the LPCXpresso LEDs will be included in the build. See: - - boards/lpcxpresso-lpc1768/include/board.h - Defines LED constants, types and - prototypes the LED interface functions. + - boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/include/board.h - Defines LED + constants, types and prototypes the LED interface functions. - - boards/lpcxpresso-lpc1768/src/lpcxpresso-lpc1768.h - GPIO settings for the LEDs. + - boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpcxpresso-lpc1768.h - GPIO + settings for the LEDs. - - boards/lpcxpresso-lpc1768/src/up_leds.c - LED control logic. + - boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/up_leds.c - LED control + logic. The LPCXpresso LPC1768 has a single LEDs (there are more on the Embedded Artists base board, but those are not controlled by NuttX). Usage this single LED by NuttX diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/include/board.h b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/include/board.h index f4c38c6364..a48906c915 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/include/board.h +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpcxpresso-lpc1768/include/board.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/include/board.h * include/arch/board/board.h * * Copyright (C) 2011 Gregory Nutt. All rights reserved. @@ -32,24 +32,27 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_LPCXPRESSO_LPC1768_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC17XX_40XX_LPCXPRESSO_LPC1768_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ -/* 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 include path. +/* Clocking *****************************************************************/ + +/* 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 include path. */ #define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency */ @@ -59,22 +62,23 @@ /* This is the clock setup we configure for: * - * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source - * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1 - * CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 + * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source + * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1 + * CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 */ #define LPC17_40_CCLK 80000000 /* 80Mhz */ -/* Select the main oscillator as the frequency source. SYSCLK is then the frequency - * of the main oscillator. +/* Select the main oscillator as the frequency source. + * SYSCLK is then the frequency of the main oscillator. */ #undef CONFIG_LPC17_40_MAINOSC #define CONFIG_LPC17_40_MAINOSC 1 #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 CCLK. * The input to the divider (PLLCLK) will be determined by the PLL output. */ @@ -109,8 +113,9 @@ (((BOARD_PLL1CFG_MSEL-1) << SYSCON_PLL1CFG_MSEL_SHIFT) | \ ((BOARD_PLL1CFG_NSEL-1) << SYSCON_PLL1CFG_NSEL_SHIFT)) -/* USB divider. This divider is used when PLL1 is not enabled to get the - * USB clock from PLL0: +/* USB divider. + * This divider is used when PLL1 is not enabled to get the USB clock + * from PLL0: * * USBCLK = PLL0CLK / 10 = 48MHz */ @@ -128,9 +133,10 @@ //#define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV44 #define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV20 -/* LED definitions ******************************************************************/ -/* The LPCXpresso LPC1768 board has a single red LED (there are additional LEDs on - * the base board not considered here). +/* LED definitions **********************************************************/ + +/* The LPCXpresso LPC1768 board has a single red LED + * (there are additional LEDs on the base board not considered here). */ /* ON OFF */ #define LED_STARTED 0 /* OFF ON (never happens) */ @@ -142,9 +148,10 @@ #define LED_ASSERTION 2 /* OFF NC (momentary) */ #define LED_PANIC 0 /* OFF ON (1Hz flashing) */ -/* Alternate pin selections *********************************************************/ +/* Alternate pin selections *************************************************/ + /* Pin Description Connector On Board Base Board - * -------------------------------- --------- -------------- --------------------- + * -------------------------------- --------- -------------- ---------------- * P0[0]/RD1/TXD3/SDA1 J6-9 I2C E2PROM SDA TXD3/SDA1 * P0[1]/TD1/RXD3/SCL J6-10 RXD3/SCL1 * P0[2]/TXD0/AD0[7] J6-21 @@ -248,4 +255,4 @@ * P4[29]/TX-MCLK/MAT2.1/RXD3 PAD16 N/A */ -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_LPCXPRESSO_LPC1768_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/scripts/Make.defs b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/scripts/Make.defs index d3ebcdd46c..654f4e0888 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/scripts/Make.defs +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpcxpresso-lpc1768/scripts/Make.defs +# boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/scripts/Make.defs # # Copyright (C) 2011-2012, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/scripts/ld.script b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/scripts/ld.script index 70ac0df335..e5cec2e2d3 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/scripts/ld.script +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpcxpresso-lpc1768/scripts/ld.script + * boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/scripts/ld.script * * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/Makefile b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/Makefile index 4f46ba5cf9..8bfc2c40da 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/Makefile +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lpcxpresso-lpc1768/src/Makefile +# boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/Makefile # # Copyright (C) 2011-2012, 2014 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_adc.c b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_adc.c index 51fddfe805..ce49532f47 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_adc.c +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_adc.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpcexpresso-1768/src/lpc17_40_adc.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpcexpresso-1768/src/lpc17_40_adc.c * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: Kannan @@ -36,11 +36,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -59,17 +59,17 @@ #ifdef CONFIG_ADC -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpcxpresso_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ int lpcxpresso_adc_setup(void) { @@ -81,7 +81,9 @@ int lpcxpresso_adc_setup(void) if (!initialized) { - /* Call lpc17_40_adcinitialize() to get an instance of the ADC interface */ + /* Call lpc17_40_adcinitialize() to get an instance + * of the ADC interface + */ adc = lpc17_40_adcinitialize(); if (adc == NULL) diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_appinit.c b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_appinit.c index 2a0120446d..097398cbd4 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_appinit.c +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lpcxpresso-lpc1768/src/lpc17_40_appinit.c + * boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_appinit.c * * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -160,15 +160,18 @@ int board_app_initialize(uintptr_t arg) /* Bind the SSP port to the slot */ - ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, ssp); + ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, + CONFIG_NSH_MMCSDSLOTNO, ssp); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to bind SSP port %d to MMC/SD slot %d: %d\n", + syslog(LOG_ERR, + "ERROR: Failed to bind SSP port %d to MMC/SD slot %d: %d\n", CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret); return ret; } - syslog(LOG_INFO, "Successfuly bound SSP port %d to MMC/SD slot %d\n", + syslog(LOG_INFO, + "Successfuly bound SSP port %d to MMC/SD slot %d\n", CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); #endif diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_boot.c b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_boot.c index 917076633d..51cfdd8ddf 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_boot.c +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpcxpresso-lpc1768/src/lpc17_40_boot.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_boot.c * * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -50,32 +50,34 @@ #include "lpc17_40_ssp.h" #include "lpcxpresso-lpc1768.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_boardinitialize * * Description: - * All LPC17xx/LPC40xx architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All LPC17xx/LPC40xx architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc17_40_boardinitialize(void) { - /* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) the weak - * function lpcxpresso_sspdev_initialize() has been brought into the link. + /* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) + * the weak function lpcxpresso_sspdev_initialize() has been brought into + * the link. */ #if defined(CONFIG_LPC17_40_SSP0) || defined(CONFIG_LPC17_40_SSP1) diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_dac.c b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_dac.c index 20a38402af..e409279619 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_dac.c +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_dac.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/zkit-arm-1769/src/lpc17_40_dac.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_dac.c * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: Kannan @@ -36,11 +36,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -57,14 +57,14 @@ #ifdef CONFIG_DAC -/************************************************************************************ +/**************************************************************************** * Name: dac_devinit * * Description: - * All LPC17xx/LPC40xx architectures must provide the following interface to work with - * examples/diag. + * All LPC17xx/LPC40xx architectures must provide the following interface + * to work with examples/diag. * - ************************************************************************************/ + ****************************************************************************/ int dac_devinit(void) { diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_leds.c b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_leds.c index 9060c65423..77c2d07176 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_leds.c +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpcxpresso-lpc1768/src/lpc17_40_leds.c + * boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_leds.c * * Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_oled.c b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_oled.c index 0cfe4ddc4f..72cd151f9f 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_oled.c +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_oled.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lpcxpresso-lpc1768/src/lpc17_40_oled.c + * boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_oled.c * * Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -55,7 +55,9 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ + /* This module is only built if CONFIG_NX_LCDDRIVER is selected. In this * case, it would be an error if SSP1 is not also enabled. */ @@ -181,7 +183,8 @@ int lpc17_40_ssp1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) * * Input Parameters: * - * devno - A value in the range of 0 throuh CONFIG_UG9664HSWAG01_NINTERFACES-1. + * devno - A value in the range of 0 throuh + * CONFIG_UG9664HSWAG01_NINTERFACES-1. * This allows support for multiple OLED devices. * on - true:turn power on, false: turn power off. * diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_pwm.c b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_pwm.c index e686003027..aab194abd8 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_pwm.c +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_pwm.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpcexpresso-lpc1768/lpc17_40_pwm.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpcexpresso-lpc1768/lpc17_40_pwm.c * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -54,9 +54,9 @@ #include "lpc17_40_timer.h" #include "lpcxpresso-lpc1768.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PWM @@ -64,17 +64,17 @@ FAR struct pwm_lowerhalf_s *lpc17_40_pwminitialize(int timer); FAR struct pwm_lowerhalf_s *lpc17_40_mcpwminitialize(int timer); FAR struct pwm_lowerhalf_s *lpc17_40_timerinitialize(int timer); -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpcexpresso_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ int lpcexpresso_pwm_setup(void) { @@ -88,7 +88,9 @@ int lpcexpresso_pwm_setup(void) if (!initialized) { - /* Call lpc17_40_pwminitialize() to get an instance of the PWM interface */ + /* Call lpc17_40_pwminitialize() to get an instance + * of the PWM interface + */ pwm = lpc17_40_pwminitialize(0); if (!pwm) diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_ssp.c b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_ssp.c index e8a813b070..5777949855 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_ssp.c +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_ssp.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpcxpresso-lpc1768/src/lpc17_40_ssp.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_ssp.c * * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -54,9 +54,9 @@ #if defined(CONFIG_LPC17_40_SSP0) || defined(CONFIG_LPC17_40_SSP1) -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* Dump GPIO registers */ @@ -66,17 +66,17 @@ # define ssp_dumpgpio(m) #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpcxpresso_sspdev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the LPCXpresso. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lpcxpresso_sspdev_initialize(void) { @@ -84,16 +84,17 @@ void weak_function lpcxpresso_sspdev_initialize(void) ssp_dumpgpio("lpcxpresso_sspdev_initialize() Entry)"); - /* Configure card detect and chip select for the SD slot. NOTE: Jumper J55 must - * be set correctly for the SD slot chip select. + /* Configure card detect and chip select for the SD slot. + * NOTE: Jumper J55 must be set correctly for the SD slot chip select. */ #ifdef CONFIG_LPC17_40_SSP1 (void)lpc17_40_configgpio(LPCXPRESSO_SD_CS); (void)lpc17_40_configgpio(LPCXPRESSO_SD_CD); - /* Configure chip select for the OLED. For the SPI interface, insert jumpers in - * J42, J43, J45 pin1-2 and J46 pin 1-2. + /* Configure chip select for the OLED. + * For the SPI interface, insert jumpers in J42, J43, J45 pin1-2 + * and J46 pin 1-2. */ #ifdef CONFIG_NX_LCDDRIVER @@ -104,35 +105,39 @@ void weak_function lpcxpresso_sspdev_initialize(void) ssp_dumpgpio("lpcxpresso_sspdev_initialize() Exit"); } -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_ssp0/ssp1select and lpc17_40_ssp0/ssp1status * * Description: - * The external functions, lpc17_40_ssp0/ssp1select and lpc17_40_ssp0/ssp1status - * must be provided by board-specific logic. They are implementations of the select - * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including lpc17_40_sspbus_initialize()) - * are provided by common LPC17xx/LPC40xx logic. To use this common SPI logic on your - * board: + * The external functions, lpc17_40_ssp0/ssp1select and + * lpc17_40_ssp0/ssp1status must be provided by board-specific logic. + * They are implementations of the select and status methods of the SPI + * interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). + * All other methods (including lpc17_40_sspbus_initialize()) + * are provided by common LPC17xx/LPC40xx logic. + * To use this common SPI logic on your board: * - * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip select - * pins. - * 2. Provide lpc17_40_ssp0/ssp1select() and lpc17_40_ssp0/ssp1status() functions - * in your board-specific logic. These functions will perform chip selection - * and status operations using GPIOs in the way your board is configured. - * 3. Add a calls to lpc17_40_sspbus_initialize() in your low level application - * initialization logic - * 4. The handle returned by lpc17_40_sspbus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip + * select pins. + * 2. Provide lpc17_40_ssp0/ssp1select() and lpc17_40_ssp0/ssp1status() + * functions in your board-specific logic. + * These functions will perform chip selection and status operations + * using GPIOs in the way your board is configured. + * 3. Add a calls to lpc17_40_sspbus_initialize() in your low level + * application initialization logic + * 4. The handle returned by lpc17_40_sspbus_initialize() may then be used + * to bind the SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_SSP0 -void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_40_ssp0select() Entry"); #warning "Assert CS here (false)" @@ -148,9 +153,11 @@ uint8_t lpc17_40_ssp0status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_LPC17_40_SSP1 -void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_40_ssp1select() Entry"); if (devid == SPIDEV_MMCSD(0)) diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_usbmsc.c b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_usbmsc.c index 102dd00571..0ebefe7089 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_usbmsc.c +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_usbmsc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lpcxpresso-lpc1768/src/lpc17_40_usbmsc.c + * boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpc17_40_usbmsc.c * * Copyright (C) 2011, 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -69,7 +69,8 @@ # undef LPC17XX_40XX_MMCSDSLOTNO # define LPC17XX_40XX_MMCSDSLOTNO 0 #else - /* Add configuration for new LPC17xx/LPC40xx boards here */ + /* Add configuration for new LPC17xx/LPC40xx boards here */ + # error "Unrecognized LPC17xx/LPC40xx board" #endif @@ -110,7 +111,8 @@ int board_usbmsc_initialize(int port) syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n", LPC17XX_40XX_MMCSDSPIPORTNO, LPC17XX_40XX_MMCSDSLOTNO); - ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, LPC17XX_40XX_MMCSDSLOTNO, spi); + ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, + LPC17XX_40XX_MMCSDSLOTNO, spi); if (ret < 0) { syslog(LOG_ERR, diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpcxpresso-lpc1768.h b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpcxpresso-lpc1768.h index c76c936c96..8b886fdcd0 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpcxpresso-lpc1768.h +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpcxpresso-lpc1768.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lpcxpresso-lpcxpresso68/src/lpcxpresso-lpcxpresso68.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/src/lpcxpresso-lpc1768.h * * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,25 +31,26 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef _CONFIGS_LPCXPRESSO_LPC1768_SRC_LPCXPRESSO_H -#define _CONFIGS_LPCXPRESSO_LPC1768_SRC_LPCXPRESSO_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_LPCXPRESSO_LPC1768_SRC_LPCXPRESSO_LPC1768_H +#define __BOARDS_ARM_LPC17XX_40XX_LPCXPRESSO_LPC1768_SRC_LPCXPRESSO_LPC1768_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* LPCXpresso LPC1768 board pin usage ***************************************/ -/* LPCXpresso LPC1768 board pin usage ***********************************************/ /* Pin Description Connector On Board Base Board - * -------------------------------- --------- -------------- --------------------- + * -------------------------------- --------- -------------- ---------------- * P0[0]/RD1/TXD3/SDA1 J6-9 I2C E2PROM SDA TXD3/SDA1 * P0[1]/TD1/RXD3/SCL J6-10 RXD2/SCL1 * P0[2]/TXD0/AD0[7] J6-21 @@ -191,69 +192,69 @@ /* 96x64 White OLED with I2C/SPI interface * - * ----------------------------+-------+-------------- ----------------------------- + * ----------------------------+-------+-------------- --------------------- * LPC1758 Pin | J4/6 | Base Board Description - * ----------------------------+-------+-------------- ----------------------------- + * ----------------------------+-------+-------------- --------------------- * P2.1/PWM1.2/RXD1 | 43 | PIO1_10 FAN5331 Power Control (SHDN#) * P0.6/I2SRX-SDA/SSEL1/MAT2.0 | 8 | PIO0_2 OLED chip select (CS#) * P2.7/RD2/RTS1 | 49 | PIO2_7 OLED command/data (D/C#) * P0.7/I2STX-CLK/SCK1/MAT2.1 | 7 | PIO2_11-SCK OLED clock (D0) * P0.9/I2STX-SDA/MOSI1/MAT2.3 | 5 | PIO0_9-MOSI OLED data in (D1) - * ----------------------------+-------+-------------- ----------------------------- + * ----------------------------+-------+-------------- --------------------- */ #define LPCXPRESSO_OLED_POWER (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT2 | GPIO_PIN1) #define LPCXPRESSO_OLED_CS (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT0 | GPIO_PIN6) #define LPCXPRESSO_OLED_DC (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT2 | GPIO_PIN7) -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpcxpresso_sspdev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the LPCXpresso board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lpcxpresso_sspdev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: lpcexpresso_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PWM int lpcexpresso_pwm_setup(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: lpcxpresso_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ADC int lpcxpresso_adc_setup(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_LPCXPRESSO_LPC1768_SRC_LPCXPRESSO_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_LPCXPRESSO_LPC1768_SRC_LPCXPRESSO_LPC1768_H */ diff --git a/boards/arm/lpc17xx_40xx/mbed/include/board.h b/boards/arm/lpc17xx_40xx/mbed/include/board.h index 612f59f1df..c29a4d25ca 100644 --- a/boards/arm/lpc17xx_40xx/mbed/include/board.h +++ b/boards/arm/lpc17xx_40xx/mbed/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/mbed/include/board.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/mbed/include/board.h * * Copyright (C) 2010, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,24 +31,27 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_MBED_INCLUDE_BOARD_H -#define __BOARDS_ARM_MBED_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_MBED_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC17XX_40XX_MBED_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ -/* 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 include path. +/* Clocking *****************************************************************/ + +/* 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 include path. */ #define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency */ @@ -58,29 +61,31 @@ /* This is the clock setup we configure for: * - * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source - * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multiplier=20, pre-divider=1 - * CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 + * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source + * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multiplier=20, pre-divider=1 + * CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 */ #define LPC17_40_CCLK 80000000 /* 80Mhz*/ -/* Select the main oscillator as the frequency source. SYSCLK is then the frequency - * of the main oscillator. +/* Select the main oscillator as the frequency source. + * SYSCLK is then the frequency of the main oscillator. */ #undef CONFIG_LPC17_40_MAINOSC #define CONFIG_LPC17_40_MAINOSC 1 #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 CCLK. * The input to the divider (PLLCLK) will be determined by the PLL output. */ #define BOARD_CCLKCFG_DIVIDER 6 #define BOARD_CCLKCFG_VALUE ((BOARD_CCLKCFG_DIVIDER-1) << SYSCON_CCLKCFG_SHIFT) -/* PLL0. PLL0 is used to generate the CPU clock divider input (PLLCLK). +/* PLL0. + * PLL0 is used to generate the CPU clock divider input (PLLCLK). * * Source clock: Main oscillator * PLL0 Multiplier value (M): 20 @@ -108,7 +113,8 @@ (((BOARD_PLL1CFG_MSEL-1) << SYSCON_PLL1CFG_MSEL_SHIFT) | \ ((BOARD_PLL1CFG_NSEL-1) << SYSCON_PLL1CFG_NSEL_SHIFT)) -/* USB divider. This divider is used when PLL1 is not enabled to get the +/* USB divider. + * This divider is used when PLL1 is not enabled to get the * USB clock from PLL0: * * USBCLK = PLL0CLK / 10 = 48MHz @@ -127,12 +133,14 @@ //#define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV44 #define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV20 -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* The MBED has 4 LEDs along the bottom of the board. Blue or off. - * If CONFIG_ARCH_LEDS is defined, the LEDs will be controlled as follows for NuttX - * debug functionality (where NC means "No Change"). + * If CONFIG_ARCH_LEDS is defined, the LEDs will be controlled as follows + * for NuttX debug functionality (where NC means "No Change"). * - * During the boot phases. LED1 and LED2 will show boot status. LED3/4 Not used. + * During the boot phases. + * LED1 and LED2 will show boot status. LED3/4 Not used. */ /* LED1 LED2 */ #define LED_STARTED 0 /* OFF OFF */ @@ -140,9 +148,9 @@ #define LED_IRQSENABLED 2 /* OFF BLUE */ #define LED_STACKCREATED 3 /* OFF OFF */ -/* After the system is booted, this logic will no longer use LEDs 1 & 2. They - * are available together with LED3 for use the application software using - * lpc17_40_led (prototyped below) +/* After the system is booted, this logic will no longer use LEDs 1 & 2. + * They are available together with LED3 for use the application software + * using lpc17_40_led (prototyped below) */ /* LED1 LED2 LED3 LED4 */ #define LED_INIRQ 4 /* NC NC NC ON (momentary) */ @@ -150,7 +158,6 @@ #define LED_ASSERTION 6 /* NC NC NC ON (momentary) */ #define LED_PANIC 7 /* NC NC NC ON (1Hz flashing) */ - #define GPIO_SSP0_SCK GPIO_SSP0_SCK_1 #define GPIO_SSP0_SSEL GPIO_SSP0_SSEL_1 #define GPIO_SSP0_MISO GPIO_SSP0_MISO_1 @@ -167,9 +174,10 @@ # endif #endif -/* Alternate pin selections *********************************************************/ +/* Alternate pin selections *************************************************/ + /* Pin Description Connector On Board Base Board - * -------------------------------- --------- -------------- --------------------- + * -------------------------------- --------- -------------- ---------------- * P0[0]/RD1/TXD3/SDA1 J6-9 I2C E2PROM SDA TXD3/SDA1 * P0[1]/TD1/RXD3/SCL J6-10 RXD3/SCL1 * P0[2]/TXD0/AD0[7] J6-21 @@ -273,15 +281,15 @@ * P4[29]/TX-MCLK/MAT2.1/RXD3 PAD16 N/A */ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) @@ -292,17 +300,18 @@ extern "C" #define EXTERN extern #endif -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_led * * Description: - * Once the system has booted, these functions can be used to control LEDs 1, 2 & 3 + * Once the system has booted, these functions can be used to control + * LEDs 1, 2 & 3 * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ARCH_LEDS void lpc17_40_led(int lednum, int state); @@ -314,4 +323,4 @@ void lpc17_40_led(int lednum, int state); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_MBED_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_MBED_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc17xx_40xx/mbed/scripts/Make.defs b/boards/arm/lpc17xx_40xx/mbed/scripts/Make.defs index 442021b8eb..8bec01d581 100644 --- a/boards/arm/lpc17xx_40xx/mbed/scripts/Make.defs +++ b/boards/arm/lpc17xx_40xx/mbed/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/mbed/scripts/Make.defs +# boards/arm/lpc17xx_40xx/mbed/scripts/Make.defs # # Copyright (C) 2010, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/mbed/scripts/ld.script b/boards/arm/lpc17xx_40xx/mbed/scripts/ld.script index 644fbbd8bd..51cfeca1e0 100644 --- a/boards/arm/lpc17xx_40xx/mbed/scripts/ld.script +++ b/boards/arm/lpc17xx_40xx/mbed/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/mbed/scripts/ld.script + * boards/arm/lpc17xx_40xx/mbed/scripts/ld.script * * Copyright (C) 2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/mbed/src/Makefile b/boards/arm/lpc17xx_40xx/mbed/src/Makefile index 48630700ba..0c5fb2b81c 100644 --- a/boards/arm/lpc17xx_40xx/mbed/src/Makefile +++ b/boards/arm/lpc17xx_40xx/mbed/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/mbed/src/Makefile +# boards/arm/lpc17xx_40xx/mbed/src/Makefile # # Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_adc.c b/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_adc.c index 8676647624..21d954efd4 100644 --- a/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_adc.c +++ b/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_adc.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/mbed/src/lpc17_40_adc.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_adc.c * * Based on boards/zkit-arm-176/src/up-adc * @@ -38,11 +38,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -61,17 +61,17 @@ #ifdef CONFIG_ADC -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: mbed_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ int mbed_adc_setup(void) { diff --git a/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_appinit.c b/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_appinit.c index e0d4e9d974..328c0c9377 100644 --- a/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_appinit.c +++ b/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/mbed/src/lpc17_40_appinit.c + * boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_appinit.c * * Copyright (C) 2010, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_boot.c b/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_boot.c index 9bc2d5dc17..0c0b730fb8 100644 --- a/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_boot.c +++ b/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/mbed/src/lpc17_40_boot.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_boot.c * * Copyright (C) 2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,27 +49,28 @@ #include "mbed.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_boardinitialize * * Description: - * All LPC17xx/LPC40xx architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All LPC17xx/LPC40xx architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc17_40_boardinitialize(void) { @@ -79,4 +80,3 @@ void lpc17_40_boardinitialize(void) board_autoled_initialize(); #endif } - diff --git a/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_dac.c b/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_dac.c index d484248b3f..2c748927b1 100644 --- a/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_dac.c +++ b/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_dac.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/mbed/src/lpc17_40_dac.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_dac.c * * Based on boards/zkit-arm-1769/src/lpc17_40_dac.c * @@ -38,11 +38,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -59,14 +59,14 @@ #ifdef CONFIG_DAC -/************************************************************************************ +/**************************************************************************** * Name: dac_devinit * * Description: - * All LPC17xx/LPC40xx architectures must provide the following interface to work with - * examples/diag. + * All LPC17xx/LPC40xx architectures must provide the following interface + * to work with examples/diag. * - ************************************************************************************/ + ****************************************************************************/ int dac_devinit(void) { diff --git a/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_leds.c b/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_leds.c index 91b9824edd..94c841a438 100644 --- a/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_leds.c +++ b/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/mbed/src/lpc17_40_leds.c + * boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_leds.c * * Copyright (C) 2010, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -72,24 +72,26 @@ * Private Data ****************************************************************************/ -/* LED definitions ****************************************************************** +/* LED definitions **********************************************************/ -The MBED has 4 LEDs along the bottom of the board. Blue or off. -If CONFIG_ARCH_LEDS is defined, the LEDs will be controlled as follows for NuttX -debug functionality (where NC means "No Change"). - -During the boot phases. LED1 and LED2 will show boot status. LED3/4 Not used. - - LED1 LED2 -STARTED OFF OFF -HEAPALLOCATE BLUE OFF -IRQSENABLED OFF BLUE -STACKCREATED OFF OFF - -After the system is booted, this logic will no longer use LEDs 1 & 2. They -are available together with LED3 for use the application software using -lpc17_40_led (prototyped below) -*/ +/* The MBED has 4 LEDs along the bottom of the board. Blue or off. + * If CONFIG_ARCH_LEDS is defined, the LEDs will be controlled as follows for + * NuttX debug functionality (where NC means "No Change"). + * + * During the boot phases. + * LED1 and LED2 will show boot status. + * LED3/4 Not used. + * + * LED1 LED2 + * STARTED OFF OFF + * HEAPALLOCATE BLUE OFF + * IRQSENABLED OFF BLUE + * STACKCREATED OFF OFF + * + * After the system is booted, this logic will no longer use LEDs 1 & 2. + * They are available together with LED3 for use the application software + * using lpc17_40_led (prototyped below) + */ static bool g_initialized; static int g_nestcount; @@ -147,8 +149,8 @@ void board_autoled_on(int led) case LED_IRQSENABLED: led2 = 1; } - lpc17_40_led(MBED_LED1,led1); - lpc17_40_led(MBED_LED2,led2); + lpc17_40_led(MBED_LED1, led1); + lpc17_40_led(MBED_LED2, led2); } /* We will always control the HB LED */ @@ -186,17 +188,18 @@ void board_autoled_off(int led) } } -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_led * * Description: - * Once the system has booted, these functions can be used to control the LEDs + * Once the system has booted, these functions can be used to control + * the LEDs * - ************************************************************************************/ + ****************************************************************************/ void lpc17_40_led(int lednum, int state) - { lpc17_40_gpiowrite(lednum, state); } -#endif /* CONFIG_ARCH_LEDS */ + +#endif /* CONFIG_ARCH_LEDS */ \ No newline at end of file diff --git a/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_pwm.c b/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_pwm.c index dd8b285123..c288c57927 100644 --- a/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_pwm.c +++ b/boards/arm/lpc17xx_40xx/mbed/src/lpc17_40_pwm.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/mbed/lpc17_40_pwm.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/mbed/lpc17_40_pwm.c * * Based on onfigs/lpcexpresso-lpc1768/lpc17_40_pwm.c * @@ -33,11 +33,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -56,9 +56,9 @@ #include "lpc17_40_timer.h" #include "mbed.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PWM @@ -66,17 +66,17 @@ FAR struct pwm_lowerhalf_s *lpc17_40_pwminitialize(int timer); FAR struct pwm_lowerhalf_s *lpc17_40_mcpwminitialize(int timer); FAR struct pwm_lowerhalf_s *lpc17_40_timerinitialize(int timer); -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: mbed_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ int mbed_pwm_setup(void) { diff --git a/boards/arm/lpc17xx_40xx/mbed/src/mbed.h b/boards/arm/lpc17xx_40xx/mbed/src/mbed.h index 5ca4d59b6d..0944decc56 100644 --- a/boards/arm/lpc17xx_40xx/mbed/src/mbed.h +++ b/boards/arm/lpc17xx_40xx/mbed/src/mbed.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/mbed/src/mbed.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/mbed/src/mbed.h * * Copyright (C) 2010, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,23 +31,23 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef _CONFIGS_MBED_SRC_MBED_H -#define _CONFIGS_MBED_SRC_MBED_H +#ifndef __BOARDS_ARM_LPC17XX40XX_MBED_SRC_MBED_H +#define __BOARDS_ARM_LPC17XX40XX_MBED_SRC_MBED_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* MBED GPIO Pin Definitions ********************************************************/ +/* MBED GPIO Pin Definitions ************************************************/ #define MBED_LED1 (GPIO_OUTPUT | GPIO_PORT1 | GPIO_PIN18) #define MBED_LED1_OFF MBED_LED1 @@ -64,54 +64,53 @@ #define MBED_HEARTBEAT MBED_LED4 -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: mbed_sspdev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the NUCLEUS-2G board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function mbed_sspdev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: mbed_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PWM int mbed_pwm_setup(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: mbed_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ADC int mbed_adc_setup(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_MBED_SRC_MBED_H */ - +#endif /* __BOARDS_ARM_LPC17XX40XX_MBED_SRC_MBED_H */ diff --git a/boards/arm/lpc17xx_40xx/mcb1700/include/board.h b/boards/arm/lpc17xx_40xx/mcb1700/include/board.h index b98d9ceb47..0402718fc4 100644 --- a/boards/arm/lpc17xx_40xx/mcb1700/include/board.h +++ b/boards/arm/lpc17xx_40xx/mcb1700/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/mcb1700/include/board.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/mcb1700/include/board.h * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,24 +31,26 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_MCB1700_INCLUDE_BOARD_H -#define __BOARDS_ARM_MCB1700_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_MCB1700_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC17XX_40XX_MCB1700_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ -/* 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 include path. +/* Clocking *****************************************************************/ + +/* 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 include path. */ #define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency */ @@ -58,15 +60,15 @@ /* This is the clock setup we configure for: * - * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source - * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multiplier=20, pre-divider=1 - * CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 + * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source + * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multiplier=20, pre-divider=1 + * CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 */ #define LPC17_40_CCLK 80000000 /* 80Mhz*/ -/* Select the main oscillator as the frequency source. SYSCLK is then the frequency - * of the main oscillator. +/* Select the main oscillator as the frequency source. + * SYSCLK is then the frequency of the main oscillator. */ #undef CONFIG_LPC17_40_MAINOSC @@ -127,12 +129,15 @@ //#define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV44 #define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV20 -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* The MCB1700 has 4 LEDs along the bottom of the board. Blue or off. - * If CONFIG_ARCH_LEDS is defined, the LEDs will be controlled as follows for NuttX - * debug functionality (where NC means "No Change"). + * If CONFIG_ARCH_LEDS is defined, the LEDs will be controlled as follows + * for NuttX debug functionality (where NC means "No Change"). * - * During the boot phases. LED1 and LED2 will show boot status. LED3/4 Not used. + * During the boot phases. + * LED1 and LED2 will show boot status. + * LED3/4 Not used. */ /* LED1 LED2 */ #define LED_STARTED 0 /* OFF OFF */ @@ -150,7 +155,6 @@ #define LED_ASSERTION 6 /* NC NC NC ON (momentary) */ #define LED_PANIC 7 /* NC NC NC ON (1Hz flashing) */ - #define GPIO_SSP0_SCK GPIO_SSP0_SCK_1 #define GPIO_SSP0_SSEL GPIO_SSP0_SSEL_1 #define GPIO_SSP0_MISO GPIO_SSP0_MISO_1 @@ -167,9 +171,10 @@ # endif #endif -/* Alternate pin selections *********************************************************/ +/* Alternate pin selections *************************************************/ + /* Pin Description Connector On Board Base Board - * -------------------------------- --------- -------------- --------------------- + * -------------------------------- --------- -------------- ---------------- * P0[0]/RD1/TXD3/SDA1 J6-9 I2C E2PROM SDA TXD3/SDA1 * P0[1]/TD1/RXD3/SCL J6-10 RXD3/SCL1 * P0[2]/TXD0/AD0[7] J6-21 @@ -273,15 +278,15 @@ * P4[29]/TX-MCLK/MAT2.1/RXD3 PAD16 N/A */ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) @@ -292,17 +297,18 @@ extern "C" #define EXTERN extern #endif -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_led * * Description: - * Once the system has booted, these functions can be used to control LEDs 1, 2 & 3 + * Once the system has booted, these functions can be used to control + * LEDs 1, 2 & 3 * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ARCH_LEDS void lpc17_40_led(int lednum, int state); @@ -314,4 +320,4 @@ void lpc17_40_led(int lednum, int state); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_MCB1700_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_MCB1700_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc17xx_40xx/mcb1700/scripts/Make.defs b/boards/arm/lpc17xx_40xx/mcb1700/scripts/Make.defs index b024864ec1..029849b190 100644 --- a/boards/arm/lpc17xx_40xx/mcb1700/scripts/Make.defs +++ b/boards/arm/lpc17xx_40xx/mcb1700/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/mcb1700/scripts/Make.defs +# boards/arm/lpc17xx_40xx/mcb1700/scripts/Make.defs # # Copyright (C) 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/mcb1700/scripts/ld.script b/boards/arm/lpc17xx_40xx/mcb1700/scripts/ld.script index 4112866b2e..01d5b36926 100644 --- a/boards/arm/lpc17xx_40xx/mcb1700/scripts/ld.script +++ b/boards/arm/lpc17xx_40xx/mcb1700/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/mcb1700/scripts/ld.script + * boards/arm/lpc17xx_40xx/mcb1700/scripts/ld.script * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/mcb1700/src/Makefile b/boards/arm/lpc17xx_40xx/mcb1700/src/Makefile index 0c078862df..3580ecb22f 100644 --- a/boards/arm/lpc17xx_40xx/mcb1700/src/Makefile +++ b/boards/arm/lpc17xx_40xx/mcb1700/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/mcb1700/src/Makefile +# boards/arm/lpc17xx_40xx/mcb1700/src/Makefile # # Copyright (C) 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_adc.c b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_adc.c index bfaac038cb..544c9dac06 100644 --- a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_adc.c +++ b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_adc.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/mcb1700/src/lpc17_40_adc.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_adc.c * * Based on boards/zkit-arm-176/src/up-adc * @@ -38,11 +38,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -61,17 +61,17 @@ #ifdef CONFIG_ADC -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: mcb1700_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ int mcb1700_adc_setup(void) { @@ -83,7 +83,9 @@ int mcb1700_adc_setup(void) if (!initialized) { - /* Call lpc17_40_adcinitialize() to get an instance of the ADC interface */ + /* Call lpc17_40_adcinitialize() to get an instance of + * the ADC interface + */ adc = lpc17_40_adcinitialize(); if (adc == NULL) diff --git a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_appinit.c b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_appinit.c index ef0570697c..be9e064199 100644 --- a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_appinit.c +++ b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/mcb1700/src/lpc17_40_appinit.c + * boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_appinit.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_boot.c b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_boot.c index 6fee4b0f69..897cf52139 100644 --- a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_boot.c +++ b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/mcb1700/src/lpc17_40_boot.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_boot.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,19 +49,20 @@ #include "mcb1700.h" -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_boardinitialize * * Description: - * All LPC17xx/LPC40xx architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All LPC17xx/LPC40xx architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc17_40_boardinitialize(void) { @@ -78,9 +79,9 @@ void lpc17_40_boardinitialize(void) * Description: * If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional * initialization call will be performed in the boot-up sequence to a - * function called board_late_initialize(). board_late_initialize() will be - * called immediately after up_initialize() is called and just before the - * initial application is started. This additional initialization phase + * function called board_late_initialize(). board_late_initialize() will + * be called immediately after up_initialize() is called and just before + * the initial application is started. This additional initialization phase * may be used, for example, to initialize board-specific device drivers. * ****************************************************************************/ diff --git a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c index c095d7a68b..47808dbb4a 100644 --- a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/mcb1700/src/lpc17_40_bringup.c + * boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_bringup.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -157,12 +157,13 @@ static int nsh_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; syslog(LOG_INFO, "nsh_waiter: Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ DEBUGVERIFY(CONN_WAIT(g_usbconn, &hport)); - syslog(LOG_INFO, "nsh_waiter: %s\n", hport->connected ? "connected" : "disconnected"); + syslog(LOG_INFO, "nsh_waiter: %s\n", + hport->connected ? "connected" : "disconnected"); /* Did we just become connected? */ @@ -258,7 +259,8 @@ static int nsh_usbhostinitialize(void) * that we care about: */ - syslog(LOG_INFO, "Register class drivers\n"); + syslog(LOG_INFO, + "Register class drivers\n"); #ifdef CONFIG_USBHOST_HUB /* Initialize USB hub support */ @@ -266,7 +268,8 @@ static int nsh_usbhostinitialize(void) ret = usbhost_hub_initialize(); if (ret < 0) { - syslog(LOG_ERR, "ERROR: usbhost_hub_initialize failed: %d\n", ret); + syslog(LOG_ERR, + "ERROR: usbhost_hub_initialize failed: %d\n", ret); } #endif @@ -276,7 +279,8 @@ static int nsh_usbhostinitialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to register the mass storage class: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -286,7 +290,8 @@ static int nsh_usbhostinitialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); } #endif @@ -341,7 +346,8 @@ int mcb1700_bringup(void) ret = nsh_sdinitialize(); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to initialize SPI-based SD card: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Failed to initialize SPI-based SD card: %d\n", ret); } /* Initialize USB host */ @@ -349,7 +355,8 @@ int mcb1700_bringup(void) ret = nsh_usbhostinitialize(); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Failed to initialize USB host: %d\n", ret); } #ifdef CONFIG_CAN diff --git a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_dac.c b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_dac.c index d8be578212..a054befb79 100644 --- a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_dac.c +++ b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_dac.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/mcb1700/src/lpc17_40_dac.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_dac.c * * Based on boards/zkit-arm-1769/src/lpc17_40_dac.c * @@ -38,11 +38,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -59,14 +59,14 @@ #ifdef CONFIG_DAC -/************************************************************************************ +/**************************************************************************** * Name: dac_devinit * * Description: - * All LPC17xx/LPC40xx architectures must provide the following interface to work with - * examples/diag. + * All LPC17xx/LPC40xx architectures must provide the following interface + * to work with examples/diag. * - ************************************************************************************/ + ****************************************************************************/ int dac_devinit(void) { @@ -75,8 +75,10 @@ int dac_devinit(void) int ret; if (!initialized) - { - /* Call lpc17_40_dacinitialize() to get an instance of the dac interface */ + { + /* Call lpc17_40_dacinitialize() to get an instance + * of the dac interface + */ dac = lpc17_40_dacinitialize(); if (dac == NULL) @@ -93,7 +95,7 @@ int dac_devinit(void) } initialized = true; - } + } return OK; } diff --git a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_leds.c b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_leds.c index 5bdbe795ba..6f1712f204 100644 --- a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_leds.c +++ b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/mcb1700/src/lpc17_40_leds.c + * boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_leds.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -73,6 +73,7 @@ ****************************************************************************/ /* LED definitions **********************************************************/ + /* The MCB1700 has 4 LEDs along the bottom of the board. Blue or off. * If CONFIG_ARCH_LEDS is defined, the LEDs will be controlled as follows * for NuttX debug functionality (where NC means "No Change"). @@ -145,8 +146,8 @@ void board_autoled_on(int led) led2 = 1; } - lpc17_40_led(MCB1700_LED1,led1); - lpc17_40_led(MCB1700_LED2,led2); + lpc17_40_led(MCB1700_LED1, led1); + lpc17_40_led(MCB1700_LED2, led2); } /* We will always control the HB LED */ @@ -184,13 +185,14 @@ void board_autoled_off(int led) } } -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_led * * Description: - * Once the system has booted, these functions can be used to control the LEDs + * Once the system has booted, these functions can be used to control the + * LEDs * - ************************************************************************************/ + ****************************************************************************/ void lpc17_40_led(int lednum, int state) diff --git a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_pwm.c b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_pwm.c index f802a320b1..14d08e09b6 100644 --- a/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_pwm.c +++ b/boards/arm/lpc17xx_40xx/mcb1700/src/lpc17_40_pwm.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/mcb1700/lpc17_40_pwm.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/mcb1700/lpc17_40_pwm.c * * Based on boards/lpcexpresso-lpc1768/lpc17_40_pwm.c * @@ -33,11 +33,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -56,9 +56,9 @@ #include "lpc17_40_timer.h" #include "mcb1700.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PWM @@ -66,17 +66,17 @@ FAR struct pwm_lowerhalf_s *lpc17_40_pwminitialize(int timer); FAR struct pwm_lowerhalf_s *lpc17_40_mcpwminitialize(int timer); FAR struct pwm_lowerhalf_s *lpc17_40_timerinitialize(int timer); -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: mcb1700_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ int mcb1700_pwm_setup(void) { @@ -90,7 +90,9 @@ int mcb1700_pwm_setup(void) if (!initialized) { - /* Call lpc17_40_pwminitialize() to get an instance of the PWM interface */ + /* Call lpc17_40_pwminitialize() to get an instance + * of the PWM interface + */ pwm = lpc17_40_pwminitialize(0); if (!pwm) diff --git a/boards/arm/lpc17xx_40xx/mcb1700/src/mcb1700.h b/boards/arm/lpc17xx_40xx/mcb1700/src/mcb1700.h index 4051902cba..e0730cd8e1 100644 --- a/boards/arm/lpc17xx_40xx/mcb1700/src/mcb1700.h +++ b/boards/arm/lpc17xx_40xx/mcb1700/src/mcb1700.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/mcb1700/src/mcb1700.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/mcb1700/src/mcb1700.h * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,23 +31,23 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef _CONFIGS_MCB1700_SRC_MCB1700_H -#define _CONFIGS_MCB1700_SRC_MCB1700_H +#ifndef __BOARDSS_ARM_LPC17XX_40XX_MCB1700_SRC_MCB1700_H +#define __BOARDSS_ARM_LPC17XX_40XX__MCB1700_SRC_MCB1700_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* MCB1700 GPIO Pin Definitions *****************************************************/ +/* MCB1700 GPIO Pin Definitions *********************************************/ #define MCB1700_LED1 (GPIO_OUTPUT | GPIO_PORT1 | GPIO_PIN18) #define MCB1700_LED1_OFF MCB1700_LED1 @@ -66,9 +66,9 @@ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: mcb1700_bringup @@ -86,40 +86,39 @@ int mcb1700_bringup(void); -/************************************************************************************ +/**************************************************************************** * Name: mcb1700_sspdev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the NUCLEUS-2G board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function mcb1700_sspdev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: mcb1700_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PWM int mcb1700_pwm_setup(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: mcb1700_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ADC int mcb1700_adc_setup(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_MCB1700_SRC_MCB1700_H */ - +#endif /* __BOARDSS_ARM_LPC17XX_40XX__MCB1700_SRC_MCB1700_H */ diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/README.txt b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/README.txt index 96acf30aff..ff6934ccf9 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/README.txt +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/README.txt @@ -161,7 +161,8 @@ Olimex LPC1766-STK development board to use because it relied on a 9-bit SPI inteface (the 9th bit being the command/data bit which is normally a discrete input). All support for the Nokia 6100 was removed on May 19, 2018. That obsoleted - driver can be viewed in the nuttx/drivers/lcd and boards/olimex-lpc1766stk + driver can be viewed in the + nuttx/drivers/lcd and boards/arm/lpc17xx_40xx/olimex-lpc1766stk directories of the Obsoleted repository. The obsoleted driver attempted to created the 9th bit on-they-flay in the @@ -177,12 +178,13 @@ LEDs If CONFIG_ARCH_LEDS is defined, then support for the LPC1766-STK LEDs will be included in the build. See: - - boards/olimex-lpc1766stk/include/board.h - Defines LED constants, types and - prototypes the LED interface functions. + - boards/arm/lpc17xx_40xx/olimex-lpc1766stk/include/board.h - Defines LED + constants, types and prototypes the LED interface functions. - - boards/olimex-lpc1766stk/src/lpc1766stk.h - GPIO settings for the LEDs. + - boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc1766stk.h - GPIO settings + for the LEDs. - - boards/olimex-lpc1766stk/src/up_leds.c - LED control logic. + - boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/up_leds.c - LED control logic. The LPC1766-STK has two LEDs. If CONFIG_ARCH_LEDS is defined, these LEDs will be controlled as follows for NuttX debug functionality (where NC means "No Change"). @@ -370,7 +372,7 @@ Using OpenOCD and GDB with an FT2232 JTAG emulator LPC1766-STK (http://www.olimex.com). OpenOCD requires a configuration file. I keep the one I used last here: - boards/olimex-lpc1766stk/tools/olimex.cfg + boards/arm/lpc17xx_40xx/olimex-lpc1766stk/tools/olimex.cfg However, the "correct" configuration script to use with OpenOCD may change as the features of OpenOCD evolve. So you should at least @@ -392,13 +394,13 @@ Using OpenOCD and GDB with an FT2232 JTAG emulator - Possibly the value of OPENOCD_PATH and TARGET_PATH - It assumes that the correct script to use is the one at - boards/olimex-lpc1766stk/tools/olimex.cfg + boards/arm/lpc17xx_40xx/olimex-lpc1766stk/tools/olimex.cfg Starting OpenOCD Then you should be able to start the OpenOCD daemon like: - boards/olimex-lpc1766stk/tools/oocd.sh $PWD + boards/arm/lpc17xx_40xx/olimex-lpc1766stk/tools/oocd.sh $PWD If you add the path to oocd.sh to your PATH environment variable, the command simplifies to just: diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/include/board.h b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/include/board.h index 239cd7f369..82b68308f4 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/include/board.h +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/olimex-lpc1766stk/include/board.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/olimex-lpc1766stk/include/board.h * include/arch/board/board.h * * Copyright (C) 2010-2012 Gregory Nutt. All rights reserved. @@ -32,14 +32,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __ARCH_BOARD_BOARD_H -#define __ARCH_BOARD_BOARD_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_OLIMEX_LPC1766STK_BOARD_H +#define __BOARDS_ARM_LPC17XX_40XX_OLIMEX_LPC1766STK_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,12 +49,15 @@ # include #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Clocking *************************************************************************/ -/* 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 include path. + ****************************************************************************/ + +/* Clocking *****************************************************************/ + +/* 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 include path. */ #define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency */ @@ -64,22 +67,23 @@ /* This is the clock setup we configure for: * - * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source - * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1 - * CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 + * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source + * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1 + * CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 */ #define LPC17_40_CCLK 80000000 /* 80Mhz */ -/* Select the main oscillator as the frequency source. SYSCLK is then the frequency - * of the main oscillator. +/* Select the main oscillator as the frequency source. + * SYSCLK is then the frequency of the main oscillator. */ #undef CONFIG_LPC17_40_MAINOSC #define CONFIG_LPC17_40_MAINOSC 1 #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 CCLK. * The input to the divider (PLLCLK) will be determined by the PLL output. */ @@ -114,7 +118,8 @@ (((BOARD_PLL1CFG_MSEL-1) << SYSCON_PLL1CFG_MSEL_SHIFT) | \ ((BOARD_PLL1CFG_NSEL-1) << SYSCON_PLL1CFG_NSEL_SHIFT)) -/* USB divider. This divider is used when PLL1 is not enabled to get the +/* USB divider. + * This divider is used when PLL1 is not enabled to get the * USB clock from PLL0: * * USBCLK = PLL0CLK / 10 = 48MHz @@ -133,9 +138,11 @@ //#define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV44 #define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV20 -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in - * any way. The following definitions are used to access individual LEDs. + * any way. + * The following definitions are used to access individual LEDs. * * LED1 -- Connected to P1[25] * LED2 -- Connected to P0[4] @@ -167,9 +174,10 @@ #define LED_PANIC 2 /* N/C ON = Oops! We crashed. (flashing) */ #define LED_IDLE 3 /* OFF N/C = LPC17 in sleep mode (LED1 glowing) */ -/* Button definitions ***************************************************************/ -/* The LPC1766-STK supports several buttons. All will read "1" when open and "0" - * when closed +/* Button definitions *******************************************************/ + +/* The LPC1766-STK supports several buttons. + * All will read "1" when open and "0" when closed * * BUT1 -- Connected to P0[23] * BUT2 -- Connected to P2[13] @@ -206,7 +214,7 @@ #define BOARD_JOYSTICK_LEFT_BIT (1 << BOARD_JOYSTICK_LEFT) #define BOARD_JOYSTICK_RIGHT_BIT (1 << BOARD_JOYSTICK_RIGHT) -/* Alternate pin selections *********************************************************/ +/* Alternate pin selections *************************************************/ /* CAN1 GPIO PIN SIGNAL NAME * -------------------------------- ---- -------------- @@ -275,6 +283,7 @@ * -------------------------------- ---- -------------- * P0[24]/AD0[1]/I2SRX_WS/CAP3[1] 8 TEMP * P0[25]/AD0[2]/I2SRX_SDA/TXD3 7 MIC IN + */ /* USB GPIO PIN SIGNAL NAME * -------------------------------- ---- -------------- @@ -349,4 +358,4 @@ * P1[31]/SCK1/AD0[5] 20 AIN5 */ -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_OLIMEX_LPC1766STK_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/scripts/Make.defs b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/scripts/Make.defs index 0bbd0ef50b..e5932428d7 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/scripts/Make.defs +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/olimex-lpc1766stk/scripts/Make.defs +# boards/arm/lpc17xx_40xx/olimex-lpc1766stk/scripts/Make.defs # # Copyright (C) 2010, 2012-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/scripts/ld.script b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/scripts/ld.script index 6de491f530..4229cf197a 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/scripts/ld.script +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/olimex-lpc1766stk/scripts/ld.script + * boards/arm/lpc17xx_40xx/olimex-lpc1766stk/scripts/ld.script * * Copyright (C) 2010-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/Makefile b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/Makefile index 4089f7540a..a1b3452752 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/Makefile +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/olimex-lpc1766stk/src/Makefile +# boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/Makefile # # Copyright (C) 2010, 2012, 2018 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc1766stk.h b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc1766stk.h index f710e60bef..4dc0c6b949 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc1766stk.h +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc1766stk.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/olimex-lpc1766stk/src/lpc1766stk.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc1766stk.h * * Copyright (C) 2010-2011, 2016, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,23 +31,24 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef _CONFIGS_OLIMEX_LPC1766STK_SRC_LPC1766STK_H -#define _CONFIGS_OLIMEX_LPC1766STK_SRC_LPC1766STK_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_OLIMEX_LPC1766STK_SRC_LPC1766STK_H +#define __BOARDS_ARM_LPC17XX_40XX_OLIMEX_LPC1766STK_SRC_LPC1766STK_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* LPC1766-STK GPIO Pin Definitions *****************************************/ -/* LPC1766-STK GPIO Pin Definitions *************************************************/ /* Board GPIO Usage: * * GPIO PIN SIGNAL NAME @@ -143,9 +144,9 @@ * NOTES: * 1. Pull-ups are not required because the pins are already pulled-up by * through resistors on the board. - * 2. All buttons are capable of supporting interrupts if board_button_irq() is - * called to attach an interrupt handler. Interrupts are configured to - * occur on both edges. + * 2. All buttons are capable of supporting interrupts if board_button_irq() + * is called to attach an interrupt handler. + * Interrupts are configured to occur on both edges. */ #define LPC1766STK_BUT1 (GPIO_INTBOTH | GPIO_FLOAT | GPIO_PORT0 | GPIO_PIN23) @@ -169,9 +170,9 @@ * NOTES: * 1. Pull-ups are not required because the pins are already pulled-up by * through resistors on the board. - * 2. All buttons are capable of supporting interrupts if board_button_irq() is - * called to attach an interrupt handler. Interrupts are configured to - * occur on both edges. + * 2. All buttons are capable of supporting interrupts if board_button_irq() + * is called to attach an interrupt handler. + * Interrupts are configured to occur on both edges. */ #define LPC1766STK_CENTER (GPIO_INTBOTH | GPIO_FLOAT | GPIO_PORT0 | GPIO_PIN5) @@ -236,21 +237,21 @@ * P2[10]/#EINT0/NMI 53 ISP_E4 */ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_bringup * * Description: @@ -262,31 +263,32 @@ * CONFIG_BOARD_LATE_INITIALIZE=y && CONFIG_LIB_BOARDCTL=y : * Called from the NSH library * - ************************************************************************************/ + ****************************************************************************/ int lpc17_40_bringup(void); -/************************************************************************************ +/**************************************************************************** * Name: lpc1766stk_sspdev_initialize * * Description: - * Called to configure SPI chip select GPIO pins for the Olimex LPC1766-STK board. + * Called to configure SPI chip select GPIO pins for the Olimex LPC1766-STK + * board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lpc1766stk_sspdev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: lpc1766stk_can_setup * * Description: * Initialize CAN and register the CAN device * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_CAN int lpc1766stk_can_setup(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_OLIMEX_LPC1766STK_SRC_LPC1766STK_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_OLIMEX_LPC1766STK_SRC_LPC1766STK_H */ diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_appinit.c b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_appinit.c index 689cad1091..903249c894 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_appinit.c +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/olimex-lpc1766stk/src/lpc17_40_appinit.c + * boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_appinit.c * * Copyright (C) 2010, 2013-2016, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_boot.c b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_boot.c index a3eb2b18c2..c292f77a80 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_boot.c +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/olimex-lpc1766stk/src/lpc17_40_boot.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_boot.c * * Copyright (C) 2010, 2012, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -50,32 +50,34 @@ #include "lpc17_40_ssp.h" #include "lpc1766stk.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_boardinitialize * * Description: - * All LPC17xx/LPC40xx architectures must provide the following entry point. This entry point - * is called early in the initialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All LPC17xx/LPC40xx architectures must provide the following entry point. + * This entry point is called early in the initialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc17_40_boardinitialize(void) { - /* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) the weak - * function lpc1766stk_sspdev_initialize() has been brought into the link. + /* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) the + * weak function lpc1766stk_sspdev_initialize() has been brought into the + * link. */ #if defined(CONFIG_LPC17_40_SSP0) || defined(CONFIG_LPC17_40_SSP1) @@ -98,9 +100,9 @@ void lpc17_40_boardinitialize(void) * Description: * If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional * initialization call will be performed in the boot-up sequence to a - * function called board_late_initialize(). board_late_initialize() will be - * called immediately after up_initialize() is called and just before the - * initial application is started. This additional initialization phase + * function called board_late_initialize(). board_late_initialize() will + * be called immediately after up_initialize() is called and just before + * the initial application is started. This additional initialization phase * may be used, for example, to initialize board-specific device drivers. * ****************************************************************************/ diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c index d3e6e9732b..40a129dac4 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/olimex-lpc1766stk/src/lpc17_40_bringup.c + * boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_bringup.c * * Copyright (C) 2010, 2013-2016, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -156,12 +156,13 @@ static int nsh_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; syslog(LOG_INFO, "nsh_waiter: Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ DEBUGVERIFY(CONN_WAIT(g_usbconn, &hport)); - syslog(LOG_INFO, "nsh_waiter: %s\n", hport->connected ? "connected" : "disconnected"); + syslog(LOG_INFO, "nsh_waiter: %s\n", + hport->connected ? "connected" : "disconnected"); /* Did we just become connected? */ @@ -275,7 +276,8 @@ static int nsh_usbhostinitialize(void) ret = usbhost_msc_initialize(); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to register the mass storage class: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -285,7 +287,8 @@ static int nsh_usbhostinitialize(void) ret = usbhost_cdcacm_initialize(); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); } #endif @@ -295,7 +298,8 @@ static int nsh_usbhostinitialize(void) ret = usbhost_mouse_init(); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to register USB HID mouse device class\n"); + syslog(LOG_ERR, + "ERROR: Failed to register USB HID mouse device class\n"); } #endif @@ -305,7 +309,8 @@ static int nsh_usbhostinitialize(void) ret = usbhost_kbdinit(); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to register USB HID KBD keyboard class\n"); + syslog(LOG_ERR, + "ERROR: Failed to register USB HID KBD keyboard class\n"); } #endif @@ -337,7 +342,7 @@ static int nsh_usbhostinitialize(void) * Public Functions ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_bringup * * Description: @@ -349,7 +354,7 @@ static int nsh_usbhostinitialize(void) * CONFIG_BOARD_LATE_INITIALIZE=y && CONFIG_LIB_BOARDCTL=y : * Called from the NSH library * - ************************************************************************************/ + ****************************************************************************/ int lpc17_40_bringup(void) { diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_buttons.c b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_buttons.c index d0bfd9fd13..26237ca46e 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_buttons.c +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/olimex-lpc1766stk/src/lpc17_40_buttons.c + * boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_buttons.c * * Copyright (C) 2011, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -95,10 +95,10 @@ static uint8_t g_buttonirq[NUM_BUTTONS] = * Name: board_button_initialize * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_buttons() may be called to collect the current state of all - * buttons or board_button_irq() may be called to register button interrupt - * handlers. + * board_button_initialize() must be called to initialize button resources. + * After that, board_buttons() may be called to collect the current state of + * all buttons or board_button_irq() may be called to register button + * interrupt handlers. * ****************************************************************************/ @@ -118,9 +118,9 @@ void board_button_initialize(void) * Name: board_buttons * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_buttons() may be called to collect the current state of all - * buttons. + * board_button_initialize() must be called to initialize button resources. + * After that, board_buttons() may be called to collect the current state + * of all buttons. * * board_buttons() may be called at any time to harvest the state of every * button. The state of the buttons is returned as a bitset with one @@ -139,16 +139,16 @@ uint32_t board_buttons(void) for (i = 0; i < NUM_BUTTONS; i++) { - /* A LOW value means that the key is pressed. */ + /* A LOW value means that the key is pressed. */ - bool released = lpc17_40_gpioread(g_buttoncfg[i]); + bool released = lpc17_40_gpioread(g_buttoncfg[i]); - /* Accumulate the set of depressed (not released) keys */ + /* Accumulate the set of depressed (not released) keys */ - if (!released) - { + if (!released) + { ret |= (1 << i); - } + } } return ret; @@ -158,19 +158,20 @@ uint32_t board_buttons(void) * Button support. * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_button_irq() may be called to register button interrupt handlers. + * board_button_initialize() must be called to initialize button resources. + * After that, board_button_irq() may be called to register button interrupt + * handlers. * - * board_button_irq() may be called to register an interrupt handler that will - * be called when a button is depressed or released. The ID value is a - * button enumeration value that uniquely identifies a button resource. See the - * BOARD_BUTTON_* and BOARD_JOYSTICK_* definitions in board.h for the meaning - * of enumeration values. + * board_button_irq() may be called to register an interrupt handler that + * will be called when a button is depressed or released. The ID value is + * a button enumeration value that uniquely identifies a button resource. + * See the BOARD_BUTTON_* and BOARD_JOYSTICK_* definitions in board.h for + * the meaning of enumeration values. * * Note that board_button_irq() also enables button interrupts. Button * interrupts will remain enabled after the interrupt handler is attached. - * Interrupts may be disabled (and detached) by calling board_button_irq with - * irqhandler equal to NULL. + * Interrupts may be disabled (and detached) by calling board_button_irq + * with irqhandler equal to NULL. * ****************************************************************************/ diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_can.c b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_can.c index edbf6438e6..1d25902f78 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_can.c +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_can.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/solimex-lpc1766stk/src/lpc17_40_can.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_can.c * * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -53,10 +53,11 @@ #ifdef CONFIG_CAN -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ #if defined(CONFIG_LPC17_40_CAN1) && defined(CONFIG_LPC17_40_CAN2) # warning "Both CAN1 and CAN2 are enabled. Assuming only CAN1." @@ -73,17 +74,17 @@ # define CAN_PORT 2 #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc1766stk_can_setup * * Description: * Initialize CAN and register the CAN device * - ************************************************************************************/ + ****************************************************************************/ int lpc1766stk_can_setup(void) { diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_leds.c b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_leds.c index 330844ab12..889487983d 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_leds.c +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/olimex-lpc1766stk/src/lpc17_40_leds.c + * boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_leds.c * * Copyright (C) 2010-2011, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_ssp.c b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_ssp.c index 4e0450a64b..7aa7209af1 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_ssp.c +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_ssp.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/olimex-lpc1766stk/src/lpc17_40_ssp.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_ssp.c * * Copyright (C) 2010, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -59,9 +59,10 @@ #if defined(CONFIG_LPC17_40_SSP0) || defined(CONFIG_LPC17_40_SSP1) -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + /* Configuration ************************************************************/ #undef HAVE_SPI_CALLBACK @@ -74,6 +75,7 @@ #endif /* Debug ********************************************************************/ + /* Dump GPIO registers */ #ifdef CONFIG_DEBUG_GPIO_INFO @@ -84,9 +86,9 @@ # define ssp_dumpssp1gpio(m) #endif -/************************************************************************************ +/**************************************************************************** * Private Types - ************************************************************************************/ + ****************************************************************************/ /* This structure describes on media change callback */ @@ -98,9 +100,9 @@ struct lpc17_40_mediachange_s }; #endif -/************************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************************/ + ****************************************************************************/ /* Registered media change callback */ @@ -113,17 +115,17 @@ static struct lpc17_40_mediachange_s g_ssp1callback; #endif #endif -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: ssp_cdirqsetup * * Description: * Setup to receive a card detection interrupt * - ************************************************************************************/ + ****************************************************************************/ #if 0 /* #ifdef HAVE_SPI_CALLBACK */ static void ssp_cdirqsetup(int irq, xcpt_t irqhandler) @@ -157,13 +159,13 @@ static void ssp_cdirqsetup(int irq, xcpt_t irqhandler) } #endif -/************************************************************************************ +/**************************************************************************** * Name: ssp0/1_cdinterrupt * * Description: * Handle card detection interrupt * - ************************************************************************************/ + ****************************************************************************/ #if 0 /* ifdef HAVE_SPI_CALLBACK */ #ifdef CONFIG_LPC17_40_SSP0 @@ -193,21 +195,23 @@ static int ssp1_cdinterrupt(int irq, FAR void *context) #endif #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc1766stk_sspdev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the LPC1766-STK. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lpc1766stk_sspdev_initialize(void) { - /* Configure the SSP0 chip select GPIOs. Only the Nokia LCD is connected to SSP0 */ + /* Configure the SSP0 chip select GPIOs. + * Only the Nokia LCD is connected to SSP0 + */ #ifdef CONFIG_LPC17_40_SSP0 ssp_dumpssp0gpio("BEFORE SSP0 Initialization"); @@ -215,15 +219,17 @@ void weak_function lpc1766stk_sspdev_initialize(void) ssp_dumpssp0gpio("AFTER SSP0 Initialization"); #endif - /* Configure SSP1 chip select GPIOs. Only the SD/MMC card slot is connected to SSP1 */ + /* Configure SSP1 chip select GPIOs. + * Only the SD/MMC card slot is connected to SSP1 + */ #ifdef CONFIG_LPC17_40_SSP1 ssp_dumpssp0gpio("BEFORE SSP1 Initialization"); lpc17_40_configgpio(LPC1766STK_MMC_CS); - /* Also configure the SD/MMC power GPIO (but leave power off). This really has - * nothing to do with SSP, but does belong with other SD/MMC GPIO configuration - * settings. + /* Also configure the SD/MMC power GPIO (but leave power off). + * This really has nothing to do with SSP, but does belong with other + * SD/MMC GPIO configuration settings. */ lpc17_40_configgpio(LPC1766STK_MMC_PWR); @@ -237,35 +243,39 @@ void weak_function lpc1766stk_sspdev_initialize(void) #endif } -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_ssp0/ssp1select and lpc17_40_ssp0/ssp1status * * Description: - * The external functions, lpc17_40_ssp0/ssp1select and lpc17_40_ssp0/ssp1status - * must be provided by board-specific logic. They are implementations of the select - * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including lpc17_40_sspbus_initialize()) - * are provided by common LPC17xx/LPC40xx logic. To use this common SPI logic on your - * board: + * The external functions, lpc17_40_ssp0/ssp1select and + * lpc17_40_ssp0/ssp1status must be provided by board-specific logic. + * They are implementations of the select and status methods of the SPI + * interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). + * All other methods (including lpc17_40_sspbus_initialize()) + * are provided by common LPC17xx/LPC40xx logic. + * To use this common SPI logic on your board: * - * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip select - * pins. - * 2. Provide lpc17_40_ssp0/ssp1select() and lpc17_40_ssp0/ssp1status() functions - * in your board-specific logic. These functions will perform chip selection - * and status operations using GPIOs in the way your board is configured. - * 3. Add a calls to lpc17_40_sspbus_initialize() in your low level application - * initialization logic - * 4. The handle returned by lpc17_40_sspbus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip + * select pins. + * 2. Provide lpc17_40_ssp0/ssp1select() and lpc17_40_ssp0/ssp1status() + * functions in your board-specific logic. These functions will perform + * chip selection and status operations using GPIOs in the way your board + * is configured. + * 3. Add a calls to lpc17_40_sspbus_initialize() in your low level + * application initialization logic + * 4. The handle returned by lpc17_40_sspbus_initialize() may then be used + * to bind the SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_SSP0 -void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); if (devid == SPIDEV_DISPLAY(0)) { /* Assert/de-assert the CS pin to the card */ @@ -284,9 +294,11 @@ uint8_t lpc17_40_ssp0status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_LPC17_40_SSP1 -void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); if (devid == SPIDEV_MMCSD(0)) { /* Assert/de-assert the CS pin to the card */ @@ -304,7 +316,7 @@ uint8_t lpc17_40_ssp1status(FAR struct spi_dev_s *dev, uint32_t devid) } #endif -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_ssp0/1register * * Description: @@ -322,7 +334,7 @@ uint8_t lpc17_40_ssp1status(FAR struct spi_dev_s *dev, uint32_t devid) * Returned Value: * 0 on success; negated errno on failure. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SPI_CALLBACK #ifdef CONFIG_LPC17_40_SSP0 @@ -330,7 +342,9 @@ uint8_t lpc17_40_ssp1status(FAR struct spi_dev_s *dev, uint32_t devid) * would be configured. */ -int lpc17_40_ssp0register(FAR struct spi_dev_s *dev, spi_mediachange_t callback, void *arg) +int lpc17_40_ssp0register(FAR struct spi_dev_s *dev, + spi_mediachange_t callback, + void *arg) { /* Save the callback information */ @@ -347,7 +361,9 @@ int lpc17_40_ssp0register(FAR struct spi_dev_s *dev, spi_mediachange_t callback, #endif #ifdef CONFIG_LPC17_40_SSP1 -int lpc17_40_ssp1register(FAR struct spi_dev_s *dev, spi_mediachange_t callback, void *arg) +int lpc17_40_ssp1register(FAR struct spi_dev_s *dev, + spi_mediachange_t callback, + void *arg) { /* Save the callback information */ @@ -363,5 +379,4 @@ int lpc17_40_ssp1register(FAR struct spi_dev_s *dev, spi_mediachange_t callback, } #endif #endif - #endif /* CONFIG_LPC17_40_SSP0 || CONFIG_LPC17_40_SSP1 */ diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_usbmsc.c b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_usbmsc.c index 3f0e0bc7a6..e64a01cc82 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_usbmsc.c +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_usbmsc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/olimex-lpc1766stk/src/lpc17_40_usbmsc.c + * boards/arm/lpc17xx_40xx/olimex-lpc1766stk/src/lpc17_40_usbmsc.c * * Copyright (C) 2010, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -71,7 +71,8 @@ # undef LPC17XX_40XX_MMCSDSLOTNO # define LPC17XX_40XX_MMCSDSLOTNO 0 #else - /* Add configuration for new LPC17xx/LPC40xx boards here */ + /* Add configuration for new LPC17xx/LPC40xx boards here */ + # error "Unrecognized LPC17xx/LPC40xx board" #endif diff --git a/boards/arm/lpc17xx_40xx/open1788/README.txt b/boards/arm/lpc17xx_40xx/open1788/README.txt index 475542bd46..a6d586bc40 100644 --- a/boards/arm/lpc17xx_40xx/open1788/README.txt +++ b/boards/arm/lpc17xx_40xx/open1788/README.txt @@ -119,7 +119,7 @@ Using OpenOCD with the Olimex ARM-USB-OCD I have been using the Olimex ARM-USB-OCD debugger. OpenOCD requires a configuration file. I keep the one I used last here: - boards/open1788/tools/open1788.cfg + boards/arm/lpc17xx_40xx/open1788/tools/open1788.cfg However, the "correct" configuration script to use with OpenOCD may change as the features of OpenOCD evolve. So you should at least @@ -148,7 +148,7 @@ Using OpenOCD with the Olimex ARM-USB-OCD installations. They could be most anywhwere if you are using a windows version of OpenOCD. - boards/open1788/tools/open1788.cfg + boards/arm/lpc17xx_40xx/open1788/tools/open1788.cfg This is simply openocd-usb.cfg, lpc1788.cfg, and lpc17xx.cfg concatenated into one file for convenience. Don't use it unless you have to. @@ -159,7 +159,7 @@ Using OpenOCD with the Olimex ARM-USB-OCD - Possibly the value of OPENOCD_PATH and TARGET_PATH - It assumes that the correct script to use is the one at - boards/open1788/tools/open1788.cfg + boards/arm/lpc17xx_40xx/open1788/tools/open1788.cfg Starting OpenOCD @@ -172,7 +172,7 @@ Using OpenOCD with the Olimex ARM-USB-OCD or, if the PATH variable is not so configured: - boards/open1788/tools/oocd.sh $PWD + boards/arm/lpc17xx_40xx/open1788/tools/oocd.sh $PWD Connecting GDB diff --git a/boards/arm/lpc17xx_40xx/open1788/include/board.h b/boards/arm/lpc17xx_40xx/open1788/include/board.h index a844bab29b..4542046905 100644 --- a/boards/arm/lpc17xx_40xx/open1788/include/board.h +++ b/boards/arm/lpc17xx_40xx/open1788/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/open1788/include/board.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/open1788/include/board.h * include/arch/board/board.h * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -32,14 +32,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_OPEN1788_INCLUDE_BOARD_H -#define __BOARDS_ARM_OPEN1788_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_OPEN1788_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC17XX_40XX_OPEN1788_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,12 +49,16 @@ # include #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Clocking *************************************************************************/ -/* 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 include path. + ****************************************************************************/ + +/* Clocking *****************************************************************/ + +/* 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 include path. */ #define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency */ @@ -65,27 +69,28 @@ /* This is the clock setup we configure for: * - * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source - * PLL0CLK = (10 * SYSCLK) / 1 = 120MHz -> PLL0 multipler=10, pre-divider=1 - * CCLCK = 120MHz -> CCLK divider = 1 + * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source + * PLL0CLK = (10 * SYSCLK) / 1 = 120MHz -> PLL0 multipler=10, pre-divider=1 + * CCLCK = 120MHz -> CCLK divider = 1 */ #define LPC17_40_CCLK 120000000 /* 120Mhz */ #define BOARD_PCLKDIV 2 /* Peripheral clock = LPC17_40_CCLK/2 */ #define BOARD_PCLK_FREQUENCY (LPC17_40_CCLK / BOARD_PCLKDIV) -/* Select the main oscillator as the frequency source. SYSCLK is then the frequency - * of the main oscillator. +/* Select the main oscillator as the frequency source. + * SYSCLK is then the frequency of the main oscillator. * - * If BOARD_XTAL_FREQUENCY > 15000000, then the SCS OSCRS bit (bit 4) should also - * be set in the BOARD_SCS_VALUE. + * If BOARD_XTAL_FREQUENCY > 15000000, then the SCS OSCRS bit (bit 4) + * should also be set in the BOARD_SCS_VALUE. */ #undef CONFIG_LPC17_40_MAINOSC #define CONFIG_LPC17_40_MAINOSC 1 #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 CCLK. * The input to the divider (PLLCLK) will be determined by the PLL output. */ @@ -214,7 +219,8 @@ #endif #endif -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in * any way. The following definitions are used to access individual LEDs. * @@ -223,7 +229,8 @@ * LED3 -- Connected to P1[13] * LED4 -- Connected to P4[27] * - * These LEDs are connecte to ground so a high output value will illuminate them. + * These LEDs are connecte to ground so a high output value will illuminate + * them. */ /* LED index values for use with board_userled() */ @@ -242,26 +249,29 @@ #define BOARD_LED4_BIT (1 << BOARD_LED4) /* If CONFIG_ARCH_LEDs is defined, then NuttX will control the four LEDs - * on the WaveShare Open1788K. The following definitions describe how NuttX - * controls the LEDs: + * on the WaveShare Open1788K. + * The following definitions describe how NuttX controls the LEDs: */ /* LED1 LED2 LED3 LED4 */ #define LED_STARTED 0 /* OFF OFF OFF OFF */ #define LED_HEAPALLOCATE 1 /* ON OFF OFF OFF */ #define LED_IRQSENABLED 2 /* OFF ON OFF OFF */ #define LED_STACKCREATED 3 /* ON ON OFF OFF */ -#define LED_INIRQ 4 /* LED3 glows, on while in interrupt */ +#define LED_INIRQ 4 /* LED3 glows, on while in interrupt */ #define LED_SIGNAL 4 /* LED3 glows, on while in signal handler */ #define LED_ASSERTION 4 /* LED3 glows, on while in assertion */ #define LED_PANIC 4 /* LED3 Flashes at 2Hz */ -#define LED_IDLE 5 /* LED4 glows: ON while active * - * OFF while sleeping */ +#define LED_IDLE 5 /* LED4 glows: ON while active + * OFF while sleeping + */ -/* Button definitions ***************************************************************/ -/* The Open1788 supports several buttons. All must be pulled up by the Open1788. - * When closed, the pins will be pulled to ground. So the buttons will read "1" - * when open and "0" when closed. All except USER1 are capable of generating - * interrupts. +/* Button definitions *******************************************************/ + +/* The Open1788 supports several buttons. + * All must be pulled up by the Open1788. + * When closed, the pins will be pulled to ground. + * So the buttons will read "1" when open and "0" when closed. + * All except USER1 are capable of generating interrupts. * * USER1 -- Connected to P4[26] * USER2 -- Connected to P2[22] @@ -275,11 +285,10 @@ * JOY_D -- Connected to P2[19] * JOY_CTR -- Connected to P0[14] (shared with SSP1 SSEL) * - * For the interrupting buttons, interrupts are generated on both edges (press and - * release). + * For the interrupting buttons, interrupts are generated on both edges + * (press and release). */ - #define BOARD_BUTTON_USER1 0 #define BOARD_BUTTON_USER2 1 #define BOARD_BUTTON_USER3 2 @@ -302,7 +311,7 @@ #define BOARD_JOYSTICK_D_BIT (1 << BOARD_JOYSTICK_D) #define BOARD_JOYSTICK_CTR_BIT (1 << BOARD_JOYSTICK_CTR) -/* Alternate pin selections *********************************************************/ +/* Alternate pin selections *************************************************/ /* UART0: * @@ -315,8 +324,8 @@ /* UART1: * - * All pin options are controlled by older briges on the bottom of the board. There - * are the default settings on my board as it came out of the box: + * All pin options are controlled by older briges on the bottom of the board. + * There are the default settings on my board as it came out of the box: * * RTS --- Connected to P0[22] * RI --- Connected to P0[21] @@ -416,22 +425,21 @@ /* XPT2046 Touchscreen: * -/* -------------- -------------------- ------------ -------------------------------- + * -------------- -------------------- ------------ ------------------------- * XTPT2046 Module Module Open1788 LED * Signal Connector Connector - * -------------- -------------------- ------------ --------------------------------- + * -------------- -------------------- ------------ ------------------------- * Pin 11 PENIRQ\ PENIRQ (pulled high) PORT3 Pin 1 P2.15 PENIRQ * Pin 12 DOUT MISO PORT3 Pin 4 P1.18 MISO1 (Also USB HOST UP LED) * Pin 13 BUSY BUSY (pulled high) PORT3 Pin 9 P2.14 BUSY * Pin 14 DIN MOSI PORT3 Pin 3 P0.13 MOSI1 (Also USB Device up LED and SD CD pin) * Pin 15 CS\ SSEL (pulled high) PORT3 Pin 6 P1.8 GPIO (Also RMII_CRS_DV) * Pin 16 DCLK SCK PORT3 Pin 5 P1.19 SCK1 - * -------------- -------------------- ------------ --------------------------------- + * -------------- -------------------- ------------ ------------------------- */ - #define GPIO_SSP1_MISO GPIO_SSP1_MISO_3 #define GPIO_SSP1_MOSI GPIO_SSP1_MOSI_2 #define GPIO_SSP1_SCK GPIO_SSP1_SCK_2 -#endif /* __BOARDS_ARM_OPEN1788_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_OPEN1788_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc17xx_40xx/open1788/kernel/Makefile b/boards/arm/lpc17xx_40xx/open1788/kernel/Makefile index b8a1385766..85d6a84e33 100644 --- a/boards/arm/lpc17xx_40xx/open1788/kernel/Makefile +++ b/boards/arm/lpc17xx_40xx/open1788/kernel/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/open1788/kernel/Makefile +# boards/arm/lpc17xx_40xx/open1788/kernel/Makefile # # Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/open1788/kernel/lpc17_40_userspace.c b/boards/arm/lpc17xx_40xx/open1788/kernel/lpc17_40_userspace.c index 248688fc3f..0489e31e9a 100644 --- a/boards/arm/lpc17xx_40xx/open1788/kernel/lpc17_40_userspace.c +++ b/boards/arm/lpc17xx_40xx/open1788/kernel/lpc17_40_userspace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/open1788/kernel/lpc17_40_userspace.c + * boards/arm/lpc17xx_40xx/open1788/kernel/lpc17_40_userspace.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -50,6 +50,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifndef CONFIG_NUTTX_USERSPACE @@ -65,8 +66,8 @@ ****************************************************************************/ /* These 'addresses' of these values are setup by the linker script. They are - * not actual uint32_t storage locations! They are only used meaningfully in the - * following way: + * not actual uint32_t storage locations! They are only used meaningfully in + * the following way: * * - The linker script defines, for example, the symbol_sdata. * - The declareion extern uint32_t _sdata; makes C happy. C will believe diff --git a/boards/arm/lpc17xx_40xx/open1788/scripts/Make.defs b/boards/arm/lpc17xx_40xx/open1788/scripts/Make.defs index 918cad6022..8dce0dd153 100644 --- a/boards/arm/lpc17xx_40xx/open1788/scripts/Make.defs +++ b/boards/arm/lpc17xx_40xx/open1788/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/open1788k/scripts/Make.defs +# boards/arm/lpc17xx_40xx/open1788k/scripts/Make.defs # # Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/open1788/scripts/kernel-space.ld b/boards/arm/lpc17xx_40xx/open1788/scripts/kernel-space.ld index f65adc7d9c..3252fd81e8 100644 --- a/boards/arm/lpc17xx_40xx/open1788/scripts/kernel-space.ld +++ b/boards/arm/lpc17xx_40xx/open1788/scripts/kernel-space.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/open1788/scripts/kernel-space.ld + * boards/arm/lpc17xx_40xx/open1788/scripts/kernel-space.ld * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/open1788/scripts/ld.script b/boards/arm/lpc17xx_40xx/open1788/scripts/ld.script index 231a706c4a..0ee63f1a04 100644 --- a/boards/arm/lpc17xx_40xx/open1788/scripts/ld.script +++ b/boards/arm/lpc17xx_40xx/open1788/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/open1788/scripts/ld.script + * boards/arm/lpc17xx_40xx/open1788/scripts/ld.script * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Rommel Marcelo diff --git a/boards/arm/lpc17xx_40xx/open1788/scripts/memory.ld b/boards/arm/lpc17xx_40xx/open1788/scripts/memory.ld index a757674201..2d898f7370 100644 --- a/boards/arm/lpc17xx_40xx/open1788/scripts/memory.ld +++ b/boards/arm/lpc17xx_40xx/open1788/scripts/memory.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/open1788/scripts/memory.ld + * boards/arm/lpc17xx_40xx/open1788/scripts/memory.ld * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -41,9 +41,10 @@ * * For MPU support, the kernel-mode NuttX section is assumed to be 256KB of * FLASH and 4KB of SRAM. That, of course, can be optimized as needed (See - * also boards/open1788/scripts/kernel-space.ld); 256KB is probably much - * more than is needed by the RTOS! That size is selected only because it - * is available due to alignment issues for the user space FLASH memory. + * also boards/arm/lpc17xx_40xx/open1788/scripts/kernel-space.ld); + * 256KB is probably much more than is needed by the RTOS! + * That size is selected only because it is available due to alignment issues + * for the user space FLASH memory. * * Alignment of the user space FLASH partition is a critical factor: The * user space FLASH partition will be spanned with a single region of size diff --git a/boards/arm/lpc17xx_40xx/open1788/scripts/user-space.ld b/boards/arm/lpc17xx_40xx/open1788/scripts/user-space.ld index 29204172c7..7842631556 100644 --- a/boards/arm/lpc17xx_40xx/open1788/scripts/user-space.ld +++ b/boards/arm/lpc17xx_40xx/open1788/scripts/user-space.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/open1788/scripts/user-space.ld + * boards/arm/lpc17xx_40xx/open1788/scripts/user-space.ld * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/open1788/src/Makefile b/boards/arm/lpc17xx_40xx/open1788/src/Makefile index a379e6eeab..79459562a6 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/Makefile +++ b/boards/arm/lpc17xx_40xx/open1788/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/open1788/src/Makefile +# boards/arm/lpc17xx_40xx/open1788/src/Makefile # # Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_appinit.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_appinit.c index 3a7a7237e2..40aec4fee9 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_appinit.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/open1877/src/lpc17_40_appinit.c + * boards/arm/lpc17xx_40xx/open1877/src/lpc17_40_appinit.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_autoleds.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_autoleds.c index c0fd4ff570..7f7046eb34 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_autoleds.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/open1788/src/lpc17_40_autoleds.c + * boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_autoleds.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -57,15 +57,17 @@ * Pre-processor Definitions ****************************************************************************/ -/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in - * any way. The following definitions are used to access individual LEDs. +/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs + * in any way. + * The following definitions are used to access individual LEDs. * * LED1 -- Connected to P1[14] * LED2 -- Connected to P0[16] * LED3 -- Connected to P1[13] * LED4 -- Connected to P4[27] * - * These LEDs are connected to ground so a high output value will illuminate them. + * These LEDs are connected to ground so a high output value will illuminate + * them. * * If CONFIG_ARCH_LEDs is defined, then NuttX will control the four LEDs * on the WaveShare Open1788K. The following definitions describe how NuttX diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_boardinitialize.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_boardinitialize.c index 9264c168ea..f27f2ae87c 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_boardinitialize.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_boardinitialize.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/open1788/src/lpc17_40_boardinitialize.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_boardinitialize.c * * Copyright (C) 2013, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -51,27 +51,28 @@ #include "open1788.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_boardinitialize * * Description: - * All LPC17xx/LPC40xx architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All LPC17xx/LPC40xx architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc17_40_boardinitialize(void) { diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c index d4e11d157c..0d002ce765 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/open1788/src/lpc17_40_bringup.c + * boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_bringup.c * * Copyright (C) 2013, 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -62,6 +62,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #define NSH_HAVE_MMCSD 1 @@ -83,7 +84,9 @@ # undef NSH_HAVE_MMCSD #endif -/* MMC/SD support requires that an SPI support is enabled and an SPI port is selected */ +/* MMC/SD support requires that an SPI support is enabled and an SPI port + * is selected + */ #ifdef NSH_HAVE_MMCSD # if !defined(CONFIG_NSH_MMCSDSLOTNO) @@ -99,9 +102,10 @@ # endif #endif -/* The SD card detect (CD) signal is on P0[13]. This signal is shared. It is also - * used for MOSI1 and USB_UP_LED. The CD pin may be disconnected. There is a jumper - * on board that enables the CD pin. +/* The SD card detect (CD) signal is on P0[13]. This signal is shared. + * It is also used for MOSI1 and USB_UP_LED. + * The CD pin may be disconnected. + * There is a jumper on board that enables the CD pin. */ #ifdef NSH_HAVE_MMCSD @@ -180,7 +184,7 @@ static int nsh_waiter(int argc, char *argv[]) struct usbhost_hubport_s *hport; syslog(LOG_INFO, "nsh_waiter: Running\n"); - for (;;) + for (; ; ) { /* Wait for the device to change state */ @@ -252,8 +256,8 @@ static int nsh_sdinitialize(void) * inserted or deleted. */ - (void)irq_attach(LPC17_40_IRQ_P0p13, nsh_cdinterrupt, NULL); - up_enable_irq(LPC17_40_IRQ_P0p13); + (void)irq_attach(LPC17_40_IRQ_P0p13, nsh_cdinterrupt, NULL); + up_enable_irq(LPC17_40_IRQ_P0p13); #endif #endif @@ -321,7 +325,8 @@ static int nsh_usbhostinitialize(void) ret = usbhost_msc_initialize(); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to register the mass storage class: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Failed to register the mass storage class: %d\n", ret); } #endif @@ -331,7 +336,8 @@ static int nsh_usbhostinitialize(void) ret = usbhost_cdcacm_initialize(); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret); } #endif @@ -425,7 +431,8 @@ int open1788_bringup(void) ret = lpc17_40_djoy_initialization(); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to register the joystick driver: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Failed to register the joystick driver: %d\n", ret); return ret; } #endif diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_buttons.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_buttons.c index 10defcbf12..c3ad219dd3 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_buttons.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/open1788/src/lpc17_40_buttons.c + * boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_buttons.c * * Copyright (C) 2013, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -107,10 +107,10 @@ static const uint8_t g_buttonirq[NUM_BUTTONS] = * Name: board_button_initialize * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_buttons() may be called to collect the current state of all - * buttons or board_button_irq() may be called to register button interrupt - * handlers. + * board_button_initialize() must be called to initialize button resources. + * After that, board_buttons() may be called to collect the current state of + * all buttons or board_button_irq() may be called to register button + * interrupt handlers. * ****************************************************************************/ @@ -151,16 +151,16 @@ uint32_t board_buttons(void) for (i = 0; i < NUM_BUTTONS; i++) { - /* A LOW value means that the key is pressed. */ + /* A LOW value means that the key is pressed. */ - bool released = lpc17_40_gpioread(g_buttoncfg[i]); + bool released = lpc17_40_gpioread(g_buttoncfg[i]); - /* Accumulate the set of depressed (not released) keys */ + /* Accumulate the set of depressed (not released) keys */ - if (!released) - { + if (!released) + { ret |= (1 << i); - } + } } return ret; @@ -182,8 +182,8 @@ uint32_t board_buttons(void) * * Note that board_button_irq() also enables button interrupts. Button * interrupts will remain enabled after the interrupt handler is attached. - * Interrupts may be disabled (and detached) by calling board_button_irq with - * irqhandler equal to NULL. + * Interrupts may be disabled (and detached) by calling board_button_irq + * with irqhandler equal to NULL. * ****************************************************************************/ @@ -237,5 +237,4 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) return ret; } #endif - #endif /* CONFIG_ARCH_BUTTONS */ diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_djoystick.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_djoystick.c index f10ac589cb..7ef7cf4b71 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_djoystick.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_djoystick.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/open1788/src/lpc17_40_djoystick.c + * boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_djoystick.c * * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -97,7 +97,6 @@ static void djoy_enable(FAR const struct djoy_lowerhalf_s *lower, djoy_buttonset_t press, djoy_buttonset_t release, djoy_interrupt_t handler, FAR void *arg); - static void djoy_disable(void); static int djoy_interrupt(int irq, FAR void *context, FAR void *arg); @@ -176,16 +175,16 @@ static djoy_buttonset_t djoy_sample(FAR const struct djoy_lowerhalf_s *lower) for (i = 0; i < DJOY_NGPIOS; i++) { - /* A LOW value means that the key is pressed. */ + /* A LOW value means that the key is pressed. */ - bool released = lpc17_40_gpioread(g_joygpio[i]); + bool released = lpc17_40_gpioread(g_joygpio[i]); - /* Accumulate the set of depressed (not released) keys */ + /* Accumulate the set of depressed (not released) keys */ - if (!released) - { + if (!released) + { ret |= (1 << i); - } + } } iinfo("Returning: %02x\n", DJOY_ALLBITS); diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_lcd.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_lcd.c index a20c7f39be..1a36ddc1cf 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_lcd.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_lcd.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/open1788/src/lpc17_40_lcd.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_lcd.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,17 +49,17 @@ #ifdef CONFIG_LPC17_40_LCD -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: open1788_lcd_initialize * * Description: * Initialize the LCD. Setup backlight (initially off) * - ************************************************************************************/ + ****************************************************************************/ void open1788_lcd_initialize(void) { @@ -68,14 +68,14 @@ void open1788_lcd_initialize(void) lpc17_40_configgpio(GPIO_LCD_BL); } -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_backlight * * Description: - * If CONFIG_LPC17_40_LCD_BACKLIGHT is defined, then the board-specific logic must - * provide this interface to turn the backlight on and off. + * If CONFIG_LPC17_40_LCD_BACKLIGHT is defined, then the board-specific + * logic must provide this interface to turn the backlight on and off. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_LCD_BACKLIGHT void lpc17_40_backlight(bool blon) @@ -83,5 +83,4 @@ void lpc17_40_backlight(bool blon) lpc17_40_gpiowrite(GPIO_LCD_BL, blon); } #endif - #endif /* CONFIG_LPC17_40_LCD */ diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_nandinitialize.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_nandinitialize.c index 9942fd33f7..5e65a14ee1 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_nandinitialize.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_nandinitialize.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/open1788/src/lpc17_40_nandinitialize.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_nandinitialize.c * arch/arm/src/board/lpc17_40_nandinitialize.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -32,11 +32,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -51,17 +51,17 @@ #if defined(CONFIG_LPC17_40_EMC) && defined(CONFIG_LPC17_40_EXTNAND) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: open1788_nand_initialize * * Description: * Initialize NAND FLASH * - ************************************************************************************/ + ****************************************************************************/ void open1788_nand_initialize(void) { @@ -83,8 +83,8 @@ void open1788_nand_initialize(void) putreg32(31, LPC17_40_EMC_STATICWAITWR1); putreg32(31, LPC17_40_EMC_STATICWAITTURN1); - /* GPIO P2[21] connects to the Ready/Busy pin of the NAND part. We need to - * reconfigure this pin as normal GPIO input. + /* GPIO P2[21] connects to the Ready/Busy pin of the NAND part. + * We need to reconfigure this pin as normal GPIO input. */ lpc17_40_gpioconfig(GPIO_NAND_RB); diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_norinitialize.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_norinitialize.c index 74f2b52bc8..d1a8a76d26 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_norinitialize.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_norinitialize.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/open1788/src/lpc17_40_norinitialize.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_norinitialize.c * arch/arm/src/board/lpc17_40_norinitialize.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -32,11 +32,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -51,17 +51,17 @@ #if defined(CONFIG_LPC17_40_EMC) && defined(CONFIG_LPC17_40_EXTNOR) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: open1788_nor_initialize * * Description: * Initialize NOR FLASH * - ************************************************************************************/ + ****************************************************************************/ void open1788_nor_initialize(void) { diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_sdraminitialize.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_sdraminitialize.c index 57b96144e7..b387da0955 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_sdraminitialize.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_sdraminitialize.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/open1788/src/lpc17_40_sdraminitialize.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_sdraminitialize.c * arch/arm/src/board/lpc17_40_sdraminitialize.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -32,11 +32,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -54,12 +54,13 @@ #if defined(CONFIG_LPC17_40_EMC) && defined(CONFIG_LPC17_40_EXTDRAM) -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* The core clock is LPC17_40_EMCCLK which may be either LPC17_40_CCLK* (undivided), or - * LPC17_40_CCLK / 2 as determined by settings in the board.h header file. +/* The core clock is LPC17_40_EMCCLK which may be either LPC17_40_CCLK* + * (undivided), or LPC17_40_CCLK / 2 as determined by settings in the board.h + * header file. * * For example: * LPC17_40_CCLCK = 120,000,000 @@ -97,17 +98,17 @@ #define SDRAM_BASE 0xa0000000 /* CS0 */ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: open1788_sdram_initialize * * Description: * Initialize SDRAM * - ************************************************************************************/ + ****************************************************************************/ void open1788_sdram_initialize(void) { @@ -143,7 +144,7 @@ void open1788_sdram_initialize(void) putreg32( 1, LPC17_40_EMC_DYNAMICAPR); /* TAPR = 2 clocks? */ putreg32(EMC_NS2CLK(20) + 2, LPC17_40_EMC_DYNAMICDAL); /* TDAL = TRP + TDPL = 20ns + 2clk */ putreg32( 1, LPC17_40_EMC_DYNAMICWR); /* TWR = 2 clocks */ - putreg32( EMC_NS2CLK(63), LPC17_40_EMC_DYNAMICRC); /* H57V2562GTR-75C TRC = 63ns(min)*/ + putreg32( EMC_NS2CLK(63), LPC17_40_EMC_DYNAMICRC); /* H57V2562GTR-75C TRC = 63ns(min) */ putreg32( EMC_NS2CLK(63), LPC17_40_EMC_DYNAMICRFC); /* H57V2562GTR-75C TRFC = TRC */ putreg32( 15, LPC17_40_EMC_DYNAMICXSR); /* Exit self-refresh to active */ putreg32( EMC_NS2CLK(63), LPC17_40_EMC_DYNAMICRRD); /* 3 clock, TRRD = 15ns (min) */ @@ -158,27 +159,28 @@ void open1788_sdram_initialize(void) putreg32(MDKCFG_RASCAS0VAL, LPC17_40_EMC_DYNAMICRASCAS0); #ifdef CONFIG_LPC17_40_SDRAM_16BIT - /* For Manley lpc1778 SDRAM: H57V2562GTR-75C, 256Mb, 16Mx16, 4 banks, row=13, column=9: - * - * 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC - */ + /* For Manley lpc1778 SDRAM: + * H57V2562GTR-75C, 256Mb, 16Mx16, 4 banks, row=13, column=9: + * + * 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC + */ putreg32(EMC_DYNAMICCONFIG_MD_SDRAM | EMC_DYNAMICCONFIG_AM0(13), LPC17_40_EMC_DYNAMICCONFIG0); #elif defined CONFIG_LPC17_40_SDRAM_32BIT - /* 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC */ + /* 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC */ - putreg32(EMC_DYNAMICCONFIG_MD_SDRAM | EMC_DYNAMICCONFIG_AM0(13) | EMC_DYNAMICCONFIG_AM1, - LPC17_40_EMC_DYNAMICCONFIG0); + putreg32(EMC_DYNAMICCONFIG_MD_SDRAM | EMC_DYNAMICCONFIG_AM0(13) | + EMC_DYNAMICCONFIG_AM1, LPC17_40_EMC_DYNAMICCONFIG0); #endif up_mdelay(100); /* Issue NOP command */ - putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | EMC_DYNAMICCONTROL_I_NOP, - LPC17_40_EMC_DYNAMICCONTROL); + putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | + EMC_DYNAMICCONTROL_I_NOP, LPC17_40_EMC_DYNAMICCONTROL); /* Wait 200 Msec */ @@ -186,8 +188,8 @@ void open1788_sdram_initialize(void) /* Issue PALL command */ - putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | EMC_DYNAMICCONTROL_I_PALL, - LPC17_40_EMC_DYNAMICCONTROL); + putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | + EMC_DYNAMICCONTROL_I_PALL, LPC17_40_EMC_DYNAMICCONTROL); putreg32(2, LPC17_40_EMC_DYNAMICREFRESH); /* ( n * 16 ) -> 32 clock cycles */ @@ -195,7 +197,7 @@ void open1788_sdram_initialize(void) for (i = 0; i < 128; i++); - /* 64ms/8192 = 7.8125us, nx16x8.33ns < 7.8125us, n < 58.6*/ + /* 64ms/8192 = 7.8125us, nx16x8.33ns < 7.8125us, n < 58.6 */ regval = 64000000 / (1 << 13); regval -= 16; @@ -205,8 +207,8 @@ void open1788_sdram_initialize(void) /* Issue MODE command */ - putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | EMC_DYNAMICCONTROL_I_MODE, - LPC17_40_EMC_DYNAMICCONTROL); + putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | + EMC_DYNAMICCONTROL_I_MODE, LPC17_40_EMC_DYNAMICCONTROL); #ifdef CONFIG_LPC17_40_SDRAM_16BIT (void)getreg16(SDRAM_BASE | (0x33 << 12)); /* 8 burst, 3 CAS latency */ diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_ssp.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_ssp.c index 844a78d793..4b6ddbfb12 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_ssp.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_ssp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/open1788/src/lpc17_40_ssp.c + * boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_ssp.c * arch/arm/src/board/lpc17_40_ssp.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -104,35 +104,39 @@ void weak_function open1788_sspdev_initialize(void) #endif } -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_ssp0/1/2select and lpc17_40_ssp0/1/2status * * Description: - * The external functions, lpc17_40_ssp0/1/2select and lpc17_40_ssp0/1/2status - * must be provided by board-specific logic. They are implementations of the select - * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including lpc17_40_sspbus_initialize()) - * are provided by common LPC17xx/LPC40xx logic. To use this common SPI logic on your - * board: + * The external functions, lpc17_40_ssp0/1/2select and + * lpc17_40_ssp0/1/2status must be provided by board-specific logic. + * They are implementations of the select and status methods of the SPI + * interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). + * All other methods (including lpc17_40_sspbus_initialize()) + * are provided by common LPC17xx/LPC40xx logic. + * To use this common SPI logic on your board: * - * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip select - * pins. - * 2. Provide lpc17_40_ssp0/1/2select() and lpc17_40_ssp0/1/2status() functions - * in your board-specific logic. These functions will perform chip selection - * and status operations using GPIOs in the way your board is configured. - * 3. Add a calls to lpc17_40_sspbus_initialize() in your low level application - * initialization logic - * 4. The handle returned by lpc17_40_sspbus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP + * chip select pins. + * 2. Provide lpc17_40_ssp0/1/2select() and lpc17_40_ssp0/1/2status() + * functions in your board-specific logic. These functions will perform + * chip selection and status operations using GPIOs in the way your board + * is configured. + * 3. Add a calls to lpc17_40_sspbus_initialize() in your low level + * application initialization logic + * 4. The handle returned by lpc17_40_sspbus_initialize() may then be used + * to bind the SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_SSP0 -void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); } uint8_t lpc17_40_ssp0status(FAR struct spi_dev_s *dev, uint32_t devid) @@ -143,9 +147,11 @@ uint8_t lpc17_40_ssp0status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_LPC17_40_SSP1 -void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); if (devid == SPIDEV_TOUCHSCREEN(0)) { /* Assert/de-assert the CS pin to the touchscreen */ @@ -164,9 +170,11 @@ uint8_t lpc17_40_ssp1status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_LPC17_40_SSP2 -void lpc17_40_ssp2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp2select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); } uint8_t lpc17_40_ssp2status(FAR struct spi_dev_s *dev, uint32_t devid) diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_touchscreen.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_touchscreen.c index 9f603a24d3..360b83644f 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_touchscreen.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_touchscreen.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/open1788/src/lpc17_40_touchscreen.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_touchscreen.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Included Files @@ -178,7 +178,8 @@ static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable) iinfo("enable:%d\n", enable); if (enable) { - /* Enable PENIRQ interrupts. NOTE: The pin interrupt is enabled from worker thread + /* Enable PENIRQ interrupts. + * NOTE: The pin interrupt is enabled from worker thread * logic after completion of processing of the touchscreen interrupt. */ @@ -186,7 +187,8 @@ static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable) } else { - /* Disable PENIRQ interrupts. NOTE: The PENIRQ interrupt will be disabled from + /* Disable PENIRQ interrupts. + * NOTE: The PENIRQ interrupt will be disabled from * interrupt handling logic. */ @@ -239,7 +241,7 @@ static bool tsc_busy(FAR struct ads7843e_config_s *state) static bool tsc_pendown(FAR struct ads7843e_config_s *state) { - /* XPT2046 uses an an internal pullup resistor. The PENIRQ output goes low + /* XPT2046 uses an an internal pullup resistor. The PENIRQ output goes low * due to the current path through the touch screen to ground, which * initiates an interrupt to the processor via TP_INT. */ @@ -293,7 +295,8 @@ int open1788_tsc_setup(int minor) dev = lpc17_40_sspbus_initialize(CONFIG_ADS7843E_SPIDEV); if (!dev) { - ierr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV); + ierr("ERROR: Failed to initialize SPI bus %d\n", + CONFIG_ADS7843E_SPIDEV); return -ENODEV; } @@ -304,7 +307,9 @@ int open1788_tsc_setup(int minor) { ierr("ERROR: Failed to register touchscreen device minor=%d\n", CONFIG_ADS7843E_DEVMINOR); + /* up_spiuninitialize(dev); */ + return -ENODEV; } diff --git a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_userleds.c b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_userleds.c index 1f3979d11e..99d18a4de9 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_userleds.c +++ b/boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/open1788/src/lpc17_40_userleds.c + * boards/arm/lpc17xx_40xx/open1788/src/lpc17_40_userleds.c * arch/arm/src/board/lpc17_40_userleds.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. diff --git a/boards/arm/lpc17xx_40xx/open1788/src/open1788.h b/boards/arm/lpc17xx_40xx/open1788/src/open1788.h index 31206eb591..3d27b67d7d 100644 --- a/boards/arm/lpc17xx_40xx/open1788/src/open1788.h +++ b/boards/arm/lpc17xx_40xx/open1788/src/open1788.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/open1788/src/open1788.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/open1788/src/open1788.h * arch/arm/src/board/open1788.n * * Copyright (C) 2013, 2017-2018 Gregory Nutt. All rights reserved. @@ -32,38 +32,41 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef _CONFIGS_OPEN1788_SRC_OPEN1788_H -#define _CONFIGS_OPEN1788_SRC_OPEN1788_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_OPEN1788_SRC_OPEN1788_H +#define __BOARDS_ARM_LPC17XX_40XX_OPEN1788_SRC_OPEN1788_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Open1788 GPIO Pin Definitions ****************************************************/ -/* GPIO P2[21] connects to the Ready/Busy pin of the NAND part. We need to - * reconfigure this pin as normal GPIO input if NAND is used. +/* Open1788 GPIO Pin Definitions ********************************************/ + +/* GPIO P2[21] connects to the Ready/Busy pin of the NAND part. + * We need to reconfigure this pin as normal GPIO input if NAND is used. */ #define GPIO_NAND_RB (GPIO_INPUT | GPIO_PULLUP | GPIO_PORT2 | GPIO_PIN21) -/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in - * any way. The following definitions are used to access individual LEDs. +/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs + * in any way. + * The following definitions are used to access individual LEDs. * * LED1 -- Connected to P1[14] * LED2 -- Connected to P0[16] * LED3 -- Connected to P1[13] * LED4 -- Connected to P4[27] * - * These LEDs are connecte to ground so a high output value will illuminate them. + * These LEDs are connecte to ground so a high output value will illuminate + * them. */ #define GPIO_LED1 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT1 | GPIO_PIN14) @@ -71,11 +74,13 @@ #define GPIO_LED3 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT1 | GPIO_PIN13) #define GPIO_LED4 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT4 | GPIO_PIN27) -/* Button definitions ***************************************************************/ -/* The Open1788 supports several buttons. All must be pulled up by the Open1788. - * When closed, the pins will be pulled to ground. So the buttons will read "1" - * when open and "0" when closed. All except USER1 are capable of generating - * interrupts. +/* Button definitions *******************************************************/ + +/* The Open1788 supports several buttons. + * All must be pulled up by the Open1788. + * When closed, the pins will be pulled to ground. + * So the buttons will read "1" when open and "0" when closed. + * All except USER1 are capable of generating interrupts. * * USER1 -- Connected to P4[26] * USER2 -- Connected to P2[22] @@ -89,8 +94,8 @@ * JOY_D -- Connected to P2[19] * JOY_CTR -- Connected to P0[14] (shared with SSP1 SSEL) * - * For the interrupting buttons, interrupts are generated on both edges (press and - * release). + * For the interrupting buttons, interrupts are generated on both edges + * (press and release). */ #define GPIO_USER1 (GPIO_INPUT | GPIO_PULLUP | GPIO_PORT4 | GPIO_PIN26) @@ -113,36 +118,39 @@ #define GPIO_JOY_D_IRQ LPC17_40_IRQ_P2p19 #define GPIO_JOY_CTR_IRQ LPC17_40_IRQ_P0p14 -/* SD Card **************************************************************************/ -/* The SD card detect (CD) signal is on P0[13]. This signal is shared. It is also - * used for MOSI1 and USB_UP_LED. The CD pin may be disconnected. There is a jumper - * on board that enables the CD pin. +/* SD Card ******************************************************************/ + +/* The SD card detect (CD) signal is on P0[13]. This signal is shared. + * It is also used for MOSI1 and USB_UP_LED. The CD pin may be disconnected. + * There is a jumper on board that enables the CD pin. * * The CD pin is interrupting: */ #define GPIO_SD_CD (GPIO_INTBOTH | GPIO_PULLUP | GPIO_PORT0 | GPIO_PIN13) -/* LCD ******************************************************************************/ +/* LCD **********************************************************************/ + /* Backlight enable, P2[1]. Initial state is OFF (zero) */ #define GPIO_LCD_BL (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT2 | GPIO_PIN1) -/* XPT2046 Touchscreen **************************************************************/ -/* -------------- -------------------- ------------ -------------------------------- +/* XPT2046 Touchscreen ******************************************************/ + +/* -------------- -------------------- ------------ ------------------------- * XTPT2046 Module Module Open1788 LED * Signal Connector Connector - * -------------- -------------------- ------------ --------------------------------- + * -------------- -------------------- ------------ ------------------------- * Pin 11 PENIRQ\ PENIRQ (pulled high) PORT3 Pin 1 P2.15 PENIRQ * Pin 12 DOUT MISO PORT3 Pin 4 P1.18 MISO1 (Also USB HOST UP LED) * Pin 13 BUSY BUSY (pulled high) PORT3 Pin 9 P2.14 BUSY * Pin 14 DIN MOSI PORT3 Pin 3 P0.13 MOSI1 (Also USB Device up LED and SD CD pin) * Pin 15 CS\ SSEL (pulled high) PORT3 Pin 6 P1.8 GPIO (Also RMII_CRS_DV) * Pin 16 DCLK SCK PORT3 Pin 5 P1.19 SCK1 - * -------------- -------------------- ------------ --------------------------------- + * -------------- -------------------- ------------ ------------------------- * - * Pins should not need to be configured as pull-ups because, according to the LCD - * schematic, the are pulled-up on board the LCD module. + * Pins should not need to be configured as pull-ups because, according to + * the LCD schematic, the are pulled-up on board the LCD module. */ #define GPIO_TC_PENIRQ (GPIO_INTBOTH | GPIO_FLOAT | GPIO_PORT2 | GPIO_PIN15) @@ -151,17 +159,17 @@ #define LPC17_40_IRQ_PENIRQ LPC17_40_IRQ_P2p15 -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: open1788_bringup * * Description: @@ -173,102 +181,105 @@ * CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y : * Called from the NSH library via boardctl() * - ************************************************************************************/ + ****************************************************************************/ int open1788_bringup(void); -/************************************************************************************ +/**************************************************************************** * Name: open1788_sspdev_initialize * * Description: - * Called to configure SPI chip select GPIO pins for the WaveShare Open1788 board. + * Called to configure SPI chip select GPIO pins for the WaveShare Open1788 + * board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function open1788_sspdev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: open1788_sdram_initialize * * Description: * Initialize SDRAM * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_EMC #ifdef CONFIG_LPC17_40_EXTDRAM void open1788_sdram_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: open1788_nor_initialize * * Description: * Initialize NOR FLASH * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_EXTNOR void open1788_nor_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: open1788_nand_initialize * * Description: * Initialize NAND FLASH * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_EXTNAND void open1788_nand_initialize(void); #endif #endif /* CONFIG_LPC17_40_EMC */ -/************************************************************************************ +/**************************************************************************** * Name: open1788_lcd_initialize * * Description: * Initialize the LCD. Setup backlight (initially off) * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_LCD void open1788_lcd_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: open1788_tsc_setup * * Description: - * This function is called by board-bringup logic to configure the touchscreen - * device. This function will register the driver as /dev/inputN where N is the + * This function is called by board-bringup logic to configure the + * touchscreen device. + * This function will register the driver as /dev/inputN where N is the * minor device number. * * Input Parameters: * minor - The input device minor number * * Returned Value: - * Zero is returned on success. Otherwise, a negated errno value is returned to - * indicate the nature of the failure. + * Zero is returned on success. + * Otherwise, a negated errno value is returned to indicate the nature of + * the failure. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_INPUT_ADS7843E int open1788_tsc_setup(int minor); #endif -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_djoy_initialization * * Description: * Initialize and register the discrete joystick driver * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_OPEN1788_DJOYSTICK int lpc17_40_djoy_initialization(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_OPEN1788_SRC_OPEN1788_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_OPEN1788_SRC_OPEN1788_H */ diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/include/board.h b/boards/arm/lpc17xx_40xx/pnev5180b/include/board.h index 51a854c19b..c060b8044c 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/include/board.h +++ b/boards/arm/lpc17xx_40xx/pnev5180b/include/board.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/pnev5180b/include/board.h + * boards/arm/lpc17xx_40xx/pnev5180b/include/board.h * include/arch/board/board.h * * Copyright (C) 2019 Gregory Nutt. All rights reserved. @@ -38,8 +38,8 @@ * *****************************************************************************/ -#ifndef __BOARDS_ARM_PNEV5180B_INCLUDE_BOARD_H -#define __BOARDS_ARM_PNEV5180B_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_PNEV5180B_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC17XX_40XX_PNEV5180B_INCLUDE_BOARD_H /***************************************************************************** * Included Files @@ -207,10 +207,10 @@ extern "C" * Name: lpc17_40_boardinitialize * * Description: - * All LPC17xx/LPC40xx architectures must provide the following entry point. This - * entry point is called early in the initialization -- after all memory - * has been configured and mapped but before any devices have been - * initialized. + * All LPC17xx/LPC40xx architectures must provide the following entry point. + * This entry point is called early in the initialization -- after all + * memory has been configured and mapped but before any devices have + * been initialized. * *****************************************************************************/ @@ -234,4 +234,4 @@ void lpc17_40_led(int lednum, int state); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_PNEV5180_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_PNEV5180_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/kernel/Makefile b/boards/arm/lpc17xx_40xx/pnev5180b/kernel/Makefile index b78741f9bd..bf0952965a 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/kernel/Makefile +++ b/boards/arm/lpc17xx_40xx/pnev5180b/kernel/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/pnev5180b/kernel/Makefile +# boards/arm/lpc17xx_40xx/pnev5180b/kernel/Makefile # # Copyright (C) 2019 Gregory Nutt. All rights reserved. # Author: Michael Jung diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/kernel/lpc17_40_userspace.c b/boards/arm/lpc17xx_40xx/pnev5180b/kernel/lpc17_40_userspace.c index 1ca2b877e4..eb611b4343 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/kernel/lpc17_40_userspace.c +++ b/boards/arm/lpc17xx_40xx/pnev5180b/kernel/lpc17_40_userspace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/pnev5180b/kernel/lpc17_40_userspace.c + * boards/arm/lpc17xx_40xx/pnev5180b/kernel/lpc17_40_userspace.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Michael Jung diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/scripts/Make.defs b/boards/arm/lpc17xx_40xx/pnev5180b/scripts/Make.defs index e976e807fd..371037b02c 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/scripts/Make.defs +++ b/boards/arm/lpc17xx_40xx/pnev5180b/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/pnev5180b/scripts/Make.defs +# boards/arm/lpc17xx_40xx/pnev5180b/scripts/Make.defs # # Copyright (C) 2019 Gregory Nutt. All rights reserved. # Author: Michael Jung diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/scripts/flash.ld b/boards/arm/lpc17xx_40xx/pnev5180b/scripts/flash.ld index d522909c24..62e2ce1712 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/scripts/flash.ld +++ b/boards/arm/lpc17xx_40xx/pnev5180b/scripts/flash.ld @@ -1,5 +1,5 @@ /***************************************************************************** - * boards/pnev5180b/scripts/flash.ld + * boards/arm/lpc17xx_40xx/pnev5180b/scripts/flash.ld * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Michael Jung diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/scripts/kernel-space.ld b/boards/arm/lpc17xx_40xx/pnev5180b/scripts/kernel-space.ld index df7570e8c7..3b66e1adbb 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/scripts/kernel-space.ld +++ b/boards/arm/lpc17xx_40xx/pnev5180b/scripts/kernel-space.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/pnev5180b/scripts/kernel-space.ld + * boards/arm/lpc17xx_40xx/pnev5180b/scripts/kernel-space.ld * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Michael Jung diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/scripts/memory.ld b/boards/arm/lpc17xx_40xx/pnev5180b/scripts/memory.ld index c9a46c1706..89653ee44d 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/scripts/memory.ld +++ b/boards/arm/lpc17xx_40xx/pnev5180b/scripts/memory.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/pnev5180b/scripts/memory.ld + * boards/arm/lpc17xx_40xx/pnev5180b/scripts/memory.ld * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Michael Jung diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/scripts/user-space.ld b/boards/arm/lpc17xx_40xx/pnev5180b/scripts/user-space.ld index aac7f8d746..eb6816bc9d 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/scripts/user-space.ld +++ b/boards/arm/lpc17xx_40xx/pnev5180b/scripts/user-space.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/pnev5180b/scripts/user-space.ld + * boards/arm/lpc17xx_40xx/pnev5180b/scripts/user-space.ld * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Michael Jung diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/src/Makefile b/boards/arm/lpc17xx_40xx/pnev5180b/src/Makefile index fa1b3c8762..f3c94e49eb 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/src/Makefile +++ b/boards/arm/lpc17xx_40xx/pnev5180b/src/Makefile @@ -1,5 +1,5 @@ ############################################################################## -# boards/pnev5180b/src/Makefile +# boards/arm/lpc17xx_40xx/pnev5180b/src/Makefile # # Copyright (C) 2019 Gregory Nutt. All rights reserved. # Author: Michael Jung diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_appinit.c b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_appinit.c index 88da53390c..5e565d2f1f 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_appinit.c +++ b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_appinit.c @@ -1,5 +1,5 @@ /***************************************************************************** - * config/pnev5180b/src/lpc17_40_appinit.c + * boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_appinit.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Michael Jung diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_boot.c b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_boot.c index 493c433304..83e4b3db73 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_boot.c +++ b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_boot.c @@ -1,5 +1,5 @@ /***************************************************************************** - * boards/pnev5180b/src/lpc17_40_boot.c + * boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_boot.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Michael Jung @@ -57,9 +57,9 @@ * Name: lpc17_40_boardinitialize * * Description: - * All LPC17xx/LPC40xx architectures must provide the following entry point. This - * entry point is called early in the initialization -- after all memory - * has been configured and mapped but before any devices have been + * All LPC17xx/LPC40xx architectures must provide the following entry point. + * This entry point is called early in the initialization -- after all + * memory has been configured and mapped but before any devices have been * initialized. * *****************************************************************************/ diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_bringup.c b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_bringup.c index d4dc6e7981..46b2fbdc17 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_bringup.c +++ b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_bringup.c @@ -1,5 +1,5 @@ /***************************************************************************** - * config/pnev5180b/src/lpc17_40_bringup.c + * boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_bringup.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Michael Jung diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_composite.c b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_composite.c index 8ee206f72f..f37f7967a1 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_composite.c +++ b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_composite.c @@ -1,5 +1,5 @@ /***************************************************************************** - * boards/pnev5180b/src/lpc17_40_composite.c + * boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_composite.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Michael Jung @@ -64,9 +64,9 @@ int board_composite_initialize(int port) { - syslog(LOG_INFO, "board_composite_initialize(port: %d)\n", port); + syslog(LOG_INFO, "board_composite_initialize(port: %d)\n", port); - return OK; + return OK; } /***************************************************************************** diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_leds.c b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_leds.c index 6b88fa3a6a..8d795da2bd 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_leds.c +++ b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/pnev5180b/src/lpc17_40_leds.c + * boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_leds.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Michael Jung diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_romfs.c b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_romfs.c index b752edc6c1..bf2401686b 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_romfs.c +++ b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_romfs.c @@ -1,5 +1,5 @@ /***************************************************************************** - * boards/pnev5180b/src/lpc17_40_romfs.c + * boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_romfs.c * This file provides contents of an optional ROMFS volume, mounted at boot. * * Copyright (C) 2019 Gregory Nutt. All rights reserved. diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_romfs.h b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_romfs.h index a0a5b2f126..1f340c8cd4 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_romfs.h +++ b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_romfs.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/pnev5180b/src/lpc17_40_romfs.h + * boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_romfs.h * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Michael Jung (mijung@gmx.net) @@ -38,8 +38,8 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_PNEV5180B_SRC_LPC17_40_ROMFS_H -#define __BOARDS_ARM_PNEV5180B_SRC_LPC17_40_ROMFS_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_PNEV5180B_SRC_LPC17_40_ROMFS_H +#define __BOARDS_ARM_LPC17XX_40XX_PNEV5180B_SRC_LPC17_40_ROMFS_H /**************************************************************************** * Included Files @@ -79,4 +79,4 @@ int lpc17_40_romfs_initialize(void); #endif /* CONFIG_LPC17_40_ROMFS */ -#endif /* __BOARDS_ARM_PNEV5180B_SRC_LPC17_40_ROMFS_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_PNEV5180B_SRC_LPC17_40_ROMFS_H */ diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_spi.c b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_spi.c index 1b3fd6f8f7..aa72732988 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_spi.c +++ b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_spi.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/pnev5180b/src/lpc17_40_spi.c + * boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_spi.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt @@ -80,12 +80,12 @@ void weak_function pnev5180b_spidev_initialize(void) * must be provided by board-specific logic. They are implementations of * the select and status methods of the SPI interface defined by struct * spi_ops_s (see include/nuttx/spi/spi.h). All other methods (including - * lpc17_40_spibus_initialize()) are provided by common LPC17xx/LPC40xx logic. To - * use this common SPI logic on your board: + * lpc17_40_spibus_initialize()) are provided by common LPC17xx/LPC40xx + * logic. + * To use this common SPI logic on your board: * * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip - * select - * pins. + * select pins. * 2. Provide lpc17_40_spiselect and lpc17_40_spistatus functions * in your board-specific logic. These functions will perform chip * selection and status operations using GPIOs in the way your board is @@ -99,7 +99,8 @@ void weak_function pnev5180b_spidev_initialize(void) * ****************************************************************************/ -void lpc17_40_spiselect(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_spiselect(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_symtab.c b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_symtab.c index 85503a89ca..af5ddc91c1 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_symtab.c +++ b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_symtab.c @@ -1,5 +1,5 @@ /***************************************************************************** - * config/pnev5180b/src/lpc17_40_symtab.c + * boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_symtab.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Michael Jung diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_symtab.h b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_symtab.h index 140b7d9999..7163fb031a 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_symtab.h +++ b/boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_symtab.h @@ -1,5 +1,5 @@ /***************************************************************************** - * config/pnev5180b/src/lpc17_40_symtab.c + * boards/arm/lpc17xx_40xx/pnev5180b/src/lpc17_40_symtab.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Michael Jung @@ -33,8 +33,8 @@ * *****************************************************************************/ -#ifndef __BOARDS_ARM_PNEV5180B_SRC_LPC17_40_SYMTAB_H -#define __BOARDS_ARM_PNEV5180B_SRC_LPC17_40_SYMTAB_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_PNEV5180B_SRC_LPC17_40_SYMTAB_H +#define __BOARDS_ARM_LPC17XX_40XX_PNEV5180B_SRC_LPC17_40_SYMTAB_H /***************************************************************************** * Included Files @@ -53,4 +53,4 @@ extern const struct symtab_s lpc17_40_exports[]; extern const int lpc17_40_nexports; #endif -#endif /* __BOARDS_ARM_PNEV5180B_SRC_LPC17_40_SYMTAB_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_PNEV5180B_SRC_LPC17_40_SYMTAB_H */ diff --git a/boards/arm/lpc17xx_40xx/pnev5180b/src/pnev5180b.h b/boards/arm/lpc17xx_40xx/pnev5180b/src/pnev5180b.h index 843be536a0..a193b413df 100644 --- a/boards/arm/lpc17xx_40xx/pnev5180b/src/pnev5180b.h +++ b/boards/arm/lpc17xx_40xx/pnev5180b/src/pnev5180b.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/pnev5180b/src/pnev5180b.h + * boards/arm/lpc17xx_40xx/pnev5180b/src/pnev5180b.h * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt @@ -34,8 +34,8 @@ * ****************************************************************************/ -#ifndef _CONFIGS_PNEV5180B_SRC_PNEV5180B_H -#define _CONFIGS_PNEV5180B_SRC_PNEV5180B_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_PNEV5180B_SRC_PNEV5180B_H +#define __BOARDS_ARM_LPC17XX_40XX_PNEV5180B_SRC_PNEV5180B_H /**************************************************************************** * Included Files @@ -124,4 +124,4 @@ void pnev5180b_autoled_initialize(void); void weak_function pnev5180b_spidev_initialize(void); #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_PNEV5180B_SRC_PNEV5180B_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_PNEV5180B_SRC_PNEV5180B_H */ diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/README.txt b/boards/arm/lpc17xx_40xx/u-blox-c027/README.txt index fc24acd99a..764edf0e0b 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/README.txt +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/README.txt @@ -114,7 +114,8 @@ pppd app is located in apps/examples/pppd and requires setting correct login details in the source code. To connect using the internal u-blox TCP/IP stack, use the chat app. Its -configuration is done in boards/u-blox-c027/nsh/defconfig and can be adjusted +configuration is done in +boards/arm/lpc17xx_40xx/u-blox-c027/nsh/defconfig and can be adjusted using 'make menuconfig'. The NuttX u-blox modem driver is included like this: diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/include/board.h b/boards/arm/lpc17xx_40xx/u-blox-c027/include/board.h index b77037cdb8..efacd94621 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/include/board.h +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/u-blox-c027/include/board.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/u-blox-c027/include/board.h * * Copyright (C) 2016 Vladimir Komendantskiy. All rights reserved. * Author: Vladimir Komendantskiy @@ -31,24 +31,27 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_U_BLOX_C027_INCLUDE_BOARD_H -#define __BOARDS_ARM_U_BLOX_C027_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_U_BLOX_C027_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC17XX_40XX_U_BLOX_C027_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ -/* 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 include path. +/* Clocking *****************************************************************/ + +/* 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 include path. */ #define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency */ @@ -58,29 +61,31 @@ /* This is the clock setup we configure for: * - * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source - * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1 - * CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 + * SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source + * PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1 + * CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6 */ #define LPC17_40_CCLK 80000000 /* 80Mhz */ -/* Select the main oscillator as the frequency source. SYSCLK is then the frequency - * of the main oscillator. +/* Select the main oscillator as the frequency source. + * SYSCLK is then the frequency of the main oscillator. */ #undef CONFIG_LPC17_40_MAINOSC #define CONFIG_LPC17_40_MAINOSC 1 #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 CCLK. * The input to the divider (PLLCLK) will be determined by the PLL output. */ #define BOARD_CCLKCFG_DIVIDER 6 #define BOARD_CCLKCFG_VALUE ((BOARD_CCLKCFG_DIVIDER-1) << SYSCON_CCLKCFG_SHIFT) -/* PLL0. PLL0 is used to generate the CPU clock divider input (PLLCLK). +/* PLL0. + * PLL0 is used to generate the CPU clock divider input (PLLCLK). * * Source clock: Main oscillator * PLL0 Multiplier value (M): 20 @@ -108,7 +113,8 @@ (((BOARD_PLL1CFG_MSEL-1) << SYSCON_PLL1CFG_MSEL_SHIFT) | \ ((BOARD_PLL1CFG_NSEL-1) << SYSCON_PLL1CFG_NSEL_SHIFT)) -/* USB divider. This divider is used when PLL1 is not enabled to get the +/* USB divider. + * This divider is used when PLL1 is not enabled to get the * USB clock from PLL0: * * USBCLK = PLL0CLK / 10 = 48MHz @@ -126,7 +132,8 @@ #define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV20 -/* u-blox C027 board pin usage ***************************************************/ +/* u-blox C027 board pin usage **********************************************/ + /* Pin Description Connector On Board * -------------------------------- --------- -------------- * P0[0]/RD1/TXD3/SDA1 D14 TXD3/SDA1 @@ -204,9 +211,10 @@ * P4[29]/TX-MCLK/MAT2.1/RXD3 D1 RXD3 */ -/* LED definitions ******************************************************************/ -/* The u-blox C027 board has a single red LED (there are additional LEDs on the - * base board not considered here). +/* LED definitions **********************************************************/ + +/* The u-blox C027 board has a single red LED + * (there are additional LEDs on the base board not considered here). */ /* ON OFF */ #define LED_STARTED 0 /* OFF ON (never happens) */ @@ -252,4 +260,4 @@ #define GPIO_PWM1p5 GPIO_PWM1p5_2 #define GPIO_PWM1p6 GPIO_PWM1p6_2 -#endif /* __BOARDS_ARM_U_BLOX_C027_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_U_BLOX_C027_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/scripts/Make.defs b/boards/arm/lpc17xx_40xx/u-blox-c027/scripts/Make.defs index 2cb84959b3..6e8524071e 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/scripts/Make.defs +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/u-blox-c027/scripts/Make.defs +# boards/arm/lpc17xx_40xx/u-blox-c027/scripts/Make.defs # # Copyright (C) 2016, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/scripts/u-blox-c027.ld b/boards/arm/lpc17xx_40xx/u-blox-c027/scripts/u-blox-c027.ld index b6dcc54723..4d7fca2c30 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/scripts/u-blox-c027.ld +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/scripts/u-blox-c027.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/u-blox-c027/scripts/u-blox-c027.ld + * boards/arm/lpc17xx_40xx/u-blox-c027/scripts/u-blox-c027.ld * * Copyright (C) 2016, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/src/Makefile b/boards/arm/lpc17xx_40xx/u-blox-c027/src/Makefile index 52c9385833..a32cc4b467 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/src/Makefile +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/u-blox-c027/src/Makefile +# boards/arm/lpc17xx_40xx/u-blox-c027/src/Makefile # # Copyright (C) 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_adc.c b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_adc.c index 65f60fbef6..9d07daf8fb 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_adc.c +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_adc.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/u-blox-c027/src/lpc17_40_adc.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_adc.c * * Derives from boards/stm3220g-eval/src/lpc17_40_adc.c * @@ -38,11 +38,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -61,17 +61,17 @@ #ifdef CONFIG_ADC -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ int lpc17_40_adc_setup(void) { @@ -83,7 +83,9 @@ int lpc17_40_adc_setup(void) if (!initialized) { - /* Call lpc17_40_adcinitialize() to get an instance of the ADC interface */ + /* Call lpc17_40_adcinitialize() to get an instance of + * the ADC interface + */ adc = lpc17_40_adcinitialize(); if (adc == NULL) diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_appinit.c b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_appinit.c index a35a4fcd8a..ca066a86fc 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_appinit.c +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/u-blox-c027/src/lpc17_40_appinit.c + * boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_appinit.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -184,10 +184,12 @@ int board_app_initialize(uintptr_t arg) /* Bind the SSP port to the slot */ - ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, ssp); + ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, + CONFIG_NSH_MMCSDSLOTNO, ssp); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to bind SSP port %d to MMC/SD slot %d: %d\n", + syslog(LOG_ERR, + "ERROR: Failed to bind SSP port %d to MMC/SD slot %d: %d\n", CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret); return ret; } diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_boot.c b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_boot.c index 6949eea2a3..262b66969d 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_boot.c +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/u-blox-c027/src/lpc17_40_boot.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_boot.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -51,24 +51,26 @@ #include "lpc17_40_ssp.h" #include "u-blox-c027.h" -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_boardinitialize * * Description: - * All LPC17xx/LPC40xx architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All LPC17xx/LPC40xx architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc17_40_boardinitialize(void) { - /* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) the weak - * function c027_sspdev_initialize() has been brought into the link. + /* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) + * the weak function c027_sspdev_initialize() has been brought into the + * link. */ #if defined(CONFIG_LPC17_40_SSP0) || defined(CONFIG_LPC17_40_SSP1) @@ -91,7 +93,7 @@ void lpc17_40_boardinitialize(void) * Description: * If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional * initialization call will be performed in the boot-up sequence to a - * function called board_late_initialize(). board_late_initialize() will be + * function called board_late_initialize(). board_late_initialize() will be * called immediately after up_initialize() is called and just before the * initial application is started. This additional initialization phase * may be used, for example, to initialize board-specific device drivers. diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_dac.c b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_dac.c index c5919ae99b..20e0028261 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_dac.c +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_dac.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/u-blox-c027/src/lpc17_40_dac.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_dac.c * * Derives from boards/stm3220g-eval/src/lpc17_40_adc.c * @@ -38,11 +38,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -59,18 +59,18 @@ #ifdef CONFIG_DAC -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: dac_devinit * * Description: - * All LPC17xx/LPC40xx architectures must provide the following interface to work with - * examples/diag. + * All LPC17xx/LPC40xx architectures must provide the following interface + * to work with examples/diag. * - ************************************************************************************/ + ****************************************************************************/ int dac_devinit(void) { @@ -80,7 +80,9 @@ int dac_devinit(void) if (!initialized) { - /* Call lpc17_40_dacinitialize() to get an instance of the dac interface */ + /* Call lpc17_40_dacinitialize() to get an instance of the + * dac interface + */ dac = lpc17_40_dacinitialize(); if (dac == NULL) diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_leds.c b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_leds.c index 5f3aacb44d..2a7d77b772 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_leds.c +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/u-blox-c027/src/lpc17_40_leds.c + * boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_leds.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_pwm.c b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_pwm.c index fa7015b5ed..3b1c47af4b 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_pwm.c +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_pwm.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/u-blox-c027/lpc17_40_pwm.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/u-blox-c027/lpc17_40_pwm.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -54,9 +54,9 @@ #include "lpc17_40_timer.h" #include "u-blox-c027.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PWM @@ -64,17 +64,17 @@ FAR struct pwm_lowerhalf_s *lpc17_40_pwminitialize(int timer); FAR struct pwm_lowerhalf_s *lpc17_40_mcpwminitialize(int timer); FAR struct pwm_lowerhalf_s *lpc17_40_timerinitialize(int timer); -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ int lpc17_40_pwm_setup(void) { @@ -88,7 +88,9 @@ int lpc17_40_pwm_setup(void) if (!initialized) { - /* Call lpc17_40_pwminitialize() to get an instance of the PWM interface */ + /* Call lpc17_40_pwminitialize() to get an instance of + * the PWM interface + */ pwm = lpc17_40_pwminitialize(0); if (!pwm) diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ssp.c b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ssp.c index 393d6ad29e..f673795bbf 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ssp.c +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ssp.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/u-blox-c027/src/lpc17_40_ssp.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ssp.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -54,9 +54,9 @@ #if defined(CONFIG_LPC17_40_SSP0) || defined(CONFIG_LPC17_40_SSP1) -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* Dump GPIO registers */ @@ -66,17 +66,17 @@ # define ssp_dumpgpio(m) #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: c027_sspdev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the C027. * - ************************************************************************************/ + ****************************************************************************/ void weak_function c027_sspdev_initialize(void) { @@ -94,35 +94,39 @@ void weak_function c027_sspdev_initialize(void) ssp_dumpgpio("c027_sspdev_initialize() Exit"); } -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_ssp0/ssp1select and lpc17_40_ssp0/ssp1status * * Description: - * The external functions, lpc17_40_ssp0/ssp1select and lpc17_40_ssp0/ssp1status - * must be provided by board-specific logic. They are implementations of the select - * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including lpc17_40_sspbus_initialize()) - * are provided by common LPC17xx/LPC40xx logic. To use this common SPI logic on your - * board: + * The external functions, lpc17_40_ssp0/ssp1select and + * lpc17_40_ssp0/ssp1status must be provided by board-specific logic. + * They are implementations of the select and status methods of the SPI + * interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). + * All other methods (including lpc17_40_sspbus_initialize()) + * are provided by common LPC17xx/LPC40xx logic. + * To use this common SPI logic on your board: * - * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip select - * pins. - * 2. Provide lpc17_40_ssp0/ssp1select() and lpc17_40_ssp0/ssp1status() functions - * in your board-specific logic. These functions will perform chip selection - * and status operations using GPIOs in the way your board is configured. - * 3. Add a calls to lpc17_40_sspbus_initialize() in your low level application - * initialization logic - * 4. The handle returned by lpc17_40_sspbus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip + * select pins. + * 2. Provide lpc17_40_ssp0/ssp1select() and lpc17_40_ssp0/ssp1status() + * functions in your board-specific logic. These functions will perform + * chip selection and status operations using GPIOs in the way your + * board is configured. + * 3. Add a calls to lpc17_40_sspbus_initialize() in your low level + * application initialization logic + * 4. The handle returned by lpc17_40_sspbus_initialize() may then be used + * to bind the SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_SSP0 -void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_40_ssp0select() Entry"); #warning "Assert CS here (false)" @@ -138,9 +142,11 @@ uint8_t lpc17_40_ssp0status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_LPC17_40_SSP1 -void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_40_ssp1select() Entry"); if (devid == SPIDEV_MMCSD(0)) @@ -177,5 +183,4 @@ uint8_t lpc17_40_ssp1status(FAR struct spi_dev_s *dev, uint32_t devid) return 0; } #endif - #endif /* CONFIG_LPC17_40_SSP0 || CONFIG_LPC17_40_SSP1 */ diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ubxmdm.c b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ubxmdm.c index 32cb1e5002..445d2f1c8c 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ubxmdm.c +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ubxmdm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/u-blox-c027/src/lpc17_40_ubxmdm.c + * boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_ubxmdm.c * * Copyright (C) 2016 Vladimir Komendantskiy. All rights reserved. * Author: Vladimir Komendantskiy @@ -59,7 +59,9 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Debug ********************************************************************/ + /* Non-standard debug that may be enabled just for testing the modem driver */ #ifdef CONFIG_MODEM_U_BLOX_DEBUG @@ -133,6 +135,7 @@ static struct lpc17_40_ubxmdm_lower lpc17_40_ubxmdm_lower; /**************************************************************************** * Private Data ****************************************************************************/ + /* "Lower half" driver methods */ static const struct lpc17_40_ubxmdm_pins lpc17_40_ubxmdm_pins = @@ -200,7 +203,7 @@ static int lpc17_40_poweron(FAR struct ubxmdm_lower* lower) nxsig_usleep(1 * 1000); /* Delay to obtain correct voltage on shifters */ lpc17_40_configgpio(priv->pins->shifter_en_n | GPIO_VALUE_ZERO); /* UART shifter enabled */ -/* lpc17_40_configgpio(priv->pins->power_on_n | GPIO_VALUE_ONE); * Stop current through switch */ +/* lpc17_40_configgpio(priv->pins->power_on_n | GPIO_VALUE_ONE); Stop current through switch */ return OK; } diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_usbmsc.c b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_usbmsc.c index 0032a2e3f6..c654285c7b 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_usbmsc.c +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_usbmsc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/u-blox-c027/src/lpc17_40_usbmsc.c + * boards/arm/lpc17xx_40xx/u-blox-c027/src/lpc17_40_usbmsc.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -69,7 +69,7 @@ # undef LPC17XX_40XX_MMCSDSLOTNO # define LPC17XX_40XX_MMCSDSLOTNO 0 #else - /* Add configuration for new LPC17xx/LPC40xx boards here */ + /* Add configuration for new LPC17xx/LPC40xx boards here */ # error "Unrecognized LPC17xx/LPC40xx board" #endif @@ -112,7 +112,8 @@ int board_usbmsc_initialize(int port) syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n", LPC17XX_40XX_MMCSDSPIPORTNO, LPC17XX_40XX_MMCSDSLOTNO); - ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, LPC17XX_40XX_MMCSDSLOTNO, spi); + ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, + LPC17XX_40XX_MMCSDSLOTNO, spi); if (ret < 0) { syslog(LOG_ERR, diff --git a/boards/arm/lpc17xx_40xx/u-blox-c027/src/u-blox-c027.h b/boards/arm/lpc17xx_40xx/u-blox-c027/src/u-blox-c027.h index 1c1bb72148..3717c14007 100644 --- a/boards/arm/lpc17xx_40xx/u-blox-c027/src/u-blox-c027.h +++ b/boards/arm/lpc17xx_40xx/u-blox-c027/src/u-blox-c027.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/u-blox-c027/src/u-blox-c027.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/u-blox-c027/src/u-blox-c027.h * * Copyright (C) 2016 Vladimir Komendantskiy. All rights reserved. * Author: Vladimir Komendantskiy @@ -31,21 +31,21 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_U_BLOX_C027_SRC_U_BLOX_C027_H -#define __BOARDS_ARM_U_BLOX_C027_SRC_U_BLOX_C027_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_U_BLOX_C027_SRC_U_BLOX_C027_H +#define __BOARDS_ARM_LPC17XX_40XX_U_BLOX_C027_SRC_U_BLOX_C027_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #define C027_LED (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT3 | GPIO_PIN25) @@ -70,61 +70,61 @@ #define C027_GPSEN (GPIO_OUTPUT | GPIO_PORT1 | GPIO_PIN29) #define C027_GPSRST (GPIO_OUTPUT | GPIO_PORT1 | GPIO_PIN18) -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: c027_sspdev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the C027 board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function c027_sspdev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_ubxmdm_init * * Description: * Initialisation function for the u-blox modem. * - ************************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_MODEM_U_BLOX) void lpc17_40_ubxmdm_init(bool usb_used); #endif /* CONFIG_MODEM_U_BLOX */ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PWM int lpc17_40_pwm_setup(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ADC int lpc17_40_adc_setup(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_U_BLOX_C027_SRC_U_BLOX_C027_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_U_BLOX_C027_SRC_U_BLOX_C027_H */ diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/README.txt b/boards/arm/lpc17xx_40xx/zkit-arm-1769/README.txt index 64f5d6c31f..d4da800f62 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/README.txt +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/README.txt @@ -142,12 +142,12 @@ LEDs If CONFIG_ARCH_LEDS is defined, then support for the ZKit-ARM LEDs will be included in the build. See: - - boards/zkit-arm-1769/include/board.h - Defines LED constants, types and + - boards/arm/lpc17xx_40xx/zkit-arm-1769/include/board.h - Defines LED constants, types and prototypes the LED interface functions. - - boards/zkit-arm-1769/src/zkit-arm-1769.h - GPIO settings for the LEDs. + - boards/arm/lpc17xx_40xx/zkit-arm-1769/src/zkit-arm-1769.h - GPIO settings for the LEDs. - - boards/zkit-arm-1769/src/up_leds.c - LED control logic. + - boards/arm/lpc17xx_40xx/zkit-arm-1769/src/up_leds.c - LED control logic. The ZKit-ARM LPC1768 has a single LEDs (there are more on the Embedded Artists base board, but those are not controlled by NuttX). Usage this single LED by NuttX diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/include/board.h b/boards/arm/lpc17xx_40xx/zkit-arm-1769/include/board.h index 2e4a56f974..1cddf95ff6 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/include/board.h +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/zkit-arm-1769/include/board.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/zkit-arm-1769/include/board.h * include/arch/board/board.h * * Copyright (C) 2013 Zilogic Systems. All rights reserved. @@ -37,14 +37,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_ZKIT_ARM_1769_INCLUDE_BOARD_H -#define __BOARDS_ARM_ZKIT_ARM_1769_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_ZKIT_ARM_1769_INCLUDE_BOARD_H +#define __BOARDS_ARM_LPC17XX_40XX_ZKIT_ARM_1769_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -54,12 +54,15 @@ # include #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Clocking *************************************************************************/ -/* 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 include path. + ****************************************************************************/ + +/* Clocking *****************************************************************/ + +/* 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 include path. */ #define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency */ @@ -76,22 +79,24 @@ #define LPC17_40_CCLK 80000000 /* 80Mhz */ -/* Select the main oscillator as the frequency source. SYSCLK is then the frequency - * of the main oscillator. +/* Select the main oscillator as the frequency source. + * SYSCLK is then the frequency of the main oscillator. */ #undef CONFIG_LPC17_40_MAINOSC #define CONFIG_LPC17_40_MAINOSC 1 #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 CCLK. * The input to the divider (PLLCLK) will be determined by the PLL output. */ #define BOARD_CCLKCFG_DIVIDER 6 #define BOARD_CCLKCFG_VALUE ((BOARD_CCLKCFG_DIVIDER-1) << SYSCON_CCLKCFG_SHIFT) -/* PLL0. PLL0 is used to generate the CPU clock divider input (PLLCLK). +/* PLL0. + * PLL0 is used to generate the CPU clock divider input (PLLCLK). * * Source clock: Main oscillator * PLL0 Multiplier value (M): 20 @@ -119,8 +124,9 @@ (((BOARD_PLL1CFG_MSEL-1) << SYSCON_PLL1CFG_MSEL_SHIFT) | \ ((BOARD_PLL1CFG_NSEL-1) << SYSCON_PLL1CFG_NSEL_SHIFT)) -/* USB divider. This divider is used when PLL1 is not enabled to get the - * USB clock from PLL0: +/* USB divider. + * This divider is used when PLL1 is not enabled to get the USB clock + * from PLL0: * * USBCLK = PLL0CLK / 10 = 48MHz */ @@ -138,7 +144,8 @@ //#define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV44 #define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV20 -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in * any way. The following definitions are used to access individual LEDs. * @@ -178,9 +185,10 @@ #define LED_ASSERTION 6 /* NC ON (momentary) */ #define LED_PANIC 7 /* NC ON (1Hz flashing) */ -/* Button definitions ***************************************************************/ -/* The ZKIT-ARM-1769 supports several buttons. All will read "1" when open and "0" - * when closed +/* Button definitions *******************************************************/ + +/* The ZKIT-ARM-1769 supports several buttons. + * All will read "1" when open and "0" when closed * * KEY1 -- Connected to P1[19] * KEY2 -- Connected to P1[27] @@ -189,6 +197,7 @@ * KEY5 -- Connected to P2[13] * */ + #define BOARD_BUTTON_1 0 #define BOARD_BUTTON_2 1 #define BOARD_BUTTON_3 2 @@ -202,7 +211,8 @@ #define BOARD_BUTTON4_BIT (1 << BOARD_BUTTON_4) #define BOARD_BUTTON5_BIT (1 << BOARD_BUTTON_5) -/* Alternate pin selections *********************************************************/ +/* Alternate pin selections *************************************************/ + /* Pin Description On Board Connector * -------------------------------- ---------------- ------------- * P0.0/RD1/TXD3/SDA1 RD1 AUX-CON @@ -309,35 +319,36 @@ * P4.28/RX_MCLK/MAT2.0/TXD3 GPIO3 */ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_led * * Description: * Once the system has booted, these functions can be used to control LEDs 1 * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ARCH_LEDS void lpc17_40_led(int lednum, int state); @@ -349,4 +360,4 @@ void lpc17_40_led(int lednum, int state); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_ZKIT_ARM_1769_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_ZKIT_ARM_1769_INCLUDE_BOARD_H */ diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/scripts/Make.defs b/boards/arm/lpc17xx_40xx/zkit-arm-1769/scripts/Make.defs index 1d12a698e3..f1ce332d57 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/scripts/Make.defs +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/zkit-arm-1769/scripts/Make.defs +# boards/arm/lpc17xx_40xx/zkit-arm-1769/scripts/Make.defs # # Copyright (C) 2013 Zilogic Systems. All rights reserved. # Author: BabuSubashChandar diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/scripts/ld.script b/boards/arm/lpc17xx_40xx/zkit-arm-1769/scripts/ld.script index 8adb98ce3f..2986107fb6 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/scripts/ld.script +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/zkit-arm-1769/scripts/ld.script + * boards/arm/lpc17xx_40xx/zkit-arm-1769/scripts/ld.script * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: BabuSubashChandar diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/Makefile b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/Makefile index 91ee3ab577..56f2de51dd 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/Makefile +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/zkit-arm-1769/src/Makefile +# boards/arm/lpc17xx_40xx/zkit-arm-1769/src/Makefile # # Copyright (C) 2013 Zilogic Systems. All rights reserved. # Author: BabuSubashChandar diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_adc.c b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_adc.c index d3b9d879eb..e0c4996598 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_adc.c +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_adc.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/zkit-arm-1769/src/lpc17_40_adc.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_adc.c * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: Kannan @@ -36,11 +36,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -59,29 +59,29 @@ #ifdef CONFIG_ADC -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: zkit_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ int zkit_adc_setup(void) { @@ -93,7 +93,9 @@ int zkit_adc_setup(void) if (!initialized) { - /* Call lpc17_40_adcinitialize() to get an instance of the ADC interface */ + /* Call lpc17_40_adcinitialize() to get an instance of + * the ADC interface + */ adc = lpc17_40_adcinitialize(); if (adc == NULL) diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_appinit.c b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_appinit.c index aec60f2036..9c131c9f10 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_appinit.c +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_appinit.c @@ -1,10 +1,10 @@ /**************************************************************************** - * config/zkit-arm-1769/src/lpc17_40_appinit.c + * boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_appinit.c * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: BabuSubashChandar * - * Based on config/lpcxpresso-lpc1768/src/lpc17_40_appinit.c + * Based on boards/lpcxpresso-lpc1768/src/lpc17_40_appinit.c * * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -182,7 +182,8 @@ int board_app_initialize(uintptr_t arg) /* Bind the SPI port to the slot */ - ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi); + ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, + CONFIG_NSH_MMCSDSLOTNO, spi); if (ret < 0) { message("board_app_initialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_boot.c b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_boot.c index 43e4caadc9..560cf70598 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_boot.c +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/zkit-arm-1769/src/lpc17_40_boot.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_boot.c * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: BabuSubashChandar @@ -36,11 +36,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -54,32 +54,34 @@ #include "zkit-arm-1769.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_boardinitialize * * Description: - * All LPC17xx/LPC40xx architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured - * and mapped but before any devices have been initialized. + * All LPC17xx/LPC40xx architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void lpc17_40_boardinitialize(void) { - /* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) the weak - * function zkit_sspdev_initialize() has been brought into the link. + /* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) + * the weak function zkit_sspdev_initialize() has been brought into the + * link. */ #if defined(CONFIG_LPC17_40_SSP0) || defined(CONFIG_LPC17_40_SSP1) diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_buttons.c b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_buttons.c index 7a74b649df..5c9651b6d7 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_buttons.c +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/zkit-arm-1769/src/lpc17_40_buttons.c + * boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_buttons.c * * Copyright (C) 2011 Zilogic Systems. All rights reserved. * Author: Kannan @@ -67,8 +67,8 @@ /**************************************************************************** * Private Data ****************************************************************************/ -/* Pin configuration for each zkit-arm-1769 button. This array is indexed by - * NUM_BUTTONS in board.h +/* Pin configuration for each zkit-arm-1769 button. + * This array is indexed by NUM_BUTTONS in board.h */ static const uint16_t g_buttons[NUM_BUTTONS] = @@ -84,10 +84,10 @@ static const uint16_t g_buttons[NUM_BUTTONS] = * Name: board_button_initialize * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_buttons() may be called to collect the current state of all - * buttons or board_button_irq() may be called to register button interrupt - * handlers. + * board_button_initialize() must be called to initialize button resources. + * After that, board_buttons() may be called to collect the current state + * of all buttons or board_button_irq() may be called to register button + * interrupt handlers. * ****************************************************************************/ @@ -121,7 +121,7 @@ uint32_t board_buttons(void) { released = lpc17_40_gpioread(g_buttons[i]); - /* Accumulate set of depressed keys */ + /* Accumulate set of depressed keys */ if (!released) { @@ -132,27 +132,29 @@ uint32_t board_buttons(void) return ret; } -/************************************************************************************ +/**************************************************************************** * Button support. * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_buttons() may be called to collect the current state of all - * buttons or board_button_irq() may be called to register button interrupt - * handlers. + * board_button_initialize() must be called to initialize button resources. + * After that, board_buttons() may be called to collect the current state + * of all buttons or board_button_irq() may be called to register button + * interrupt handlers. * - * After board_button_initialize() has been called, board_buttons() may be called to - * collect the state of all buttons. board_buttons() returns an 32-bit bit set - * with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT - * definitions in board.h for the meaning of each bit. + * After board_button_initialize() has been called, board_buttons() may be + * called to collect the state of all buttons. board_buttons() returns an + * 32-bit bit set with each bit associated with a button. + * See the BUTTON_*_BIT and JOYSTICK_*_BIT definitions in board.h for the + * meaning of each bit. * - * board_button_irq() may be called to register an interrupt handler that will - * be called when a button is depressed or released. The ID value is a - * button enumeration value that uniquely identifies a button resource. See the - * BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration - * value. + * board_button_irq() may be called to register an interrupt handler that + * will be called when a button is depressed or released. + * The ID value is a button enumeration value that uniquely identifies a + * button resource. + * See the BUTTON_* and JOYSTICK_* definitions in board.h for the meaning + * of enumeration value. * - ************************************************************************************/ + ****************************************************************************/ #if defined CONFIG_ARCH_IRQBUTTONS && CONFIG_LPC17_40_GPIOIRQ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_can.c b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_can.c index 245a5c2d2c..9372c19d9d 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_can.c +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_can.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/zkit-arm-1769/src/lpc17_40_can.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_can.c * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: Raashid Muhammed @@ -36,11 +36,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -58,25 +58,26 @@ #ifdef CONFIG_CAN -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ #define CAN_PORT1 1 #define CAN_PORT2 2 -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: zkit_can_setup * * Description: * Initialize CAN and register the CAN device * - ************************************************************************************/ + ****************************************************************************/ int zkit_can_setup(void) { diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_dac.c b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_dac.c index 9addc977b7..e0deee43de 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_dac.c +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_dac.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/zkit-arm-1769/src/lpc17_40_dac.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_dac.c * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: Kannan @@ -36,11 +36,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -58,14 +58,14 @@ #ifdef CONFIG_DAC -/************************************************************************************ +/**************************************************************************** * Name: dac_devinit * * Description: - * All LPC17xx/LPC40xx architectures must provide the following interface to work with - * examples/diag. + * All LPC17xx/LPC40xx architectures must provide the following interface + * to work with examples/diag. * - ************************************************************************************/ + ****************************************************************************/ int dac_devinit(void) { diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_lcd.c b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_lcd.c index 5ae3aff037..177fbfc55e 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_lcd.c +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_lcd.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/zkit-arm-1769/src/lpc17_40_lcd.c + * boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_lcd.c * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: Manikandan diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_leds.c b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_leds.c index 4ef0322aa6..2a90a26fb8 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_leds.c +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/zkit-arm-1769/src/lpc17_40_leds.c + * boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_leds.c * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: BabuSubashChandar @@ -65,8 +65,8 @@ /* LED definitions **********************************************************/ /* The ZKit-ARM-1769 has 2 LEDs along the bottom of the board. Red or off. - * If CONFIG_ARCH_LEDS is defined, the LEDs will be controlled as follows for NuttX - * debug functionality (where NC means "No Change"). + * If CONFIG_ARCH_LEDS is defined, the LEDs will be controlled as follows for + * NuttX debug functionality (where NC means "No Change"). * * During the boot phases. LED1 and LED2 will show boot status. * @@ -176,13 +176,13 @@ void board_autoled_off(int led) } } -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_led * * Description: * Once the system has booted, this functions can be used to control LED 1 * - ************************************************************************************/ + ****************************************************************************/ void lpc17_40_led(int lednum, int state) { diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_spi.c b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_spi.c index 094f0b88ad..51c15d7ec8 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_spi.c +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_spi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/zkit-arm-1769/src/lpc17_40_spi.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_spi.c * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: Kannan @@ -36,11 +36,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -59,9 +59,9 @@ #if defined(CONFIG_LPC17_40_SPI) -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* Dump GPIO registers */ @@ -71,18 +71,18 @@ # define spi_dumpgpio(m) #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: zkit_spidev_initialize * * Description: * Called to configure SPI chip select and card detect GPIO pins for the * ZKIT-ARM-1769 Kit. * - ************************************************************************************/ + ****************************************************************************/ void weak_function zkit_spidev_initialize(void) { @@ -98,34 +98,38 @@ void weak_function zkit_spidev_initialize(void) spi_dumpgpio("zkit_spidev_initialize() Exit"); } -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_spiselect and lpc17_40_spistatus * * Description: * The external functions, lpc17_40_spiselect and lpc17_40_spistatus - * must be provided by board-specific logic. They are implementations of the select - * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including lpc17_40_spibus_initialize()) - * are provided by common LPC17xx/LPC40xx logic. To use this common SPI logic on your - * board: + * must be provided by board-specific logic. They are implementations of + * the select and status methods of the SPI interface defined by struct + * spi_ops_s (see include/nuttx/spi/spi.h). + * All other methods (including lpc17_40_spibus_initialize()) + * are provided by common LPC17xx/LPC40xx logic. + * To use this common SPI logic on your board: * - * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip select - * pins. + * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP + * chip select pins. * 2. Provide lpc17_40_spiselect and lpc17_40_spistatus functions - * in your board-specific logic. These functions will perform chip selection - * and status operations using GPIOs in the way your board is configured. - * 3. Add a calls to lpc17_40_spibus_initialize() in your low level application - * initialization logic - * 4. The handle returned by lpc17_40_spibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * in your board-specific logic. These functions will perform chip + * selection and status operations using GPIOs in the way your board is + * configured. + * 3. Add a calls to lpc17_40_spibus_initialize() in your low level + * application initialization logic + * 4. The handle returned by lpc17_40_spibus_initialize() may then be used + * to bind the SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). * - ************************************************************************************/ + ****************************************************************************/ -void lpc17_40_spiselect(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_spiselect(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); spi_dumpgpio("lpc17_40_spiselect() Entry"); if (devid == SPIDEV_MMCSD(0)) diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_ssp.c b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_ssp.c index acb6d16460..a67ce5c9bb 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_ssp.c +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_ssp.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/zkit-arm-1769/src/lpc17_40_ssp.c +/**************************************************************************** + * boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_ssp.c * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: BabuSubashChandar @@ -36,11 +36,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -59,9 +59,9 @@ #if defined(CONFIG_LPC17_40_SSP0) || defined(CONFIG_LPC17_40_SSP1) -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* Dump GPIO registers */ @@ -71,17 +71,17 @@ # define ssp_dumpgpio(m) #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: zkit_sspdev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the ZKIT-ARM-1769 Kit. * - ************************************************************************************/ + ****************************************************************************/ void weak_function zkit_sspdev_initialize(void) { @@ -100,35 +100,39 @@ void weak_function zkit_sspdev_initialize(void) ssp_dumpgpio("zkit_sspdev_initialize() Exit"); } -/************************************************************************************ +/**************************************************************************** * Name: lpc17_40_ssp0/ssp1select and lpc17_40_ssp0/ssp1status * * Description: - * The external functions, lpc17_40_ssp0/ssp1select and lpc17_40_ssp0/ssp1status - * must be provided by board-specific logic. They are implementations of the select - * and status methods of the SPI interface defined by struct spi_ops_s (see - * include/nuttx/spi/spi.h). All other methods (including lpc17_40_sspbus_initialize()) - * are provided by common LPC17xx/LPC40xx logic. To use this common SPI logic on your - * board: + * The external functions, lpc17_40_ssp0/ssp1select and + * lpc17_40_ssp0/ssp1status must be provided by board-specific logic. + * They are implementations of the select and status methods of the SPI + * interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). + * All other methods (including lpc17_40_sspbus_initialize()) + * are provided by common LPC17xx/LPC40xx logic. + * To use this common SPI logic on your board: * - * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip select - * pins. - * 2. Provide lpc17_40_ssp0/ssp1select() and lpc17_40_ssp0/ssp1status() functions - * in your board-specific logic. These functions will perform chip selection - * and status operations using GPIOs in the way your board is configured. - * 3. Add a calls to lpc17_40_sspbus_initialize() in your low level application - * initialization logic - * 4. The handle returned by lpc17_40_sspbus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip + * select pins. + * 2. Provide lpc17_40_ssp0/ssp1select() and lpc17_40_ssp0/ssp1status() + * functions in your board-specific logic. + * These functions will perform chip selection and status operations + * using GPIOs in the way your board is configured. + * 3. Add a calls to lpc17_40_sspbus_initialize() in your low level + * application initialization logic + * 4. The handle returned by lpc17_40_sspbus_initialize() may then be used + * to bind the SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_LPC17_40_SSP1 -void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_40_ssp1select() Entry"); #warning "Assert CS here (false)" @@ -160,9 +164,11 @@ int weak_function lpc17_40_ssp1cmddata(FAR struct spi_dev_s *dev, #endif /* CONFIG_LPC17_40_SSP1 */ #ifdef CONFIG_LPC17_40_SSP0 -void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, + bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); ssp_dumpgpio("lpc17_40_ssp0select() Entry"); #ifdef CONFIG_NX_LCDDRIVER diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_usbmsc.c b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_usbmsc.c index dc41f760af..a4fe6ad953 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_usbmsc.c +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_usbmsc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/zkit-arm-1769/src/lpc17_40_usbmsc.c + * boards/arm/lpc17xx_40xx/zkit-arm-1769/src/lpc17_40_usbmsc.c * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: BabuSubashChandar @@ -75,7 +75,8 @@ # undef LPC17XX_40XX_MMCSDSLOTNO # define LPC17XX_40XX_MMCSDSLOTNO 0 #else - /* Add configuration for new LPC17xx/LPC40xx boards here */ + /* Add configuration for new LPC17xx/LPC40xx boards here */ + # error "Unrecognized LPC17xx/LPC40xx board" #endif diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/zkit-arm-1769.h b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/zkit-arm-1769.h index 5a54d12d6f..87ba94eb83 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/zkit-arm-1769.h +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/src/zkit-arm-1769.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/zkit-arm-1769/src/zkit-arm-1769.h +/**************************************************************************** + * boards/arm/lpc17xx_40xx/zkit-arm-1769/src/zkit-arm-1769.h * * Copyright (C) 2013 Zilogic Systems. All rights reserved. * Author: BabuSubashChandar @@ -36,24 +36,26 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef _CONFIGS_ZKITARM_LPC1768_SRC_ZKITARM_H -#define _CONFIGS_ZKITARM_LPC1768_SRC_ZKITARM_H +#ifndef __BOARDS_ARM_LPC17XX_40XX_ZKITARM_LPC1768_SRC_ZKITARM_H +#define __BOARDS_ARM_LPC17XX_40XX_ZKITARM_LPC1768_SRC_ZKITARM_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/************************************************************************************ + ****************************************************************************/ + +/**************************************************************************** * ZKit-ARM-1769 Pin Usage - ************************************************************************************/ + ****************************************************************************/ + /* Pin Description On Board Connector * -------------------------------- ---------------- ------------- * P0.0/RD1/TXD3/SDA1 RD1 AUX-CON @@ -194,16 +196,17 @@ * * ZKit-ARM Signals * - * ----------------------------+---------------+-------------------------------------------- + * ----------------------------+---------------+------------------------- * LPC1758 Pin | Board Signal | Description - * ----------------------------+---------------+-------------------------------------------- + * ----------------------------+---------------+------------------------- * P1.20/MCFB0/PWM1.2/SCK0 | LCD-SCK | LCD Clock signal (D6) * P1.21/MCABORT/PWM1.3/SSEL0 | LCD-SSEL | LCD Chip Select (CSB) * P1.22/MCOB0/USB_PWRD/MAT1.0 | LCD-A0 | LCD-A0 (A0) * P1.23/MCFB1/PWM1.4/MISO0 | N.C | * P1.24/MCFB2/PWM1.5/MOSI0 | LCD-MOSI | LCD Data (D7) - * P1.25/MCOA1/MAT1.1 | LCD-RST | LCD Reset (RSTB) - Resets Everything in LCD - * ----------------------------+---------------+-------------------------------------------- + * P1.25/MCOA1/MAT1.1 | LCD-RST | LCD Reset (RSTB) - + * | | Resets Everything in LCD + * ----------------------------+---------------+------------------------- */ #if 0 @@ -215,63 +218,65 @@ #define ZKITARM_OLED_CS (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT1 | GPIO_PIN21) #define ZKITARM_OLED_RS (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT1 | GPIO_PIN22) -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: zkit_sspdev_initialize * * Description: - * Called to configure SSP chip select GPIO pins for the ZKit-ARM-1769 board. + * Called to configure SSP chip select GPIO pins for the ZKit-ARM-1769 + * board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function zkit_sspdev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: zkit_spidev_initialize * * Description: - * Called to configure SPI chip select GPIO pins for the ZKit-ARM-1769 board. + * Called to configure SPI chip select GPIO pins for the ZKit-ARM-1769 + * board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function zkit_spidev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: zkit_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ADC int zkit_adc_setup(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: zkit_can_setup * * Description: * Initialize CAN and register the CAN device * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_CAN int zkit_can_setup(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_ZKITARM_LPC1768_SRC_ZKITARM_H */ +#endif /* __BOARDS_ARM_LPC17XX_40XX_ZKITARM_LPC1768_SRC_ZKITARM_H */