diff --git a/boards/arm/a1x/pcduino-a10/README.txt b/boards/arm/a1x/pcduino-a10/README.txt index 160a872cbc4..a50ff3759da 100644 --- a/boards/arm/a1x/pcduino-a10/README.txt +++ b/boards/arm/a1x/pcduino-a10/README.txt @@ -378,7 +378,7 @@ Configurations STATUS: This configuration builds and runs, but only if the patch at - nuttx/boards/pcduino-a10/nsh/pcduino-140107.patch is applied. This patchfile + nuttx/boards/arm/a1x/pcduino-a10/nsh/pcduino-140107.patch is applied. This patchfile contains some fixes that are as-of-yet not well understood and so cannot be checked in. Below is a summary of the kludges currently in this patch file: diff --git a/boards/arm/a1x/pcduino-a10/include/board.h b/boards/arm/a1x/pcduino-a10/include/board.h index 2d402cb3014..02c17c80a68 100644 --- a/boards/arm/a1x/pcduino-a10/include/board.h +++ b/boards/arm/a1x/pcduino-a10/include/board.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * boards/arm/a1x/pcduino-a10/include/board.h * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -31,32 +31,34 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __BOARDS_ARM_A1X_PCDUINO_A10_INCLUDE_BOARD_H #define __BOARDS_ARM_A1X_PCDUINO_A10_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include "hardware/a1x_piocfg.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ -/* Since NuttX is booted from a loader on the A10, clocking should already be setup - * when NuttX starts. +/* Clocking *****************************************************************/ + +/* Since NuttX is booted from a loader on the A10, clocking should already + * be setup when NuttX starts. */ -/* LED definitions ******************************************************************/ -/* The pcDuino v1 has four green LEDs; three can be controlled from software. Two - * are tied to ground and, hence, illuminated by driving the output pins to a high - * value: +/* LED definitions **********************************************************/ + +/* The pcDuino v1 has four green LEDs; three can be controlled from software. + * Two are tied to ground and, hence, illuminated by driving the output pins + * to a high value: * * 1. LED1 SPI0_CLK SPI0_CLK/UART5_RX/EINT23/PI11 * 2. LED5 IPSOUT From the PMU (not controllable by software) @@ -87,7 +89,8 @@ * * SYMBOL Value Meaning LED state * LED1 LED3 LED4 - * ----------------- ----- ----------------------- ---- ---- ------------ */ + * ----------------- ----- ----------------------- ---- ---- -------- + */ #define LED_STARTED 0 /* NuttX has been started ON OFF OFF */ #define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF ON OFF */ @@ -100,14 +103,15 @@ /* LED_IDLE --- /* MCU is is sleep mode Not used * - * After booting, LED1 and 3 are not longer used by the system and can be used for - * other purposes by the application (Of course, all LEDs are available to the - * application if CONFIG_ARCH_LEDS is not defined. + * After booting, LED1 and 3 are not longer used by the system and can be + * used for other purposes by the application (Of course, all LEDs are + * available to the application if CONFIG_ARCH_LEDS is not defined. */ -/* Button definitions ***************************************************************/ -/* There are a total of five switches on-board. All pulled high and, hence, will be - * sensed as low when closed. +/* Button definitions *******************************************************/ + +/* There are a total of five switches on-board. + * All pulled high and, hence, will be sensed as low when closed. * * SW1 Reset (not available to software) * SW2 UBOOT UBOOT_SEL (?) @@ -125,10 +129,12 @@ #define BUTTON_KEY_HOME_BIT (1 << BUTTON_KEY_HOME) #define BUTTON_KEY_MENU_BIT (1 << BUTTON_KEY_MENU) -/* NAND *****************************************************************************/ +/* NAND *********************************************************************/ + +/* GPIO pin disambiguation **************************************************/ + +/* UARTs ********************************************************************/ -/* GPIO pin disambiguation **********************************************************/ -/* UARTs ****************************************************************************/ /* Two UART connections are available: * * 1. UART0 is available on J5 Debug Port. @@ -148,13 +154,12 @@ #define PIO_UART2_RX PIO_UART2_RX_1 #define PIO_UART2_TX PIO_UART2_TX_1 -/************************************************************************************ +/**************************************************************************** * Assembly Language Macros - ************************************************************************************/ + ****************************************************************************/ #ifdef __ASSEMBLY__ - .macro config_sdram - .endm + .macro config_sdram + .endm #endif /* __ASSEMBLY__ */ - #endif /* __BOARDS_ARM_A1X_PCDUINO_A10_INCLUDE_BOARD_H */ diff --git a/boards/arm/a1x/pcduino-a10/include/board_memorymap.h b/boards/arm/a1x/pcduino-a10/include/board_memorymap.h index 13b863228a1..228cc8bacda 100644 --- a/boards/arm/a1x/pcduino-a10/include/board_memorymap.h +++ b/boards/arm/a1x/pcduino-a10/include/board_memorymap.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * boards/arm/a1x/pcduino-a10/include/board_memorymap.h * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -31,38 +31,39 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __BOARDS_ARM_A1X_PCDUINO_A10_INCLUDE_BOARD_MEMORYMAP_H #define __BOARDS_ARM_A1X_PCDUINO_A10_INCLUDE_BOARD_MEMORYMAP_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * 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 - ************************************************************************************/ + ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) diff --git a/boards/arm/a1x/pcduino-a10/scripts/Make.defs b/boards/arm/a1x/pcduino-a10/scripts/Make.defs index 841b04e1025..403f22f552b 100644 --- a/boards/arm/a1x/pcduino-a10/scripts/Make.defs +++ b/boards/arm/a1x/pcduino-a10/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/pcduino-a10/scripts/Make.defs +# boards/arm/a1x/pcduino-a10/scripts/Make.defs # # Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/a1x/pcduino-a10/scripts/sdram.ld b/boards/arm/a1x/pcduino-a10/scripts/sdram.ld index 2929ee7aa06..7d736b55554 100644 --- a/boards/arm/a1x/pcduino-a10/scripts/sdram.ld +++ b/boards/arm/a1x/pcduino-a10/scripts/sdram.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/pcduino-a10/scripts/sdram.ld + * boards/arm/a1x/pcduino-a10/scripts/sdram.ld * * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/a1x/pcduino-a10/src/Makefile b/boards/arm/a1x/pcduino-a10/src/Makefile index fe8fc3bbcd2..7d30c06a136 100644 --- a/boards/arm/a1x/pcduino-a10/src/Makefile +++ b/boards/arm/a1x/pcduino-a10/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/pcduino-a10/src/Makefile +# boards/arm/a1x/pcduino-a10/src/Makefile # # Copyright (C) 2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/a1x/pcduino-a10/src/a1x_boot.c b/boards/arm/a1x/pcduino-a10/src/a1x_boot.c index 9968b7940fe..de384698b70 100644 --- a/boards/arm/a1x/pcduino-a10/src/a1x_boot.c +++ b/boards/arm/a1x/pcduino-a10/src/a1x_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/pcduino-a10/src/a1x_boot.c +/**************************************************************************** + * boards/arm/a1x/pcduino-a10/src/a1x_boot.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 @@ -45,19 +45,19 @@ #include "pcduino_a10.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: a1x_boardinitialize * * Description: @@ -65,7 +65,7 @@ * point is called early in the initialization -- after all memory has been * configured and mapped but before any devices have been initialized. * - ************************************************************************************/ + ****************************************************************************/ void a1x_boardinitialize(void) { diff --git a/boards/arm/a1x/pcduino-a10/src/a1x_buttons.c b/boards/arm/a1x/pcduino-a10/src/a1x_buttons.c index 01c213bb5f0..333dff41a2a 100644 --- a/boards/arm/a1x/pcduino-a10/src/a1x_buttons.c +++ b/boards/arm/a1x/pcduino-a10/src/a1x_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/pcduino-a10/src/a1x_buttons.c + * boards/arm/a1x/pcduino-a10/src/a1x_buttons.c * * Copyright (C) 2013-2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -61,10 +61,10 @@ * 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. * ****************************************************************************/ @@ -77,10 +77,11 @@ void board_button_initialize(void) * Name: board_buttons * * Description: - * 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* definitions - * above for the meaning of each bit in the returned value. + * 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* definitions above for the meaning of each bit in the + * returned value. * ****************************************************************************/ diff --git a/boards/arm/a1x/pcduino-a10/src/a1x_leds.c b/boards/arm/a1x/pcduino-a10/src/a1x_leds.c index 19f807ee78a..2886e745e2b 100644 --- a/boards/arm/a1x/pcduino-a10/src/a1x_leds.c +++ b/boards/arm/a1x/pcduino-a10/src/a1x_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/pcduino-a10/src/a1x_leds.c + * boards/arm/a1x/pcduino-a10/src/a1x_leds.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -66,8 +66,8 @@ * These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is * defined. In that case, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: + * include/board.h and src/stm32_leds.c. + * The LEDs are used to encode OS-related events as follows: * * SYMBOL Meaning LED state * LED1 LED3 LED4 @@ -82,9 +82,9 @@ * LED_PANIC The system has crashed N/C N/C 2Hz Flashing * LED_IDLE MCU is is sleep mode Not used * - * After booting, LED1 and 3 are not longer used by the system and can be used for - * other purposes by the application (Of course, all LEDs are available to the - * application if CONFIG_ARCH_LEDS is not defined. + * After booting, LED1 and 3 are not longer used by the system and can be used + * for other purposes by the application (Of course, all LEDs are available to + * the application if CONFIG_ARCH_LEDS is not defined. */ /**************************************************************************** @@ -201,20 +201,21 @@ void board_autoled_off(int led) } #endif -/************************************************************************************ +/**************************************************************************** * Name: board_userled_initialize, board_userled, and board_userled_all * * Description: * These interfaces allow user control of the board LEDs. * - * If CONFIG_ARCH_LEDS is defined, then NuttX will control both on-board LEDs up - * until the completion of boot. The it will continue to control LED2; LED1 is - * avaiable for application use. - * - * If CONFIG_ARCH_LEDS is not defined, then both LEDs are available for application + * If CONFIG_ARCH_LEDS is defined, then NuttX will control both on-board + * LEDs up until the completion of boot. + * The it will continue to control LED2; LED1 is avaiable for application * use. * - ************************************************************************************/ + * If CONFIG_ARCH_LEDS is not defined, then both LEDs are available for + * application use. + * + ****************************************************************************/ void board_userled_initialize(void) { diff --git a/boards/arm/a1x/pcduino-a10/src/pcduino_a10.h b/boards/arm/a1x/pcduino-a10/src/pcduino_a10.h index 4fa4183dfc2..9206da16f36 100644 --- a/boards/arm/a1x/pcduino-a10/src/pcduino_a10.h +++ b/boards/arm/a1x/pcduino-a10/src/pcduino_a10.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/pcduino-a10/src/pcduino-a10.h +/**************************************************************************** + * boards/arm/a1x/pcduino-a10/src/pcduino-a10.h * * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,14 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_PCDUINO_A10_PCDUINO_A10_H -#define __BOARDS_ARM_PCDUINO_A10_PCDUINO_A10_H +#ifndef __BOARDS_ARM_A1X_PCDUINO_A10_PCDUINO_A10_H +#define __BOARDS_ARM_A1X_PCDUINO_A10_PCDUINO_A10_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -50,21 +50,24 @@ #include "a1x_pio.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ + ****************************************************************************/ -/* LEDs *****************************************************************************/ -/* The pcDuino v1 has four green LEDs; three can be controlled from software. Two - * are tied to ground and, hence, illuminated by driving the output pins to a high - * value: +/* Configuration ************************************************************/ + +/* LEDs *********************************************************************/ + +/* The pcDuino v1 has four green LEDs; three can be controlled from software. + * Two are tied to ground and, hence, illuminated by driving the output pins + * to a high value: * * 1. LED1 SPI0_CLK SPI0_CLK/UART5_RX/EINT23/PI11 * 2. LED5 IPSOUT From the PMU (not controllable by software) */ -#define PIO_LED1 (PIO_OUTPUT | PIO_PULL_NONE | PIO_DRIVE_MEDLOW | PIO_INT_NONE | \ +#define PIO_LED1 (PIO_OUTPUT | PIO_PULL_NONE | \ + PIO_DRIVE_MEDLOW | PIO_INT_NONE | \ PIO_OUTPUT_CLEAR | PIO_PORT_PIOI | PIO_PIN11) /* And two are pull high and, hence, illuminated by grounding the output: @@ -73,16 +76,18 @@ * 4. LED4 TX_LED LCD1_D15/ATAD11/KP_IN5/SMC_VPPPP/EINT15/CSI1_D15/PH15 */ -#define PIO_LED3 (PIO_OUTPUT | PIO_PULL_NONE | PIO_DRIVE_MEDLOW | PIO_INT_NONE | \ +#define PIO_LED3 (PIO_OUTPUT | PIO_PULL_NONE | \ + PIO_DRIVE_MEDLOW | PIO_INT_NONE | \ PIO_OUTPUT_SET | PIO_PORT_PIOH | PIO_PIN16) -#define PIO_LED4 (PIO_OUTPUT | PIO_PULL_NONE | PIO_DRIVE_MEDLOW | PIO_INT_NONE | \ +#define PIO_LED4 (PIO_OUTPUT | PIO_PULL_NONE | \ + PIO_DRIVE_MEDLOW | PIO_INT_NONE | \ PIO_OUTPUT_SET | PIO_PORT_PIOH | PIO_PIN15) /* These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is * defined. In that case, the usage by the board port is defined in - * include/board.h and src/stm32_leds.c. The LEDs are used to encode OS-related - * events as follows: + * include/board.h and src/stm32_leds.c. + * The LEDs are used to encode OS-related events as follows: * * SYMBOL Meaning LED state * LED1 LED3 LED4 @@ -97,14 +102,15 @@ * LED_PANIC The system has crashed N/C N/C 2Hz Flashing * LED_IDLE MCU is is sleep mode Not used * - * After booting, LED1 and 3 are not longer used by the system and can be used for - * other purposes by the application (Of course, all LEDs are available to the - * application if CONFIG_ARCH_LEDS is not defined. + * After booting, LED1 and 3 are not longer used by the system and can be used + * for other purposes by the application (Of course, all LEDs are available to + * the application if CONFIG_ARCH_LEDS is not defined. */ -/* Buttons **************************************************************************/ -/* There are a total of five switches on-board. All pulled high and, hence, will be - * sensed as low when closed. +/* Buttons ******************************************************************/ + +/* There are a total of five switches on-board. All pulled high and, hence, + * will be sensed as low when closed. * * SW1 Reset (not available to software) * SW2 UBOOT UBOOT_SEL (?) @@ -129,21 +135,21 @@ PIO_INT_NONE | IO_PORT_PIOH | PIO_PIN19) #endif -/* SPI Chip Selects *****************************************************************/ +/* SPI Chip Selects *********************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: a1x_led_initialize @@ -156,4 +162,4 @@ void a1x_led_initialize(void); #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_PCDUINO_A10_PCDUINO_A10_H */ +#endif /* __BOARDS_ARM_A1X_PCDUINO_A10_PCDUINO_A10_H */ diff --git a/boards/arm/am335x/beaglebone-black/include/board.h b/boards/arm/am335x/beaglebone-black/include/board.h index 274e1fbf0cf..6d57b774a21 100644 --- a/boards/arm/am335x/beaglebone-black/include/board.h +++ b/boards/arm/am335x/beaglebone-black/include/board.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * boards/arm/am335x/beaglebone-black/include/board.h * * Copyright (C) 2018 Petro Karashchenko. All rights reserved. @@ -31,41 +31,44 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __BOARDS_ARM_AM335X_BEAGLEBONE_BLACK_INCLUDE_BOARD_H #define __BOARDS_ARM_AM335X_BEAGLEBONE_BLACK_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include "hardware/am335x_pinmux.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ -/* Since NuttX is booted from a loader on the AM335X, clocking should already be setup - * when NuttX starts. +/* Clocking *****************************************************************/ + +/* Since NuttX is booted from a loader on the AM335X, clocking should already + * be setup when NuttX starts. */ -/* LED definitions ******************************************************************/ -/* The beaglebone black has four user LEDs; all four can be controlled from software. - * All are tied to ground and, hence, illuminated by driving the output pins to a high - * value: +/* LED definitions **********************************************************/ + +/* The beaglebone black has four user LEDs; all four can be controlled from + * software. + * All are tied to ground and, hence, illuminated by driving the output pins + * to a high value: * - * 1. LED0 GPMC_A5 GPMC_A5/GMII2_TXD0/RGMII2_TD0/RMII2_TXD0/GPMC_A21/PR1_MII1_RXD3/ - * eQEP1B_IN/GPIO1_21 - * 2. LED1 GPMC_A6 GPMC_A6/GMII2_TXCLK/RGMII2_TCLK/MMC2_DAT4/GPMC_A22/PR1_MII1_RXD2/ - * eQEP1_INDEX/GPIO1_22 - * 3. LED2 GPMC_A7 GPMC_A7/GMII2_RXCLK/RGMII2_RCLK/MMC2_DAT5/GPMC_A23/PR1_MII1_RXD1/ - * eQEP1_STROBE/GPIO1_23 - * 4. LED3 GPMC_A8 GPMC_A8/GMII2_RXD3/RGMII2_RD3/MMC2_DAT6/GPMC_A24/PR1_MII1_RXD0/ - * MCASP0_ACLKX/GPIO1_24 + * 1. LED0 GPMC_A5 GPMC_A5/GMII2_TXD0/RGMII2_TD0/RMII2_TXD0/GPMC_A21/ + * PR1_MII1_RXD3/eQEP1B_IN/GPIO1_21 + * 2. LED1 GPMC_A6 GPMC_A6/GMII2_TXCLK/RGMII2_TCLK/MMC2_DAT4/GPMC_A22/ + * PR1_MII1_RXD2/eQEP1_INDEX/GPIO1_22 + * 3. LED2 GPMC_A7 GPMC_A7/GMII2_RXCLK/RGMII2_RCLK/MMC2_DAT5/GPMC_A23/ + * PR1_MII1_RXD1/eQEP1_STROBE/GPIO1_23 + * 4. LED3 GPMC_A8 GPMC_A8/GMII2_RXD3/RGMII2_RD3/MMC2_DAT6/GPMC_A24/ + * PR1_MII1_RXD0/MCASP0_ACLKX/GPIO1_24 */ /* LED index values for use with board_userled() */ @@ -85,12 +88,13 @@ /* These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is * defined. In that case, the usage by the board port is defined in - * include/board.h and src/am335x_leds.c. The LEDs are used to encode OS-related - * events as follows: + * include/board.h and src/am335x_leds.c. + * The LEDs are used to encode OS-related events as follows: * * SYMBOL Value Meaning LED state * LED0 LED1 LED2 - * ----------------- ----- ----------------------- ---- ---- ------------ */ + * ----------------- ----- ----------------------- ---- ---- ---------* + */ #define LED_STARTED 0 /* NuttX has been started ON OFF OFF */ #define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF ON OFF */ @@ -103,34 +107,35 @@ /* LED_IDLE --- /* MCU is is sleep mode Not used * - * After booting, LED0 and 1 are not longer used by the system and can be used for - * other purposes by the application (Of course, all LEDs are available to the - * application if CONFIG_ARCH_LEDS is not defined. + * After booting, LED0 and 1 are not longer used by the system and can be + * used for other purposes by the application (Of course, all LEDs are + * available to the application if CONFIG_ARCH_LEDS is not defined. */ -/* NAND *****************************************************************************/ +/* NAND *********************************************************************/ + +/* GPIO pin disambiguation **************************************************/ + +/* UARTs ********************************************************************/ -/* GPIO pin disambiguation **********************************************************/ -/* UARTs ****************************************************************************/ /* One UART connections is available: * * 1. UART0 is available on FT2232H USB to Serial Adapter. * - * FT2232H BDBUS1 Pin UART0-RXD UART0_RXD/SPI1_CS0/DCAN0_TX/I2C2_SDA/ - eCAP2_IN_PWM2_OUT/PR1_PRU1_PRU_R30_14/ - * PR1_PRU1_PRU_R31_14/GPIO1_10 - * FT2232H BDBUS0 Pin UART0-TXD UART0_TXD/SPI1_CS1/DCAN0_RX/I2C2_SCL/ - * eCAP1_IN_PWM1_OUT/PR1_PRU1_PRU_R30_15/ - * PR1_PRU1_PRU_R31_15/GPIO1_11 + * FT2232H BDBUS1 Pin UART0-RXD UART0_RXD/SPI1_CS0/DCAN0_TX/I2C2_SDA/ + * eCAP2_IN_PWM2_OUT/PR1_PRU1_PRU_R30_14/ + * PR1_PRU1_PRU_R31_14/GPIO1_10 + * FT2232H BDBUS0 Pin UART0-TXD UART0_TXD/SPI1_CS1/DCAN0_RX/I2C2_SCL/ + * eCAP1_IN_PWM1_OUT/PR1_PRU1_PRU_R30_15/ + * PR1_PRU1_PRU_R31_15/GPIO1_11 */ -/************************************************************************************ +/**************************************************************************** * Assembly Language Macros - ************************************************************************************/ + ****************************************************************************/ #ifdef __ASSEMBLY__ - .macro config_sdram - .endm + .macro config_sdram + .endm #endif /* __ASSEMBLY__ */ - #endif /* __BOARDS_ARM_AM335X_BEAGLEBONE_BLACK_INCLUDE_BOARD_H */ diff --git a/boards/arm/am335x/beaglebone-black/include/board_memorymap.h b/boards/arm/am335x/beaglebone-black/include/board_memorymap.h index ad39ce3d832..7173d63d941 100644 --- a/boards/arm/am335x/beaglebone-black/include/board_memorymap.h +++ b/boards/arm/am335x/beaglebone-black/include/board_memorymap.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * boards/arm/am335x/beaglebone-black/include/board_memorymap.h * * Copyright (C) 2019 Gregory Nutt. All rights reserved. @@ -31,24 +31,24 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __BOARDS_ARM_AM335X_BEAGLEBONE_BLACK_INCLUDE_BOARD_MEMORYMAP_H #define __BOARDS_ARM_AM335X_BEAGLEBONE_BLACK_INCLUDE_BOARD_MEMORYMAP_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ @@ -61,9 +61,9 @@ extern "C" #define EXTERN extern #endif -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) diff --git a/boards/arm/am335x/beaglebone-black/scripts/Make.defs b/boards/arm/am335x/beaglebone-black/scripts/Make.defs index 479bb05bbef..618b43f7642 100644 --- a/boards/arm/am335x/beaglebone-black/scripts/Make.defs +++ b/boards/arm/am335x/beaglebone-black/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/beaglebone-black/scripts/Make.defs +# boards/arm/am335x/beaglebone-black/scripts/Make.defs # # Copyright (C) 2018 Petro Karashchenko. All rights reserved. # Author: Petro Karashchenko diff --git a/boards/arm/am335x/beaglebone-black/scripts/sdram.ld b/boards/arm/am335x/beaglebone-black/scripts/sdram.ld index 995e4e210dc..d1549b14b36 100644 --- a/boards/arm/am335x/beaglebone-black/scripts/sdram.ld +++ b/boards/arm/am335x/beaglebone-black/scripts/sdram.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/beaglebone-black/scripts/sdram.ld + * boards/arm/am335x/beaglebone-black/scripts/sdram.ld * * Copyright (C) 2018 Petro Karashchenko. All rights reserved. * Author: Petro Karashchenko diff --git a/boards/arm/am335x/beaglebone-black/src/am335x_boot.c b/boards/arm/am335x/beaglebone-black/src/am335x_boot.c index 3aff5efd694..7cb2ded54f2 100644 --- a/boards/arm/am335x/beaglebone-black/src/am335x_boot.c +++ b/boards/arm/am335x/beaglebone-black/src/am335x_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/beaglebone-black/src/am335x_boot.c +/**************************************************************************** + * boards/arm/am335x/beaglebone-black/src/am335x_boot.c * * Copyright (C) 2018 Petro Karashchenko. All rights reserved. * Author: Petro Karashchenko @@ -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 @@ -45,17 +45,17 @@ #include "beaglebone-black.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: am335x_memory_initialize @@ -83,15 +83,16 @@ void am335x_memory_initialize(void) /* SDRAM was initialized by a bootloader in the supported configurations. */ } -/************************************************************************************ +/**************************************************************************** * Name: am335x_board_initialize * * Description: - * All AM335x 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 AM335x 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 am335x_board_initialize(void) { @@ -106,7 +107,7 @@ void am335x_board_initialize(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/am335x/beaglebone-black/src/am335x_buttons.c b/boards/arm/am335x/beaglebone-black/src/am335x_buttons.c index 06634e48e1e..6e8556e325e 100644 --- a/boards/arm/am335x/beaglebone-black/src/am335x_buttons.c +++ b/boards/arm/am335x/beaglebone-black/src/am335x_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/beaglebone-black/src/am335x_buttons.c + * boards/arm/am335x/beaglebone-black/src/am335x_buttons.c * * Copyright (C) 2018 Petro Karashchenko. All rights reserved. * Author: Petro Karashchenko diff --git a/boards/arm/am335x/beaglebone-black/src/am335x_lcd.c b/boards/arm/am335x/beaglebone-black/src/am335x_lcd.c index 58421dc4331..c483fb337d8 100644 --- a/boards/arm/am335x/beaglebone-black/src/am335x_lcd.c +++ b/boards/arm/am335x/beaglebone-black/src/am335x_lcd.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/beaglebone-black/src/am335x_lcd.c + * boards/arm/am335x/beaglebone-black/src/am335x_lcd.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -140,13 +140,14 @@ int up_fbinitialize(int display) #ifdef HAVE_TDA19988 TDA19988_HANDLE handle; - /* Initialize the TDA19988 GPIO interrupt input */ - /* Initialize the TDA19988 lower half state instance */ - /* Initialize the TDA19988 HDMI controller driver */ - /* Allocate a buffer to hold the EDID data */ - /* Read raw EDID data from the connected monitor */ - /* Select a compatible video mode from the EDID data */ - /* Free the allocated EDID buffer */ + /* Initialize the TDA19988 GPIO interrupt input + * Initialize the TDA19988 lower half state instance + * Initialize the TDA19988 HDMI controller driver + * Allocate a buffer to hold the EDID data + * Read raw EDID data from the connected monitor + * Select a compatible video mode from the EDID data + * Free the allocated EDID buffer + */ #warning Missing logic #else @@ -163,7 +164,7 @@ int up_fbinitialize(int display) #endif /* Convert the selected video mode to a AM335X LCD panel configuration */ - am335x_lcd_videomode(videomode, &panel); + am335x_lcd_videomode(videomode, &panel); /* Initialize the LCD controller using this panel configuration */ diff --git a/boards/arm/am335x/beaglebone-black/src/am335x_leds.c b/boards/arm/am335x/beaglebone-black/src/am335x_leds.c index a7d58941807..a91733a09af 100644 --- a/boards/arm/am335x/beaglebone-black/src/am335x_leds.c +++ b/boards/arm/am335x/beaglebone-black/src/am335x_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/beaglebone-black/src/am335x_leds.c + * boards/arm/am335x/beaglebone-black/src/am335x_leds.c * * Copyright (C) 2018 Petro Karashchenko. All rights reserved. * Author: Petro Karashchenko @@ -203,20 +203,21 @@ void board_autoled_off(int led) } #endif -/************************************************************************************ +/**************************************************************************** * Name: board_userled_initialize, board_userled, and board_userled_all * * Description: * These interfaces allow user control of the board LEDs. * - * If CONFIG_ARCH_LEDS is defined, then NuttX will control both on-board LEDs up - * until the completion of boot. The it will continue to control LED1; LED0 is - * available for application use. + * If CONFIG_ARCH_LEDS is defined, then NuttX will control both on-board + * LEDs up until the completion of boot. + * Then it will continue to control LED1; LED0 is available for + * application use. * - * If CONFIG_ARCH_LEDS is not defined, then both LEDs are available for application - * use. + * If CONFIG_ARCH_LEDS is not defined, then both LEDs are available for + * application use. * - ************************************************************************************/ + ****************************************************************************/ void board_userled_initialize(void) { diff --git a/boards/arm/am335x/beaglebone-black/src/beaglebone-black.h b/boards/arm/am335x/beaglebone-black/src/beaglebone-black.h index 700f4d8ce0e..bd558488e29 100644 --- a/boards/arm/am335x/beaglebone-black/src/beaglebone-black.h +++ b/boards/arm/am335x/beaglebone-black/src/beaglebone-black.h @@ -1,5 +1,5 @@ - /************************************************************************************ - * boards/beaglebone-black/src/beaglebone-black.h +/**************************************************************************** + * boards/arm/am335x/beaglebone-black/src/beaglebone-black.h * * Copyright (C) 2018 Petro Karashchenko. All rights reserved. * Author: Petro Karashchenko @@ -31,14 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __BOARDS_ARM_BEAGLEBONE_BLACK_SRC_BEAGLEBONE_BLACK_H #define __BOARDS_ARM_BEAGLEBONE_BLACK_SRC_BEAGLEBONE_BLACK_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -50,11 +50,11 @@ #include "am335x_gpio.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* LCD ******************************************************************************/ +/* LCD **********************************************************************/ #define HAVE_LCD 1 #define HAVE_TDA19988 1 @@ -78,18 +78,19 @@ /* LEDs *****************************************************************************/ -/* The beaglebone black has four user LEDs; all four can be controlled from software. - * All are tied to ground and, hence, illuminated by driving the output pins to a - * high value: +/* The beaglebone black has four user LEDs; all four can be controlled from + * software. + * All are tied to ground and, hence, illuminated by driving the output pins + * to a high value: * - * 1. LED0 GPMC_A5 GPMC_A5/GMII2_TXD0/RGMII2_TD0/RMII2_TXD0/GPMC_A21/PR1_MII1_RXD3/ - * eQEP1B_IN/GPIO1_21 - * 2. LED1 GPMC_A6 GPMC_A6/GMII2_TXCLK/RGMII2_TCLK/MMC2_DAT4/GPMC_A22/PR1_MII1_RXD2/ - * eQEP1_INDEX/GPIO1_22 - * 3. LED2 GPMC_A7 GPMC_A7/GMII2_RXCLK/RGMII2_RCLK/MMC2_DAT5/GPMC_A23/PR1_MII1_RXD1/ - * eQEP1_STROBE/GPIO1_23 - * 4. LED3 GPMC_A8 GPMC_A8/GMII2_RXD3/RGMII2_RD3/MMC2_DAT6/GPMC_A24/PR1_MII1_RXD0/ - * MCASP0_ACLKX/GPIO1_24 + * 1. LED0 GPMC_A5 GPMC_A5/GMII2_TXD0/RGMII2_TD0/RMII2_TXD0/GPMC_A21/ + * PR1_MII1_RXD3/eQEP1B_IN/GPIO1_21 + * 2. LED1 GPMC_A6 GPMC_A6/GMII2_TXCLK/RGMII2_TCLK/MMC2_DAT4/GPMC_A22/ + * PR1_MII1_RXD2/eQEP1_INDEX/GPIO1_22 + * 3. LED2 GPMC_A7 GPMC_A7/GMII2_RXCLK/RGMII2_RCLK/MMC2_DAT5/GPMC_A23/ + * PR1_MII1_RXD1/eQEP1_STROBE/GPIO1_23 + * 4. LED3 GPMC_A8 GPMC_A8/GMII2_RXD3/RGMII2_RD3/MMC2_DAT6/GPMC_A24/ + * PR1_MII1_RXD0/MCASP0_ACLKX/GPIO1_24 */ #define GPIO_LED0 (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | GPIO_PORT1 | GPIO_PIN21 | \ @@ -103,8 +104,8 @@ /* These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is * defined. In that case, the usage by the board port is defined in - * include/board.h and src/am335x_leds.c. The LEDs are used to encode OS-related - * events as follows: + * include/board.h and src/am335x_leds.c. + * The LEDs are used to encode OS-related events as follows: * * SYMBOL Meaning LED state * LED1 LED3 LED4 @@ -119,24 +120,24 @@ * LED_PANIC The system has crashed N/C N/C 2Hz Flashing * LED_IDLE MCU is is sleep mode Not used * - * After booting, LED1 and 3 are not longer used by the system and can be used for - * other purposes by the application (Of course, all LEDs are available to the - * application if CONFIG_ARCH_LEDS is not defined. + * After booting, LED1 and 3 are not longer used by the system and can be + * used for other purposes by the application (Of course, all LEDs are + * available to the application if CONFIG_ARCH_LEDS is not defined. */ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Name: am355x_led_initialize diff --git a/boards/arm/c5471/c5471evm/scripts/Make.defs b/boards/arm/c5471/c5471evm/scripts/Make.defs index 7bade157bec..125553e424b 100644 --- a/boards/arm/c5471/c5471evm/scripts/Make.defs +++ b/boards/arm/c5471/c5471evm/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/c5471evm/scripts/Make.defs +# boards/arm/c5471/c5471evm/scripts/Make.defs # # Copyright (C) 2007, 2008, 2011, 2014, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/c5471/c5471evm/scripts/ld.script b/boards/arm/c5471/c5471evm/scripts/ld.script index d9f060947ff..f85afce4da9 100644 --- a/boards/arm/c5471/c5471evm/scripts/ld.script +++ b/boards/arm/c5471/c5471evm/scripts/ld.script @@ -1,5 +1,5 @@ /************************************************************ - * boards/c5471evm/scripts/ld.script + * boards/arm/c5471/c5471evm/scripts/ld.script * * Copyright (C) 2007, 2011-2012, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/c5471/c5471evm/src/Makefile b/boards/arm/c5471/c5471evm/src/Makefile index 5442544f20b..0d2865a1cea 100644 --- a/boards/arm/c5471/c5471evm/src/Makefile +++ b/boards/arm/c5471/c5471evm/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/c5471/c5471evm/src/Makefile +# boards/arm/c5471/c5471/c5471evm/src/Makefile # # Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/c5471/c5471evm/src/c5471_leds.c b/boards/arm/c5471/c5471evm/src/c5471_leds.c index 2f6279ed346..e66be0a6347 100644 --- a/boards/arm/c5471/c5471evm/src/c5471_leds.c +++ b/boards/arm/c5471/c5471evm/src/c5471_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/c5471/c5471evm/src/c5471_leds.c + * boards/arm/c5471/c5471evm/src/c5471_leds.c * * Copyright (C) 2007-2009, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/cxd56xx/spresense/include/board.h b/boards/arm/cxd56xx/spresense/include/board.h index b3d973ad495..27ed2c5bfe9 100644 --- a/boards/arm/cxd56xx/spresense/include/board.h +++ b/boards/arm/cxd56xx/spresense/include/board.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/include/board.h + * boards/arm/cxd56xx/spresense/include/board.h * * Copyright 2018 Sony Semiconductor Solutions Corporation * @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef _CONFIGS_SPRESENSE_INCLUDE_BOARD_H -#define _CONFIGS_SPRESENSE_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_BOARD_H +#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_BOARD_H /**************************************************************************** * Included Files @@ -286,4 +286,4 @@ void cxd56_boardinitialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* _CONFIGS_SPRESENSE_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_BOARD_H */ diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_bmi160.h b/boards/arm/cxd56xx/spresense/include/cxd56_bmi160.h index a3f53f39f8d..93b8ddd8584 100644 --- a/boards/arm/cxd56xx/spresense/include/cxd56_bmi160.h +++ b/boards/arm/cxd56xx/spresense/include/cxd56_bmi160.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/include/cxd56_bmi160.h + * boards/arm/cxd56xx/spresense/include/cxd56_bmi160.h * * Copyright 2018 Sony Semiconductor Solutions Corporation * @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARD_COMMON_INCLUDE_CXD56_BMI160_H -#define __BOARD_COMMON_INCLUDE_CXD56_BMI160_H +#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_BMI160_H +#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_BMI160_H /**************************************************************************** * Included Files @@ -81,4 +81,4 @@ int board_bmi160_initialize(int bus); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARD_COMMON_INCLUDE_CXD56_BMI160_H */ +#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_BMI160_H */ diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_charger.h b/boards/arm/cxd56xx/spresense/include/cxd56_charger.h index d5b06f6624f..6003574d22b 100644 --- a/boards/arm/cxd56xx/spresense/include/cxd56_charger.h +++ b/boards/arm/cxd56xx/spresense/include/cxd56_charger.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/include/cxd56_charger.h + * boards/arm/cxd56xx/spresense/include/cxd56_charger.h * * Copyright 2018 Sony Semiconductor Solutions Corporation * @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARD_COMMON_INCLUDE_CXD56_CHARGER_H -#define __BOARD_COMMON_INCLUDE_CXD56_CHARGER_H +#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_CHARGER_H +#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_CHARGER_H /**************************************************************************** * Included Files @@ -91,4 +91,4 @@ int board_charger_uninitialize(FAR const char *devpath); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARD_COMMON_INCLUDE_CXD56_CHARGER_H */ +#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_CHARGER_H */ diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_clock.h b/boards/arm/cxd56xx/spresense/include/cxd56_clock.h index b7575a6fdca..93f99868237 100644 --- a/boards/arm/cxd56xx/spresense/include/cxd56_clock.h +++ b/boards/arm/cxd56xx/spresense/include/cxd56_clock.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/include/cxd56_clock.h + * boards/arm/cxd56xx/spresense/include/cxd56_clock.h * * Copyright 2019 Sony Semiconductor Solutions Corporation * @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARD_COMMON_INCLUDE_CXD56_CLOCK_H -#define __BOARD_COMMON_INCLUDE_CXD56_CLOCK_H +#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_CLOCK_H +#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_CLOCK_H /**************************************************************************** * Included Files @@ -83,4 +83,4 @@ void board_clock_enable(void); } #endif -#endif /* __BOARD_COMMON_INCLUDE_CXD56_CLOCK_H */ +#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_CLOCK_H */ diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_flash.h b/boards/arm/cxd56xx/spresense/include/cxd56_flash.h index 64154001edf..d8dc9925c29 100644 --- a/boards/arm/cxd56xx/spresense/include/cxd56_flash.h +++ b/boards/arm/cxd56xx/spresense/include/cxd56_flash.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/include/cxd56_flash.h + * boards/arm/cxd56xx/spresense/include/cxd56_flash.h * * Copyright 2018 Sony Semiconductor Solutions Corporation * @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARD_COMMON_INCLUDE_CXD56_FLASH_H -#define __BOARD_COMMON_INCLUDE_CXD56_FLASH_H +#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_FLASH_H +#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_FLASH_H /**************************************************************************** * Included Files @@ -83,4 +83,4 @@ int board_flash_initialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARD_COMMON_INCLUDE_CXD56_FLASH_H */ +#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_FLASH_H */ diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_gauge.h b/boards/arm/cxd56xx/spresense/include/cxd56_gauge.h index 23ec0077370..ab99152459d 100644 --- a/boards/arm/cxd56xx/spresense/include/cxd56_gauge.h +++ b/boards/arm/cxd56xx/spresense/include/cxd56_gauge.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/include/cxd56_gauge.h + * boards/arm/cxd56xx/spresense/include/cxd56_gauge.h * * Copyright 2018 Sony Semiconductor Solutions Corporation * @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARD_COMMON_INCLUDE_CXD56_GAUGE_H -#define __BOARD_COMMON_INCLUDE_CXD56_GAUGE_H +#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_GAUGE_H +#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_GAUGE_H /**************************************************************************** * Included Files @@ -91,4 +91,4 @@ int board_gauge_uninitialize(FAR const char *devpath); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARD_COMMON_INCLUDE_CXD56_GAUGE_H */ +#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_GAUGE_H */ diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_gpioif.h b/boards/arm/cxd56xx/spresense/include/cxd56_gpioif.h index 67da017080a..2b028a16271 100644 --- a/boards/arm/cxd56xx/spresense/include/cxd56_gpioif.h +++ b/boards/arm/cxd56xx/spresense/include/cxd56_gpioif.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/include/cxd56_gpioif.h + * boards/arm/cxd56xx/spresense/include/cxd56_gpioif.h * * Copyright 2018 Sony Semiconductor Solutions Corporation * @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARD_COMMON_INCLUDE_CXD56_GPIOIF_H -#define __BOARD_COMMON_INCLUDE_CXD56_GPIOIF_H +#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_GPIOIF_H +#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_GPIOIF_H /**************************************************************************** * Included Files @@ -71,8 +71,7 @@ extern "C" #define PIN_PULLDOWN (2) /**< Internal Weak Pull Down */ #define PIN_BUSKEEPER (3) /**< Internal Bus-Keeper */ -/* - * GPIO Interrupt Setting +/* GPIO Interrupt Setting * GPIO interrupt level and edge trigger types */ @@ -88,8 +87,7 @@ extern "C" * Public Function Prototypes ****************************************************************************/ -/* - * GPIO Configure +/* GPIO Configure * * [in] pin: Pin number * [in] mode: Function mode 0=GPIO @@ -107,8 +105,7 @@ extern "C" int board_gpio_config(uint32_t pin, int mode, bool input, bool drive, int pull); -/* - * GPIO Status +/* GPIO Status * * [in] pin: Pin number * [out] input: Input Enable true=enable, false=disable @@ -126,8 +123,7 @@ int board_gpio_config(uint32_t pin, int mode, bool input, bool drive, int board_gpio_status(uint32_t pin, bool *input, bool *output, bool *drive, int *pull); -/* - * GPIO Write +/* GPIO Write * * [in] pin: Pin number * [in] value: Write Value 0hiz @@ -135,8 +131,7 @@ int board_gpio_status(uint32_t pin, bool *input, bool *output, bool *drive, void board_gpio_write(uint32_t pin, int value); -/* - * GPIO Read +/* GPIO Read * * param: [in] pin: Pin number * @@ -145,8 +140,7 @@ void board_gpio_write(uint32_t pin, int value); int board_gpio_read(uint32_t pin); -/* - * GPIO Interrupt Configure +/* GPIO Interrupt Configure * * [in] pin: Pin number * [in] mode: Interrupt polarity @@ -163,8 +157,7 @@ int board_gpio_read(uint32_t pin); int board_gpio_intconfig(uint32_t pin, int mode, bool filter, xcpt_t isr); -/* - * GPIO Interrupt Configure +/* GPIO Interrupt Configure * * [in] pin: Pin number * [out] mode: Interrupt polarity @@ -182,8 +175,7 @@ int board_gpio_intconfig(uint32_t pin, int mode, bool filter, xcpt_t isr); int board_gpio_intstatus(uint32_t pin, int *mode, bool *filter, bool *enabled); -/* - * GPIO Interrupt Enable/Disable +/* GPIO Interrupt Enable/Disable * * [in] pin: Pin number * [in] enable: Interrupt true=enable, false=disable @@ -199,4 +191,4 @@ int board_gpio_int(uint32_t pin, bool enable); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARD_COMMON_INCLUDE_CXD56_GPIOIF_H */ +#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_GPIOIF_H */ diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_gs2200m.h b/boards/arm/cxd56xx/spresense/include/cxd56_gs2200m.h index bc6c6160705..efd3bbb5445 100644 --- a/boards/arm/cxd56xx/spresense/include/cxd56_gs2200m.h +++ b/boards/arm/cxd56xx/spresense/include/cxd56_gs2200m.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/include/cxd56_gs2200m.h + * boards/arm/cxd56xx/spresense/include/cxd56_gs2200m.h * * Copyright 2019 Sony Home Entertainment & Sound Products Inc. * Author: Masayuki Ishikawa @@ -37,7 +37,6 @@ #ifndef __BOARDS_ARM_SPRESENSE_INCLUDE_CXD56_GS2200M_H #define __BOARDS_ARM_SPRESENSE_INCLUDE_CXD56_GS2200M_H - /**************************************************************************** * Included Files ****************************************************************************/ @@ -77,7 +76,6 @@ extern "C" int board_gs2200m_initialize(FAR const char *devpath, int bus); - #undef EXTERN #if defined(__cplusplus) } diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_i2cdev.h b/boards/arm/cxd56xx/spresense/include/cxd56_i2cdev.h index 25e9a1ea848..d9eb74df676 100644 --- a/boards/arm/cxd56xx/spresense/include/cxd56_i2cdev.h +++ b/boards/arm/cxd56xx/spresense/include/cxd56_i2cdev.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/include/cxd56_i2cdev.h + * boards/arm/cxd56xx/spresense/include/cxd56_i2cdev.h * * Copyright 2018 Sony Semiconductor Solutions Corporation * @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARD_COMMON_INCLUDE_CXD56_I2CDEV_H -#define __BOARD_COMMON_INCLUDE_CXD56_I2CDEV_H +#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_I2CDEV_H +#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_I2CDEV_H /**************************************************************************** * Included Files @@ -83,4 +83,4 @@ int board_i2cdev_initialize(int bus); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARD_COMMON_INCLUDE_CXD56_I2CDEV_H */ +#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_I2CDEV_H */ diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_power.h b/boards/arm/cxd56xx/spresense/include/cxd56_power.h index 75c76f93c7b..f8b5811f31b 100644 --- a/boards/arm/cxd56xx/spresense/include/cxd56_power.h +++ b/boards/arm/cxd56xx/spresense/include/cxd56_power.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/include/cxd56_power.h + * boards/arm/cxd56xx/spresense/include/cxd56_power.h * * Copyright 2018 Sony Semiconductor Solutions Corporation * @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARD_COMMON_INCLUDE_CXD56_POWER_H -#define __BOARD_COMMON_INCLUDE_CXD56_POWER_H +#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_POWER_H +#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_POWER_H /**************************************************************************** * Included Files @@ -199,4 +199,4 @@ int board_lna_power_control(bool en); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARD_COMMON_INCLUDE_CXD56_POWER_H */ +#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_POWER_H */ diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_pwm.h b/boards/arm/cxd56xx/spresense/include/cxd56_pwm.h index 9604228567e..cd70c3aa441 100644 --- a/boards/arm/cxd56xx/spresense/include/cxd56_pwm.h +++ b/boards/arm/cxd56xx/spresense/include/cxd56_pwm.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/include/cxd56_pwm.h + * boards/arm/cxd56xx/spresense/include/cxd56_pwm.h * * Copyright 2018 Sony Semiconductor Solutions Corporation * @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARD_COMMON_INCLUDE_CXD56_PWM_H -#define __BOARD_COMMON_INCLUDE_CXD56_PWM_H +#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_PWM_H +#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_PWM_H /**************************************************************************** * Included Files @@ -81,4 +81,4 @@ int board_pwm_setup(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARD_COMMON_INCLUDE_CXD56_PWM_H */ +#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_PWM_H */ diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_sdcard.h b/boards/arm/cxd56xx/spresense/include/cxd56_sdcard.h index 73d137eb1e6..a57ecfc8eb4 100644 --- a/boards/arm/cxd56xx/spresense/include/cxd56_sdcard.h +++ b/boards/arm/cxd56xx/spresense/include/cxd56_sdcard.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/include/cxd56_sdcard.h + * boards/arm/cxd56xx/spresense/include/cxd56_sdcard.h * * Copyright 2018 Sony Semiconductor Solutions Corporation * @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARD_COMMON_INCLUDE_CXD56_SDCARD_H -#define __BOARD_COMMON_INCLUDE_CXD56_SDCARD_H +#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_SDCARD_H +#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_SDCARD_H /**************************************************************************** * Included Files @@ -151,4 +151,4 @@ void board_sdcard_set_low_voltage(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARD_COMMON_INCLUDE_CXD56_SDCARD_H */ +#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_SDCARD_H */ diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_wdt.h b/boards/arm/cxd56xx/spresense/include/cxd56_wdt.h index 56b523c88fd..f310bb1db5e 100644 --- a/boards/arm/cxd56xx/spresense/include/cxd56_wdt.h +++ b/boards/arm/cxd56xx/spresense/include/cxd56_wdt.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/include/cxd56_wdt.h + * boards/arm/cxd56xx/spresense/include/cxd56_wdt.h * * Copyright 2018 Sony Semiconductor Solutions Corporation * @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARD_COMMON_INCLUDE_CXD56_WDT_H -#define __BOARD_COMMON_INCLUDE_CXD56_WDT_H +#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_WDT_H +#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_WDT_H /**************************************************************************** * Included Files @@ -81,4 +81,4 @@ int cxd56_wdt_initialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARD_COMMON_INCLUDE_CXD56_WDT_H */ +#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_WDT_H */ diff --git a/boards/arm/cxd56xx/spresense/scripts/Make.defs b/boards/arm/cxd56xx/spresense/scripts/Make.defs index ef610afefe2..b400aab0cc4 100644 --- a/boards/arm/cxd56xx/spresense/scripts/Make.defs +++ b/boards/arm/cxd56xx/spresense/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/spresense/nsh/Make.defs +# boards/arm/cxd56xx/spresense/nsh/Make.defs # # Copyright (C) 2014 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/cxd56xx/spresense/scripts/ramconfig.ld b/boards/arm/cxd56xx/spresense/scripts/ramconfig.ld index c07cd61f396..674ceb7b12c 100644 --- a/boards/arm/cxd56xx/spresense/scripts/ramconfig.ld +++ b/boards/arm/cxd56xx/spresense/scripts/ramconfig.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/scripts/ramconfig.ld + * boards/arm/cxd56xx/spresense/scripts/ramconfig.ld * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/Makefile b/boards/arm/cxd56xx/spresense/src/Makefile index 70f475a7fd7..efc768f7436 100644 --- a/boards/arm/cxd56xx/spresense/src/Makefile +++ b/boards/arm/cxd56xx/spresense/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/spresense/src/Makefile +# boards/arm/cxd56x/spresense/src/Makefile # # Copyright 2018 Sony Semiconductor Solutions Corporation # diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_appinit.c b/boards/arm/cxd56xx/spresense/src/cxd56_appinit.c index f6b5993767b..d66acef2b9a 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_appinit.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_appinit.c + * boards/arm/cxd56xx/spresense/src/cxd56_appinit.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_bmi160_i2c.c b/boards/arm/cxd56xx/spresense/src/cxd56_bmi160_i2c.c index f32ef8599b2..b4625e0cdac 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_bmi160_i2c.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_bmi160_i2c.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_bmi160_i2c.c + * boards/arm/cxd56xx/spresense/src/cxd56_bmi160_i2c.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_boot.c b/boards/arm/cxd56xx/spresense/src/cxd56_boot.c index be44c5f13da..caaa719cdc5 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_boot.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_boot.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_boot.c + * boards/arm/cxd56xx/spresense/src/cxd56_boot.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c b/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c index e46a3c71c24..3d9e9105e5b 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_bringup.c + * boards/arm/cxd56xx/spresense/src/cxd56_bringup.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_buttons.c b/boards/arm/cxd56xx/spresense/src/cxd56_buttons.c index 124e1cf1ef8..60ba3d4579a 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_buttons.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_buttons.c + * boards/arm/cxd56xx/spresense/src/cxd56_buttons.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_charger.c b/boards/arm/cxd56xx/spresense/src/cxd56_charger.c index 6f2a7251393..fc5e9896e02 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_charger.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_charger.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_charger.c + * boards/arm/cxd56xx/spresense/src/cxd56_charger.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_clock.c b/boards/arm/cxd56xx/spresense/src/cxd56_clock.c index 1ca19561df0..03e3ff86707 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_clock.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_clock.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_clock.c + * boards/arm/cxd56xx/spresense/src/cxd56_clock.c * * Copyright 2019 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_composite.c b/boards/arm/cxd56xx/spresense/src/cxd56_composite.c index d150746fdfa..8cb3d85efc5 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_composite.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_composite.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_composite.c + * boards/arm/cxd56xx/spresense/src/cxd56_composite.c * * Copyright (C) 2016, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -209,6 +209,7 @@ FAR void *board_composite_connect(int port, int configid) int strbase = COMPOSITE_NSTRIDS; /* Configure the mass storage device device */ + /* Ask the usbmsc driver to fill in the constants we didn't * know here. */ @@ -216,6 +217,7 @@ FAR void *board_composite_connect(int port, int configid) usbmsc_get_composite_devdesc(&dev[0]); /* Overwrite and correct some values... */ + /* The callback functions for the USBMSC class */ dev[0].classobject = board_mscclassobject; @@ -249,6 +251,7 @@ FAR void *board_composite_connect(int port, int configid) cdcacm_get_composite_devdesc(&dev[1]); /* Overwrite and correct some values... */ + /* The callback functions for the CDC/ACM class */ dev[1].classobject = cdcacm_classobject; diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_flash.c b/boards/arm/cxd56xx/spresense/src/cxd56_flash.c index 4e8d24af9b2..26acc0dc80d 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_flash.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_flash.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_flash.c + * boards/arm/cxd56xx/spresense/src/cxd56_flash.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_gauge.c b/boards/arm/cxd56xx/spresense/src/cxd56_gauge.c index 3c810b348da..88c384ff086 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_gauge.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_gauge.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_gauge.c + * boards/arm/cxd56xx/spresense/src/cxd56_gauge.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_gpioif.c b/boards/arm/cxd56xx/spresense/src/cxd56_gpioif.c index 6c80f8fe89c..6e89653ff65 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_gpioif.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_gpioif.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_gpioif.c + * boards/arm/cxd56xx/spresense/src/cxd56_gpioif.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_gs2200m.c b/boards/arm/cxd56xx/spresense/src/cxd56_gs2200m.c index 5cee420a492..04e21339a95 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_gs2200m.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_gs2200m.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_gs2200m.c + * boards/arm/cxd56xx/spresense/src/cxd56_gs2200m.c * * Copyright 2019 Sony Home Entertainment & Sound Products Inc. * Author: Masayuki Ishikawa @@ -109,6 +109,7 @@ static void gs2200m_irq_enable(void) if (1 == _enable_count) { /* NOTE: This would happen if we received an event */ + return; } diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_i2cdev.c b/boards/arm/cxd56xx/spresense/src/cxd56_i2cdev.c index 0d5d733dabe..4a144f59f7d 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_i2cdev.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_i2cdev.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_i2cdev.c + * boards/arm/cxd56xx/spresense/src/cxd56_i2cdev.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_ili9340.c b/boards/arm/cxd56xx/spresense/src/cxd56_ili9340.c index 25a5ef9a3c3..d1caa1b41a9 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_ili9340.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_ili9340.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_ili9340.c + * boards/arm/cxd56xx/spresense/src/cxd56_ili9340.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_ioctl.c b/boards/arm/cxd56xx/spresense/src/cxd56_ioctl.c index 9b495b4ed75..960e16b35b7 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_ioctl.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_ioctl.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_ioctl.c + * boards/arm/cxd56xx/spresense/src/cxd56_ioctl.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_leds.c b/boards/arm/cxd56xx/spresense/src/cxd56_leds.c index 9775df6f022..5ea6f3e83ed 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_leds.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_leds.c + * boards/arm/cxd56xx/spresense/src/cxd56_leds.c * * Copyright (C) 2011-2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -116,10 +116,10 @@ static inline void led_setbits(unsigned int setbits) void board_autoled_initialize(void) { - cxd56_gpio_config(GPIO_LED1,false); - cxd56_gpio_config(GPIO_LED2,false); - cxd56_gpio_config(GPIO_LED3,false); - cxd56_gpio_config(GPIO_LED4,false); + cxd56_gpio_config(GPIO_LED1, false); + cxd56_gpio_config(GPIO_LED2, false); + cxd56_gpio_config(GPIO_LED3, false); + cxd56_gpio_config(GPIO_LED4, false); } /**************************************************************************** @@ -128,7 +128,8 @@ void board_autoled_initialize(void) void board_autoled_on(int led) { - led_clrbits(BOARD_LED1_BIT | BOARD_LED2_BIT | BOARD_LED3_BIT | BOARD_LED4_BIT); + led_clrbits(BOARD_LED1_BIT | BOARD_LED2_BIT | + BOARD_LED3_BIT | BOARD_LED4_BIT); led_setbits(led); } diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_lpm013m091a.c b/boards/arm/cxd56xx/spresense/src/cxd56_lpm013m091a.c index 4c870a0bf97..923789652c9 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_lpm013m091a.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_lpm013m091a.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_lpm013m091a.c + * boards/arm/cxd56xx/spresense/src/cxd56_lpm013m091a.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_main.c b/boards/arm/cxd56xx/spresense/src/cxd56_main.c index a63ded02e6c..3c21935a848 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_main.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/spresense_main.c + * boards/arm/cxd56xx/spresense/src/spresense_main.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_netinit.c b/boards/arm/cxd56xx/spresense/src/cxd56_netinit.c index 50948845d07..3826993c2d8 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_netinit.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_netinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_netinit.c + * boards/arm/cxd56xx/spresense/src/cxd56_netinit.c * * Copyright 2019 Sony Home Entertainment & Sound Products Inc. * Author: Masayuki Ishikawa diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_ostest.c b/boards/arm/cxd56xx/spresense/src/cxd56_ostest.c index 253121e0b4e..94eaf2daea2 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_ostest.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_ostest.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_ostest.c + * boards/arm/cxd56xx/spresense/src/cxd56_ostest.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_power.c b/boards/arm/cxd56xx/spresense/src/cxd56_power.c index ce56da16507..9a2ee9b259c 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_power.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_power.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_power.c + * boards/arm/cxd56xx/spresense/src/cxd56_power.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_pwm.c b/boards/arm/cxd56xx/spresense/src/cxd56_pwm.c index a40fa93ab0f..8fe107d8b8a 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_pwm.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_pwm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_pwm.c + * boards/arm/cxd56xx/spresense/src/cxd56_pwm.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_sdcard.c b/boards/arm/cxd56xx/spresense/src/cxd56_sdcard.c index 84f869ff236..c7c63d23549 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_sdcard.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_sdcard.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_sdcard.c + * boards/arm/cxd56xx/spresense/src/cxd56_sdcard.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_spi.c b/boards/arm/cxd56xx/spresense/src/cxd56_spi.c index 6e5333c6a4b..7435aa3ce13 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_spi.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_spi.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_spi.c + * boards/arm/cxd56xx/spresense/src/cxd56_spi.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * @@ -67,31 +67,34 @@ * Name: cxd56_spi0/3/4/5select and cxd56_spi0/3/4/5status * * Description: - * The external functions, cxd56_spi1/2/3select and cxd56_spi1/2/3status 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 cxd56_spibus_initialize()) - * are provided by common CXD56 logic. To use this common SPI logic on your - * board: + * The external functions, cxd56_spi1/2/3select and cxd56_spi1/2/3 status + * 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 cxd56_spibus_initialize()) are provided by + * common CXD56 logic. To use this common SPI logic on your board: * * 1. Provide logic in cxd56_boardinitialize() to configure SPI chip select * pins. - * 2. Provide cxd56_spi0/3/4/5select() and cxd56_spi0/3/4/5status() functions in your - * board-specific logic. These functions will perform chip selection and - * status operations using GPIOs in the way your board is configured. + * 2. Provide cxd56_spi0/3/4/5select() and cxd56_spi0/3/4/5status() + * 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 cxd56_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by cxd56_spibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 4. The handle returned by cxd56_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). * ****************************************************************************/ #ifdef CONFIG_CXD56_SPI0 -void cxd56_spi0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void cxd56_spi0select(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 cxd56_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) @@ -101,9 +104,11 @@ uint8_t cxd56_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_CXD56_SPI3 -void cxd56_spi3select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void cxd56_spi3select(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"); /* Disable clock gating (clock enable) */ @@ -130,9 +135,11 @@ uint8_t cxd56_spi3status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_CXD56_SPI4 -void cxd56_spi4select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void cxd56_spi4select(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 cxd56_spi4status(FAR struct spi_dev_s *dev, uint32_t devid) @@ -142,9 +149,11 @@ uint8_t cxd56_spi4status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_CXD56_SPI5 -void cxd56_spi5select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void cxd56_spi5select(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 cxd56_spi5status(FAR struct spi_dev_s *dev, uint32_t devid) diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_uid.c b/boards/arm/cxd56xx/spresense/src/cxd56_uid.c index 2aad86dde90..05e4638af58 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_uid.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_uid.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_uid.c + * boards/arm/cxd56xx/spresense/src/cxd56_uid.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_usbmsc.c b/boards/arm/cxd56xx/spresense/src/cxd56_usbmsc.c index b5952efb01c..f8e62207c9d 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_usbmsc.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_usbmsc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_usbmsc.c + * boards/arm/cxd56xx/spresense/src/cxd56_usbmsc.c * * Copyright (C) 2009, 2011, 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -68,9 +68,10 @@ int board_usbmsc_initialize(int port) { /* If system/usbmsc is built as an NSH command, then SD slot should - * already have been initialized in board_app_initialize() (see stm32_appinit.c). + * already have been initialized in board_app_initialize() + * (see stm32_appinit.c). * In this case, there is nothing further to be done here. */ - return OK; + return OK; } diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_userleds.c b/boards/arm/cxd56xx/spresense/src/cxd56_userleds.c index bd08559666f..ffe05b3e17e 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_userleds.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/cxd56_userleds.c + * boards/arm/cxd56xx/spresense/src/cxd56_userleds.c * * Copyright 2018 Sony Semiconductor Solutions Corporation * diff --git a/boards/arm/cxd56xx/spresense/src/spresense.h b/boards/arm/cxd56xx/spresense/src/spresense.h index 5627d32028c..47d3a55eefc 100644 --- a/boards/arm/cxd56xx/spresense/src/spresense.h +++ b/boards/arm/cxd56xx/spresense/src/spresense.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/spresense/src/spresense.h + * boards/arm/cxd56xx/spresense/src/spresense.h * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_SPRESENSE_SRC_SPRESENSE_H -#define __BOARDS_ARM_SPRESENSE_SRC_SPRESENSE_H +#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_SRC_SPRESENSE_H +#define __BOARDS_ARM_CXD56XX_SPRESENSE_SRC_SPRESENSE_H /**************************************************************************** * Included Files @@ -77,4 +77,4 @@ int cxd56_bringup(void); #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_SPRESENSE_SRC_SPRESENSE_H */ +#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_SRC_SPRESENSE_H */ diff --git a/boards/arm/dm320/ntosd-dm320/include/board.h b/boards/arm/dm320/ntosd-dm320/include/board.h index f64377265d5..f3e7744bb5b 100644 --- a/boards/arm/dm320/ntosd-dm320/include/board.h +++ b/boards/arm/dm320/ntosd-dm320/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ntods-dm320/include/board/board.h +/**************************************************************************** + * boards/arm/dm320/ntods-dm320/include/board/board.h * * Copyright (C) 2007-201, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,20 +31,21 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_NTOSD_DM320_INCLUDE_BOARD_H -#define __BOARDS_ARM_NTOSD_DM320_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_DM320_NTOSD_DM320_INCLUDE_BOARD_H +#define __BOARDS_ARM_DM320_NTOSD_DM320_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* Clocking *****************************************************************/ -/* Clocking *************************************************************************/ /* This platform has the ARM at 175 MHz and the DSP at 101.25 MHz */ #define DM320_ARM_CLOCK 175500000 @@ -61,10 +62,11 @@ #define DM9000_BASE CONFIG_DM9000_BASE -/* Memory Map ***********************************************************************/ +/* Memory Map ***************************************************************/ -/* The Neuros development board has 16MiB RAM starting at 0x01000000 (physical) and - * 8MiB of FLASH. The Neuros OSD 1.0 consumer has 32MiB RAM starting at 0x01100000 +/* The Neuros development board has 16MiB RAM starting at 0x01000000 + * (physical) and 8MiB of FLASH. + * The Neuros OSD 1.0 consumer has 32MiB RAM starting at 0x01100000 * (physical) and 16MiB of FLASH. * * FIXME: Flash location may also differ on OSD 1.0 consumer unit! @@ -135,13 +137,11 @@ #define LED_PANIC GIO_LED_RED #define LED_IDLE 0 - -/************************************************************************************ +/**************************************************************************** * Inline Functions - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ #endif - -#endif /* __BOARDS_ARM_NTOSD_DM320_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_DM320_NTOSD_DM320_INCLUDE_BOARD_H */ diff --git a/boards/arm/dm320/ntosd-dm320/scripts/Make.defs b/boards/arm/dm320/ntosd-dm320/scripts/Make.defs index 319a375e8a6..3361c08af6c 100644 --- a/boards/arm/dm320/ntosd-dm320/scripts/Make.defs +++ b/boards/arm/dm320/ntosd-dm320/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/ntosd-dm320/scripts/Make.defs +# boards/arm/dm320/ntosd-dm320/scripts/Make.defs # # Copyright (C) 2007-2008, 2010, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/dm320/ntosd-dm320/scripts/sdram.ld b/boards/arm/dm320/ntosd-dm320/scripts/sdram.ld index 1c6bf5249dd..6b2f5daf1f4 100644 --- a/boards/arm/dm320/ntosd-dm320/scripts/sdram.ld +++ b/boards/arm/dm320/ntosd-dm320/scripts/sdram.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ntosd-dm320/scripts/sdram.ld + * boards/arm/dm320/ntosd-dm320/scripts/sdram.ld * * Copyright (C) 2007, 2008, 2011, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/dm320/ntosd-dm320/src/Makefile b/boards/arm/dm320/ntosd-dm320/src/Makefile index bb05ad0e15d..d5a945b2456 100644 --- a/boards/arm/dm320/ntosd-dm320/src/Makefile +++ b/boards/arm/dm320/ntosd-dm320/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/ntosd-dm320/src/Makefile +# boards/arm/dm320/ntosd-dm320/src/Makefile # # Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/dm320/ntosd-dm320/src/dm320_leds.c b/boards/arm/dm320/ntosd-dm320/src/dm320_leds.c index 40858e00d10..f56ea64c9e5 100644 --- a/boards/arm/dm320/ntosd-dm320/src/dm320_leds.c +++ b/boards/arm/dm320/ntosd-dm320/src/dm320_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * confgs/ntosd-dm320/src/dm320_leds.c + * boards/arm/dm320/ntosd-dm320/src/dm320_leds.c * * Copyright (C) 2007, 2009, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/dm320/ntosd-dm320/src/dm320_network.c b/boards/arm/dm320/ntosd-dm320/src/dm320_network.c index 4c0955c9f35..ba922ea7927 100644 --- a/boards/arm/dm320/ntosd-dm320/src/dm320_network.c +++ b/boards/arm/dm320/ntosd-dm320/src/dm320_network.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ntosd-dm320/src/dm320_network.c + * boards/arm/dm320/ntosd-dm320/src/dm320_network.c * * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/efm32/efm32-g8xx-stk/include/board.h b/boards/arm/efm32/efm32-g8xx-stk/include/board.h index 66b88bb3094..c818e25c4cf 100644 --- a/boards/arm/efm32/efm32-g8xx-stk/include/board.h +++ b/boards/arm/efm32/efm32-g8xx-stk/include/board.h @@ -50,7 +50,9 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Clocking *****************************************************************/ + /* Clock Sources * - 1-28 MHz High Frequency RC Oscillator (HFRCO) * - 4-32 MHz High Frequency Crystal Oscillator (HFXO) @@ -163,6 +165,7 @@ */ /* LEDs *********************************************************************/ + /* The EFM32 Gecko Starter Kit supports 4 yellow LEDs. One side is grounded * so these LEDs are illuminated by outputting a high value. * @@ -200,6 +203,7 @@ #define LED_PANIC 7 /* N/C + N/C + N/C + LED3 */ /* Pin routing **************************************************************/ + /* UART0: * * U0_RX #1 PE1 **AVAILABLE at TP130** diff --git a/boards/arm/efm32/efm32-g8xx-stk/scripts/efm32-g8xx-stk.ld b/boards/arm/efm32/efm32-g8xx-stk/scripts/efm32-g8xx-stk.ld index 72342c77f2c..348df4f41f1 100644 --- a/boards/arm/efm32/efm32-g8xx-stk/scripts/efm32-g8xx-stk.ld +++ b/boards/arm/efm32/efm32-g8xx-stk/scripts/efm32-g8xx-stk.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/arm/efm32-g8xx-stk/scripts/efm32-g8xx-stk.ld + * boards/arm/efm32/efm32-g8xx-stk/scripts/efm32-g8xx-stk.ld * * Copyright (C) 2012, 2014, 2017 Gregory Nutt. All rights reserved. * diff --git a/boards/arm/efm32/efm32-g8xx-stk/src/efm32-g8xx-stk.h b/boards/arm/efm32/efm32-g8xx-stk/src/efm32-g8xx-stk.h index 4cfca0c925c..3269bb95b04 100644 --- a/boards/arm/efm32/efm32-g8xx-stk/src/efm32-g8xx-stk.h +++ b/boards/arm/efm32/efm32-g8xx-stk/src/efm32-g8xx-stk.h @@ -60,23 +60,23 @@ GPIO_PORTD|GPIO_PIN13) #endif - /* LEDs - * - * The EFM32 Gecko Start Kit has four yellow LEDs. These LEDs are connected - * as follows: - * - * ------------------------------------- -------------------- - * EFM32 PIN BOARD SIGNALS - * ------------------------------------- -------------------- - * C0/USART1_TX#0/PCNT0_S0IN#2/ACMP0_CH0 MCU_PC0 UIF_LED0 - * C1/USART1_RX#0/PCNT0_S1IN#2/ACMP0_CH1 MCU_PC1 UIF_LED1 - * C2/USART2_TX#0/ACMP0_CH2 MCU_PC2 UIF_LED2 - * C3/USART2_RX#0/ACMP0_CH3 MCU_PC3 UIF_LED3 - * ------------------------------------- -------------------- - * - * All LEDs are grounded and so are illuminated by outputting a high - * value to the LED. - */ +/* LEDs + * + * The EFM32 Gecko Start Kit has four yellow LEDs. These LEDs are connected + * as follows: + * + * ------------------------------------- -------------------- + * EFM32 PIN BOARD SIGNALS + * ------------------------------------- -------------------- + * C0/USART1_TX#0/PCNT0_S0IN#2/ACMP0_CH0 MCU_PC0 UIF_LED0 + * C1/USART1_RX#0/PCNT0_S1IN#2/ACMP0_CH1 MCU_PC1 UIF_LED1 + * C2/USART2_TX#0/ACMP0_CH2 MCU_PC2 UIF_LED2 + * C3/USART2_RX#0/ACMP0_CH3 MCU_PC3 UIF_LED3 + * ------------------------------------- -------------------- + * + * All LEDs are grounded and so are illuminated by outputting a high + * value to the LED. + */ #define GPIO_LED0 (GPIO_OUTPUT_WIREDOR_PULLDOWN|\ GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN0) diff --git a/boards/arm/efm32/efm32-g8xx-stk/src/efm32_autoleds.c b/boards/arm/efm32/efm32-g8xx-stk/src/efm32_autoleds.c index 84f08c85832..95dc1c68228 100644 --- a/boards/arm/efm32/efm32-g8xx-stk/src/efm32_autoleds.c +++ b/boards/arm/efm32/efm32-g8xx-stk/src/efm32_autoleds.c @@ -218,12 +218,12 @@ static void led_setonoff(unsigned int bits) void board_autoled_initialize(void) { - /* Configure LED0-4 GPIOs for output */ + /* Configure LED0-4 GPIOs for output */ - efm32_configgpio(GPIO_LED0); - efm32_configgpio(GPIO_LED1); - efm32_configgpio(GPIO_LED2); - efm32_configgpio(GPIO_LED3); + efm32_configgpio(GPIO_LED0); + efm32_configgpio(GPIO_LED1); + efm32_configgpio(GPIO_LED2); + efm32_configgpio(GPIO_LED3); } /**************************************************************************** diff --git a/boards/arm/efm32/efm32-g8xx-stk/src/efm32_userleds.c b/boards/arm/efm32/efm32-g8xx-stk/src/efm32_userleds.c index 13a23ce71fb..2b98636c9d6 100644 --- a/boards/arm/efm32/efm32-g8xx-stk/src/efm32_userleds.c +++ b/boards/arm/efm32/efm32-g8xx-stk/src/efm32_userleds.c @@ -58,6 +58,7 @@ /**************************************************************************** * Private Data ****************************************************************************/ + /* This array maps an LED number to GPIO pin configuration */ static gpio_pinset_t g_ledcfg[BOARD_NLEDS] = @@ -112,35 +113,30 @@ static void led_pm_notify(struct pm_callback_s *cb, int domain, case(PM_NORMAL): { /* Restore normal LEDs operation */ - } break; case(PM_IDLE): { /* Entering IDLE mode - Turn leds off */ - } break; case(PM_STANDBY): { /* Entering STANDBY mode - Logic for PM_STANDBY goes here */ - } break; case(PM_SLEEP): { /* Entering SLEEP mode - Logic for PM_SLEEP goes here */ - } break; default: { /* Should not get here */ - } break; } @@ -181,12 +177,12 @@ static int led_pm_prepare(struct pm_callback_s *cb, int domain, void board_userled_initialize(void) { - /* Configure LED0-4 GPIOs for output */ + /* Configure LED0-4 GPIOs for output */ - efm32_configgpio(GPIO_LED0); - efm32_configgpio(GPIO_LED1); - efm32_configgpio(GPIO_LED2); - efm32_configgpio(GPIO_LED3); + efm32_configgpio(GPIO_LED0); + efm32_configgpio(GPIO_LED1); + efm32_configgpio(GPIO_LED2); + efm32_configgpio(GPIO_LED3); } /**************************************************************************** diff --git a/boards/arm/efm32/efm32gg-stk3700/include/board.h b/boards/arm/efm32/efm32gg-stk3700/include/board.h index 378bbcb0c7a..7067afc5b22 100644 --- a/boards/arm/efm32/efm32gg-stk3700/include/board.h +++ b/boards/arm/efm32/efm32gg-stk3700/include/board.h @@ -50,7 +50,9 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Clocking *****************************************************************/ + /* Clock Sources * - 1-28 MHz High Frequency RC Oscillator (HFRCO) * - 4-32 MHz High Frequency Crystal Oscillator (HFXO) @@ -169,6 +171,7 @@ */ /* LEDs *********************************************************************/ + /* The EFM32 Giant Gecko Start Kit has two yellow LEDs marked LED0 and LED1. * These LEDs are controlled by GPIO pins on the EFM32. The LEDs are * connected to pins PE2 and PE3 in an active high configuration: @@ -204,7 +207,9 @@ * * SYMBOL Val Meaning LED state * LED0 LED1 - * ----------------- --- ----------------------- -------- -------- */ + * ----------------- --- ----------------------- -------- -------- + */ + #define LED_STARTED 0 /* NuttX has been started OFF OFF */ #define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF OFF */ #define LED_IRQSENABLED 0 /* Interrupts enabled OFF OFF */ @@ -216,6 +221,7 @@ #undef LED_IDLE /* MCU is is sleep mode Not used */ /* Buttons ******************************************************************/ + /* The EFM32 Giant Gecko Start Kit has two buttons marked PB0 and PB1. They * are connected to the EFM32, and are debounced by RC filters with a time * constant of 1ms. The buttons are connected to pins PB9 and PB10: @@ -238,6 +244,7 @@ #define BUTTON_PB1_BIT (1 << BUTTON_PB1) /* Pin routing **************************************************************/ + /* UART0: * * The kit contains a board controller that is responsible for performing diff --git a/boards/arm/efm32/efm32gg-stk3700/scripts/ld.script b/boards/arm/efm32/efm32gg-stk3700/scripts/ld.script index b2f36b8d718..8ac83220937 100644 --- a/boards/arm/efm32/efm32gg-stk3700/scripts/ld.script +++ b/boards/arm/efm32/efm32gg-stk3700/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/arm/efm32gg-stk3700/scripts/ld.script + * boards/arm/efm32/efm32gg-stk3700/scripts/ld.script * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * diff --git a/boards/arm/efm32/olimex-efm32g880f128-stk/include/board.h b/boards/arm/efm32/olimex-efm32g880f128-stk/include/board.h index ff86a07e959..fdb05de25e6 100644 --- a/boards/arm/efm32/olimex-efm32g880f128-stk/include/board.h +++ b/boards/arm/efm32/olimex-efm32g880f128-stk/include/board.h @@ -50,7 +50,9 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Clocking *****************************************************************/ + /* Clock Sources * - 1-28 MHz High Frequency RC Oscillator (HFRCO) * - 4-32 MHz High Frequency Crystal Oscillator (HFXO) @@ -163,6 +165,7 @@ */ /* LEDs *********************************************************************/ + /* The EFM32 Gecko Starter Kit supports 4 yellow LEDs. One side is grounded * so these LEDs are illuminated by outputting a high value. * @@ -205,6 +208,7 @@ #define LED_PANIC 7 /* N/C + N/C + N/C + LED4 */ /* Buttons ******************************************************************/ + /* The Olimex board has four buttons, BUT1-4. Each is grounded and so should * have a weak pull-up so that it will be sensed as "1" when open and "0" * when closed. @@ -231,6 +235,7 @@ #define BUTTON_4_BIT (1 << BUTTON_4) /* Pin routing **************************************************************/ + /* UART0: * * U0_RX #1 PE1 **AVAILABLE at EXT-19** diff --git a/boards/arm/efm32/olimex-efm32g880f128-stk/scripts/ld.script b/boards/arm/efm32/olimex-efm32g880f128-stk/scripts/ld.script index 876820b46f0..a57d87b73b5 100644 --- a/boards/arm/efm32/olimex-efm32g880f128-stk/scripts/ld.script +++ b/boards/arm/efm32/olimex-efm32g880f128-stk/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/olimex-efm32g880f128-stk/scripts/ld.script + * boards/arm/efm32/olimex-efm32g880f128-stk/scripts/ld.script * * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. * diff --git a/boards/arm/efm32/olimex-efm32g880f128-stk/src/efm32_buttons.c b/boards/arm/efm32/olimex-efm32g880f128-stk/src/efm32_buttons.c index 040bdecbf2e..a0cd149cf18 100644 --- a/boards/arm/efm32/olimex-efm32g880f128-stk/src/efm32_buttons.c +++ b/boards/arm/efm32/olimex-efm32g880f128-stk/src/efm32_buttons.c @@ -166,7 +166,7 @@ uint32_t board_buttons(void) #if defined(CONFIG_EFM32_GPIO_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS) int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { - if (id >=0 && id < NUM_BUTTONS) + if (id >= 0 && id < NUM_BUTTONS) { irqstate_t flags; diff --git a/boards/arm/imx6/sabre-6quad/include/board.h b/boards/arm/imx6/sabre-6quad/include/board.h index 065679fa72a..8e4ea12410c 100644 --- a/boards/arm/imx6/sabre-6quad/include/board.h +++ b/boards/arm/imx6/sabre-6quad/include/board.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * boards/arm/imx6/sabre-6quad/include/board.h * * Copyright (C) 2016 Gregory Nutt. All rights reserved. @@ -31,21 +31,23 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __BOARDS_ARM_IMX6_SABRE_6QUAD_INCLUDE_BOARD_H #define __BOARDS_ARM_IMX6_SABRE_6QUAD_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Clocking *************************************************************************/ + ****************************************************************************/ + +/* Clocking *****************************************************************/ + /* The Sabre-6Quad board has two crystals: * * Y1 24 MHz CPU_XTALI/CPU_XTALO @@ -55,9 +57,10 @@ #define BOARD_CPUXTAL_FREQUENCY 24000000 #define BAORD_RTCXTAL_FREQUENCY 32768 -/* Clocking will be configured at 792 MHz initially when started via U-Boot. The - * Linux kernel will use the CPU frequency scaling code which will switch the - * processor frequency between 400 MHz and 1GHz based on load and temperature. +/* Clocking will be configured at 792 MHz initially when started via U-Boot. + * The Linux kernel will use the CPU frequency scaling code which will switch + * the processor frequency between 400 MHz and 1GHz based on load and + * temperature. * * These are the frequencies reported with U-Boot starts up: * @@ -83,12 +86,14 @@ * For now, NuttX simply leaves the clocking at 792MHz. */ -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* LEDs * - * A single LED is available driven GPIO1_IO02. On the schematic this is - * USR_DEF_RED_LED signal to pin T1 (GPIO_2). This signal is shared with KEY_ROW6 - * (ALT2). A high value illuminates the LED. + * A single LED is available driven GPIO1_IO02. + * On the schematic this is USR_DEF_RED_LED signal to pin T1 (GPIO_2). + * This signal is shared with KEY_ROW6 (ALT2). + * A high value illuminates the LED. */ /* LED index values for use with board_userled() */ @@ -107,7 +112,8 @@ * * ---------------------- ---------------------------- ------ * SYMBOL Meaning LED - * ---------------------- ---------------------------- ------ */ + * ---------------------- ---------------------------- ------ + */ #define LED_STARTED 0 /* NuttX has been started OFF */ #define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF */ @@ -124,23 +130,25 @@ * 2Hz, then a fatal error has been detected and the system has halted. */ -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ -/* GPIO Disambiguation **************************************************************/ -/* A DEBUG VCOM is available MICRO USB AB 5 J509. This corresponds to UART1 from - * the i.MX6. UART1 connects to J509 via the CSIO_DAT10 and CSIO_DAT11 pins: +/* GPIO Disambiguation ******************************************************/ + +/* A DEBUG VCOM is available MICRO USB AB 5 J509. + * This corresponds to UART1 from the i.MX6. + * UART1 connects to J509 via the CSIO_DAT10 and CSIO_DAT11 pins: */ #define GPIO_UART1_RX_DATA GPIO_UART1_RX_DATA_2 #define GPIO_UART1_TX_DATA GPIO_UART1_TX_DATA_2 -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ @@ -153,9 +161,9 @@ extern "C" #define EXTERN extern #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) diff --git a/boards/arm/imx6/sabre-6quad/include/board_memorymap.h b/boards/arm/imx6/sabre-6quad/include/board_memorymap.h index 1aacbccfaa5..51fe2272c94 100644 --- a/boards/arm/imx6/sabre-6quad/include/board_memorymap.h +++ b/boards/arm/imx6/sabre-6quad/include/board_memorymap.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * boards/arm/imx6/sabr-6quad/include/board_memorymap.h * * Copyright (C) 2016 Gregory Nutt. All rights reserved. @@ -31,24 +31,24 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __BOARDS_ARM_IMX6_SABRE_6QUAD_INCLUDE_BOARD_MEMORYMAP_H #define __BOARDS_ARM_IMX6_SABRE_6QUAD_INCLUDE_BOARD_MEMORYMAP_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ @@ -61,9 +61,9 @@ extern "C" #define EXTERN extern #endif -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) diff --git a/boards/arm/imx6/sabre-6quad/src/imx_appinit.c b/boards/arm/imx6/sabre-6quad/src/imx_appinit.c index c4405ca4830..a868227f235 100644 --- a/boards/arm/imx6/sabre-6quad/src/imx_appinit.c +++ b/boards/arm/imx6/sabre-6quad/src/imx_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/arm/imx6/sabre-6quad/src/imx_appinit.c + * boards/arm/imx6/sabre-6quad/src/imx_appinit.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/imx6/sabre-6quad/src/imx_bringup.c b/boards/arm/imx6/sabre-6quad/src/imx_bringup.c index 1e942bc381a..ca1ba7ba31d 100644 --- a/boards/arm/imx6/sabre-6quad/src/imx_bringup.c +++ b/boards/arm/imx6/sabre-6quad/src/imx_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/arm/imx6/sabre-6quad/src/imx_bringup.c + * boards/arm/imx6/sabre-6quad/src/imx_bringup.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/imx6/sabre-6quad/src/imx_userleds.c b/boards/arm/imx6/sabre-6quad/src/imx_userleds.c index aac2dd7f87d..13ef31793d6 100644 --- a/boards/arm/imx6/sabre-6quad/src/imx_userleds.c +++ b/boards/arm/imx6/sabre-6quad/src/imx_userleds.c @@ -82,5 +82,5 @@ void board_userled_all(uint8_t ledset) { /* Low illuminates */ - imx_gpio_write(GPIO_LED, (ledset & BOARD_LED_BIT) == 0)); + imx_gpio_write(GPIO_LED, (ledset & BOARD_LED_BIT) == 0); } diff --git a/boards/arm/imx6/sabre-6quad/src/sabre-6quad.h b/boards/arm/imx6/sabre-6quad/src/sabre-6quad.h index efda2648d79..d60a6db5e4c 100644 --- a/boards/arm/imx6/sabre-6quad/src/sabre-6quad.h +++ b/boards/arm/imx6/sabre-6quad/src/sabre-6quad.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * boards/arm/imx6/sabre-6quad/src/sabre-6quad.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. @@ -31,14 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __BOARDS_ARM_IMX6_SABRE_6QUAD_SRC_SABRE_6QUAD_H #define __BOARDS_ARM_IMX6_SABRE_6QUAD_SRC_SABRE_6QUAD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -47,45 +47,50 @@ #include "imx_gpio.h" #include "imx_iomuxc.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ + +/* SABRE-6QUAD GPIO Pin Definitions *****************************************/ -/* SABRE-6QUAD GPIO Pin Definitions *************************************************/ /* LED * - * A single LED is available driven GPIO1_IO02. On the schematic this is - * USR_DEF_RED_LED signal to pin T1 (GPIO_2). This signal is shared with KEY_ROW6 - * (ALT2). A high value illuminates the LED. + * A single LED is available driven GPIO1_IO02. + * On the schematic this is USR_DEF_RED_LED signal to pin T1 (GPIO_2). + * This signal is shared with KEY_ROW6 (ALT2). + * A high value illuminates the LED. */ -#define IOMUX_LED (IOMUX_PULL_NONE | IOMUX_CMOS_OUTPUT | IOMUX_DRIVE_40OHM | \ +#define IOMUX_LED (IOMUX_PULL_NONE | IOMUX_CMOS_OUTPUT | \ + IOMUX_DRIVE_40OHM | \ IOMUX_SPEED_MEDIUM | IOMUX_SLEW_SLOW) -#define GPIO_LED (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | GPIO_PORT1 | GPIO_PIN2 | \ +#define GPIO_LED (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | \ + GPIO_PORT1 | GPIO_PIN2 | \ IOMUX_LED) -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: imx_bringup * * Description: * Bring up board features * - ************************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LIB_BOARDCTL) || defined(CONFIG_BOARD_LATE_INITIALIZE) int imx_bringup(void); diff --git a/boards/arm/imxrt/imxrt1050-evk/include/board.h b/boards/arm/imxrt/imxrt1050-evk/include/board.h index 545989f73da..966fe6bf77c 100644 --- a/boards/arm/imxrt/imxrt1050-evk/include/board.h +++ b/boards/arm/imxrt/imxrt1050-evk/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/arm/imxrt/imxrt1050/include/board.h +/**************************************************************************** + * boards/arm/imxrt/imxrt1050-evk/include/board.h * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt @@ -33,22 +33,22 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __BOARDS_ARM_IMXRT_IMXRT1050_EVK_INCLUDE_BOARD_H #define __BOARDS_ARM_IMXRT_IMXRT1050_EVK_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ +/* Clocking *****************************************************************/ /* Set VDD_SOC to 1.25V */ @@ -108,10 +108,10 @@ #define BOARD_CPU_FREQUENCY \ (BOARD_XTAL_FREQUENCY * (IMXRT_ARM_PLL_DIV_SELECT / 2)) / IMXRT_ARM_PODF_DIVIDER -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ -/* There are four LED status indicators located on the EVK Board. The functions of - * these LEDs include: +/* There are four LED status indicators located on the EVK Board. + * The functions of these LEDs include: * * - Main Power Supply(D3) * Green: DC 5V main supply is normal. @@ -140,7 +140,8 @@ * * -------------------- ----------------------------- ------ * SYMBOL Meaning LED - * -------------------- ----------------------------- ------ */ + * -------------------- ----------------------------- ------ + */ #define LED_STARTED 0 /* NuttX has been started OFF */ #define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF */ @@ -157,7 +158,7 @@ * 2Hz, then a fatal error has been detected and the system has halted. */ -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ /* The IMXRT board has one external user button * @@ -168,18 +169,19 @@ #define BUTTON_SW8_BIT (1 << BUTTON_SW8) -/* SDIO *****************************************************************************/ +/* SDIO *********************************************************************/ -/* Pin drive characteristics - drive strength in particular may need tuning for - * specific boards, but has been checked by scope on the EVKB to make sure shapes - * are square with minimal ringing. +/* Pin drive characteristics - drive strength in particular may need tuning + * for specific boards, but has been checked by scope on the EVKB to make + * sure shapes are square with minimal ringing. */ #define USDHC1_DATAX_IOMUX (IOMUX_SLEW_FAST | IOMUX_DRIVE_130OHM | \ IOMUX_PULL_UP_47K | IOMUX_SCHMITT_TRIGGER) #define USDHC1_CMD_IOMUX (IOMUX_SLEW_FAST | IOMUX_DRIVE_130OHM | \ IOMUX_PULL_UP_47K | IOMUX_SCHMITT_TRIGGER) -#define USDHC1_CLK_IOMUX (IOMUX_SLEW_FAST | IOMUX_DRIVE_130OHM | IOMUX_SPEED_MAX) +#define USDHC1_CLK_IOMUX (IOMUX_SLEW_FAST | IOMUX_DRIVE_130OHM | \ + IOMUX_SPEED_MAX) #define USDHC1_CD_IOMUX (0) #define PIN_USDHC1_D0 (GPIO_USDHC1_DATA0 | USDHC1_DATAX_IOMUX) @@ -206,7 +208,8 @@ #define BOARD_USDHC_SD4MODE_PRESCALER USDHC_SYSCTL_SDCLKFS_DIV8 #define BOARD_USDHC_SD4MODE_DIVISOR USDHC_SYSCTL_DVS_DIV(1) -/* ETH Disambiguation ***************************************************************/ +/* ETH Disambiguation *******************************************************/ + #define GPIO_ENET_MDIO GPIO_ENET_MDIO_3 #define GPIO_ENET_MDC GPIO_ENET_MDC_3 #define GPIO_ENET_RX_EN GPIO_ENET_RX_EN_1 @@ -214,7 +217,7 @@ #define GPIO_ENET_TX_CLK GPIO_ENET_TX_CLK_1 #define GPIO_ENET_TX_EN GPIO_ENET_TX_EN_1 -/* PIO Disambiguation ***************************************************************/ +/* PIO Disambiguation *******************************************************/ /* LPUARTs * @@ -261,13 +264,13 @@ #define GPIO_LPSPI3_MISO GPIO_LPSPI3_SDI_2 /* GPIO_AD_B0_02 */ #define GPIO_LPSPI3_MOSI GPIO_LPSPI3_SDO_2 /* GPIO_AD_B0_01 */ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ @@ -280,9 +283,9 @@ extern "C" #define EXTERN extern #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) diff --git a/boards/arm/imxrt/imxrt1050-evk/kernel/imxrt_userspace.c b/boards/arm/imxrt/imxrt1050-evk/kernel/imxrt_userspace.c index 56ee62e9a6c..8336bae6aec 100644 --- a/boards/arm/imxrt/imxrt1050-evk/kernel/imxrt_userspace.c +++ b/boards/arm/imxrt/imxrt1050-evk/kernel/imxrt_userspace.c @@ -50,6 +50,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifndef CONFIG_NUTTX_USERSPACE @@ -64,9 +65,9 @@ * 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 diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_appinit.c b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_appinit.c index 18b6a849a48..a7283f5da8d 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_appinit.c +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/arm/imxrt/imxrt1050-evk/src/imxrt_appinit.c + * boards/arm/imxrt/imxrt1050-evk/src/imxrt_appinit.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_bringup.c b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_bringup.c index c470c124d87..b1d1ca3f677 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_bringup.c +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/arm/imxrt/imxrt1050-evk/src/imxrt_bringup.c + * boards/arm/imxrt/imxrt1050-evk/src/imxrt_bringup.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -122,7 +122,7 @@ static int nsh_sdmmc_initialize(void) } } return OK; - } +} #else # define nsh_sdmmc_initialize() (OK) #endif diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_buttons.c b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_buttons.c index 303ea237053..c107f2f1661 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_buttons.c +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_buttons.c @@ -81,9 +81,9 @@ void board_button_initialize(void) { - /* Configure the button as input */ + /* Configure the button as input */ - imxrt_config_gpio(GPIO_SW8); + imxrt_config_gpio(GPIO_SW8); } /**************************************************************************** diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_ethernet.c b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_ethernet.c index 6aed7de32d3..7c86d373726 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_ethernet.c +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_ethernet.c @@ -70,6 +70,7 @@ #define IMXRT_ENET_DEVNAME "eth0" /* Debug ********************************************************************/ + /* Extra, in-depth debug output that is only available if * CONFIG_NETDEV_PHY_DEBUG us defined. */ @@ -84,13 +85,13 @@ # define phyinfo(x...) #endif -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: imxrt_enet_phy_enable - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_IMXRT_GPIO1_0_15_IRQ static void imxrt_enet_phy_enable(bool enable) @@ -108,27 +109,29 @@ static void imxrt_enet_phy_enable(bool enable) } #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Function: imxrt_phy_boardinitialize * * Description: - * Some boards require specialized initialization of the PHY before it can be - * used. This may include such things as configuring GPIOs, resetting the PHY, - * etc. If CONFIG_IMXRT_ENET_PHYINIT is defined in the configuration then the - * board specific logic must provide imxrt_phyinitialize(); The i.MX RT Ethernet - * driver will call this function one time before it first uses the PHY. + * Some boards require specialized initialization of the PHY before it can + * be used. + * This may include such things as configuring GPIOs, resetting the PHY, etc. + * If CONFIG_IMXRT_ENET_PHYINIT is defined in the configuration then the + * board specific logic must provide imxrt_phyinitialize(); + * The i.MX RT Ethernet driver will call this function one time before it + * first uses the PHY. * * Input Parameters: - * intf - Always zero for now. + * intf - Always zero for now. * * Returned Value: - * OK on success; Negated errno on failure. + * OK on success; Negated errno on failure. * - ************************************************************************************/ + ****************************************************************************/ int imxrt_phy_boardinitialize(int intf) { diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_boot.c b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_boot.c index 750ffdd613f..62697e07dad 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_boot.c +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_boot.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_boot.c + * boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_boot.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Ivan Ucherdzhiev @@ -61,7 +61,7 @@ const struct boot_data_s g_boot_data = { FLASH_BASE, /* boot start location */ (FLASH_END - FLASH_BASE), /* size */ - PLUGIN_FLAG, /* Plugin flag*/ - 0xFFFFFFFF /* empty - extra data word */ + PLUGIN_FLAG, /* Plugin flag */ + 0xffffffff /* empty - extra data word */ }; diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_boot.h b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_boot.h index 20d727af2e3..5049c08ff30 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_boot.h +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_boot.h @@ -1,5 +1,5 @@ /**************************************************************************** - * config/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_boot.h + * boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_boot.h * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Ivan Ucherdzhiev @@ -121,11 +121,11 @@ struct ivt_s uint32_t boot_data; - /* Absolute address of the IVT.*/ + /* Absolute address of the IVT. */ uint32_t self; - /* Absolute address of the image CSF.*/ + /* Absolute address of the image CSF. */ uint32_t csf; diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_flash.c b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_flash.c index 19aaa2a9c55..83ff4c1abb4 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_flash.c +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_flash.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_flash.c + * boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_flash.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Ivan Ucherdzhiev @@ -33,16 +33,15 @@ * ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - ******************************************************************************/ - + ****************************************************************************/ #include "imxrt_flexspi_nor_flash.h" -/******************************************************************************* +/**************************************************************************** * Public Data - ******************************************************************************/ + ****************************************************************************/ #if defined (CONFIG_IMXRT1050_EVK_HYPER_FLASH) __attribute__((section(".boot_hdr.conf"))) @@ -71,7 +70,7 @@ const struct flexspi_nor_config_s g_flash_config = { /* Read LUTs */ - FLEXSPI_LUT_SEQ(CMD_DDR, FLEXSPI_8PAD, 0xA0, RADDR_DDR, FLEXSPI_8PAD, 0x18), + FLEXSPI_LUT_SEQ(CMD_DDR, FLEXSPI_8PAD, 0xa0, RADDR_DDR, FLEXSPI_8PAD, 0x18), FLEXSPI_LUT_SEQ(CADDR_DDR, FLEXSPI_8PAD, 0x10, DUMMY_DDR, FLEXSPI_8PAD, 0x06), FLEXSPI_LUT_SEQ(READ_DDR, FLEXSPI_8PAD, 0x04, STOP, FLEXSPI_1PAD, 0x0), }, @@ -102,10 +101,11 @@ const struct flexspi_nor_config_s g_flash_config = .lookup_table = { /* LUTs */ - /* 0 Fast read Quad IO DTR Mode Operation in SPI Mode (normal read)*/ - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xED, RADDR_DDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_DDR, FLEXSPI_4PAD, 0x0C, READ_DDR, FLEXSPI_4PAD, 0x08), + /* 0 Fast read Quad IO DTR Mode Operation in SPI Mode (normal read) */ + + FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xed, RADDR_DDR, FLEXSPI_4PAD, 0x18), + FLEXSPI_LUT_SEQ(DUMMY_DDR, FLEXSPI_4PAD, 0x0c, READ_DDR, FLEXSPI_4PAD, 0x08), FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), @@ -139,7 +139,7 @@ const struct flexspi_nor_config_s g_flash_config = /* 5 Erase Sector */ - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD7, RADDR_SDR, FLEXSPI_1PAD, 0x18), + FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xd7, RADDR_SDR, FLEXSPI_1PAD, 0x18), FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), @@ -181,11 +181,10 @@ const struct flexspi_nor_config_s g_flash_config = /* 11 Chip Erase */ - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xC7, STOP, FLEXSPI_1PAD, 0x0), + FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xc7, STOP, FLEXSPI_1PAD, 0x0), FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - }, }, diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_flash.h b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_flash.h index f23b51b6769..4e171f30e0e 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_flash.h +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_flash.h @@ -1,5 +1,5 @@ /**************************************************************************** - * config/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_flash.h + * boards/arm/imxrt/imxrt1050-evk/src/imxrt_flexspi_nor_flash.h * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Ivan Ucherdzhiev @@ -138,8 +138,6 @@ FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | \ FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1)) -/* */ - #define NOR_CMD_INDEX_READ CMD_INDEX_READ #define NOR_CMD_INDEX_READSTATUS CMD_INDEX_READSTATUS #define NOR_CMD_INDEX_WRITEENABLE CMD_INDEX_WRITEENABLE @@ -216,7 +214,7 @@ enum flexspi_serial_clkfreq_e FLEXSPI_SERIAL_CLKFREQ_200MHz = 9, }; -/* FlexSPI clock configuration type*/ +/* FlexSPI clock configuration type */ enum flexspi_serial_clockmode_e { @@ -228,7 +226,7 @@ enum flexspi_serial_clockmode_e enum flash_read_sample_clk_e { - FLASH_READ_SAMPLE_CLK_LOOPBACK_INTERNELLY= 0, + FLASH_READ_SAMPLE_CLK_LOOPBACK_INTERNELLY = 0, FLASH_READ_SAMPLE_CLK_LOOPBACK_FROM_DQSPAD = 1, FLASH_READ_SAMPLE_CLK_LOOPBACK_FROM_SCKPAD = 2, FLASH_READ_SAMPLE_CLK_EXTERNALINPUT_FROM_DQSPAD = 3, @@ -301,7 +299,8 @@ struct flexspi_mem_config_s uint8_t cs_setup_time; uint8_t column_address_width; /* [0x00f-0x00f] Column Address with, for * HyperBus protocol, it is fixed to 3, For - * Serial NAND, need to refer to datasheet */ + * Serial NAND, need to refer to datasheet + */ uint8_t device_mode_cfg_enable; uint8_t device_mode_type; uint16_t wait_time_cfg_commands; diff --git a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_spi.c b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_spi.c index 2da19981ef8..4c184993591 100644 --- a/boards/arm/imxrt/imxrt1050-evk/src/imxrt_spi.c +++ b/boards/arm/imxrt/imxrt1050-evk/src/imxrt_spi.c @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * boards/arm/imxrt/imxrt1050-evk/src/imxrt_spi.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. @@ -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 @@ -57,17 +57,18 @@ #if defined(CONFIG_IMXRT_LPSPI1) || defined(CONFIG_IMXRT_LPSPI2) || \ defined(CONFIG_IMXRT_LPSPI3) || defined(CONFIG_IMXRT_LPSPI4) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: imxrt_spidev_initialize * * Description: - * Called to configure SPI chip select GPIO pins for the imxrt1050-evk board. + * Called to configure SPI chip select GPIO pins for the imxrt1050-evk + * board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function imxrt_spidev_initialize(void) { @@ -84,31 +85,34 @@ void weak_function imxrt_spidev_initialize(void) * Name: imxrt_lpspi1/2/3select and imxrt_lpspi1/2/3status * * Description: - * The external functions, imxrt_lpspi1/2/3select and imxrt_lpspi1/2/3status 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 imxrt_lpspibus_initialize()) - * are provided by common STM32 logic. To use this common SPI logic on your - * board: + * The external functions, imxrt_lpspi1/2/3select and imxrt_lpspi1/2/3status + * 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 imxrt_lpspibus_initialize()) are provided by + * common STM32 logic. To use this common SPI logic on your board: * * 1. Provide logic in imxrt_boardinitialize() to configure SPI chip select * pins. - * 2. Provide imxrt_lpspi1/2/3select() and imxrt_lpspi1/2/3status() 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 imxrt_lpspibus_initialize() in your low level application - * initialization logic - * 4. The handle returned by imxrt_lpspibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 2. Provide imxrt_lpspi1/2/3select() and imxrt_lpspi1/2/3status() + * 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 imxrt_lpspibus_initialize() in your low level + * application initialization logic + * 4. The handle returned by imxrt_lpspibus_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_IMXRT_LPSPI1 -void imxrt_lpspi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void imxrt_lpspi1select(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"); imxrt_gpio_write(GPIO_LPSPI1_CS, !selected); } @@ -120,9 +124,11 @@ uint8_t imxrt_lpspi1status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_IMXRT_LPSPI2 -void imxrt_lpspi2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void imxrt_lpspi2select(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"); imxrt_gpio_write(GPIO_LPSPI2_CS, !selected); } @@ -134,9 +140,11 @@ uint8_t imxrt_lpspi2status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_IMXRT_LPSPI3 -void imxrt_lpspi3select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void imxrt_lpspi3select(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"); imxrt_gpio_write(GPIO_LPSPI3_CS, !selected); } @@ -148,9 +156,11 @@ uint8_t imxrt_lpspi3status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_IMXRT_LPSPI4 -void imxrt_lpspi4select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void imxrt_lpspi4select(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"); imxrt_gpio_write(GPIO_LPSPI4_CS, !selected); } @@ -213,5 +223,4 @@ int imxrt_lpspi4cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd) } #endif #endif /* CONFIG_SPI_CMDDATA */ - #endif /* CONFIG_IMXRT_LPSPI1 || CONFIG_IMXRT_LPSPI2 */ diff --git a/boards/arm/imxrt/imxrt1060-evk/README.txt b/boards/arm/imxrt/imxrt1060-evk/README.txt index d0651c12f0e..a4312398f91 100644 --- a/boards/arm/imxrt/imxrt1060-evk/README.txt +++ b/boards/arm/imxrt/imxrt1060-evk/README.txt @@ -33,7 +33,7 @@ README - Ethernet (10/100T) connector - CAN transceivers - Arduino® interface - + o Sensors - FXOS8700CQ 6-Axis Ecompass (3-Axis Mag, 3-Axis Accel) diff --git a/boards/arm/imxrt/imxrt1060-evk/include/board.h b/boards/arm/imxrt/imxrt1060-evk/include/board.h index 81c39bd2d55..a70f047ea31 100644 --- a/boards/arm/imxrt/imxrt1060-evk/include/board.h +++ b/boards/arm/imxrt/imxrt1060-evk/include/board.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * boards/arm/imxrt/imxrt1060/include/board.h * * Copyright (C) 2018-2019 Gregory Nutt. All rights reserved. @@ -33,22 +33,22 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ #ifndef __BOARDS_ARM_IMXRT_IMXRT1060_EVK_INCLUDE_BOARD_H #define __BOARDS_ARM_IMXRT_IMXRT1060_EVK_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ +/* Clocking *****************************************************************/ /* Set VDD_SOC to 1.25V */ @@ -104,9 +104,10 @@ #define BOARD_CPU_FREQUENCY \ (BOARD_XTAL_FREQUENCY * (IMXRT_ARM_PLL_DIV_SELECT / 2)) / IMXRT_ARM_PODF_DIVIDER -/* LED definitions ******************************************************************/ -/* There are four LED status indicators located on the EVK Board. The functions of - * these LEDs include: +/* LED definitions **********************************************************/ + +/* There are four LED status indicators located on the EVK Board. + * The functions of these LEDs include: * * - Main Power Supply(D3) * Green: DC 5V main supply is normal. @@ -135,7 +136,8 @@ * * -------------------- ----------------------------- ------ * SYMBOL Meaning LED - * -------------------- ----------------------------- ------ */ + * -------------------- ----------------------------- ------ + */ #define LED_STARTED 0 /* NuttX has been started OFF */ #define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF */ @@ -152,7 +154,8 @@ * 2Hz, then a fatal error has been detected and the system has halted. */ -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* The IMXRT board has one external user button * * 1. SW8 (IRQ88) GPIO5-00 @@ -163,9 +166,11 @@ #define BUTTON_SW8_BIT (1 << BUTTON_SW8) -/* SDIO *****************************************************************************/ +/* SDIO *********************************************************************/ -/* Pin drive characteristics - drive strength in particular may need tuning for specific boards */ +/* Pin drive characteristics + * drive strength in particular may need tuning for specific boards + */ #define USDHC1_DATAX_IOMUX (IOMUX_SLEW_FAST | IOMUX_DRIVE_130OHM | \ IOMUX_PULL_UP_47K | IOMUX_SCHMITT_TRIGGER) @@ -198,7 +203,7 @@ #define BOARD_USDHC_SD4MODE_PRESCALER USDHC_SYSCTL_SDCLKFS_DIV8 #define BOARD_USDHC_SD4MODE_DIVISOR USDHC_SYSCTL_DVS_DIV(1) -/* ETH Disambiguation ***************************************************************/ +/* ETH Disambiguation *******************************************************/ #define GPIO_ENET_MDIO GPIO_ENET_MDIO_3 #define GPIO_ENET_MDC GPIO_ENET_MDC_3 @@ -207,7 +212,8 @@ #define GPIO_ENET_TX_CLK GPIO_ENET_TX_CLK_1 #define GPIO_ENET_TX_EN GPIO_ENET_TX_EN_1 -/* PIO Disambiguation ***************************************************************/ +/* PIO Disambiguation *******************************************************/ + /* LPUARTs * * Virtual console port provided by OpenSDA: @@ -253,13 +259,13 @@ #define GPIO_LPSPI3_MISO GPIO_LPSPI3_SDI_2 /* GPIO_AD_B0_02 */ #define GPIO_LPSPI3_MOSI GPIO_LPSPI3_SDO_2 /* GPIO_AD_B0_01 */ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ @@ -272,9 +278,9 @@ extern "C" #define EXTERN extern #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ #undef EXTERN #if defined(__cplusplus) diff --git a/boards/arm/imxrt/imxrt1060-evk/kernel/imxrt_userspace.c b/boards/arm/imxrt/imxrt1060-evk/kernel/imxrt_userspace.c index 601fe1f7fb2..b730f66115b 100644 --- a/boards/arm/imxrt/imxrt1060-evk/kernel/imxrt_userspace.c +++ b/boards/arm/imxrt/imxrt1060-evk/kernel/imxrt_userspace.c @@ -50,6 +50,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifndef CONFIG_NUTTX_USERSPACE @@ -64,9 +65,9 @@ * 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 diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_bringup.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_bringup.c index 72c789d3b3c..1c8256e1229 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_bringup.c +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_bringup.c @@ -122,7 +122,7 @@ static int nsh_sdmmc_initialize(void) } } return OK; - } +} #else # define nsh_sdmmc_initialize() (OK) #endif diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_buttons.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_buttons.c index 9c27fe56037..81585ece8c5 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_buttons.c +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_buttons.c @@ -82,9 +82,9 @@ void board_button_initialize(void) { - /* Configure the button as input */ + /* Configure the button as input */ - imxrt_config_gpio(GPIO_SW8); + imxrt_config_gpio(GPIO_SW8); } /**************************************************************************** diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_ethernet.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_ethernet.c index d49d5806c5b..1dbf21a408f 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_ethernet.c +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_ethernet.c @@ -71,6 +71,7 @@ #define IMXRT_ENET_DEVNAME "eth0" /* Debug ********************************************************************/ + /* Extra, in-depth debug output that is only available if * CONFIG_NETDEV_PHY_DEBUG us defined. */ @@ -85,13 +86,13 @@ # define phyinfo(x...) #endif -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: imxrt_enet_phy_enable - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_IMXRT_GPIO1_0_15_IRQ static void imxrt_enet_phy_enable(bool enable) @@ -109,19 +110,21 @@ static void imxrt_enet_phy_enable(bool enable) } #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Function: imxrt_phy_boardinitialize * * Description: - * Some boards require specialized initialization of the PHY before it can be - * used. This may include such things as configuring GPIOs, resetting the PHY, - * etc. If CONFIG_IMXRT_ENET_PHYINIT is defined in the configuration then the - * board specific logic must provide imxrt_phyinitialize(); The i.MX RT Ethernet - * driver will call this function one time before it first uses the PHY. + * Some boards require specialized initialization of the PHY before it can + * be used. This may include such things as configuring GPIOs, resetting + * the PHY, etc. + * If CONFIG_IMXRT_ENET_PHYINIT is defined in the configuration then the + * board specific logic must provide imxrt_phyinitialize(); + * The i.MX RT Ethernet driver will call this function one time before it + * first uses the PHY. * * Input Parameters: * intf - Always zero for now. @@ -129,7 +132,7 @@ static void imxrt_enet_phy_enable(bool enable) * Returned Value: * OK on success; Negated errno on failure. * - ************************************************************************************/ + ****************************************************************************/ int imxrt_phy_boardinitialize(int intf) { diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.c index 24cf020a7fc..5a520db1752 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.c +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.c @@ -61,7 +61,7 @@ const struct boot_data_s g_boot_data = { FLASH_BASE, /* boot start location */ (FLASH_END - FLASH_BASE), /* size */ - PLUGIN_FLAG, /* Plugin flag*/ - 0xFFFFFFFF /* empty - extra data word */ + PLUGIN_FLAG, /* Plugin flag */ + 0xffffffff /* empty - extra data word */ }; diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.h b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.h index 329b4a4832c..a00cb9d5542 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.h +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.h @@ -117,11 +117,11 @@ struct ivt_s uint32_t boot_data; - /* Absolute address of the IVT.*/ + /* Absolute address of the IVT. */ uint32_t self; - /* Absolute address of the image CSF.*/ + /* Absolute address of the image CSF. */ uint32_t csf; diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_flash.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_flash.c index 4ce1341f035..8a09bb736ee 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_flash.c +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_flash.c @@ -34,16 +34,15 @@ * ****************************************************************************/ -/******************************************************************************* +/**************************************************************************** * Included Files - ******************************************************************************/ - + ****************************************************************************/ #include "imxrt_flexspi_nor_flash.h" -/******************************************************************************* +/**************************************************************************** * Public Data - ******************************************************************************/ + ****************************************************************************/ #if defined (CONFIG_IMXRT1060_EVK_HYPER_FLASH) __attribute__((section(".boot_hdr.conf"))) @@ -72,7 +71,7 @@ const struct flexspi_nor_config_s g_flash_config = { /* Read LUTs */ - FLEXSPI_LUT_SEQ(CMD_DDR, FLEXSPI_8PAD, 0xA0, RADDR_DDR, FLEXSPI_8PAD, 0x18), + FLEXSPI_LUT_SEQ(CMD_DDR, FLEXSPI_8PAD, 0xa0, RADDR_DDR, FLEXSPI_8PAD, 0x18), FLEXSPI_LUT_SEQ(CADDR_DDR, FLEXSPI_8PAD, 0x10, DUMMY_DDR, FLEXSPI_8PAD, 0x06), FLEXSPI_LUT_SEQ(READ_DDR, FLEXSPI_8PAD, 0x04, STOP, FLEXSPI_1PAD, 0x0), }, @@ -103,10 +102,11 @@ const struct flexspi_nor_config_s g_flash_config = .lookup_table = { /* LUTs */ - /* 0 Fast read Quad IO DTR Mode Operation in SPI Mode (normal read)*/ - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xED, RADDR_DDR, FLEXSPI_4PAD, 0x18), - FLEXSPI_LUT_SEQ(DUMMY_DDR, FLEXSPI_4PAD, 0x0C, READ_DDR, FLEXSPI_4PAD, 0x08), + /* 0 Fast read Quad IO DTR Mode Operation in SPI Mode (normal read) */ + + FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xed, RADDR_DDR, FLEXSPI_4PAD, 0x18), + FLEXSPI_LUT_SEQ(DUMMY_DDR, FLEXSPI_4PAD, 0x0c, READ_DDR, FLEXSPI_4PAD, 0x08), FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), @@ -140,7 +140,7 @@ const struct flexspi_nor_config_s g_flash_config = /* 5 Erase Sector */ - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD7, RADDR_SDR, FLEXSPI_1PAD, 0x18), + FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xd7, RADDR_SDR, FLEXSPI_1PAD, 0x18), FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), @@ -182,11 +182,10 @@ const struct flexspi_nor_config_s g_flash_config = /* 11 Chip Erase */ - FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xC7, STOP, FLEXSPI_1PAD, 0x0), + FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xc7, STOP, FLEXSPI_1PAD, 0x0), FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), FLEXSPI_LUT_SEQ(STOP, FLEXSPI_1PAD, 0x0, STOP, FLEXSPI_1PAD, 0x0), - }, }, diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_flash.h b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_flash.h index d3b6f99a812..400b06db608 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_flash.h +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_flash.h @@ -217,7 +217,7 @@ enum flexspi_serial_clkfreq_e FLEXSPI_SERIAL_CLKFREQ_200MHz = 9, }; -/* FlexSPI clock configuration type*/ +/* FlexSPI clock configuration type */ enum flexspi_serial_clockmode_e { @@ -229,7 +229,7 @@ enum flexspi_serial_clockmode_e enum flash_read_sample_clk_e { - FLASH_READ_SAMPLE_CLK_LOOPBACK_INTERNELLY= 0, + FLASH_READ_SAMPLE_CLK_LOOPBACK_INTERNELLY = 0, FLASH_READ_SAMPLE_CLK_LOOPBACK_FROM_DQSPAD = 1, FLASH_READ_SAMPLE_CLK_LOOPBACK_FROM_SCKPAD = 2, FLASH_READ_SAMPLE_CLK_EXTERNALINPUT_FROM_DQSPAD = 3, @@ -300,9 +300,11 @@ struct flexspi_mem_config_s uint8_t read_sample_clksrc; uint8_t cs_hold_time; uint8_t cs_setup_time; - uint8_t column_address_width; /* [0x00f-0x00f] Column Address with, for - * HyperBus protocol, it is fixed to 3, For - * Serial NAND, need to refer to datasheet */ + uint8_t column_address_width; /* [0x00f-0x00f] Column Address with, for + * HyperBus protocol, it is fixed to 3, + * For Serial NAND, need to refer to + * datasheet + */ uint8_t device_mode_cfg_enable; uint8_t device_mode_type; uint16_t wait_time_cfg_commands; diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_spi.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_spi.c index ff9b5af9bfc..5c347c46c39 100644 --- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_spi.c +++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_spi.c @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * boards/arm/imxrt/imxrt1060-evk/src/imxrt_spi.c * * Copyright (C) 2018 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 @@ -58,17 +58,18 @@ #if defined(CONFIG_IMXRT_LPSPI1) || defined(CONFIG_IMXRT_LPSPI2) || \ defined(CONFIG_IMXRT_LPSPI3) || defined(CONFIG_IMXRT_LPSPI4) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: imxrt_spidev_initialize * * Description: - * Called to configure SPI chip select GPIO pins for the imxrt1060-evk board. + * Called to configure SPI chip select GPIO pins for the imxrt1060-evk + * board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function imxrt_spidev_initialize(void) { @@ -85,31 +86,35 @@ void weak_function imxrt_spidev_initialize(void) * Name: imxrt_lpspi1/2/3select and imxrt_lpspi1/2/3status * * Description: - * The external functions, imxrt_lpspi1/2/3select and imxrt_lpspi1/2/3status 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 imxrt_lpspibus_initialize()) - * are provided by common STM32 logic. To use this common SPI logic on your - * board: + * The external functions, imxrt_lpspi1/2/3select and imxrt_lpspi1/2/3status + * 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 imxrt_lpspibus_initialize()) + * are provided by common STM32 logic. + * To use this common SPI logic on your board: * * 1. Provide logic in imxrt_boardinitialize() to configure SPI chip select * pins. - * 2. Provide imxrt_lpspi1/2/3select() and imxrt_lpspi1/2/3status() 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 imxrt_lpspibus_initialize() in your low level application - * initialization logic - * 4. The handle returned by imxrt_lpspibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 2. Provide imxrt_lpspi1/2/3select() and imxrt_lpspi1/2/3status() + * 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 imxrt_lpspibus_initialize() in your low level + * application initialization logic + * 4. The handle returned by imxrt_lpspibus_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_IMXRT_LPSPI1 -void imxrt_lpspi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void imxrt_lpspi1select(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"); imxrt_gpio_write(GPIO_LPSPI1_CS, !selected); } @@ -121,9 +126,11 @@ uint8_t imxrt_lpspi1status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_IMXRT_LPSPI2 -void imxrt_lpspi2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void imxrt_lpspi2select(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"); imxrt_gpio_write(GPIO_LPSPI2_CS, !selected); } @@ -135,9 +142,11 @@ uint8_t imxrt_lpspi2status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_IMXRT_LPSPI3 -void imxrt_lpspi3select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void imxrt_lpspi3select(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"); imxrt_gpio_write(GPIO_LPSPI3_CS, !selected); } @@ -149,9 +158,11 @@ uint8_t imxrt_lpspi3status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_IMXRT_LPSPI4 -void imxrt_lpspi4select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void imxrt_lpspi4select(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"); imxrt_gpio_write(GPIO_LPSPI4_CS, !selected); } diff --git a/boards/arm/kinetis/freedom-k28f/include/board.h b/boards/arm/kinetis/freedom-k28f/include/board.h index 211ca07c876..6f43b712301 100644 --- a/boards/arm/kinetis/freedom-k28f/include/board.h +++ b/boards/arm/kinetis/freedom-k28f/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k28f/include/board.h +/**************************************************************************** + * boards/arm/kinetis/freedom-k28f/include/board.h * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,14 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_FREEDOM_K28F_INCLUDE_BOARD_H -#define __BOARDS_ARM_FREEDOM_K28F_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_KINETIS_FREEDOM_K28F_INCLUDE_BOARD_H +#define __BOARDS_ARM_KINETIS_FREEDOM_K28F_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,16 +49,18 @@ # include #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ -/* The Freedom K28F uses a 12MHz external Oscillator. The Kinetis MCU startup from an - * internal digitally-controlled oscillator (DCO). Nuttx will enable the main external - * oscillator (EXTAL0/XTAL0). The external oscillator/resonator can range from - * 32.768 KHz up to 50 MHz. The default external source for the MCG oscillator inputs - * is 12 MHz oscillator +/* Clocking *****************************************************************/ + +/* The Freedom K28F uses a 12MHz external Oscillator. + * The Kinetis MCU startup from an internal digitally-controlled oscillator + * (DCO). Nuttx will enable the main external oscillator (EXTAL0/XTAL0). + * The external oscillator/resonator can range from 32.768 KHz up to 50 MHz. + * The default external source for the MCG oscillator inputs is 12 MHz + * oscillator * * X501 a High-frequency, low-power Xtal */ @@ -67,21 +69,22 @@ #define BOARD_EXTAL_FREQ 12000000 /* 12MHz Oscillator */ #define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator */ -/* PLL Configuration. Either the external clock or crystal frequency is used to - * select the PRDIV value. Only reference clock frequencies are supported that will - * produce a KINETIS_MCG_PLL_REF_MIN >= PLLIN <=KINETIS_MCG_PLL_REF_MAX reference - * clock to the PLL. - * - * PLL Input frequency: PLLIN = REFCLK / PRDIV = 12 MHz / 1 = 12 MHz - * PLL Output frequency: PLLOUT = PLLIN * VDIV = 12 MHz * 25 = 300 MHz - * MCG Frequency: PLLOUT = 150 MHz = 300 MHz / KINETIS_MCG_PLL_INTERNAL_DIVBY +/* PLL Configuration. + * Either the external clock or crystal frequency is used to select the + * PRDIV value. Only reference clock frequencies are supported that will + * produce a KINETIS_MCG_PLL_REF_MIN >= PLLIN <=KINETIS_MCG_PLL_REF_MAX + * reference clock to the PLL. * + * PLL Input frequency: PLLIN = REFCLK / PRDIV = 12 MHz / 1 = 12 MHz + * PLL Output frequency: PLLOUT = PLLIN * VDIV = 12 MHz * 25 = 300 MHz + * MCG Frequency: PLLOUT = 150 MHz = 300 MHz / + * KINETIS_MCG_PLL_INTERNAL_DIVBY * PRDIV register value is the divider minus KINETIS_MCG_C5_PRDIV_BASE. * VDIV register value is offset by KINETIS_MCG_C6_VDIV_BASE. */ -#define BOARD_PRDIV 1 /* PLL External Reference Divider */ -#define BOARD_VDIV 25 /* PLL VCO Divider (frequency multiplier) */ +#define BOARD_PRDIV 1 /* PLL External Reference Divider */ +#define BOARD_VDIV 25 /* PLL VCO Divider (frequency multiplier) */ /* Define additional MCG_C2 Setting */ @@ -144,36 +147,46 @@ #define BOARD_TPM_CLKSRC SIM_SOPT2_TPMSRC_MCGCLK #define BOARD_TPM_FREQ BOARD_SIM_CLKDIV3_FREQ -/* 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. Possible values for prescaler and divisor are: + * The SDHC module is always configure configured so that the core clock is + * the baseclock. + * Possible values for prescaler and divisor are: * * SDCLKFS: {2, 4, 8, 16, 32, 63, 128, 256} * DVS: {1..16} */ -/* Identification mode: Optimal 400KHz, Actual 180MHz / (32 * 15) = 375 Khz */ +/* Identification mode: + * Optimal 400KHz, Actual 180MHz / (32 * 15) = 375 Khz + */ #define BOARD_SDHC_IDMODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV32 #define BOARD_SDHC_IDMODE_DIVISOR SDHC_SYSCTL_DVS_DIV(15) -/* MMC normal mode: Optimal 20MHz, Actual 180MHz / (2 * 5) = 18 MHz */ +/* MMC normal mode: + * Optimal 20MHz, Actual 180MHz / (2 * 5) = 18 MHz + */ #define BOARD_SDHC_MMCMODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 #define BOARD_SDHC_MMCMODE_DIVISOR SDHC_SYSCTL_DVS_DIV(5) -/* SD normal mode (1-bit): Optimal 20MHz, Actual 180MHz / (2 * 5) = 18 MHz */ +/* SD normal mode (1-bit): + * Optimal 20MHz, Actual 180MHz / (2 * 5) = 18 MHz + */ #define BOARD_SDHC_SD1MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 #define BOARD_SDHC_SD1MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(5) -/* SD normal mode (4-bit): Optimal 25MHz, Actual 180MHz / (2 * 4) = 22.5 MHz (with DMA) - * SD normal mode (4-bit): Optimal 20MHz, Actual 180MHz / (2 * 4) = 22.5 MHz (no DMA) +/* SD normal mode (4-bit): + * Optimal 25MHz, Actual 180MHz / (2 * 4) = 22.5 MHz (with DMA) + * SD normal mode (4-bit): + * Optimal 20MHz, Actual 180MHz / (2 * 4) = 22.5 MHz (no DMA) */ #ifdef CONFIG_SDIO_DMA @@ -194,6 +207,7 @@ #define BOARD_USB_FLASHACCESS /* PWM Configuration */ + /* FTM0 Channels */ #define GPIO_FTM0_CH0OUT PIN_FTM0_CH0_2 /* Pin 22: PTC1 */ @@ -215,9 +229,10 @@ #define GPIO_FTM2_CH0OUT PIN_FTM2_CH0 /* Pin 25: PTB18 */ #define GPIO_FTM2_CH1OUT PIN_FTM2_CH1 /* Pin 32: PTB19 */ -/* LED definitions ******************************************************************/ -/* A single LED is available driven by PTC5. The LED is grounded so bringing PTC5 - * high will illuminate the LED. +/* LED definitions **********************************************************/ + +/* A single LED is available driven by PTC5. The LED is grounded so bringing + * PTC5 high will illuminate the LED. */ /* LED index values for use with board_userled() */ @@ -230,10 +245,11 @@ #define BOARD_LED_BIT (1 << BOARD_LED) /* When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will - * control the LED as defined below. Thus if the LED is statically on, NuttX has - * successfully booted and is, apparently, running normally. If the LED is - * flashing at approximately 2Hz, then a fatal error has been detected and the - * system has halted. + * control the LED as defined below. + * Thus if the LED is statically on, NuttX has successfully booted and is, + * apparently, running normally. + * If the LED is flashing at approximately 2Hz, then a fatal error has been + * detected and the system has halted. */ #define LED_STARTED 0 /* STATUS LED=OFF */ @@ -245,10 +261,12 @@ #define LED_ASSERTION 3 /* STATUS LED=no change */ #define LED_PANIC 3 /* STATUS LED=flashing */ -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* The freedom-k28f board has no standard GPIO contact buttons */ -/* Alternative pin resolution *******************************************************/ +/* Alternative pin resolution ***********************************************/ + /* The Freedom K28F has five LPUARTs with pin availability as follows: * * ----- --------------- ------------------------------- @@ -397,7 +415,8 @@ #endif #endif -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* The Freedom K28F has a single RGB LED driven by the K28F as follows: * * LED K28 @@ -406,8 +425,8 @@ * BLUE PTE7 * GREEN PTE8 * - * 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. */ /* LED index values for use with board_userled() */ @@ -429,7 +448,9 @@ * * SYMBOL Meaning LED state * RED GREEN BLUE - * ------------------- ---------------------------- ----------------- */ + * ------------------- ---------------------------- ----------------- + */ + #define LED_STARTED 1 /* NuttX has been started OFF OFF OFF */ #define LED_HEAPALLOCATE 2 /* Heap has been allocated OFF OFF ON */ #define LED_IRQSENABLED 0 /* Interrupts enabled OFF OFF ON */ @@ -440,14 +461,15 @@ #define LED_PANIC 4 /* The system has crashed FLASH OFF OFF */ #undef LED_IDLE /* K28 is in sleep mode (Not used) */ -/* Button definitions ***************************************************************/ -/* Two push buttons, SW2 and SW3, are available on FRDM-K28F board, where SW2 is - * connected to PTA4 and SW3 is connected to PTD0. Besides the general purpose - * input/output functions, SW2 and SW3 can be low-power wake up signal. Also, only - * SW3 can be a non-maskable interrupt. +/* Button definitions *******************************************************/ + +/* Two push buttons, SW2 and SW3, are available on FRDM-K28F board, + * where SW2 is connected to PTA4 and SW3 is connected to PTD0. + * Besides the general purpose input/output functions, SW2 and SW3 can be + * low-power wake up signal. Also, only SW3 can be a non-maskable interrupt. * * Switch GPIO Function - * --------- --------------------------------------------------------------- + * --------- -------------------------------------------------------------- * SW2 PTA4/NMI_B * SW3 PTA4/NMI_B */ @@ -459,4 +481,4 @@ #define BUTTON_SW2_BIT (1 << BUTTON_SW2) #define BUTTON_SW3_BIT (1 << BUTTON_SW3) -#endif /* __BOARDS_ARM_FREEDOM_K28F_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_KINETIS_FREEDOM_K28F_INCLUDE_BOARD_H */ diff --git a/boards/arm/kinetis/freedom-k28f/scripts/Make.defs b/boards/arm/kinetis/freedom-k28f/scripts/Make.defs index 7518f112de5..b73e5783ff4 100644 --- a/boards/arm/kinetis/freedom-k28f/scripts/Make.defs +++ b/boards/arm/kinetis/freedom-k28f/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/freedom-k28f/scripts/Make.defs +# boards/arm/kinetis/freedom-k28f/scripts/Make.defs # # Copyright (C) 2018 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k28f/scripts/flash.ld b/boards/arm/kinetis/freedom-k28f/scripts/flash.ld index b0838927223..8bf38fa889d 100644 --- a/boards/arm/kinetis/freedom-k28f/scripts/flash.ld +++ b/boards/arm/kinetis/freedom-k28f/scripts/flash.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k28f/scripts/flash.ld + * boards/arm/kinetis/freedom-k28f/scripts/flash.ld * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k28f/src/Makefile b/boards/arm/kinetis/freedom-k28f/src/Makefile index ee04fff4e30..c2c6c0f8ff9 100644 --- a/boards/arm/kinetis/freedom-k28f/src/Makefile +++ b/boards/arm/kinetis/freedom-k28f/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/freedom-k28f/src/Makefile +# boards/arm/kinetis/freedom-k28f/src/Makefile # # Copyright (C) 2018 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k28f/src/freedom-k28f.h b/boards/arm/kinetis/freedom-k28f/src/freedom-k28f.h index 9a0548aaebf..0554a433104 100644 --- a/boards/arm/kinetis/freedom-k28f/src/freedom-k28f.h +++ b/boards/arm/kinetis/freedom-k28f/src/freedom-k28f.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k28f/src/freedom-k28f.h + * boards/arm/kinetis/freedom-k28f/src/freedom-k28f.h * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_FREEDOM_K28F_SRC_FREEDOM_K28F_H -#define __BOARDS_ARM_FREEDOM_K28F_SRC_FREEDOM_K28F_H +#ifndef __BOARDS_ARM_KINETIS_FREEDOM_K28F_SRC_FREEDOM_K28F_H +#define __BOARDS_ARM_KINETIS_FREEDOM_K28F_SRC_FREEDOM_K28F_H /**************************************************************************** * Included Files @@ -48,6 +48,7 @@ ****************************************************************************/ /* Freedom-K28F GPIOs *******************************************************/ + /* An RGB LED is connected through GPIO as shown below: * * LED K28 @@ -61,10 +62,11 @@ #define GPIO_LED_G (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTE | PIN7) #define GPIO_LED_B (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTE | PIN8) -/* Two push buttons, SW2 and SW3, are available on FRDM-K28F board, where SW2 is - * connected to PTA4 and SW3 is connected to PTD0. Besides the general purpose - * input/output functions, SW2 and SW3 can be low-power wake up signal. Also, only - * SW3 can be a non-maskable interrupt. +/* Two push buttons, SW2 and SW3, are available on FRDM-K28F board, where SW2 + * is connected to PTA4 and SW3 is connected to PTD0. + * Besides the general purpose input/output functions, SW2 and SW3 can be + * low-power wake up signal. + * Also, only SW3 can be a non-maskable interrupt. * * Switch GPIO Function * --------- --------------------------------------------------------------- diff --git a/boards/arm/kinetis/freedom-k28f/src/k28_appinit.c b/boards/arm/kinetis/freedom-k28f/src/k28_appinit.c index bd4722644f1..f014b00e474 100644 --- a/boards/arm/kinetis/freedom-k28f/src/k28_appinit.c +++ b/boards/arm/kinetis/freedom-k28f/src/k28_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/freedom-k28f/src/k28_appinit.c + * boards/arm/kinetis/freedom-k28f/src/k28_appinit.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k28f/src/k28_autoleds.c b/boards/arm/kinetis/freedom-k28f/src/k28_autoleds.c index fcdf959fef3..d34a4d5a7e6 100644 --- a/boards/arm/kinetis/freedom-k28f/src/k28_autoleds.c +++ b/boards/arm/kinetis/freedom-k28f/src/k28_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k28f/src/k28_autoleds.c + * boards/arm/kinetis/freedom-k28f/src/k28_autoleds.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k28f/src/k28_boot.c b/boards/arm/kinetis/freedom-k28f/src/k28_boot.c index cb44c5938c5..fa9b73075e8 100644 --- a/boards/arm/kinetis/freedom-k28f/src/k28_boot.c +++ b/boards/arm/kinetis/freedom-k28f/src/k28_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k28f/src/k28_boot.c +/**************************************************************************** + * boards/arm/kinetis/freedom-k28f/src/k28_boot.c * * Copyright (C) 2018 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 @@ -46,25 +46,26 @@ #include "freedom-k28f.h" -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_boardinitialize * * Description: - * All Kinetis 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 Kinetis 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 kinetis_boardinitialize(void) { #if defined(CONFIG_KINETIS_SPI1) || defined(CONFIG_KINETIS_SPI2) - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * k28_spidev_initialize() has been brought into the link. + /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak + * function k28_spidev_initialize() has been brought into the link. */ if (k28_spidev_initialize) diff --git a/boards/arm/kinetis/freedom-k28f/src/k28_bringup.c b/boards/arm/kinetis/freedom-k28f/src/k28_bringup.c index a3326792038..f4c96c81ffb 100644 --- a/boards/arm/kinetis/freedom-k28f/src/k28_bringup.c +++ b/boards/arm/kinetis/freedom-k28f/src/k28_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/freedom-k28f/src/k28_bringup.c + * boards/arm/kinetis/freedom-k28f/src/k28_bringup.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k28f/src/k28_i2c.c b/boards/arm/kinetis/freedom-k28f/src/k28_i2c.c index d0b03f15aee..20019823957 100644 --- a/boards/arm/kinetis/freedom-k28f/src/k28_i2c.c +++ b/boards/arm/kinetis/freedom-k28f/src/k28_i2c.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k28f/src/k28_i2c.c + * boards/arm/kinetis/freedom-k28f/src/k28_i2c.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,9 +33,9 @@ * ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -55,9 +55,9 @@ #if defined(CONFIG_KINETIS_I2C0) || defined(CONFIG_KINETIS_I2C1) -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_KINETIS_I2C0 FAR struct i2c_master_s* g_i2c0_dev; @@ -66,17 +66,17 @@ FAR struct i2c_master_s* g_i2c0_dev; FAR struct i2c_master_s* g_i2c1_dev; #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k28_i2cdev_initialize * * Description: * Called to configure I2C * - ************************************************************************************/ + ****************************************************************************/ void k28_i2cdev_initialize(void) { @@ -86,7 +86,8 @@ void k28_i2cdev_initialize(void) g_i2c0_dev = kinetis_i2cbus_initialize(0); if (g_i2c0_dev == NULL) { - syslog(LOG_ERR, "ERROR: kinetis_i2cbus_initialize(0) failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: kinetis_i2cbus_initialize(0) failed: %d\n", + ret); ret = -ENODEV; } else @@ -101,7 +102,8 @@ void k28_i2cdev_initialize(void) g_i2c1_dev = kinetis_i2cbus_initialize(1); if (g_i2c1_dev == NULL) { - syslog(LOG_ERR, "ERROR: kinetis_i2cbus_initialize(1) failed: %d\n", ret); + syslog(LOG_ERR, "ERROR: kinetis_i2cbus_initialize(1) failed: %d\n", + ret); ret = -ENODEV; } else diff --git a/boards/arm/kinetis/freedom-k28f/src/k28_pwm.c b/boards/arm/kinetis/freedom-k28f/src/k28_pwm.c index db551ac3e46..1f0740c472d 100644 --- a/boards/arm/kinetis/freedom-k28f/src/k28_pwm.c +++ b/boards/arm/kinetis/freedom-k28f/src/k28_pwm.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k28f/src/k28_pwm.c +/**************************************************************************** + * boards/arm/kinetis/freedom-k28f/src/k28_pwm.c * * Copyright (C) 2018 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,17 +54,17 @@ #ifdef CONFIG_PWM -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k28_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ int k28_pwm_setup(void) { @@ -77,7 +77,9 @@ int k28_pwm_setup(void) if (!initialized) { #ifdef CONFIG_KINETIS_FTM0_PWM - /* Call kinetis_pwminitialize() to get an instance of the PWM interface */ + /* Call kinetis_pwminitialize() + * to get an instance of the PWM interface + */ pwm = kinetis_pwminitialize(0); if (!pwm) diff --git a/boards/arm/kinetis/freedom-k28f/src/k28_spi.c b/boards/arm/kinetis/freedom-k28f/src/k28_spi.c index 3c30e5187c6..5fe8467a222 100644 --- a/boards/arm/kinetis/freedom-k28f/src/k28_spi.c +++ b/boards/arm/kinetis/freedom-k28f/src/k28_spi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k28f/src/k28_spi.c +/**************************************************************************** + * boards/arm/kinetis/freedom-k28f/src/k28_spi.c * * Copyright (C) 2018 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 @@ -55,52 +55,56 @@ #if defined(CONFIG_KINETIS_SPI0) || defined(CONFIG_KINETIS_SPI1) || \ defined(CONFIG_KINETIS_SPI2) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k28_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the KwikStik-K40 board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function k28_spidev_initialize(void) { # warning "Missing logic" } -/************************************************************************************ +/**************************************************************************** * Name: kinetis_spi0/1/2select and kinetis_spi0/1/2status * * Description: - * The external functions, kinetis_spi0/1/2select and kinetis_spi0/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 kinetis_spibus_initialize()) - * are provided by common Kinetis logic. To use this common SPI logic on your - * board: + * The external functions, kinetis_spi0/1/2select and kinetis_spi0/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 kinetis_spibus_initialize()) + * are provided by common Kinetis logic. + * To use this common SPI logic on your board: * - * 1. Provide logic in kinetis_boardinitialize() to configure SPI chip select - * pins. - * 2. Provide kinetis_spi0/1/2select() and kinetis_spi0/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 kinetis_spibus_initialize() in your low level application - * initialization logic - * 4. The handle returned by kinetis_spibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 1. Provide logic in kinetis_boardinitialize() to configure SPI chip + * select pins. + * 2. Provide kinetis_spi0/1/2select() and kinetis_spi0/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 kinetis_spibus_initialize() in your low level + * application initialization logic + * 4. The handle returned by kinetis_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). * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_KINETIS_SPI0 -void kinetis_spi0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi0select(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"); # warning "Missing logic" } @@ -112,9 +116,11 @@ uint8_t kinetis_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_KINETIS_SPI1 -void kinetis_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi1select(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"); # warning "Missing logic" } @@ -126,9 +132,11 @@ uint8_t kinetis_spi1status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_KINETIS_SPI2 -void kinetis_spi2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi2select(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"); # warning "Missing logic" } diff --git a/boards/arm/kinetis/freedom-k28f/src/k28_usbdev.c b/boards/arm/kinetis/freedom-k28f/src/k28_usbdev.c index 0d85148f2f3..712cbb05eeb 100644 --- a/boards/arm/kinetis/freedom-k28f/src/k28_usbdev.c +++ b/boards/arm/kinetis/freedom-k28f/src/k28_usbdev.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k28f/src/k28_usbdev.c +/**************************************************************************** + * boards/arm/kinetis/freedom-k28f/src/k28_usbdev.c * * Copyright (C) 2018 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,40 +53,41 @@ #include "hardware/kinetis_sim.h" #include "freedom-k28f.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #define khci_getreg(addr) getreg8(addr) #define khci_putreg(val,addr) putreg8(val,addr) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k28_usbdev_initialize * * Description: * Called to setup USB-related GPIO pins for the KwikStik-K40 board. * - ************************************************************************************/ + ****************************************************************************/ void k28_usbdev_initialize(void) { } -/************************************************************************************ +/**************************************************************************** * Name: kinetis_usbpullup * * Description: - * If USB is supported and the board supports a pullup via GPIO (for USB software - * connect and disconnect), then the board software must provide kinetis_pullup. - * See include/nuttx/usb/usbdev.h for additional description of this method. - * Alternatively, if no pull-up GPIO the following EXTERN can be redefined to be - * NULL. + * If USB is supported and the board supports a pullup via GPIO (for USB + * software connect and disconnect), then the board software must provide + * kinetis_pullup. See include/nuttx/usb/usbdev.h for additional description + * of this method. + * Alternatively, if no pull-up GPIO the following EXTERN can be redefined + * to be NULL. * - ************************************************************************************/ + ****************************************************************************/ int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable) { @@ -101,7 +102,7 @@ int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable) } else { - khci_putreg(0,KINETIS_USB0_CONTROL); + khci_putreg(0, KINETIS_USB0_CONTROL); } #if 0 @@ -116,22 +117,23 @@ int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable) regval &= ~(1 << 2); } - khci_putreg(regval,KINETIS_USB0_OTGCTL); + khci_putreg(regval, KINETIS_USB0_OTGCTL); #endif return OK; } -/************************************************************************************ +/***************************************************************************** * Name: kinetis_usbsuspend * * Description: - * Board logic must provide the kinetis_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the kinetis_usbsuspend logic if the USBDEV + * driver is used. + * This function is called whenever the USB enters or leaves suspend mode. + * This is an opportunity for the board logic to shutdown clocks, power, + * etc. while the USB is suspended. * - ************************************************************************************/ + ****************************************************************************/ void kinetis_usbsuspend(FAR struct usbdev_s *dev, bool resume) { diff --git a/boards/arm/kinetis/freedom-k28f/src/k28_userleds.c b/boards/arm/kinetis/freedom-k28f/src/k28_userleds.c index 849e73dd150..e890c18f24c 100644 --- a/boards/arm/kinetis/freedom-k28f/src/k28_userleds.c +++ b/boards/arm/kinetis/freedom-k28f/src/k28_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k28f/src/kinetis_userleds.c + * boards/arm/kinetis/freedom-k28f/src/kinetis_userleds.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k64f/include/board.h b/boards/arm/kinetis/freedom-k64f/include/board.h index 3e04242f93a..a0c6f08f1db 100644 --- a/boards/arm/kinetis/freedom-k64f/include/board.h +++ b/boards/arm/kinetis/freedom-k64f/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k64f/include/board.h +/**************************************************************************** + * boards/arm/kinetis/freedom-k64f/include/board.h * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,14 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_FREEDOM_K64F_INCLUDE_BOARD_H -#define __BOARDS_ARM_FREEDOM_K64F_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_KINETIS_FREEDOM_K64F_INCLUDE_BOARD_H +#define __BOARDS_ARM_KINETIS_FREEDOM_K64F_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -46,26 +46,28 @@ # include #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ -/* The Freedom K64F uses a 50MHz external clock from the Micrel Ethernet PHY. The - * Kinetis MCU startup from an internal digitally-controlled oscillator (DCO). Nuttx - * will enable the main external oscillator (EXTAL0/XTAL0). The external - * oscillator/resonator can range from 32.768 KHz up to 50 MHz. The default external - * source for the MCG oscillator inputs (EXTAL) is 50 MHz clock source from Micrel - * Ethernet PHY. +/* Clocking *****************************************************************/ + +/* The Freedom K64F uses a 50MHz external clock from the Micrel Ethernet PHY. + * The Kinetis MCU startup from an internal digitally-controlled oscillator + * (DCO). Nuttx will enable the main external oscillator (EXTAL0/XTAL0). + * The external oscillator/resonator can range from 32.768 KHz up to 50 MHz. + * The default external source for the MCG oscillator inputs (EXTAL) is + * 50 MHz clock source from Micrel Ethernet PHY. */ -#define BOARD_EXTCLOCK 1 /* External clock */ -#define BOARD_EXTAL_FREQ 50000000 /* 50MHz Oscillator from Micrel PHY */ -#define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator */ +#define BOARD_EXTCLOCK 1 /* External clock */ +#define BOARD_EXTAL_FREQ 50000000 /* 50MHz Oscillator from Micrel PHY */ +#define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator */ -/* PLL Configuration. Either the external clock or crystal frequency is used to - * select the PRDIV value. Only reference clock frequencies are supported that will - * produce a KINETIS_MCG_PLL_REF_MIN >= PLLIN <= KINETIS_MCG_PLL_REF_MIN reference +/* PLL Configuration. Either the external clock or crystal frequency is used + * to select the PRDIV value. + * Only reference clock frequencies are supported that will produce + * a KINETIS_MCG_PLL_REF_MIN >= PLLIN <= KINETIS_MCG_PLL_REF_MIN reference * clock to the PLL. * * PLL Input frequency: PLLIN = REFCLK / PRDIV = 50 Mhz / 20 = 2.5 MHz @@ -76,8 +78,8 @@ * VDIV register value is offset by KINETIS_MCG_C6_VDIV_BASE. */ -#define BOARD_PRDIV 20 /* PLL External Reference Divider */ -#define BOARD_VDIV 48 /* PLL VCO Divider (frequency multiplier) */ +#define BOARD_PRDIV 20 /* PLL External Reference Divider */ +#define BOARD_VDIV 48 /* PLL VCO Divider (frequency multiplier) */ #define BOARD_PLLIN_FREQ (BOARD_EXTAL_FREQ / BOARD_PRDIV) #define BOARD_PLLOUT_FREQ (BOARD_PLLIN_FREQ * BOARD_VDIV) @@ -100,36 +102,46 @@ #define BOARD_FLEXBUS_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV3) #define BOARD_FLASHCLK_FREQ (BOARD_MCG_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. Possible values for presscaler and divisor are: + * The SDHC module is always configure configured so that the core clock is + * the base clock. + * Possible values for presscaler and divisor are: * * SDCLKFS: {2, 4, 8, 16, 32, 63, 128, 256} * DVS: {1..16} */ -/* Identification mode: Optimal 400KHz, Actual 120MHz / (32 * 10) = 375 Khz */ +/* Identification mode: + * Optimal 400KHz, Actual 120MHz / (32 * 10) = 375 Khz + */ #define BOARD_SDHC_IDMODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV32 #define BOARD_SDHC_IDMODE_DIVISOR SDHC_SYSCTL_DVS_DIV(10) -/* MMC normal mode: Optimal 20MHz, Actual 120MHz / (2 * 3) = 20 MHz */ +/* MMC normal mode: + * Optimal 20MHz, Actual 120MHz / (2 * 3) = 20 MHz + */ #define BOARD_SDHC_MMCMODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 #define BOARD_SDHC_MMCMODE_DIVISOR SDHC_SYSCTL_DVS_DIV(3) -/* SD normal mode (1-bit): Optimal 20MHz, Actual 120MHz / (2 * 3) = 20 MHz */ +/* SD normal mode (1-bit): + * Optimal 20MHz, Actual 120MHz / (2 * 3) = 20 MHz + */ #define BOARD_SDHC_SD1MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 #define BOARD_SDHC_SD1MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(3) -/* SD normal mode (4-bit): Optimal 25MHz, Actual 120MHz / (2 * 3) = 20 MHz (with DMA) - * SD normal mode (4-bit): Optimal 20MHz, Actual 120MHz / (2 * 3) = 20 MHz (no DMA) +/* SD normal mode (4-bit): + * Optimal 25MHz, Actual 120MHz / (2 * 3) = 20 MHz (with DMA) + * SD normal mode (4-bit): + * Optimal 20MHz, Actual 120MHz / (2 * 3) = 20 MHz (no DMA) */ #ifdef CONFIG_SDIO_DMA @@ -141,7 +153,9 @@ #endif /* PWM Configuration */ + /* FTM0 Channels */ + /* Channels can be modified using kinetis_k64pinmux.h */ #define GPIO_FTM0_CH0OUT PIN_FTM0_CH0_1 @@ -151,7 +165,8 @@ #define GPIO_FTM0_CH4OUT PIN_FTM0_CH4_1 #define GPIO_FTM0_CH5OUT PIN_FTM0_CH5_1 -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* The Freedom K64F has a single RGB LED driven by the K64F as follows: * * LED K64 @@ -160,8 +175,9 @@ * BLUE PTB21/SPI2_SCK/FB_AD30/CMP1_OUT * GREEN PTE26/ENET_1588_CLKIN/UART4_CTS_b/RTC_CLKOUT/USB0_CLKIN * - * 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. */ /* LED index values for use with board_userled() */ @@ -183,7 +199,8 @@ * * SYMBOL Meaning LED state * RED GREEN BLUE - * ------------------- ---------------------------- ----------------- */ + * ------------------- ---------------------------- ----------------- + */ #define LED_STARTED 1 /* NuttX has been started OFF OFF OFF */ #define LED_HEAPALLOCATE 2 /* Heap has been allocated OFF OFF ON */ #define LED_IRQSENABLED 0 /* Interrupts enabled OFF OFF ON */ @@ -194,11 +211,12 @@ #define LED_PANIC 4 /* The system has crashed FLASH OFF OFF */ #undef LED_IDLE /* K64 is in sleep mode (Not used) */ -/* Button definitions ***************************************************************/ -/* Two push buttons, SW2 and SW3, are available on FRDM-K64F board, where SW2 is - * connected to PTC6 and SW3 is connected to PTA4. Besides the general purpose - * input/output functions, SW2 and SW3 can be low-power wake up signal. Also, only - * SW3 can be a non-maskable interrupt. +/* Button definitions *******************************************************/ + +/* Two push buttons, SW2 and SW3, are available on FRDM-K64F board, + * where SW2 is connected to PTC6 and SW3 is connected to PTA4. + * Besides the general purpose input/output functions, SW2 and SW3 can be + * low-power wake up signal. Also, only SW3 can be a non-maskable interrupt. * * Switch GPIO Function * --------- --------------------------------------------------------------- @@ -212,15 +230,17 @@ #define BUTTON_SW2_BIT (1 << BUTTON_SW2) #define BUTTON_SW3_BIT (1 << BUTTON_SW3) -/* Alternative pin resolution *******************************************************/ +/* Alternative pin resolution ***********************************************/ + /* If there are alternative configurations for various pins in the - * kinetis_k64pinmux.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. + * kinetis_k64pinmux.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. */ -/* The primary serial port interface signals are PTB16 UART0_RX and PTB17 UART0_TX. +/* The primary serial port interface signals are PTB16 UART0_RX and + * PTB17 UART0_TX. * These signals are connected to the OpenSDAv2 circuit. */ diff --git a/boards/arm/kinetis/freedom-k64f/scripts/Make.defs b/boards/arm/kinetis/freedom-k64f/scripts/Make.defs index 952897d53af..5f4d87cd9e9 100644 --- a/boards/arm/kinetis/freedom-k64f/scripts/Make.defs +++ b/boards/arm/kinetis/freedom-k64f/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/freedom-k64f/scripts/Make.defs +# boards/arm/kinetis/freedom-k64f/scripts/Make.defs # # Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k64f/scripts/flash.ld b/boards/arm/kinetis/freedom-k64f/scripts/flash.ld index d58489b2a4f..3b4d05ebe53 100644 --- a/boards/arm/kinetis/freedom-k64f/scripts/flash.ld +++ b/boards/arm/kinetis/freedom-k64f/scripts/flash.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k64f/scripts/flash.ld + * boards/arm/kinetis/freedom-k64f/scripts/flash.ld * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k64f/src/Makefile b/boards/arm/kinetis/freedom-k64f/src/Makefile index 12cfe22935f..e7a442539b7 100644 --- a/boards/arm/kinetis/freedom-k64f/src/Makefile +++ b/boards/arm/kinetis/freedom-k64f/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/freedom-k64f/src/Makefile +# boards/arm/kinetis/freedom-k64f/src/Makefile # # Copyright (C) 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k64f/src/freedom-k64f.h b/boards/arm/kinetis/freedom-k64f/src/freedom-k64f.h index fdb58fdeac9..07e1dfd04d4 100644 --- a/boards/arm/kinetis/freedom-k64f/src/freedom-k64f.h +++ b/boards/arm/kinetis/freedom-k64f/src/freedom-k64f.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k64f/src/freedom-k64f.h +/**************************************************************************** + * boards/arm/kinetis/freedom-k64f/src/freedom-k64f.h * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -32,25 +32,25 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_FREEDOM_K64F_SRC_FREEDOM_K64F_H -#define __BOARDS_ARM_FREEDOM_K64F_SRC_FREEDOM_K64F_H +#ifndef __BOARDS_ARM_KINETIS_FREEDOM_K64F_SRC_FREEDOM_K64F_H +#define __BOARDS_ARM_KINETIS_FREEDOM_K64F_SRC_FREEDOM_K64F_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Application Configuration ********************************************************/ +/* Application Configuration ************************************************/ /* Assume we have everything */ @@ -84,8 +84,8 @@ #define MMCSD_SLOTNO 0 -/* Can't support MMC/SD features if mountpoints are disabled or if SDHC support - * is not enabled. +/* Can't support MMC/SD features if mountpoints are disabled or if SDHC + * support is not enabled. */ #if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_KINETIS_SDHC) @@ -169,11 +169,13 @@ # undef CONFIG_KINETIS_SPI2 #endif -/* FREEDOM-K64F GPIOs ****************************************************************/ -/* A micro Secure Digital (SD) card slot is available on the FRDM-K64F connected to - * the SD Host Controller (SDHC) signals of the MCU. This slot will accept micro - * format SD memory cards. The SD card detect pin (PTE6) is an open switch that - * shorts with VDD when card is inserted. +/* FREEDOM-K64F GPIOs *******************************************************/ + +/* A micro Secure Digital (SD) card slot is available on the FRDM-K64F + * connected to the SD Host Controller (SDHC) signals of the MCU. + * This slot will accept micro format SD memory cards. + * The SD card detect pin (PTE6) is an open switch that shorts with VDD when + * card is inserted. * * ------------ ------------- -------- * SD Card Slot Board Signal K64F Pin @@ -192,13 +194,14 @@ #define GPIO_SD_CARDDETECT (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTE | PIN6) -/* Two push buttons, SW2 and SW3, are available on FRDM-K64F board, where SW2 is - * connected to PTC6 and SW3 is connected to PTA4. Besides the general purpose - * input/output functions, SW2 and SW3 can be low-power wake up signal. Also, only - * SW3 can be a non-maskable interrupt. +/* Two push buttons, SW2 and SW3, are available on FRDM-K64F board, + * where SW2 is connected to PTC6 and SW3 is connected to PTA4. + * Besides the general purpose input/output functions, + * SW2 and SW3 can be low-power wake up signal. + * Also, only SW3 can be a non-maskable interrupt. * * Switch GPIO Function - * --------- --------------------------------------------------------------- + * --------- -------------------------------------------------------------- * SW2 PTC6/SPI0_SOUT/PD0_EXTRG/I2S0_RX_BCLK/FB_AD9/I2S0_MCLK/LLWU_P10 * SW3 PTA4/FTM0_CH1/NMI_b/LLWU_P3 */ @@ -219,43 +222,43 @@ #define GPIO_LED_G (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTE | PIN26) #define GPIO_LED_B (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTB | PIN21) -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k64_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the FREEDOM-K64F board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function k64_spidev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: k64_usbinitialize * * Description: * Called to setup USB-related GPIO pins for the FREEDOM-K64F board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function k64_usbinitialize(void); -/************************************************************************************ +/**************************************************************************** * Name: k64_bringup * * Description: * Bring up board features * - ************************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LIB_BOARDCTL) || defined(CONFIG_BOARD_LATE_INITIALIZE) int k64_bringup(void); @@ -275,13 +278,13 @@ int k64_sdhc_initialize(void); # define k64_sdhc_initialize() (OK) #endif -/************************************************************************************ +/**************************************************************************** * Name: k64_cardinserted * * Description: * Check if a card is inserted into the SDHC slot * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUTOMOUNTER bool k64_cardinserted(void); @@ -289,13 +292,13 @@ bool k64_cardinserted(void); # define k64_cardinserted() (false) #endif -/************************************************************************************ +/**************************************************************************** * Name: k64_writeprotected * * Description: * Check if the card in the MMC/SD slot is write protected * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUTOMOUNTER bool k64_writeprotected(void); @@ -303,7 +306,7 @@ bool k64_writeprotected(void); # define k64_writeprotected() (false) #endif -/************************************************************************************ +/**************************************************************************** * Name: k64_automount_initialize * * Description: @@ -315,20 +318,20 @@ bool k64_writeprotected(void); * Returned Value: * None * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUTOMOUNTER void k64_automount_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: k64_automount_event * * Description: - * The SDHC card detection logic has detected an insertion or removal event. It - * has already scheduled the MMC/SD block driver operations. Now we need to - * schedule the auto-mount event which will occur with a substantial delay to make - * sure that everything has settle down. + * The SDHC card detection logic has detected an insertion or removal event. + * It has already scheduled the MMC/SD block driver operations. + * Now we need to schedule the auto-mount event which will occur with a + * substantial delay to make sure that everything has settle down. * * Input Parameters: * inserted - True if the card is inserted in the slot. False otherwise. @@ -339,23 +342,23 @@ void k64_automount_initialize(void); * Assumptions: * Interrupts are disabled. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUTOMOUNTER void k64_automount_event(bool inserted); #endif -/************************************************************************************ +/**************************************************************************** * Name: k64_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PWM int k64_pwm_setup(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_FREEDOM_K64F_SRC_FREEDOM_K64F_H */ +#endif /* __BOARDS_ARM_KINETIS_FREEDOM_K64F_SRC_FREEDOM_K64F_H */ diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_appinit.c b/boards/arm/kinetis/freedom-k64f/src/k64_appinit.c index 0ca9b405fb2..0276950ec32 100644 --- a/boards/arm/kinetis/freedom-k64f/src/k64_appinit.c +++ b/boards/arm/kinetis/freedom-k64f/src/k64_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/freedom-k64f/src/k64_appinit.c + * boards/arm/kinetis/freedom-k64f/src/k64_appinit.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_autoleds.c b/boards/arm/kinetis/freedom-k64f/src/k64_autoleds.c index 2ca2606c9f6..0390af1d3c9 100644 --- a/boards/arm/kinetis/freedom-k64f/src/k64_autoleds.c +++ b/boards/arm/kinetis/freedom-k64f/src/k64_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k64f/src/k64_autoleds.c + * boards/arm/kinetis/freedom-k64f/src/k64_autoleds.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_automount.c b/boards/arm/kinetis/freedom-k64f/src/k64_automount.c index c6ab41e166f..87e1f743e91 100644 --- a/boards/arm/kinetis/freedom-k64f/src/k64_automount.c +++ b/boards/arm/kinetis/freedom-k64f/src/k64_automount.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k64f/src/k64_automount.c +/**************************************************************************** + * boards/arm/kinetis/freedom-k64f/src/k64_automount.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 @@ -53,9 +53,9 @@ #ifdef HAVE_AUTOMOUNTER -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #ifndef NULL # define NULL (FAR void *)0 @@ -65,9 +65,10 @@ # define OK 0 #endif -/************************************************************************************ +/**************************************************************************** * Private Types - ************************************************************************************/ + ****************************************************************************/ + /* This structure represents the changeable state of the automounter */ struct k64_automount_state_s @@ -82,26 +83,27 @@ struct k64_automount_state_s struct k64_automount_config_s { - /* This must be first thing in structure so that we can simply cast from struct - * automount_lower_s to struct k64_automount_config_s + /* This must be first thing in structure so that we can simply cast from + * struct automount_lower_s to struct k64_automount_config_s */ struct automount_lower_s lower; /* Publicly visible part */ FAR struct k64_automount_state_s *state; /* Changeable state */ }; -/************************************************************************************ +/**************************************************************************** * Private Function Prototypes - ************************************************************************************/ + ****************************************************************************/ static int k64_attach(FAR const struct automount_lower_s *lower, automount_handler_t isr, FAR void *arg); -static void k64_enable(FAR const struct automount_lower_s *lower, bool enable); +static void k64_enable(FAR const struct automount_lower_s *lower, + bool enable); static bool k64_inserted(FAR const struct automount_lower_s *lower); -/************************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************************/ + ****************************************************************************/ static struct k64_automount_state_s g_sdhc_state; static const struct k64_automount_config_s g_sdhc_config = @@ -120,11 +122,11 @@ static const struct k64_automount_config_s g_sdhc_config = .state = &g_sdhc_state }; -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k64_attach * * Description: @@ -138,7 +140,7 @@ static const struct k64_automount_config_s g_sdhc_config = * Returned Value: * Always returns OK * - ************************************************************************************/ + ****************************************************************************/ static int k64_attach(FAR const struct automount_lower_s *lower, automount_handler_t isr, FAR void *arg) @@ -164,7 +166,7 @@ static int k64_attach(FAR const struct automount_lower_s *lower, return OK; } -/************************************************************************************ +/**************************************************************************** * Name: k64_enable * * Description: @@ -177,9 +179,10 @@ static int k64_attach(FAR const struct automount_lower_s *lower, * Returned Value: * None * - ************************************************************************************/ + ****************************************************************************/ -static void k64_enable(FAR const struct automount_lower_s *lower, bool enable) +static void k64_enable(FAR const struct automount_lower_s *lower, + bool enable) { FAR const struct k64_automount_config_s *config; FAR struct k64_automount_state_s *state; @@ -215,7 +218,7 @@ static void k64_enable(FAR const struct automount_lower_s *lower, bool enable) leave_critical_section(flags); } -/************************************************************************************ +/**************************************************************************** * Name: k64_inserted * * Description: @@ -227,18 +230,18 @@ static void k64_enable(FAR const struct automount_lower_s *lower, bool enable) * Returned Value: * True if the card is inserted; False otherwise * - ************************************************************************************/ + ****************************************************************************/ static bool k64_inserted(FAR const struct automount_lower_s *lower) { return k64_cardinserted(); } -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k64_automount_initialize * * Description: @@ -250,7 +253,7 @@ static bool k64_inserted(FAR const struct automount_lower_s *lower) * Returned Value: * None * - ************************************************************************************/ + ****************************************************************************/ void k64_automount_initialize(void) { @@ -267,20 +270,20 @@ void k64_automount_initialize(void) } } -/************************************************************************************ +/**************************************************************************** * Name: k64_automount_event * * Description: - * The SDHC card detection logic has detected an insertion or removal event. It - * has already scheduled the MMC/SD block driver operations. Now we need to - * schedule the auto-mount event which will occur with a substantial delay to make - * sure that everything has settle down. + * The SDHC card detection logic has detected an insertion or removal event. + * It has already scheduled the MMC/SD block driver operations. + * Now we need to schedule the auto-mount event which will occur with a + * substantial delay to make sure that everything has settle down. * * Input Parameters: - * slotno - Identifies the SDHC0 slot: SDHC0_SLOTNO or SDHC1_SLOTNO. There is a - * terminology problem here: Each SDHC supports two slots, slot A and slot B. - * Only slot A is used. So this is not a really a slot, but an HSCMI peripheral - * number. + * slotno - Identifies the SDHC0 slot: SDHC0_SLOTNO or SDHC1_SLOTNO. + * There is a terminology problem here: Each SDHC supports two slots, + * slot A and slot B. Only slot A is used. + * So this is not a really a slot, but an HSCMI peripheral number. * inserted - True if the card is inserted in the slot. False otherwise. * * Returned Value: @@ -289,7 +292,7 @@ void k64_automount_initialize(void) * Assumptions: * Interrupts are disabled. * - ************************************************************************************/ + ****************************************************************************/ void k64_automount_event(bool inserted) { diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_boot.c b/boards/arm/kinetis/freedom-k64f/src/k64_boot.c index 7565970fe73..73d16184e23 100644 --- a/boards/arm/kinetis/freedom-k64f/src/k64_boot.c +++ b/boards/arm/kinetis/freedom-k64f/src/k64_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k64f/src/k64_boot.c +/**************************************************************************** + * boards/arm/kinetis/freedom-k64f/src/k64_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 @@ -47,25 +47,26 @@ #include "up_arch.h" #include "freedom-k64f.h" -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_boardinitialize * * Description: - * All Kinetis 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 Kinetis 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 kinetis_boardinitialize(void) { #if defined(CONFIG_KINETIS_SPI1) || defined(CONFIG_KINETIS_SPI2) - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * k64_spidev_initialize() has been brought into the link. + /* Configure SPI chip selects if 1) SPI is not disabled, and 2) + * the weak function k64_spidev_initialize() has been brought into the link. */ if (k64_spidev_initialize) @@ -75,10 +76,10 @@ void kinetis_boardinitialize(void) #endif #if defined(CONFIG_USBDEV) && defined(CONFIG_KINETIS_USB) - /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not - * disabled, and 3) the weak function k64_usbinitialize() has been brought - * into the build. - */ + /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not + * disabled, and 3) the weak function k64_usbinitialize() has been brought + * into the build. + */ if (k64_usbinitialize) { diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_bringup.c b/boards/arm/kinetis/freedom-k64f/src/k64_bringup.c index 657817343f9..da4a818a348 100644 --- a/boards/arm/kinetis/freedom-k64f/src/k64_bringup.c +++ b/boards/arm/kinetis/freedom-k64f/src/k64_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/freedom-k64f/src/k64_bringup.c + * boards/arm/kinetis/freedom-k64f/src/k64_bringup.c * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_buttons.c b/boards/arm/kinetis/freedom-k64f/src/k64_buttons.c index 26b60037eaf..33ce907b136 100644 --- a/boards/arm/kinetis/freedom-k64f/src/k64_buttons.c +++ b/boards/arm/kinetis/freedom-k64f/src/k64_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k64f/src/k64_buttons.c + * boards/arm/kinetis/freedom-k64f/src/k64_buttons.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -54,10 +54,11 @@ * Pre-processor Definitions ****************************************************************************/ -/* Two push buttons, SW2 and SW3, are available on FRDM-K64F board, where SW2 is - * connected to PTC6 and SW3 is connected to PTA4. Besides the general purpose - * input/output functions, SW2 and SW3 can be low-power wake up signal. Also, only - * SW3 can be a non-maskable interrupt. +/* Two push buttons, SW2 and SW3, are available on FRDM-K64F board, where SW2 + * is connected to PTC6 and SW3 is connected to PTA4. + * Besides the general purpose input/output functions, SW2 and SW3 can be + * low-power wake up signal. + * Also, only SW3 can be a non-maskable interrupt. * * Switch GPIO Function * --------- --------------------------------------------------------------- @@ -82,10 +83,10 @@ void board_button_initialize(void) { - /* Configure the two buttons as inputs */ + /* Configure the two buttons as inputs */ - kinetis_pinconfig(GPIO_SW2); - kinetis_pinconfig(GPIO_SW3); + kinetis_pinconfig(GPIO_SW2); + kinetis_pinconfig(GPIO_SW3); } /**************************************************************************** diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_pwm.c b/boards/arm/kinetis/freedom-k64f/src/k64_pwm.c index a77d5420653..e0b88c8b9cf 100644 --- a/boards/arm/kinetis/freedom-k64f/src/k64_pwm.c +++ b/boards/arm/kinetis/freedom-k64f/src/k64_pwm.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k64f/src/k64_pwm.c +/**************************************************************************** + * boards/arm/kinetis/freedom-k64f/src/k64_pwm.c * * Copyright (C) 2013, 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 @@ -55,17 +55,17 @@ #ifdef CONFIG_PWM -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k64_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ int k64_pwm_setup(void) { diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_sdhc.c b/boards/arm/kinetis/freedom-k64f/src/k64_sdhc.c index 9efec40ce9d..be24c8b2d9d 100644 --- a/boards/arm/kinetis/freedom-k64f/src/k64_sdhc.c +++ b/boards/arm/kinetis/freedom-k64f/src/k64_sdhc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/freedom-k64f/src/k64_sdhc.c + * boards/arm/kinetis/freedom-k64f/src/k64_sdhc.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,10 +33,11 @@ * ****************************************************************************/ -/* A micro Secure Digital (SD) card slot is available on the FRDM-K64F connected to - * the SD Host Controller (SDHC) signals of the MCU. This slot will accept micro - * format SD memory cards. The SD card detect pin (PTE6) is an open switch that - * shorts with VDD when card is inserted. +/* A micro Secure Digital (SD) card slot is available on the FRDM-K64F + * connected to the SD Host Controller (SDHC) signals of the MCU. + * This slot will accept micro format SD memory cards. + * The SD card detect pin (PTE6) is an open switch that shorts with VDD when + * card is inserted. * * ------------ ------------- -------- * SD Card Slot Board Signal K64F Pin @@ -81,6 +82,7 @@ /**************************************************************************** * Private Types ****************************************************************************/ + /* This structure holds static information unique to one SDHC peripheral */ struct k64_sdhc_state_s @@ -174,6 +176,7 @@ int k64_sdhc_initialize(void) /* Configure the write protect GPIO -- None */ /* Mount the SDHC-based MMC/SD block driver */ + /* First, get an instance of the SDHC interface */ mcinfo("Initializing SDHC slot %d\n", MMCSD_SLOTNO); @@ -192,7 +195,8 @@ int k64_sdhc_initialize(void) ret = mmcsd_slotinitialize(MMSCD_MINOR, g_sdhc.sdhc); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n", + ret); return ret; } diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_spi.c b/boards/arm/kinetis/freedom-k64f/src/k64_spi.c index 8d98e6e00fc..fe5305edec6 100644 --- a/boards/arm/kinetis/freedom-k64f/src/k64_spi.c +++ b/boards/arm/kinetis/freedom-k64f/src/k64_spi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k64f/src/k64_spi.c +/**************************************************************************** + * boards/arm/kinetis/freedom-k64f/src/k64_spi.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 @@ -52,57 +52,63 @@ #include "freedom-k64f.h" #if defined(CONFIG_KINETIS_SPI0) || defined(CONFIG_KINETIS_SPI1) || \ - defined(CONFIG_KINETIS_SPI2) + defined(CONFIG_KINETIS_SPI2) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k64_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the FREEDOM-K64F board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function k64_spidev_initialize(void) { # warning "Missing logic" } -/************************************************************************************ - * Name: kinetis_spi[n]select, kinetis_spi[n]status, and kinetis_spi[n]cmddata +/**************************************************************************** + * Name: kinetis_spi[n]select, kinetis_spi[n]status, and + * kinetis_spi[n]cmddata * * Description: - * These external functions must be provided by board-specific logic. They are - * implementations of the select, status, and cmddata methods of the SPI interface - * defined by struct spi_ops_s (see include/nuttx/spi/spi.h). All other methods - * including kinetis_spibus_initialize()) are provided by common Kinetis logic. + * These external functions must be provided by board-specific logic. + * They are implementations of the select, status, and cmddata methods of + * the SPI interface defined by struct spi_ops_s + * (see include/nuttx/spi/spi.h). + * All other methods including kinetis_spibus_initialize()) are provided by + * common Kinetis logic. * To use this common SPI logic on your board: * - * 1. Provide logic in kinetis_boardinitialize() to configure SPI chip select - * pins. + * 1. Provide logic in kinetis_boardinitialize() to configure SPI chip + * select pins. * 2. Provide kinetis_spi[n]select() and kinetis_spi[n]status() functions - * in your board-specific logic. These functions will perform chip selection - * and status operations using GPIOs in the way your board is configured. + * in your board-specific logic. These functions will perform chip + * selection and status operations using GPIOs in the way your board is + * configured. * 2. If CONFIG_SPI_CMDDATA is defined in the NuttX configuration, provide - * kinetis_spi[n]cmddata() functions in your board-specific logic. These - * functions will perform cmd/data selection operations using GPIOs in the way - * your board is configured. - * 3. Add a call to kinetis_spibus_initialize() in your low level application - * initialization logic - * 4. The handle returned by kinetis_spibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * kinetis_spi[n]cmddata() functions in your board-specific logic. These + * functions will perform cmd/data selection operations using GPIOs in + * the way your board is configured. + * 3. Add a call to kinetis_spibus_initialize() in your low level + * application initialization logic + * 4. The handle returned by kinetis_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). * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_KINETIS_SPI0 -void kinetis_spi0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi0select(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"); # warning "Missing logic" } @@ -114,9 +120,11 @@ uint8_t kinetis_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_KINETIS_SPI1 -void kinetis_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi1select(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"); # warning "Missing logic" } @@ -128,9 +136,11 @@ uint8_t kinetis_spi1status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_KINETIS_SPI2 -void kinetis_spi2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi2select(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"); # warning "Missing logic" } diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_uid.c b/boards/arm/kinetis/freedom-k64f/src/k64_uid.c index c5511267f23..37c40289dc7 100644 --- a/boards/arm/kinetis/freedom-k64f/src/k64_uid.c +++ b/boards/arm/kinetis/freedom-k64f/src/k64_uid.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k64/src/kinetis_uid.c + * boards/arm/kinetis/freedom-k64/src/kinetis_uid.c * * Copyright (C) 2016 Neil Hancock. All rights reserved. * diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_usbdev.c b/boards/arm/kinetis/freedom-k64f/src/k64_usbdev.c index 765ac053d39..4dcf5165b55 100644 --- a/boards/arm/kinetis/freedom-k64f/src/k64_usbdev.c +++ b/boards/arm/kinetis/freedom-k64f/src/k64_usbdev.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k64f/src/k64_usbdev.c +/**************************************************************************** + * boards/arm/kinetis/freedom-k64f/src/k64_usbdev.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,34 +51,35 @@ #include "kinetis.h" #include "freedom-k64f.h" -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k64_usbinitialize * * Description: * Called to setup USB-related GPIO pins for the FREEDOM-K64F board. * - ************************************************************************************/ + ****************************************************************************/ void k64_usbinitialize(void) { # warning "Missing logic" } -/************************************************************************************ +/***************************************************************************** * Name: kinetis_usbpullup * * Description: - * If USB is supported and the board supports a pullup via GPIO (for USB software - * connect and disconnect), then the board software must provide kinetis_usbpullup. + * If USB is supported and the board supports a pullup via GPIO (for USB + * software connect and disconnect), then the board software must provide + * kinetis_usbpullup. * See include/nuttx/usb/usbdev.h for additional description of this method. - * Alternatively, if no pull-up GPIO the following EXTERN can be redefined to be - * NULL. + * Alternatively, if no pull-up GPIO the following EXTERN can be redefined + * to be NULL. * - ************************************************************************************/ + ****************************************************************************/ int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable) { @@ -87,16 +88,17 @@ int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable) return OK; } -/************************************************************************************ +/**************************************************************************** * Name: kinetis_usbsuspend * * Description: - * Board logic must provide the kinetis_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the kinetis_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. + * This is an opportunity for the board logic to shutdown clocks, power, + * etc. while the USB is suspended. * - ************************************************************************************/ + ****************************************************************************/ void kinetis_usbsuspend(FAR struct usbdev_s *dev, bool resume) { diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_usbmsc.c b/boards/arm/kinetis/freedom-k64f/src/k64_usbmsc.c index 29ed2116b58..4e62c0ea78f 100644 --- a/boards/arm/kinetis/freedom-k64f/src/k64_usbmsc.c +++ b/boards/arm/kinetis/freedom-k64f/src/k64_usbmsc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k64f/src/k64_usbmsc.c + * boards/arm/kinetis/freedom-k64f/src/k64_usbmsc.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -67,7 +67,8 @@ # undef K64_MMCSDSLOTNO # define K64_MMCSDSLOTNO 0 #else - /* Add configuration for new Kinetis boards here */ + /* Add configuration for new Kinetis boards here */ + # error "Unrecognized Kinetis board" #endif @@ -87,7 +88,8 @@ int board_usbmsc_initialize(int port) { /* If system/usbmsc is built as an NSH command, then SD slot should - * already have been initialized in board_app_initialize() (see k64_appinit.c). + * already have been initialized in board_app_initialize() + * (see k64_appinit.c). * In this case, there is nothing further to be done here. */ @@ -95,5 +97,5 @@ int board_usbmsc_initialize(int port) # warning "Missing logic" #endif /* CONFIG_NSH_BUILTIN_APPS */ - return OK; + return OK; } diff --git a/boards/arm/kinetis/freedom-k64f/src/k64_userleds.c b/boards/arm/kinetis/freedom-k64f/src/k64_userleds.c index 110e867cd85..6c857af3493 100644 --- a/boards/arm/kinetis/freedom-k64f/src/k64_userleds.c +++ b/boards/arm/kinetis/freedom-k64f/src/k64_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k64f/src/k64_userleds.c + * boards/arm/kinetis/freedom-k64f/src/k64_userleds.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k66f/include/board.h b/boards/arm/kinetis/freedom-k66f/include/board.h index cc3986de6b5..cfa24fad4b9 100644 --- a/boards/arm/kinetis/freedom-k66f/include/board.h +++ b/boards/arm/kinetis/freedom-k66f/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k66f/include/board.h +/**************************************************************************** + * boards/arm/kinetis/freedom-k66f/include/board.h * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt @@ -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_FREEDOM_K66F_INCLUDE_BOARD_H -#define __BOARDS_ARM_FREEDOM_K66F_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_KINETIS_FREEDOM_K66F_INCLUDE_BOARD_H +#define __BOARDS_ARM_KINETIS_FREEDOM_K66F_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #ifndef __ASSEMBLY__ @@ -48,16 +48,18 @@ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ -/* The Freedom K66F uses a 12Mhz external Oscillator. The Kinetis MCU startup from an - * internal digitally-controlled oscillator (DCO). Nuttx will enable the main external - * oscillator (EXTAL0/XTAL0). The external oscillator/resonator can range from - * 32.768 KHz up to 50 MHz. The default external source for the MCG oscillator inputs - * is 12 MHz oscillator +/* Clocking *****************************************************************/ + +/* The Freedom K66F uses a 12Mhz external Oscillator. + * The Kinetis MCU startup from an internal digitally-controlled oscillator + * (DCO). Nuttx will enable the main external oscillator (EXTAL0/XTAL0). + * The external oscillator/resonator can range from 32.768 KHz up to 50 MHz. + * The default external source for the MCG oscillator inputs is 12 MHz + * oscillator * * X501 a High-frequency, low-power Xtal */ @@ -66,21 +68,23 @@ #define BOARD_EXTAL_FREQ 12000000 /* 12MHz Oscillator */ #define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator */ -/* PLL Configuration. Either the external clock or crystal frequency is used to - * select the PRDIV value. Only reference clock frequencies are supported that will - * produce a KINETIS_MCG_PLL_REF_MIN >= PLLIN <=KINETIS_MCG_PLL_REF_MAX reference +/* PLL Configuration. Either the external clock or crystal frequency is used + * to select the PRDIV value. + * Only reference clock frequencies are supported that will produce a + * KINETIS_MCG_PLL_REF_MIN >= PLLIN <=KINETIS_MCG_PLL_REF_MAX reference * clock to the PLL. * * PLL Input frequency: PLLIN = REFCLK / PRDIV = 12 Mhz / 1 = 12 MHz * PLL Output frequency: PLLOUT = PLLIN * VDIV = 12 Mhz * 30 = 360 MHz - * MCG Frequency: PLLOUT = 180 Mhz = 360 MHz / KINETIS_MCG_PLL_INTERNAL_DIVBY + * MCG Frequency: PLLOUT = 180 Mhz = 360 MHz / + * KINETIS_MCG_PLL_INTERNAL_DIVBY * * PRDIV register value is the divider minus KINETIS_MCG_C5_PRDIV_BASE. * VDIV register value is offset by KINETIS_MCG_C6_VDIV_BASE. */ -#define BOARD_PRDIV 1 /* PLL External Reference Divider */ -#define BOARD_VDIV 30 /* PLL VCO Divider (frequency multiplier) */ +#define BOARD_PRDIV 1 /* PLL External Reference Divider */ +#define BOARD_VDIV 30 /* PLL VCO Divider (frequency multiplier) */ /* Define additional MCG_C2 Setting */ @@ -93,10 +97,10 @@ /* SIM CLKDIV1 dividers */ -#define BOARD_OUTDIV1 1 /* Core = MCG, 180 MHz */ -#define BOARD_OUTDIV2 3 /* Bus = MCG / 3, 60 MHz */ -#define BOARD_OUTDIV3 3 /* FlexBus = MCG / 3, 60 MHz */ -#define BOARD_OUTDIV4 7 /* Flash clock = MCG / 7, 25.7 MHz */ +#define BOARD_OUTDIV1 1 /* Core = MCG, 180 MHz */ +#define BOARD_OUTDIV2 3 /* Bus = MCG / 3, 60 MHz */ +#define BOARD_OUTDIV3 3 /* FlexBus = MCG / 3, 60 MHz */ +#define BOARD_OUTDIV4 7 /* Flash clock = MCG / 7, 25.7 MHz */ #define BOARD_CORECLK_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV1) #define BOARD_BUS_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV2) @@ -143,36 +147,46 @@ #define BOARD_TPM_CLKSRC SIM_SOPT2_TPMSRC_MCGCLK #define BOARD_TPM_FREQ BOARD_SIM_CLKDIV3_FREQ -/* 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. Possible values for prescaler and divisor are: + * The SDHC module is always configure configured so that the core clock is + * the base clock. + * Possible values for prescaler and divisor are: * * SDCLKFS: {2, 4, 8, 16, 32, 63, 128, 256} * DVS: {1..16} */ -/* Identification mode: Optimal 400KHz, Actual 180MHz / (32 * 15) = 375 Khz */ +/* Identification mode: + * Optimal 400KHz, Actual 180MHz / (32 * 15) = 375 Khz + */ #define BOARD_SDHC_IDMODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV32 #define BOARD_SDHC_IDMODE_DIVISOR SDHC_SYSCTL_DVS_DIV(15) -/* MMC normal mode: Optimal 20MHz, Actual 180MHz / (2 * 5) = 18 MHz */ +/* MMC normal mode: + * Optimal 20MHz, Actual 180MHz / (2 * 5) = 18 MHz + */ #define BOARD_SDHC_MMCMODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 #define BOARD_SDHC_MMCMODE_DIVISOR SDHC_SYSCTL_DVS_DIV(5) -/* SD normal mode (1-bit): Optimal 20MHz, Actual 180MHz / (2 * 5) = 18 MHz */ +/* SD normal mode (1-bit): + * Optimal 20MHz, Actual 180MHz / (2 * 5) = 18 MHz + */ #define BOARD_SDHC_SD1MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 #define BOARD_SDHC_SD1MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(5) -/* SD normal mode (4-bit): Optimal 25MHz, Actual 180MHz / (2 * 4) = 22.5 MHz (with DMA) - * SD normal mode (4-bit): Optimal 20MHz, Actual 180MHz / (2 * 4) = 22.5 MHz (no DMA) +/* SD normal mode (4-bit): + * Optimal 25MHz, Actual 180MHz / (2 * 4) = 22.5 MHz (with DMA) + * SD normal mode (4-bit): + * Optimal 20MHz, Actual 180MHz / (2 * 4) = 22.5 MHz (no DMA) */ #ifdef CONFIG_SDIO_DMA @@ -184,7 +198,9 @@ #endif /* PWM Configuration */ + /* FTM0 Channels */ + /* Channels can be modified using kinetis_k66pinmux.h */ #define GPIO_FTM0_CH0OUT PIN_FTM0_CH0_1 @@ -195,7 +211,9 @@ #define GPIO_FTM0_CH5OUT PIN_FTM0_CH5_1 /* PWM Configuration */ + /* FTM3 Channels */ + /* Channels can be modified using kinetis_k66pinmux.h */ #define GPIO_FTM3_CH0OUT PIN_FTM3_CH0_1 @@ -204,7 +222,8 @@ #define GPIO_FTM3_CH3OUT PIN_FTM3_CH3_1 #define GPIO_FTM3_CH4OUT PIN_FTM3_CH4_1 -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* The Freedom K66F has a single RGB LED driven by the K66F as follows: * * LED K66 @@ -213,8 +232,8 @@ * BLUE PTB21/SPI2_SCK/FB_AD30/CMP1_OUT * GREEN PTE26/ENET_1588_CLKIN/UART4_CTS_b/RTC_CLKOUT/USB0_CLKIN * - * 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. */ /* LED index values for use with board_userled() */ @@ -236,7 +255,9 @@ * * SYMBOL Meaning LED state * RED GREEN BLUE - * ------------------- ---------------------------- ----------------- */ + * ------------------- ---------------------------- ----------------- + */ + #define LED_STARTED 1 /* NuttX has been started OFF OFF OFF */ #define LED_HEAPALLOCATE 2 /* Heap has been allocated OFF OFF ON */ #define LED_IRQSENABLED 0 /* Interrupts enabled OFF OFF ON */ @@ -247,11 +268,12 @@ #define LED_PANIC 4 /* The system has crashed FLASH OFF OFF */ #undef LED_IDLE /* K66 is in sleep mode (Not used) */ -/* Button definitions ***************************************************************/ -/* Two push buttons, SW2 and SW3, are available on FRDM-K66F board, where SW2 is - * connected to PTC6 and SW3 is connected to PTA4. Besides the general purpose - * input/output functions, SW2 and SW3 can be low-power wake up signal. Also, only - * SW3 can be a non-maskable interrupt. +/* Button definitions *******************************************************/ + +/* Two push buttons, SW2 and SW3, are available on FRDM-K66F board, where SW2 + * is connected to PTC6 and SW3 is connected to PTA4. + * Besides the general purpose input/output functions, SW2 and SW3 can be + * low-power wake up signal. Also, only SW3 can be a non-maskable interrupt. * * Switch GPIO Function * --------- --------------------------------------------------------------- @@ -266,15 +288,17 @@ #define BUTTON_SW2_BIT (1 << BUTTON_SW2) #define BUTTON_SW3_BIT (1 << BUTTON_SW3) -/* Alternative pin resolution *******************************************************/ +/* Alternative pin resolution ***********************************************/ + /* If there are alternative configurations for various pins in the - * kinetis_k66pinmux.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. + * kinetis_k66pinmux.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. */ -/* The primary serial port interface signals are PTB16 UART0_RX and PTB17 UART0_TX. +/* The primary serial port interface signals are PTB16 UART0_RX and PTB17 + * UART0_TX. * These signals are connected to the OpenSDAv2 circuit. */ @@ -357,8 +381,7 @@ #define PIN_SPI1_OUT PIN_SPI1_SOUT_3 #define PIN_SPI1_SIN PIN_SPI1_SIN_3 -/* - * Ethernet MAC/KSZ8081 PHY +/* Ethernet MAC/KSZ8081 PHY * ------------------------ * ------------ ----------------- -------------------------------------------- * KSZ8081 Board Signal(s) K66F Pin @@ -396,4 +419,4 @@ #define PIN_RMII0_MDIO PIN_RMII0_MDIO_1 #define PIN_RMII0_MDC PIN_RMII0_MDC_1 -#endif /* __BOARDS_ARM_FREEDOM_K66F_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_KINETIS_FREEDOM_K66F_INCLUDE_BOARD_H */ diff --git a/boards/arm/kinetis/freedom-k66f/scripts/Make.defs b/boards/arm/kinetis/freedom-k66f/scripts/Make.defs index 8f055d4c99c..5bf085d81fe 100644 --- a/boards/arm/kinetis/freedom-k66f/scripts/Make.defs +++ b/boards/arm/kinetis/freedom-k66f/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/freedom-k66f/scripts/Make.defs +# boards/arm/kinetis/freedom-k66f/scripts/Make.defs # # Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. # Authors: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k66f/scripts/flash.ld b/boards/arm/kinetis/freedom-k66f/scripts/flash.ld index fc7f8df1cba..607f310d50d 100644 --- a/boards/arm/kinetis/freedom-k66f/scripts/flash.ld +++ b/boards/arm/kinetis/freedom-k66f/scripts/flash.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k66f/scripts/flash.ld + * boards/arm/kinetis/freedom-k66f/scripts/flash.ld * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k66f/src/Makefile b/boards/arm/kinetis/freedom-k66f/src/Makefile index dffb726a2a5..e2b0f287fb9 100644 --- a/boards/arm/kinetis/freedom-k66f/src/Makefile +++ b/boards/arm/kinetis/freedom-k66f/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/freedom-k66f/src/Makefile +# boards/arm/kinetis/freedom-k66f/src/Makefile # # Copyright (C) 2016-2017, 2019 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k66f/src/freedom-k66f.h b/boards/arm/kinetis/freedom-k66f/src/freedom-k66f.h index 7a29c212101..fab000f1339 100644 --- a/boards/arm/kinetis/freedom-k66f/src/freedom-k66f.h +++ b/boards/arm/kinetis/freedom-k66f/src/freedom-k66f.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k66f/src/freedom-k66f.h +/**************************************************************************** + * boards/arm/kinetis/freedom-k66f/src/freedom-k66f.h * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt @@ -32,25 +32,25 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_FREEDOM_K66F_SRC_FREEDOM_K66F_H -#define __BOARDS_ARM_FREEDOM_K66F_SRC_FREEDOM_K66F_H +#ifndef __BOARDS_ARM_KINETIS_FREEDOM_K66F_SRC_FREEDOM_K66F_H +#define __BOARDS_ARM_KINETIS_FREEDOM_K66F_SRC_FREEDOM_K66F_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Application Configuration ********************************************************/ +/* Application Configuration ************************************************/ /* Assume we have everything */ @@ -85,8 +85,8 @@ #define MMCSD_SLOTNO 0 -/* Can't support MMC/SD features if mountpoints are disabled or if SDHC support - * is not enabled. +/* Can't support MMC/SD features if mountpoints are disabled or if SDHC + * support is not enabled. */ #if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_KINETIS_SDHC) @@ -175,15 +175,17 @@ #endif #if !defined(CONFIG_KINETIS_SPI0) && !defined(CONFIG_KINETIS_SPI1) && \ - !defined(CONFIG_KINETIS_SPI3) + !defined(CONFIG_KINETIS_SPI3) # undef HAVE_SPI #endif -/* FREEDOM-K66F GPIOs ****************************************************************/ -/* A micro Secure Digital (SD) card slot is available on the FRDM-K66F connected to - * the SD Host Controller (SDHC) signals of the MCU. This slot will accept micro - * format SD memory cards. The SD card detect pin (PTD10) is an open switch that - * shorts with VDD when card is inserted. +/* FREEDOM-K66F GPIOs *******************************************************/ + +/* A micro Secure Digital (SD) card slot is available on the FRDM-K66F + * connected to the SD Host Controller (SDHC) signals of the MCU. + * This slot will accept micro format SD memory cards. + * The SD card detect pin (PTD10) is an open switch that shorts with VDD when + * card is inserted. * * ------------ ------------- -------- * SD Card Slot Board Signal K66F Pin @@ -202,10 +204,10 @@ #define GPIO_SD_CARDDETECT (GPIO_PULLDOWN | PIN_INT_BOTH | PIN_PORTD | PIN10) -/* Two push buttons, SW2 and SW3, are available on FRDM-K66F board, where SW2 is - * connected to PTC6 and SW3 is connected to PTA4. Besides the general purpose - * input/output functions, SW2 and SW3 can be low-power wake up signal. Also, only - * SW3 can be a non-maskable interrupt. +/* Two push buttons, SW2 and SW3, are available on FRDM-K66F board, where SW2 + * is connected to PTC6 and SW3 is connected to PTA4. + * Besides the general purpose input/output functions, SW2 and SW3 can be + * low-power wake up signal. Also, only SW3 can be a non-maskable interrupt. * * Switch GPIO Function * --------- --------------------------------------------------------------- @@ -220,9 +222,12 @@ * * LED K66 * ------ ------------------------------------------------------- - * RED PTC9/ADC1_SE5B/CMP0_IN3/FTM3_CH5/I2S0_RX_BCLK/FB_AD6/SDRAM_A14/FTM_FLT0 - * GREEN PTE6/LLWU_P16/SPI1_PCS3/UART3_CTS/I2S0_MCLK/FTM3_CH1/USB0_SOF_OUT - * BLUE PTA11/LLWU_P23/FTM2_CH1/MII0_RXCLK/I2C2_SDA/FTM2_QD_PHB/TPM2_CH1 + * RED PTC9/ADC1_SE5B/CMP0_IN3/FTM3_CH5/I2S0_RX_BCLK/ + * FB_AD6/SDRAM_A14/FTM_FLT0 + * GREEN PTE6/LLWU_P16/SPI1_PCS3/UART3_CTS/I2S0_MCLK/ + * FTM3_CH1/USB0_SOF_OUT + * BLUE PTA11/LLWU_P23/FTM2_CH1/MII0_RXCLK/I2C2_SDA/ + * FTM2_QD_PHB/TPM2_CH1 */ #define GPIO_LED_R (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTC | PIN9) @@ -234,56 +239,57 @@ #define PIN_CE (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTB | PIN20) #define PIN_SPI1_PCS0 (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTD | PIN4) -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k66_spidev_initialize * * Description: - * Called to configure SPI chip select GPIO pins for the FREEDOM-K66F board. + * Called to configure SPI chip select GPIO pins for the FREEDOM-K66F + * board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function k66_spidev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: k66_rtc_initialize * * Description: * Called to initialize the RTC FREEDOM-K66F board. * - ************************************************************************************/ + ****************************************************************************/ #if defined(HAVE_RTC_DRIVER) int k66_rtc_initialize(void); #else # define k66_rtc_initialize() (OK) #endif -/************************************************************************************ +/**************************************************************************** * Name: k66_usbinitialize * * Description: * Called to setup USB-related GPIO pins for the FREEDOM-K66F board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function k66_usbinitialize(void); -/************************************************************************************ +/**************************************************************************** * Name: k66_bringup * * Description: * Bring up board features * - ************************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LIB_BOARDCTL) || defined(CONFIG_BOARD_LATE_INITIALIZE) int k66_bringup(void); @@ -303,13 +309,13 @@ int k66_sdhc_initialize(void); # define k66_sdhc_initialize() (OK) #endif -/************************************************************************************ +/**************************************************************************** * Name: k66_cardinserted * * Description: * Check if a card is inserted into the SDHC slot * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUTOMOUNTER bool k66_cardinserted(void); @@ -317,13 +323,13 @@ bool k66_cardinserted(void); # define k66_cardinserted() (false) #endif -/************************************************************************************ +/**************************************************************************** * Name: k66_writeprotected * * Description: * Check if the card in the MMC/SD slot is write protected * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUTOMOUNTER bool k66_writeprotected(void); @@ -331,7 +337,7 @@ bool k66_writeprotected(void); # define k66_writeprotected() (false) #endif -/************************************************************************************ +/**************************************************************************** * Name: k66_automount_initialize * * Description: @@ -343,20 +349,20 @@ bool k66_writeprotected(void); * Returned Value: * None * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUTOMOUNTER void k66_automount_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: k66_automount_event * * Description: - * The SDHC card detection logic has detected an insertion or removal event. It - * has already scheduled the MMC/SD block driver operations. Now we need to - * schedule the auto-mount event which will occur with a substantial delay to make - * sure that everything has settle down. + * The SDHC card detection logic has detected an insertion or removal event. + * It has already scheduled the MMC/SD block driver operations. + * Now we need to schedule the auto-mount event which will occur with a + * substantial delay to make sure that everything has settle down. * * Input Parameters: * inserted - True if the card is inserted in the slot. False otherwise. @@ -367,23 +373,23 @@ void k66_automount_initialize(void); * Assumptions: * Interrupts are disabled. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUTOMOUNTER void k66_automount_event(bool inserted); #endif -/************************************************************************************ +/**************************************************************************** * Name: k66_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PWM int k66_pwm_setup(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_FREEDOM_K66F_SRC_FREEDOM_K66F_H */ +#endif /* __BOARDS_ARM_KINETIS_FREEDOM_K66F_SRC_FREEDOM_K66F_H */ diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_appinit.c b/boards/arm/kinetis/freedom-k66f/src/k66_appinit.c index 64950b1fd9a..cb0f2ff6903 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_appinit.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/freedom-k66f/src/k66_appinit.c + * boards/arm/kinetis/freedom-k66f/src/k66_appinit.c * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_autoleds.c b/boards/arm/kinetis/freedom-k66f/src/k66_autoleds.c index 64edcc19439..e43895120aa 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_autoleds.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k66f/src/k66_autoleds.c + * boards/arm/kinetis/freedom-k66f/src/k66_autoleds.c * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_automount.c b/boards/arm/kinetis/freedom-k66f/src/k66_automount.c index 06df436c69f..5b6c39b1dcc 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_automount.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_automount.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k66f/src/k66_automount.c +/**************************************************************************** + * boards/arm/kinetis/freedom-k66f/src/k66_automount.c * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Authors: 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 @@ -54,9 +54,9 @@ #ifdef HAVE_AUTOMOUNTER -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #ifndef NULL # define NULL (FAR void *)0 @@ -66,9 +66,10 @@ # define OK 0 #endif -/************************************************************************************ +/**************************************************************************** * Private Types - ************************************************************************************/ + ****************************************************************************/ + /* This structure represents the changeable state of the automounter */ struct k66_automount_state_s @@ -83,26 +84,27 @@ struct k66_automount_state_s struct k66_automount_config_s { - /* This must be first thing in structure so that we can simply cast from struct - * automount_lower_s to struct k66_automount_config_s + /* This must be first thing in structure so that we can simply cast from + * struct automount_lower_s to struct k66_automount_config_s */ struct automount_lower_s lower; /* Publicly visible part */ FAR struct k66_automount_state_s *state; /* Changeable state */ }; -/************************************************************************************ +/**************************************************************************** * Private Function Prototypes - ************************************************************************************/ + ****************************************************************************/ static int k66_attach(FAR const struct automount_lower_s *lower, automount_handler_t isr, FAR void *arg); -static void k66_enable(FAR const struct automount_lower_s *lower, bool enable); +static void k66_enable(FAR const struct automount_lower_s *lower, + bool enable); static bool k66_inserted(FAR const struct automount_lower_s *lower); -/************************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************************/ + ****************************************************************************/ static struct k66_automount_state_s g_sdhc_state; static const struct k66_automount_config_s g_sdhc_config = @@ -121,11 +123,11 @@ static const struct k66_automount_config_s g_sdhc_config = .state = &g_sdhc_state }; -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k66_attach * * Description: @@ -139,7 +141,7 @@ static const struct k66_automount_config_s g_sdhc_config = * Returned Value: * Always returns OK * - ************************************************************************************/ + ****************************************************************************/ static int k66_attach(FAR const struct automount_lower_s *lower, automount_handler_t isr, FAR void *arg) @@ -165,7 +167,7 @@ static int k66_attach(FAR const struct automount_lower_s *lower, return OK; } -/************************************************************************************ +/**************************************************************************** * Name: k66_enable * * Description: @@ -178,7 +180,7 @@ static int k66_attach(FAR const struct automount_lower_s *lower, * Returned Value: * None * - ************************************************************************************/ + ****************************************************************************/ static void k66_enable(FAR const struct automount_lower_s *lower, bool enable) { @@ -216,7 +218,7 @@ static void k66_enable(FAR const struct automount_lower_s *lower, bool enable) leave_critical_section(flags); } -/************************************************************************************ +/**************************************************************************** * Name: k66_inserted * * Description: @@ -228,18 +230,18 @@ static void k66_enable(FAR const struct automount_lower_s *lower, bool enable) * Returned Value: * True if the card is inserted; False otherwise * - ************************************************************************************/ + ****************************************************************************/ static bool k66_inserted(FAR const struct automount_lower_s *lower) { return k66_cardinserted(); } -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k66_automount_initialize * * Description: @@ -251,7 +253,7 @@ static bool k66_inserted(FAR const struct automount_lower_s *lower) * Returned Value: * None * - ************************************************************************************/ + ****************************************************************************/ void k66_automount_initialize(void) { @@ -268,20 +270,20 @@ void k66_automount_initialize(void) } } -/************************************************************************************ +/***************************************************************************** * Name: k66_automount_event * * Description: - * The SDHC card detection logic has detected an insertion or removal event. It - * has already scheduled the MMC/SD block driver operations. Now we need to - * schedule the auto-mount event which will occur with a substantial delay to make - * sure that everything has settle down. + * The SDHC card detection logic has detected an insertion or removal event. + * It has already scheduled the MMC/SD block driver operations. + * Now we need to schedule the auto-mount event which will occur with a + * substantial delay to make sure that everything has settle down. * * Input Parameters: - * slotno - Identifies the SDHC0 slot: SDHC0_SLOTNO or SDHC1_SLOTNO. There is a - * terminology problem here: Each SDHC supports two slots, slot A and slot B. - * Only slot A is used. So this is not a really a slot, but an HSCMI peripheral - * number. + * slotno - Identifies the SDHC0 slot: SDHC0_SLOTNO or SDHC1_SLOTNO. + * There is a terminology problem here: Each SDHC supports two slots, + * slot A and slot B. Only slot A is used. + * So this is not a really a slot, but an HSCMI peripheral number. * inserted - True if the card is inserted in the slot. False otherwise. * * Returned Value: @@ -290,7 +292,7 @@ void k66_automount_initialize(void) * Assumptions: * Interrupts are disabled. * - ************************************************************************************/ + *****************************************************************************/ void k66_automount_event(bool inserted) { diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_boot.c b/boards/arm/kinetis/freedom-k66f/src/k66_boot.c index 941efdfd7e3..96415f80bc5 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_boot.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k66f/src/k66_boot.c +/**************************************************************************** + * boards/arm/kinetis/freedom-k66f/src/k66_boot.c * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Authors: 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 @@ -48,19 +48,20 @@ #include "up_arch.h" #include "freedom-k66f.h" -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_boardinitialize * * Description: - * All Kinetis 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 Kinetis 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 kinetis_boardinitialize(void) { @@ -70,9 +71,9 @@ void kinetis_boardinitialize(void) board_autoled_initialize(); #endif #if defined(CONFIG_KINETIS_SPI0) || defined(CONFIG_KINETIS_SPI1) || \ - defined(CONFIG_KINETIS_SPI2) - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * k66_spidev_initialize() has been brought into the link. + defined(CONFIG_KINETIS_SPI2) + /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak + * function k66_spidev_initialize() has been brought into the link. */ if (k66_spidev_initialize) @@ -82,17 +83,16 @@ void kinetis_boardinitialize(void) #endif #if defined(CONFIG_USBDEV) && defined(CONFIG_KINETIS_USB) - /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not - * disabled, and 3) the weak function k66_usbinitialize() has been brought - * into the build. - */ + /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not + * disabled, and 3) the weak function k66_usbinitialize() has been brought + * into the build. + */ if (k66_usbinitialize) { k66_usbinitialize(); } #endif - } /**************************************************************************** diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_bringup.c b/boards/arm/kinetis/freedom-k66f/src/k66_bringup.c index a8346e69730..51a2549385d 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_bringup.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/freedom-k66f/src/k66_bringup.c + * boards/arm/kinetis/freedom-k66f/src/k66_bringup.c * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt @@ -110,7 +110,7 @@ int k66_bringup(void) if (ret < 0) { - syslog(LOG_ERR,"ERROR: Failed to mount %s: %d\n", + syslog(LOG_ERR, "ERROR: Failed to mount %s: %d\n", CONFIG_FRDMK66F_SDHC_MOUNT_MOUNTPOINT, errno); } } diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_buttons.c b/boards/arm/kinetis/freedom-k66f/src/k66_buttons.c index ce428bcfdb4..ab84718649b 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_buttons.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k66f/src/k66_buttons.c + * boards/arm/kinetis/freedom-k66f/src/k66_buttons.c * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt @@ -58,10 +58,11 @@ * Pre-processor Definitions ****************************************************************************/ -/* Two push buttons, SW2 and SW3, are available on FRDM-K66F board, where SW2 is - * connected to PTC6 and SW3 is connected to PTA4. Besides the general purpose - * input/output functions, SW2 and SW3 can be low-power wake up signal. Also, only - * SW3 can be a non-maskable interrupt. +/* Two push buttons, SW2 and SW3, are available on FRDM-K66F board, where SW2 + * is connected to PTC6 and SW3 is connected to PTA4. + * Besides the general purpose input/output functions, SW2 and SW3 can be + * low-power wake up signal. + * Also, only SW3 can be a non-maskable interrupt. * * Switch GPIO Function * --------- --------------------------------------------------------------- @@ -86,10 +87,10 @@ void board_button_initialize(void) { - /* Configure the two buttons as inputs */ + /* Configure the two buttons as inputs */ - kinetis_pinconfig(GPIO_SW2); - kinetis_pinconfig(GPIO_SW3); + kinetis_pinconfig(GPIO_SW2); + kinetis_pinconfig(GPIO_SW3); } /**************************************************************************** diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_pwm.c b/boards/arm/kinetis/freedom-k66f/src/k66_pwm.c index bf5219937db..17828eeb07a 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_pwm.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_pwm.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k66f/src/k66_pwm.c +/**************************************************************************** + * boards/arm/kinetis/freedom-k66f/src/k66_pwm.c * * Copyright (C) 2013, 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 @@ -55,17 +55,17 @@ #ifdef CONFIG_PWM -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k66_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ int k66_pwm_setup(void) { diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_reset.c b/boards/arm/kinetis/freedom-k66f/src/k66_reset.c index d0c77fe7726..85bf55147b8 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_reset.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_reset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/fredom-k66f/src/k66_reset.c + * boards/arm/kinetis/freedom-k66f/src/k66_reset.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_rtc.c b/boards/arm/kinetis/freedom-k66f/src/k66_rtc.c index f8d80cc1983..8c9365010a1 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_rtc.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_rtc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/freedom-k66f/src/k66_bringup.c + * boards/arm/kinetis/freedom-k66f/src/k66_bringup.c * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_sdhc.c b/boards/arm/kinetis/freedom-k66f/src/k66_sdhc.c index ac2ac2dce57..35f5fe83c16 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_sdhc.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_sdhc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/freedom-k66f/src/k66_sdhc.c + * boards/arm/kinetis/freedom-k66f/src/k66_sdhc.c * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_spi.c b/boards/arm/kinetis/freedom-k66f/src/k66_spi.c index 07ae462a0bf..9b9cc92d1d6 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_spi.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_spi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k66f/src/k66_spi.c +/**************************************************************************** + * boards/arm/kinetis/freedom-k66f/src/k66_spi.c * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Authors: 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 @@ -55,17 +55,18 @@ #if defined(CONFIG_KINETIS_SPI0) || defined(CONFIG_KINETIS_SPI1) || \ defined(CONFIG_KINETIS_SPI2) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k66_spidev_initialize * * Description: - * Called to configure SPI chip select GPIO pins for the FREEDOM-K66F board. + * Called to configure SPI chip select GPIO pins for the FREEDOM-K66F + * board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function k66_spidev_initialize(void) { @@ -75,38 +76,44 @@ void weak_function k66_spidev_initialize(void) kinetis_pinconfig(PIN_SPI1_PCS0); } -/************************************************************************************ - * Name: kinetis_spi[n]select, kinetis_spi[n]status, and kinetis_spi[n]cmddata +/**************************************************************************** + * Name: kinetis_spi[n]select, kinetis_spi[n]status, and + * kinetis_spi[n]cmddata * * Description: - * These external functions must be provided by board-specific logic. They are - * implementations of the select, status, and cmddata methods of the SPI interface - * defined by struct spi_ops_s (see include/nuttx/spi/spi.h). All other methods - * including kinetis_spibus_initialize()) are provided by common Kinetis logic. + * These external functions must be provided by board-specific logic. + * They are implementations of the select, status, and cmddata methods of + * the SPI interface defined by struct spi_ops_s + * (see include/nuttx/spi/spi.h). + * All other methods including kinetis_spibus_initialize()) are provided + * by common Kinetis logic. * To use this common SPI logic on your board: * - * 1. Provide logic in kinetis_boardinitialize() to configure SPI chip select - * pins. + * 1. Provide logic in kinetis_boardinitialize() to configure SPI chip + * select pins. * 2. Provide kinetis_spi[n]select() and kinetis_spi[n]status() functions - * in your board-specific logic. These functions will perform chip selection - * and status operations using GPIOs in the way your board is configured. + * in your board-specific logic. These functions will perform chip + * selection and status operations using GPIOs in the way your board + * is configured. * 2. If CONFIG_SPI_CMDDATA is defined in the NuttX configuration, provide - * kinetis_spi[n]cmddata() functions in your board-specific logic. These - * functions will perform cmd/data selection operations using GPIOs in the way - * your board is configured. - * 3. Add a call to kinetis_spibus_initialize() in your low level application - * initialization logic - * 4. The handle returned by kinetis_spibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * kinetis_spi[n]cmddata() functions in your board-specific logic. + * These functions will perform cmd/data selection operations using GPIOs + * in the way your board is configured. + * 3. Add a call to kinetis_spibus_initialize() in your low level + * application initialization logic + * 4. The handle returned by kinetis_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). * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_KINETIS_SPI0 -void kinetis_spi0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi0select(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"); # warning "Missing logic" } @@ -118,9 +125,11 @@ uint8_t kinetis_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_KINETIS_SPI1 -void kinetis_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi1select(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"); kinetis_gpiowrite(PIN_SPI1_PCS0, !selected); } @@ -132,9 +141,11 @@ uint8_t kinetis_spi1status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_KINETIS_SPI2 -void kinetis_spi2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi2select(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"); # warning "Missing logic" } diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_uid.c b/boards/arm/kinetis/freedom-k66f/src/k66_uid.c index 1d1538185fe..626baba1aba 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_uid.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_uid.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k66/src/kinetis_uid.c + * boards/arm/kinetis/freedom-k66/src/kinetis_uid.c * * Copyright (C) 2016 Neil Hancock. All rights reserved. * diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_usbdev.c b/boards/arm/kinetis/freedom-k66f/src/k66_usbdev.c index 9fd35e8927a..61583762437 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_usbdev.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_usbdev.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/freedom-k66f/src/k66_usbdev.c +/**************************************************************************** + * boards/arm/kinetis/freedom-k66f/src/k66_usbdev.c * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Authors: 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 @@ -52,34 +52,35 @@ #include "kinetis.h" #include "freedom-k66f.h" -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k66_usbinitialize * * Description: * Called to setup USB-related GPIO pins for the FREEDOM-K66F board. * - ************************************************************************************/ + ****************************************************************************/ void k66_usbinitialize(void) { # warning "Missing logic" } -/************************************************************************************ +/**************************************************************************** * Name: kinetis_usbpullup * * Description: - * If USB is supported and the board supports a pullup via GPIO (for USB software - * connect and disconnect), then the board software must provide kinetis_usbpullup. + * If USB is supported and the board supports a pullup via GPIO (for USB + * software connect and disconnect), then the board software must provide + * kinetis_usbpullup. * See include/nuttx/usb/usbdev.h for additional description of this method. - * Alternatively, if no pull-up GPIO the following EXTERN can be redefined to be - * NULL. + * Alternatively, if no pull-up GPIO the following EXTERN can be redefined + * to be NULL. * - ************************************************************************************/ + ****************************************************************************/ int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable) { @@ -88,16 +89,17 @@ int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable) return OK; } -/************************************************************************************ +/**************************************************************************** * Name: kinetis_usbsuspend * * Description: - * Board logic must provide the kinetis_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the kinetis_usbsuspend logic if the USBDEV + * driver is used. + * This function is called whenever the USB enters or leaves suspend mode. + * This is an opportunity for the board logic to shutdown clocks, power, + * etc. while the USB is suspended. * - ************************************************************************************/ + ****************************************************************************/ void kinetis_usbsuspend(FAR struct usbdev_s *dev, bool resume) { diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_usbmsc.c b/boards/arm/kinetis/freedom-k66f/src/k66_usbmsc.c index acd0f390e1f..15266cedcf7 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_usbmsc.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_usbmsc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k66f/src/k66_usbmsc.c + * boards/arm/kinetis/freedom-k66f/src/k66_usbmsc.c * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt @@ -68,7 +68,8 @@ # undef k66_MMCSDSLOTNO # define k66_MMCSDSLOTNO 0 #else - /* Add configuration for new Kinetis boards here */ + /* Add configuration for new Kinetis boards here */ + # error "Unrecognized Kinetis board" #endif @@ -88,7 +89,8 @@ int board_usbmsc_initialize(int port) { /* If system/usbmsc is built as an NSH command, then SD slot should - * already have been initialized in board_app_initialize() (see k66_appinit.c). + * already have been initialized in board_app_initialize() + * (see k66_appinit.c). * In this case, there is nothing further to be done here. */ @@ -96,5 +98,5 @@ int board_usbmsc_initialize(int port) # warning "Missing logic" #endif /* CONFIG_NSH_BUILTIN_APPS */ - return OK; + return OK; } diff --git a/boards/arm/kinetis/freedom-k66f/src/k66_userleds.c b/boards/arm/kinetis/freedom-k66f/src/k66_userleds.c index 168c8859594..bab3fee78ef 100644 --- a/boards/arm/kinetis/freedom-k66f/src/k66_userleds.c +++ b/boards/arm/kinetis/freedom-k66f/src/k66_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/freedom-k66f/src/k66_userleds.c + * boards/arm/kinetis/freedom-k66f/src/k66_userleds.c * * Copyright (C) 2016-2017 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt diff --git a/boards/arm/kinetis/kwikstik-k40/include/board.h b/boards/arm/kinetis/kwikstik-k40/include/board.h index f674f515000..bb785dea290 100644 --- a/boards/arm/kinetis/kwikstik-k40/include/board.h +++ b/boards/arm/kinetis/kwikstik-k40/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/kwikstik-k40/include/board.h +/**************************************************************************** + * boards/arm/kinetis/kwikstik-k40/include/board.h * include/arch/board/board.h * * Copyright (C) 2011 Gregory Nutt. All rights reserved. @@ -32,41 +32,42 @@ * 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_KINETIS_KWIKSTIK-K40_INCLUDE_BOARD_H +#define __BOARDS_ARM_KINETIS_KWIKSTIK-K40_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_EXTAL_FREQ 4000000 /* 4MHz crystal frequency (REFCLK) */ -#define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator */ +#undef BOARD_EXTCLOCK /* Crystal */ +#define BOARD_EXTAL_FREQ 4000000 /* 4MHz crystal frequency (REFCLK) */ +#define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator */ -/* PLL Configuration. NOTE: Only even frequency crystals are supported that will - * produce a 2MHz reference clock to the PLL. +/* PLL Configuration. NOTE: Only even frequency crystals are supported that + * will produce a 2MHz reference clock to the PLL. * * PLL Input frequency: PLLIN = REFCLK/PRDIV = 4MHz/2 = 2MHz * PLL Output frequency: PLLOUT = PLLIN*VDIV = 2Mhz*48 = 96MHz * MCG Frequency: PLLOUT = 96MHz */ -#define BOARD_PRDIV 2 /* PLL External Reference Divider */ -#define BOARD_VDIV 48 /* PLL VCO Divider (frequency multiplier) */ +#define BOARD_PRDIV 2 /* PLL External Reference Divider */ +#define BOARD_VDIV 48 /* PLL VCO Divider (frequency multiplier) */ #define BOARD_PLLIN_FREQ (BOARD_EXTAL_FREQ / BOARD_PRDIV) #define BOARD_PLLOUT_FREQ (BOARD_PLLIN_FREQ * BOARD_VDIV) @@ -84,14 +85,15 @@ #define BOARD_FLEXBUS_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV3) #define BOARD_FLASHCLK_FREQ (BOARD_MCG_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) */ @@ -123,7 +125,8 @@ # define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(15) #endif -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* The KwikStik-K40 board has no MCU driven, GPIO-based LEDs */ #define LED_STARTED 0 @@ -135,15 +138,18 @@ #define LED_ASSERTION 6 #define LED_PANIC 7 -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* The KwikStik-K40 board has no standard GPIO contact buttons */ -/* Alternative pin resolution *******************************************************/ +/* Alternative pin resolution ***********************************************/ + /* If there are alternative configurations for various pins in the - * kinetis_k40pinmux.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. + * kinetis_k40pinmux.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. */ /* On-Board Connections @@ -247,4 +253,4 @@ #define PIN_I2C1_SCL PIN_I2C1_SCL_2 #define PIN_I2C1_SDA PIN_I2C1_SDA_2 -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __BOARDS_ARM_KINETIS_KWIKSTIK-K40_INCLUDE_BOARD_H */ diff --git a/boards/arm/kinetis/kwikstik-k40/scripts/Make.defs b/boards/arm/kinetis/kwikstik-k40/scripts/Make.defs index 982e75325f0..4b4301c2a97 100644 --- a/boards/arm/kinetis/kwikstik-k40/scripts/Make.defs +++ b/boards/arm/kinetis/kwikstik-k40/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/kwikstik-k40/scripts/Make.defs +# boards/arm/kinetis/kwikstik-k40/scripts/Make.defs # # Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kinetis/kwikstik-k40/scripts/kwikstik-k40.ld b/boards/arm/kinetis/kwikstik-k40/scripts/kwikstik-k40.ld index 49af4ed113d..05d7daf876d 100644 --- a/boards/arm/kinetis/kwikstik-k40/scripts/kwikstik-k40.ld +++ b/boards/arm/kinetis/kwikstik-k40/scripts/kwikstik-k40.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/kwikstik-k40/scripts/kwikstik-k40.ld + * boards/arm/kinetis/kwikstik-k40/scripts/kwikstik-k40.ld * * Copyright (C) 2011, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/kwikstik-k40/src/Makefile b/boards/arm/kinetis/kwikstik-k40/src/Makefile index a018a2c2fdc..9e1308f5785 100644 --- a/boards/arm/kinetis/kwikstik-k40/src/Makefile +++ b/boards/arm/kinetis/kwikstik-k40/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/kwikstik-k40/src/Makefile +# boards/arm/kinetis/kwikstik-k40/src/Makefile # # Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kinetis/kwikstik-k40/src/k40_appinit.c b/boards/arm/kinetis/kwikstik-k40/src/k40_appinit.c index 104b6a339df..7e067dd8e52 100644 --- a/boards/arm/kinetis/kwikstik-k40/src/k40_appinit.c +++ b/boards/arm/kinetis/kwikstik-k40/src/k40_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/kwikstik-k40/src/k40_appinit.c + * boards/arm/kinetis/kwikstik-k40/src/k40_appinit.c * * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -57,6 +57,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ /* PORT and SLOT number probably depend on the board configuration */ @@ -72,7 +73,8 @@ # define CONFIG_NSH_MMCSDSLOTNO 0 # endif #else - /* Add configuration for new Kinetis boards here */ + /* Add configuration for new Kinetis boards here */ + # error "Unrecognized Kinetis board" # undef NSH_HAVEUSBDEV # undef NSH_HAVEMMCSD @@ -84,8 +86,8 @@ # undef NSH_HAVEUSBDEV #endif -/* Can't support MMC/SD features if mountpoints are disabled or if SDHC support - * is not enabled. +/* Can't support MMC/SD features if mountpoints are disabled or if SDHC + * support is not enabled. */ #if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_KINETIS_SDHC) @@ -220,6 +222,7 @@ int board_app_initialize(uintptr_t arg) (void)kinetis_pinirqattach(GPIO_SD_CARDDETECT, kinetis_cdinterrupt, NULL); /* Mount the SDHC-based MMC/SD block driver */ + /* First, get an instance of the SDHC interface */ syslog(LOG_INFO, "Initializing SDHC slot %d\n", @@ -241,7 +244,8 @@ int board_app_initialize(uintptr_t arg) ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_nsh.sdhc); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n", + ret); return ret; } diff --git a/boards/arm/kinetis/kwikstik-k40/src/k40_boot.c b/boards/arm/kinetis/kwikstik-k40/src/k40_boot.c index 2420a34771a..a5f56f6612d 100644 --- a/boards/arm/kinetis/kwikstik-k40/src/k40_boot.c +++ b/boards/arm/kinetis/kwikstik-k40/src/k40_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/kwikstik-k40/src/k40_boot.c +/**************************************************************************** + * boards/arm/kinetis/kwikstik-k40/src/k40_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 @@ -47,32 +47,33 @@ #include "up_arch.h" #include "kwikstik-k40.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_boardinitialize * * Description: - * All Kinetis 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 Kinetis 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 kinetis_boardinitialize(void) { - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * kinetis_spidev_initialize() has been brought into the link. + /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak + * function kinetis_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_KINETIS_SPI1) || defined(CONFIG_KINETIS_SPI2) @@ -82,10 +83,10 @@ void kinetis_boardinitialize(void) } #endif - /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not - * disabled, and 3) the weak function kinetis_usbinitialize() has been brought - * into the build. - */ + /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not + * disabled, and 3) the weak function kinetis_usbinitialize() has been + * brought into the build. + */ #if defined(CONFIG_USBDEV) && defined(CONFIG_KINETIS_USB) if (kinetis_usbinitialize) diff --git a/boards/arm/kinetis/kwikstik-k40/src/k40_buttons.c b/boards/arm/kinetis/kwikstik-k40/src/k40_buttons.c index 2fffdcb106c..28599c5f8c6 100644 --- a/boards/arm/kinetis/kwikstik-k40/src/k40_buttons.c +++ b/boards/arm/kinetis/kwikstik-k40/src/k40_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/kwikstik-k40/src/k40_buttons.c + * boards/arm/kinetis/kwikstik-k40/src/k40_buttons.c * * Copyright (C) 2011, 2014-2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -60,8 +60,8 @@ * 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. + * all buttons or board_button_irq() may be called to register button + * interrupt handlers. * ****************************************************************************/ @@ -87,8 +87,8 @@ uint32_t board_buttons(void) * 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. + * 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 @@ -96,9 +96,10 @@ uint32_t board_buttons(void) * 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. + * 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. * diff --git a/boards/arm/kinetis/kwikstik-k40/src/k40_lcd.c b/boards/arm/kinetis/kwikstik-k40/src/k40_lcd.c index a6f7f55e4fd..f87cb028050 100644 --- a/boards/arm/kinetis/kwikstik-k40/src/k40_lcd.c +++ b/boards/arm/kinetis/kwikstik-k40/src/k40_lcd.c @@ -1,5 +1,5 @@ -/************************************************************************************** - * boards/kwikstik-k40/src/k40_lcd.c +/**************************************************************************** + * boards/arm/kinetis/kwikstik-k40/src/k40_lcd.c * * Copyright (C) 2011 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 "up_arch.h" #include "kwikstik-k40.h" -/************************************************************************************** +/**************************************************************************** * Public Functions - **************************************************************************************/ + ****************************************************************************/ -/************************************************************************************** +/**************************************************************************** * Name: board_lcd_initialize * * Description: - * Initialize the LCD video hardware. The initial state of the LCD is fully - * initialized, display memory cleared, and the LCD ready to use, but with the power - * setting at 0 (full off). + * Initialize the LCD video hardware. + * The initial state of the LCD is fully initialized, display memory + * cleared, and the LCD ready to use, but with the power setting at 0 + * (full off). * - **************************************************************************************/ + ****************************************************************************/ int board_lcd_initialize(void) { @@ -70,14 +71,14 @@ int board_lcd_initialize(void) return OK; } -/************************************************************************************** +/**************************************************************************** * Name: board_lcd_getdev * * Description: - * Return a a reference to the LCD object for the specified LCD. This allows support - * for multiple LCD devices. + * Return a a reference to the LCD object for the specified LCD. + * This allows support for multiple LCD devices. * - **************************************************************************************/ + ****************************************************************************/ FAR struct lcd_dev_s *board_lcd_getdev(int lcddev) { @@ -86,13 +87,13 @@ FAR struct lcd_dev_s *board_lcd_getdev(int lcddev) return NULL; } -/************************************************************************************** +/**************************************************************************** * Name: board_lcd_uninitialize * * Description: * Unitialize the LCD support * - **************************************************************************************/ + ****************************************************************************/ void board_lcd_uninitialize(void) { diff --git a/boards/arm/kinetis/kwikstik-k40/src/k40_leds.c b/boards/arm/kinetis/kwikstik-k40/src/k40_leds.c index b4fe42f9f97..cf7d750106c 100644 --- a/boards/arm/kinetis/kwikstik-k40/src/k40_leds.c +++ b/boards/arm/kinetis/kwikstik-k40/src/k40_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/kwikstik-k40/src/k40_leds.c + * boards/arm/kinetis/kwikstik-k40/src/k40_leds.c * * Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/kwikstik-k40/src/k40_spi.c b/boards/arm/kinetis/kwikstik-k40/src/k40_spi.c index b558db7fb2a..6678e4cd02e 100644 --- a/boards/arm/kinetis/kwikstik-k40/src/k40_spi.c +++ b/boards/arm/kinetis/kwikstik-k40/src/k40_spi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/kwikstik-k40/src/k40_spi.c +/**************************************************************************** + * boards/arm/kinetis/kwikstik-k40/src/k40_spi.c * * Copyright (C) 2011 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 @@ -52,19 +52,19 @@ #include "kwikstik-k40.h" #if defined(CONFIG_KINETIS_SPI0) || defined(CONFIG_KINETIS_SPI1) || \ - defined(CONFIG_KINETIS_SPI2) + defined(CONFIG_KINETIS_SPI2) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the KwikStik-K40 board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function kinetis_spidev_initialize(void) { @@ -75,31 +75,35 @@ void weak_function kinetis_spidev_initialize(void) * Name: kinetis_spi0/1/2select and kinetis_spi0/1/2status * * Description: - * The external functions, kinetis_spi0/1/2select and kinetis_spi0/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 kinetis_spibus_initialize()) - * are provided by common Kinetis logic. To use this common SPI logic on your - * board: + * The external functions, kinetis_spi0/1/2select and + * kinetis_spi0/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 kinetis_spibus_initialize()) are provided + * by common Kinetis logic. + * To use this common SPI logic on your board: * - * 1. Provide logic in kinetis_boardinitialize() to configure SPI chip select - * pins. - * 2. Provide kinetis_spi0/1/2select() and kinetis_spi0/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 kinetis_spibus_initialize() in your low level application - * initialization logic - * 4. The handle returned by kinetis_spibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 1. Provide logic in kinetis_boardinitialize() to configure SPI chip + * select pins. + * 2. Provide kinetis_spi0/1/2select() and kinetis_spi0/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 kinetis_spibus_initialize() in your low level + * application initialization logic + * 4. The handle returned by kinetis_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). * ****************************************************************************/ #ifdef CONFIG_KINETIS_SPI0 -void kinetis_spi0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi0select(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"); # warning "Missing logic" } @@ -111,9 +115,11 @@ uint8_t kinetis_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_KINETIS_SPI1 -void kinetis_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi1select(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"); # warning "Missing logic" } @@ -125,9 +131,11 @@ uint8_t kinetis_spi1status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_KINETIS_SPI2 -void kinetis_spi2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi2select(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"); # warning "Missing logic" } diff --git a/boards/arm/kinetis/kwikstik-k40/src/k40_usbdev.c b/boards/arm/kinetis/kwikstik-k40/src/k40_usbdev.c index d97a203caab..5c342f68ed6 100644 --- a/boards/arm/kinetis/kwikstik-k40/src/k40_usbdev.c +++ b/boards/arm/kinetis/kwikstik-k40/src/k40_usbdev.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/kwikstik-k40/src/k40_usbdev.c +/**************************************************************************** + * boards/arm/kinetis/kwikstik-k40/src/k40_usbdev.c * * Copyright (C) 2011 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,42 +51,43 @@ #include "kinetis.h" #include "kwikstik-k40.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_usbinitialize * * Description: * Called to setup USB-related GPIO pins for the KwikStik-K40 board. * - ************************************************************************************/ + ****************************************************************************/ void kinetis_usbinitialize(void) { # warning "Missing logic" } -/************************************************************************************ +/**************************************************************************** * Name: kinetis_usbpullup * * Description: - * If USB is supported and the board supports a pullup via GPIO (for USB software - * connect and disconnect), then the board software must provide kinetis_pullup. + * If USB is supported and the board supports a pullup via GPIO (for USB + * software connect and disconnect), then the board software must provide + * kinetis_pullup. * See include/nuttx/usb/usbdev.h for additional description of this method. - * Alternatively, if no pull-up GPIO the following EXTERN can be redefined to be - * NULL. + * Alternatively, if no pull-up GPIO the following EXTERN can be redefined + * to be NULL. * - ************************************************************************************/ + ****************************************************************************/ int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable) { @@ -95,16 +96,17 @@ int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable) return OK; } -/************************************************************************************ +/**************************************************************************** * Name: kinetis_usbsuspend * * Description: - * Board logic must provide the kinetis_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the kinetis_usbsuspend logic if the USBDEV + * driver is used. + * This function is called whenever the USB enters or leaves suspend mode. + * This is an opportunity for the board logic to shutdown clocks, power, + * etc. while the USB is suspended. * - ************************************************************************************/ + ****************************************************************************/ void kinetis_usbsuspend(FAR struct usbdev_s *dev, bool resume) { diff --git a/boards/arm/kinetis/kwikstik-k40/src/k40_usbmsc.c b/boards/arm/kinetis/kwikstik-k40/src/k40_usbmsc.c index e804eed3f10..ccba362e83e 100644 --- a/boards/arm/kinetis/kwikstik-k40/src/k40_usbmsc.c +++ b/boards/arm/kinetis/kwikstik-k40/src/k40_usbmsc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/kwikstik-k40/src/k40_usbmsc.c + * boards/arm/kinetis/kwikstik-k40/src/k40_usbmsc.c * * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -67,7 +67,8 @@ # undef KINETIS_MMCSDSLOTNO # define KINETIS_MMCSDSLOTNO 0 #else - /* Add configuration for new Kinetis boards here */ + /* Add configuration for new Kinetis boards here */ + # error "Unrecognized Kinetis board" #endif @@ -86,7 +87,8 @@ int board_usbmsc_initialize(int port) { /* If system/usbmsc is built as an NSH command, then SD slot should - * already have been initialized in board_app_initialize() (see k40_appinit.c). + * already have been initialized in board_app_initialize() + * (see k40_appinit.c). * In this case, there is nothing further to be done here. */ @@ -94,5 +96,5 @@ int board_usbmsc_initialize(int port) # warning "Missing logic" #endif /* CONFIG_NSH_BUILTIN_APPS */ - return OK; + return OK; } diff --git a/boards/arm/kinetis/kwikstik-k40/src/kwikstik-k40.h b/boards/arm/kinetis/kwikstik-k40/src/kwikstik-k40.h index 7165864ea02..89ea4236a37 100644 --- a/boards/arm/kinetis/kwikstik-k40/src/kwikstik-k40.h +++ b/boards/arm/kinetis/kwikstik-k40/src/kwikstik-k40.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/kwikstik-k40/src/kwikstik-k40.h +/**************************************************************************** + * boards/arm/kinetis/kwikstik-k40/src/kwikstik-k40.h * arch/arm/src/board/kwikstik-k40.h * * Copyright (C) 2011 Gregory Nutt. All rights reserved. @@ -32,23 +32,23 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_KWIKSTK_K40_SRC_KWIKSTIK_H -#define __BOARDS_ARM_KWIKSTK_K40_SRC_KWIKSTIK_H +#ifndef __BOARDS_ARM_KINETIS_KWIKSTK_K40_SRC_KWIKSTIK_H +#define __BOARDS_ARM_KINETIS_KWIKSTK_K40_SRC_KWIKSTIK_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* How many SPI modules does this chip support? The LM3S6918 supports 2 SPI * modules (others may support more -- in such case, the following must be @@ -62,7 +62,8 @@ # undef CONFIG_KINETIS_SPI2 #endif -/* KwikStik-K40 GPIOs ***************************************************************/ +/* KwikStik-K40 GPIOs *******************************************************/ + /* On-Board Connections * * ------------------- -------------------------- -------- ------------------- @@ -145,40 +146,39 @@ * B52 GPIO5 / SD_CARD_DET PTA16 */ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the KwikStik-K40 board. * - ************************************************************************************/ + ****************************************************************************/ extern void weak_function kinetis_spidev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: kinetis_usbinitialize * * Description: * Called to setup USB-related GPIO pins for the KwikStik-K40 board. * - ************************************************************************************/ + ****************************************************************************/ extern void weak_function kinetis_usbinitialize(void); #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_KWIKSTK_K40_SRC_KWIKSTIK_H */ - +#endif /* __BOARDS_ARM_KINETIS_KWIKSTK_K40_SRC_KWIKSTIK_H */ diff --git a/boards/arm/kinetis/teensy-3.x/README.txt b/boards/arm/kinetis/teensy-3.x/README.txt index d70667b8c9c..37621596507 100644 --- a/boards/arm/kinetis/teensy-3.x/README.txt +++ b/boards/arm/kinetis/teensy-3.x/README.txt @@ -30,9 +30,9 @@ README --------------- -------------- -------------- --------------------------- NOTES: - 1. Settings in boards/teensy-3.x/include/board.h will automatically + 1. Settings in boards/arm/kinetis/teensy-3.x/include/board.h will automatically select the correct clocking based on CONFIG_ARCH_CHIP_MK20DX128VLH5=y. - 2. The linker script at boards/teensy-3.x/scripts/mk30dx128vlh5.ld will + 2. The linker script at boards/arm/kinetis/teensy-3.x/scripts/mk30dx128vlh5.ld will automatically be selected when CONFIG_ARCH_CHIP_MK20DX128VLH5=y. It will use the correct FLASH and SRAM sizes. diff --git a/boards/arm/kinetis/teensy-3.x/include/board.h b/boards/arm/kinetis/teensy-3.x/include/board.h index 79f5987d840..7d3e97d79ce 100644 --- a/boards/arm/kinetis/teensy-3.x/include/board.h +++ b/boards/arm/kinetis/teensy-3.x/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/teensy-3.x/include/board.h +/**************************************************************************** + * boards/arm/kinetis/teensy-3.x/include/board.h * include/arch/board/board.h * * Copyright (C) 2015-2017 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_TEENSY_3X_INCLUDE_BOARD_H -#define __BOARDS_ARM_TEENSY_3X_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_KINETIS_TEENSY_3X_INCLUDE_BOARD_H +#define __BOARDS_ARM_KINETIS_TEENSY_3X_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -48,31 +48,35 @@ # include #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* Clocking *****************************************************************/ -/* Clocking *************************************************************************/ /* The teensy-3.1 has a 16MHz crystal on board */ -#undef BOARD_EXTCLOCK /* Crystal */ -#define BOARD_EXTAL_LP /* Low Power, as opposed to Hi Gain */ +#undef BOARD_EXTCLOCK /* Crystal */ +#define BOARD_EXTAL_LP /* Low Power, as opposed to Hi Gain */ -/* BOARD_FRDIV is MCG_C1_FRDIV_DIV512 from kinetis_mcg.h. According to the k20 - * reference manual, when transitioning MCG clock modes to FLL Bypassed External - * the C1 divider must be set so that the FLL clock is between 31.25 and 39.0625 khz. +/* BOARD_FRDIV is MCG_C1_FRDIV_DIV512 from kinetis_mcg.h. + * According to the k20 reference manual, when transitioning MCG clock modes + * to FLL Bypassed External the C1 divider must be set so that the FLL clock + * is between 31.25 and 39.0625 khz. * For teensy-3.x that works out to a divider of 512. */ #define BOARD_FRDIV MCG_C1_FRDIV_DIV512 -#define BOARD_EXTAL_FREQ 16000000 /* 16MHz crystal frequency (REFCLK) */ -#define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator (not populated) */ +#define BOARD_EXTAL_FREQ 16000000 /* 16MHz crystal frequency (REFCLK) */ +#define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator (not populated) */ -/* PLL Configuration. NOTE: Only even frequency crystals are supported that will - * produce a 2MHz reference clock to the PLL. The rated speed for the MK20DX256VLH7 - * is 72MHz and 50MHz for the MK20DX128VLH5, but according to the PJRC website, - * both can be overclocked at 96MHz +/* PLL Configuration. + * NOTE: Only even frequency crystals are supported that will produce a 2MHz + * reference clock to the PLL. + * The rated speed for the MK20DX256VLH7 is 72MHz and 50MHz for the + * MK20DX128VLH5, but according to the PJRC website, both can be overclocked + * at 96MHz * * MK20DX128VLH5 Rated Frequency 50MHz (selecting 48Mhz to use USB) * @@ -95,42 +99,42 @@ #if defined(CONFIG_TEENSY_3X_OVERCLOCK) /* PLL Configuration */ -# define BOARD_PRDIV 8 /* PLL External Reference Divider */ -# define BOARD_VDIV 48 /* PLL VCO Divider (frequency multiplier) */ +# define BOARD_PRDIV 8 /* PLL External Reference Divider */ +# define BOARD_VDIV 48 /* PLL VCO Divider (frequency multiplier) */ /* SIM CLKDIV1 dividers */ -# define BOARD_OUTDIV1 1 /* Core = MCG, 96MHz */ -# define BOARD_OUTDIV2 2 /* Bus = MCG/2, 48MHz */ -# define BOARD_OUTDIV3 0 /* N/A = No OUTDIV3 */ -# define BOARD_OUTDIV4 4 /* Flash clock = MCG/4, 24MHz */ +# define BOARD_OUTDIV1 1 /* Core = MCG, 96MHz */ +# define BOARD_OUTDIV2 2 /* Bus = MCG/2, 48MHz */ +# define BOARD_OUTDIV3 0 /* N/A = No OUTDIV3 */ +# define BOARD_OUTDIV4 4 /* Flash clock = MCG/4, 24MHz */ #elif defined(CONFIG_ARCH_CHIP_MK20DX256VLH7) /* PLL Configuration */ -# define BOARD_PRDIV 8 /* PLL External Reference Divider */ -# define BOARD_VDIV 36 /* PLL VCO Divider (frequency multiplier) */ +# define BOARD_PRDIV 8 /* PLL External Reference Divider */ +# define BOARD_VDIV 36 /* PLL VCO Divider (frequency multiplier) */ /* SIM CLKDIV1 dividers */ -# define BOARD_OUTDIV1 1 /* Core = MCG, 72MHz */ -# define BOARD_OUTDIV2 2 /* Bus = MCG/2, 36MHz */ -# define BOARD_OUTDIV3 0 /* N/A = No OUTDIV3 */ -# define BOARD_OUTDIV4 3 /* Flash clock = MCG/3, 72MHz */ +# define BOARD_OUTDIV1 1 /* Core = MCG, 72MHz */ +# define BOARD_OUTDIV2 2 /* Bus = MCG/2, 36MHz */ +# define BOARD_OUTDIV3 0 /* N/A = No OUTDIV3 */ +# define BOARD_OUTDIV4 3 /* Flash clock = MCG/3, 72MHz */ #elif defined(CONFIG_ARCH_CHIP_MK20DX128VLH5) /* PLL Configuration */ -# define BOARD_PRDIV 8 /* PLL External Reference Divider */ -# define BOARD_VDIV 24 /* PLL VCO Divider (frequency multiplier) */ +# define BOARD_PRDIV 8 /* PLL External Reference Divider */ +# define BOARD_VDIV 24 /* PLL VCO Divider (frequency multiplier) */ /* SIM CLKDIV1 dividers */ -# define BOARD_OUTDIV1 1 /* Core = MCG, 48MHz */ -# define BOARD_OUTDIV2 1 /* Bus = MCG/1, 48MHz */ -# define BOARD_OUTDIV3 0 /* N/A = No OUTDIV3 */ -# define BOARD_OUTDIV4 2 /* Flash clock = MCG/2, 24MHz */ +# define BOARD_OUTDIV1 1 /* Core = MCG, 48MHz */ +# define BOARD_OUTDIV2 1 /* Bus = MCG/1, 48MHz */ +# define BOARD_OUTDIV3 0 /* N/A = No OUTDIV3 */ +# define BOARD_OUTDIV4 2 /* Flash clock = MCG/2, 24MHz */ #endif #define BOARD_PLLIN_FREQ (BOARD_EXTAL_FREQ / BOARD_PRDIV) @@ -149,9 +153,9 @@ #define BOARD_SOPT2_PLLFLLSEL SIM_SOPT2_PLLFLLSEL_MCGPLLCLK #define BOARD_SOPT2_FREQ BOARD_MCG_FREQ - /* Divider output clock = Divider input clock × [ (USBFRAC+1) / (USBDIV+1) ] - * SIM_CLKDIV2_FREQ = BOARD_SOPT2_FREQ × [ (USBFRAC+1) / (USBDIV+1) ] - */ + /* Divider output clock = Divider input clock × [ (USBFRAC+1) / (USBDIV+1) ] + * SIM_CLKDIV2_FREQ = BOARD_SOPT2_FREQ × [ (USBFRAC+1) / (USBDIV+1) ] + */ #if BOARD_SOPT2_FREQ == 96000000 /* USBFRAC/USBDIV = 1/2 of 96Mhz clock = 48MHz */ @@ -184,6 +188,7 @@ #define BOARD_USB_FLASHACCESS /* PWM Configuration */ + /* FTM0 Channels */ #define GPIO_FTM0_CH0OUT PIN_FTM0_CH0_2 /* Pin 22: PTC1 */ @@ -205,9 +210,10 @@ #define GPIO_FTM2_CH0OUT PIN_FTM2_CH0 /* Pin 25: PTB18 */ #define GPIO_FTM2_CH1OUT PIN_FTM2_CH1 /* Pin 32: PTB19 */ -/* LED definitions ******************************************************************/ -/* A single LED is available driven by PTC5. The LED is grounded so bringing PTC5 - * high will illuminate the LED. +/* LED definitions **********************************************************/ + +/* A single LED is available driven by PTC5. + * The LED is grounded so bringing PTC5 high will illuminate the LED. */ /* LED index values for use with board_userled() */ @@ -220,10 +226,11 @@ #define BOARD_LED_BIT (1 << BOARD_LED) /* When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will - * control the LED as defined below. Thus if the LED is statically on, NuttX has - * successfully booted and is, apparently, running normally. If the LED is - * flashing at approximately 2Hz, then a fatal error has been detected and the - * system has halted. + * control the LED as defined below. + * Thus if the LED is statically on, NuttX has successfully booted and is, + * apparently, running normally. + * If the LED is flashing at approximately 2Hz, then a fatal error has been + * detected and the system has halted. */ #define LED_STARTED 0 /* STATUS LED=OFF */ @@ -235,10 +242,12 @@ #define LED_ASSERTION 3 /* STATUS LED=no change */ #define LED_PANIC 3 /* STATUS LED=flashing */ -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* The teensy-3.1 board has no standard GPIO contact buttons */ -/* Alternative pin resolution *******************************************************/ +/* Alternative pin resolution ***********************************************/ + /* The K20 has three UARTs with pin availability as follows: * * --------- ------ ----------- ------------------------- @@ -296,4 +305,4 @@ #endif #endif -#endif /* __BOARDS_ARM_TEENSY_3X_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_KINETIS_TEENSY_3X_INCLUDE_BOARD_H */ diff --git a/boards/arm/kinetis/teensy-3.x/scripts/Make.defs b/boards/arm/kinetis/teensy-3.x/scripts/Make.defs index 30f92518122..0e9effe0a9f 100644 --- a/boards/arm/kinetis/teensy-3.x/scripts/Make.defs +++ b/boards/arm/kinetis/teensy-3.x/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/teensy-3.1/scripts/Make.defs +# boards/arm/kinetis/teensy-3.1/scripts/Make.defs # # Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kinetis/teensy-3.x/scripts/mk20dx128vlh5.ld b/boards/arm/kinetis/teensy-3.x/scripts/mk20dx128vlh5.ld index 850edec16ea..78a9da69cb5 100644 --- a/boards/arm/kinetis/teensy-3.x/scripts/mk20dx128vlh5.ld +++ b/boards/arm/kinetis/teensy-3.x/scripts/mk20dx128vlh5.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/teensy-3.x/scripts/mk20dx128vlh5.ld + * boards/arm/kinetis/teensy-3.x/scripts/mk20dx128vlh5.ld * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/teensy-3.x/scripts/mk20dx256vlh7.ld b/boards/arm/kinetis/teensy-3.x/scripts/mk20dx256vlh7.ld index eede347697b..15506640ec1 100644 --- a/boards/arm/kinetis/teensy-3.x/scripts/mk20dx256vlh7.ld +++ b/boards/arm/kinetis/teensy-3.x/scripts/mk20dx256vlh7.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/teensy-3.x/scripts/mk20dx256vlh7.ld + * boards/arm/kinetis/teensy-3.x/scripts/mk20dx256vlh7.ld * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/teensy-3.x/src/Makefile b/boards/arm/kinetis/teensy-3.x/src/Makefile index 26d949efe87..e239124081f 100644 --- a/boards/arm/kinetis/teensy-3.x/src/Makefile +++ b/boards/arm/kinetis/teensy-3.x/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/teensy-3.x/src/Makefile +# boards/arm/kinetis/teensy-3.x/src/Makefile # # Copyright (C) 2015, 2016 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kinetis/teensy-3.x/src/k20_appinit.c b/boards/arm/kinetis/teensy-3.x/src/k20_appinit.c index 9d89040fd87..d1bfd79c408 100644 --- a/boards/arm/kinetis/teensy-3.x/src/k20_appinit.c +++ b/boards/arm/kinetis/teensy-3.x/src/k20_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/teensy-3.x/src/k20_appinit.c + * boards/arm/kinetis/teensy-3.x/src/k20_appinit.c * * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/teensy-3.x/src/k20_autoleds.c b/boards/arm/kinetis/teensy-3.x/src/k20_autoleds.c index 1de6dbca6ed..1482bb97ab1 100644 --- a/boards/arm/kinetis/teensy-3.x/src/k20_autoleds.c +++ b/boards/arm/kinetis/teensy-3.x/src/k20_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/teensy-3.x/src/k20_autoleds.c + * boards/arm/kinetis/teensy-3.x/src/k20_autoleds.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/teensy-3.x/src/k20_boot.c b/boards/arm/kinetis/teensy-3.x/src/k20_boot.c index 463927c69d5..1ab3804c61c 100644 --- a/boards/arm/kinetis/teensy-3.x/src/k20_boot.c +++ b/boards/arm/kinetis/teensy-3.x/src/k20_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/teensy-3.x/src/k20_boot.c +/**************************************************************************** + * boards/arm/kinetis/teensy-3.x/src/k20_boot.c * * Copyright (C) 2015-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 @@ -47,25 +47,26 @@ #include "up_arch.h" #include "teensy-3x.h" -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_boardinitialize * * Description: - * All Kinetis 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 Kinetis 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 kinetis_boardinitialize(void) { #if defined(CONFIG_KINETIS_SPI1) || defined(CONFIG_KINETIS_SPI2) - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * kinetis_spidev_initialize() has been brought into the link. + /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak + * function kinetis_spidev_initialize() has been brought into the link. */ if (kinetis_spidev_initialize) diff --git a/boards/arm/kinetis/teensy-3.x/src/k20_i2c.c b/boards/arm/kinetis/teensy-3.x/src/k20_i2c.c index 792e5edfe33..7d633f039f0 100644 --- a/boards/arm/kinetis/teensy-3.x/src/k20_i2c.c +++ b/boards/arm/kinetis/teensy-3.x/src/k20_i2c.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/teensy-3.x/src/k20_i2c.c + * boards/arm/kinetis/teensy-3.x/src/k20_i2c.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Matias v01d @@ -33,9 +33,9 @@ * ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -54,17 +54,17 @@ #if defined(CONFIG_KINETIS_I2C0) || defined(CONFIG_KINETIS_I2C1) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_i2cdev_initialize * * Description: * Called to configure I2C * - ************************************************************************************/ + ****************************************************************************/ void kinetis_i2cdev_initialize(void) { diff --git a/boards/arm/kinetis/teensy-3.x/src/k20_pwm.c b/boards/arm/kinetis/teensy-3.x/src/k20_pwm.c index f79e3f9c2c7..b1e2182d2b1 100644 --- a/boards/arm/kinetis/teensy-3.x/src/k20_pwm.c +++ b/boards/arm/kinetis/teensy-3.x/src/k20_pwm.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/teensy-3.x/src/k20_pwm.c +/**************************************************************************** + * boards/arm/kinetis/teensy-3.x/src/k20_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 "kinetis_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 *kinetis_pwminitialize(int timer); -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ int kinetis_pwm_setup(void) { @@ -108,6 +110,7 @@ int kinetis_pwm_setup(void) } /* Now we are initialized */ + #endif #ifdef CONFIG_KINETIS_FTM1_PWM @@ -128,6 +131,7 @@ int kinetis_pwm_setup(void) } /* Now we are initialized */ + #endif #ifdef CONFIG_KINETIS_FTM2_PWM @@ -148,6 +152,7 @@ int kinetis_pwm_setup(void) } /* Now we are initialized */ + #endif initialized = true; } diff --git a/boards/arm/kinetis/teensy-3.x/src/k20_spi.c b/boards/arm/kinetis/teensy-3.x/src/k20_spi.c index efba66e16b9..69b18039c32 100644 --- a/boards/arm/kinetis/teensy-3.x/src/k20_spi.c +++ b/boards/arm/kinetis/teensy-3.x/src/k20_spi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/teensy-3.x/src/k20_spi.c +/**************************************************************************** + * boards/arm/kinetis/teensy-3.x/src/k20_spi.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 @@ -52,54 +52,58 @@ #include "teensy-3x.h" #if defined(CONFIG_KINETIS_SPI0) || defined(CONFIG_KINETIS_SPI1) || \ - defined(CONFIG_KINETIS_SPI2) + defined(CONFIG_KINETIS_SPI2) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the KwikStik-K40 board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function kinetis_spidev_initialize(void) { # warning "Missing logic" } -/************************************************************************************ +/**************************************************************************** * Name: kinetis_spi0/1/2select and kinetis_spi0/1/2status * * Description: - * The external functions, kinetis_spi0/1/2select and kinetis_spi0/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 kinetis_spibus_initialize()) - * are provided by common Kinetis logic. To use this common SPI logic on your - * board: + * The external functions, kinetis_spi0/1/2select and kinetis_spi0/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 kinetis_spibus_initialize()) are provided by + * common Kinetis logic. + * To use this common SPI logic on your board: * - * 1. Provide logic in kinetis_boardinitialize() to configure SPI chip select - * pins. - * 2. Provide kinetis_spi0/1/2select() and kinetis_spi0/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 kinetis_spibus_initialize() in your low level application - * initialization logic - * 4. The handle returned by kinetis_spibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 1. Provide logic in kinetis_boardinitialize() to configure SPI chip + * select pins. + * 2. Provide kinetis_spi0/1/2select() and kinetis_spi0/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 kinetis_spibus_initialize() in your low level + * application initialization logic + * 4. The handle returned by kinetis_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). * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_KINETIS_SPI0 -void kinetis_spi0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi0select(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"); # warning "Missing logic" } @@ -111,9 +115,11 @@ uint8_t kinetis_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_KINETIS_SPI1 -void kinetis_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi1select(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"); # warning "Missing logic" } @@ -125,9 +131,11 @@ uint8_t kinetis_spi1status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_KINETIS_SPI2 -void kinetis_spi2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi2select(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"); # warning "Missing logic" } diff --git a/boards/arm/kinetis/teensy-3.x/src/k20_usbdev.c b/boards/arm/kinetis/teensy-3.x/src/k20_usbdev.c index a71d8f246d4..3f73ee4f023 100644 --- a/boards/arm/kinetis/teensy-3.x/src/k20_usbdev.c +++ b/boards/arm/kinetis/teensy-3.x/src/k20_usbdev.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/teensy-3.x/src/k20_usbdev.c +/**************************************************************************** + * boards/arm/kinetis/teensy-3.x/src/k20_usbdev.c * * Copyright (C) 2011, 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,40 +53,41 @@ #include "hardware/kinetis_sim.h" #include "teensy-3x.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #define khci_getreg(addr) getreg8(addr) #define khci_putreg(val,addr) putreg8(val,addr) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_usbinitialize * * Description: * Called to setup USB-related GPIO pins for the KwikStik-K40 board. * - ************************************************************************************/ + ****************************************************************************/ void kinetis_usbinitialize(void) { } -/************************************************************************************ +/**************************************************************************** * Name: kinetis_usbpullup * * Description: - * If USB is supported and the board supports a pullup via GPIO (for USB software - * connect and disconnect), then the board software must provide kinetis_pullup. + * If USB is supported and the board supports a pullup via GPIO (for USB + * software connect and disconnect), then the board software must provide + * kinetis_pullup. * See include/nuttx/usb/usbdev.h for additional description of this method. - * Alternatively, if no pull-up GPIO the following EXTERN can be redefined to be - * NULL. + * Alternatively, if no pull-up GPIO the following EXTERN can be redefined + * to be NULL. * - ************************************************************************************/ + ****************************************************************************/ int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable) { @@ -101,7 +102,7 @@ int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable) } else { - khci_putreg(0,KINETIS_USB0_CONTROL); + khci_putreg(0, KINETIS_USB0_CONTROL); } #if 0 @@ -116,22 +117,23 @@ int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable) regval &= ~(1 << 2); } - khci_putreg(regval,KINETIS_USB0_OTGCTL); + khci_putreg(regval, KINETIS_USB0_OTGCTL); #endif return OK; } -/************************************************************************************ +/**************************************************************************** * Name: kinetis_usbsuspend * * Description: - * Board logic must provide the kinetis_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the kinetis_usbsuspend logic if the USBDEV + * driver is used. This function is called whenever the USB enters or + * leaves suspend mode. + * This is an opportunity for the board logic to shutdown clocks, power, + * etc. while the USB is suspended. * - ************************************************************************************/ + ****************************************************************************/ void kinetis_usbsuspend(FAR struct usbdev_s *dev, bool resume) { diff --git a/boards/arm/kinetis/teensy-3.x/src/k20_userleds.c b/boards/arm/kinetis/teensy-3.x/src/k20_userleds.c index af2210731cf..0841715fcb6 100644 --- a/boards/arm/kinetis/teensy-3.x/src/k20_userleds.c +++ b/boards/arm/kinetis/teensy-3.x/src/k20_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/teensy-3.x/src/kinetis_userleds.c + * boards/arm/kinetis/teensy-3.x/src/kinetis_userleds.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/teensy-3.x/src/teensy-3x.h b/boards/arm/kinetis/teensy-3.x/src/teensy-3x.h index ea615911287..8a7c4f780d3 100644 --- a/boards/arm/kinetis/teensy-3.x/src/teensy-3x.h +++ b/boards/arm/kinetis/teensy-3.x/src/teensy-3x.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/teensy-3.x/src/teensy-3x.h +/**************************************************************************** + * boards/arm/kinetis/teensy-3.x/src/teensy-3x.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,14 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_TEENSY_3X_SRC_TEENSY_3X_H -#define __BOARDS_ARM_TEENSY_3X_SRC_TEENSY_3X_H +#ifndef __BOARDS_ARM_KINETIS_TEENSY_3X_SRC_TEENSY_3X_H +#define __BOARDS_ARM_KINETIS_TEENSY_3X_SRC_TEENSY_3X_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -46,9 +46,9 @@ #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* How many SPI modules does this chip support? The LM3S6918 supports 2 SPI * modules (others may support more -- in such case, the following must be @@ -62,71 +62,71 @@ # undef CONFIG_KINETIS_SPI2 #endif -/* Teensy 3.1 GPIOs *****************************************************************/ -/* A single LED is available driven by PTC5. The LED is grounded so bringing PTC5 - * high will illuminate the LED. +/* Teensy 3.1 GPIOs *********************************************************/ + +/* A single LED is available driven by PTC5. + * The LED is grounded so bringing PTC5 high will illuminate the LED. */ #define GPIO_LED (GPIO_HIGHDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTC | PIN5) -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ FAR struct i2c_master_s* i2c_dev; #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the KwikStik-K40 board. * - ************************************************************************************/ + ****************************************************************************/ extern void weak_function kinetis_spidev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: kinetis_i2cdev_initialize * * Description: * Called to configure I2C * - ************************************************************************************/ + ****************************************************************************/ void kinetis_i2cdev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: kinetis_usbinitialize * * Description: * Called to setup USB-related GPIO pins for the KwikStik-K40 board. * - ************************************************************************************/ + ****************************************************************************/ extern void weak_function kinetis_usbinitialize(void); -/************************************************************************************ +/**************************************************************************** * Name: kinetis_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PWM int kinetis_pwm_setup(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_TEENSY_3X_SRC_TEENSY_3X_H */ - +#endif /* __BOARDS_ARM_KINETIS_TEENSY_3X_SRC_TEENSY_3X_H */ diff --git a/boards/arm/kinetis/twr-k60n512/include/board.h b/boards/arm/kinetis/twr-k60n512/include/board.h index dde3999a80c..ef9065dae09 100644 --- a/boards/arm/kinetis/twr-k60n512/include/board.h +++ b/boards/arm/kinetis/twr-k60n512/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/twr-k60n512/include/board.h +/**************************************************************************** + * boards/arm/kinetis/twr-k60n512/include/board.h * include/arch/board/board.h * * Copyright (C) 2011 Gregory Nutt. All rights reserved. @@ -32,42 +32,44 @@ * 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_KINETIS_TWR-K60N512_INCLUDE_BOARD_H +#define __BOARDS_ARM_KINETIS_TWR-K60N512_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #ifndef __ASSEMBLY__ # include #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* Clocking *****************************************************************/ -/* Clocking *************************************************************************/ /* The K60 tower board uses a 50MHz external clock */ #define BOARD_EXTCLOCK 1 /* External clock */ #define BOARD_EXTAL_FREQ 50000000 /* 50MHz Oscillator */ #define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator */ -/* PLL Configuration. Either the external clock or crystal frequency is used to - * select the PRDIV value. Only reference clock frequencies are supported that will - * produce a 2MHz reference clock to the PLL. +/* PLL Configuration. Either the external clock or crystal frequency is used + * to select the PRDIV value. + * Only reference clock frequencies are supported that will produce a 2MHz + * reference clock to the PLL. * * PLL Input frequency: PLLIN = REFCLK/PRDIV = 50MHz/25 = 2MHz * PLL Output frequency: PLLOUT = PLLIN*VDIV = 2Mhz*48 = 96MHz * MCG Frequency: PLLOUT = 96MHz */ -#define BOARD_PRDIV 25 /* PLL External Reference Divider */ -#define BOARD_VDIV 48 /* PLL VCO Divider (frequency multiplier) */ +#define BOARD_PRDIV 25 /* PLL External Reference Divider */ +#define BOARD_VDIV 48 /* PLL VCO Divider (frequency multiplier) */ #define BOARD_PLLIN_FREQ (BOARD_EXTAL_FREQ / BOARD_PRDIV) #define BOARD_PLLOUT_FREQ (BOARD_PLLIN_FREQ * BOARD_VDIV) @@ -85,14 +87,15 @@ #define BOARD_FLEXBUS_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV3) #define BOARD_FLASHCLK_FREQ (BOARD_MCG_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) */ @@ -124,7 +127,8 @@ # define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(15) #endif -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* The TWR-K60N512 has four LEDs: * * 1. E1 / Orange LED PTA11 @@ -144,7 +148,8 @@ #define LED_ASSERTION 6 /* LED1 + LED2 + LED3 */ #define LED_PANIC 7 /* N/C + N/C + N/C + LED4 */ -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* The TWR-K60N512 has user buttons (plus a reset button): * * 1. SW1 (IRQ0) PTA19 @@ -157,12 +162,13 @@ #define BUTTON_SW1_BIT (1 << BUTTON_SW1) #define BUTTON_SW2_BIT (1 << BUTTON_SW2) -/* Alternative pin resolution *******************************************************/ +/* Alternative pin resolution ***********************************************/ + /* If there are alternative configurations for various pins in the - * kinetis_k60pinmux.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. + * kinetis_k60pinmux.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. */ /* On-Board Connections @@ -369,4 +375,4 @@ * B80 EBI_D0 PTC15 */ -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __BOARDS_ARM_KINETIS_TWR-K60N512_INCLUDE_BOARD_H */ diff --git a/boards/arm/kinetis/twr-k60n512/scripts/Make.defs b/boards/arm/kinetis/twr-k60n512/scripts/Make.defs index 6588de5c421..afe2c266695 100644 --- a/boards/arm/kinetis/twr-k60n512/scripts/Make.defs +++ b/boards/arm/kinetis/twr-k60n512/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/twr-k60n512/scripts/Make.defs +# boards/arm/kinetis/twr-k60n512/scripts/Make.defs # # Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kinetis/twr-k60n512/scripts/twr-k60n512.ld b/boards/arm/kinetis/twr-k60n512/scripts/twr-k60n512.ld index 5200f9f5b7f..1a08ffa4aeb 100644 --- a/boards/arm/kinetis/twr-k60n512/scripts/twr-k60n512.ld +++ b/boards/arm/kinetis/twr-k60n512/scripts/twr-k60n512.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/twr-k60n512/scripts/twr-k60n512.ld + * boards/arm/kinetis/twr-k60n512/scripts/twr-k60n512.ld * * Copyright (C) 2011, 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/twr-k60n512/src/Makefile b/boards/arm/kinetis/twr-k60n512/src/Makefile index 94b0204e747..b3918b17a03 100644 --- a/boards/arm/kinetis/twr-k60n512/src/Makefile +++ b/boards/arm/kinetis/twr-k60n512/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/twr-k60n512/src/Makefile +# boards/arm/kinetis/twr-k60n512/src/Makefile # # Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kinetis/twr-k60n512/src/k60_appinit.c b/boards/arm/kinetis/twr-k60n512/src/k60_appinit.c index 78e3933020f..66045ddaf80 100644 --- a/boards/arm/kinetis/twr-k60n512/src/k60_appinit.c +++ b/boards/arm/kinetis/twr-k60n512/src/k60_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/twr-k60n512/src/k60_appinit.c + * boards/arm/kinetis/twr-k60n512/src/k60_appinit.c * * Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -57,6 +57,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ /* PORT and SLOT number probably depend on the board configuration */ @@ -72,7 +73,8 @@ # define CONFIG_NSH_MMCSDSLOTNO 0 # endif #else - /* Add configuration for new Kinetis boards here */ + /* Add configuration for new Kinetis boards here */ + # error "Unrecognized Kinetis board" # undef NSH_HAVEUSBDEV # undef NSH_HAVEMMCSD @@ -84,8 +86,8 @@ # undef NSH_HAVEUSBDEV #endif -/* Can't support MMC/SD features if mountpoints are disabled or if SDHC support - * is not enabled. +/* Can't support MMC/SD features if mountpoints are disabled or if SDHC + * support is not enabled. */ #if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_KINETIS_SDHC) @@ -231,6 +233,7 @@ int board_app_initialize(uintptr_t arg) kinetis_pinconfig(GPIO_SD_WRPROTECT); /* Mount the SDHC-based MMC/SD block driver */ + /* First, get an instance of the SDHC interface */ syslog(LOG_INFO, "Initializing SDHC slot %d\n", @@ -252,7 +255,8 @@ int board_app_initialize(uintptr_t arg) ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_nsh.sdhc); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n", + ret); return ret; } diff --git a/boards/arm/kinetis/twr-k60n512/src/k60_boot.c b/boards/arm/kinetis/twr-k60n512/src/k60_boot.c index 8e2c156ee10..a9dcd27b7d8 100644 --- a/boards/arm/kinetis/twr-k60n512/src/k60_boot.c +++ b/boards/arm/kinetis/twr-k60n512/src/k60_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/twr-k60n512/src/k60_boot.c +/**************************************************************************** + * boards/arm/kinetis/twr-k60n512/src/k60_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 @@ -47,32 +47,33 @@ #include "up_arch.h" #include "twr-k60n512.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_boardinitialize * * Description: - * All Kinetis 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 Kinetis 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 kinetis_boardinitialize(void) { - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * kinetis_spidev_initialize() has been brought into the link. + /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak + * function kinetis_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_KINETIS_SPI1) || defined(CONFIG_KINETIS_SPI2) @@ -82,10 +83,10 @@ void kinetis_boardinitialize(void) } #endif - /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not - * disabled, and 3) the weak function kinetis_usbinitialize() has been brought - * into the build. - */ + /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not + * disabled, and 3) the weak function kinetis_usbinitialize() has been + * brought into the build. + */ #if defined(CONFIG_USBDEV) && defined(CONFIG_KINETIS_USB) if (kinetis_usbinitialize) diff --git a/boards/arm/kinetis/twr-k60n512/src/k60_buttons.c b/boards/arm/kinetis/twr-k60n512/src/k60_buttons.c index d2dc351155e..0622dc7a7d7 100644 --- a/boards/arm/kinetis/twr-k60n512/src/k60_buttons.c +++ b/boards/arm/kinetis/twr-k60n512/src/k60_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/twr-k60n512/src/k60_buttons.c + * boards/arm/kinetis/twr-k60n512/src/k60_buttons.c * * Copyright (C) 2011, 2014-2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -75,19 +75,19 @@ * 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. * ****************************************************************************/ void board_button_initialize(void) { - /* Configure the two buttons as inputs */ + /* Configure the two buttons as inputs */ - kinetis_pinconfig(GPIO_SW1); - kinetis_pinconfig(GPIO_SW2); + kinetis_pinconfig(GPIO_SW1); + kinetis_pinconfig(GPIO_SW2); } /**************************************************************************** @@ -111,27 +111,28 @@ 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. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_ARCH_IRQBUTTONS int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) diff --git a/boards/arm/kinetis/twr-k60n512/src/k60_leds.c b/boards/arm/kinetis/twr-k60n512/src/k60_leds.c index 3e547126a3e..76d893a4836 100644 --- a/boards/arm/kinetis/twr-k60n512/src/k60_leds.c +++ b/boards/arm/kinetis/twr-k60n512/src/k60_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/twr-k60n512/src/k60_leds.c + * boards/arm/kinetis/twr-k60n512/src/k60_leds.c * * Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -221,12 +221,12 @@ static void led_setonoff(unsigned int bits) #ifdef CONFIG_ARCH_LEDS void board_autoled_initialize(void) { - /* Configure LED1-4 GPIOs for output */ + /* Configure LED1-4 GPIOs for output */ - kinetis_pinconfig(GPIO_LED1); - kinetis_pinconfig(GPIO_LED2); - kinetis_pinconfig(GPIO_LED3); - kinetis_pinconfig(GPIO_LED4); + kinetis_pinconfig(GPIO_LED1); + kinetis_pinconfig(GPIO_LED2); + kinetis_pinconfig(GPIO_LED3); + kinetis_pinconfig(GPIO_LED4); } /**************************************************************************** diff --git a/boards/arm/kinetis/twr-k60n512/src/k60_spi.c b/boards/arm/kinetis/twr-k60n512/src/k60_spi.c index 8b72d92bb7c..8a071e00fcf 100644 --- a/boards/arm/kinetis/twr-k60n512/src/k60_spi.c +++ b/boards/arm/kinetis/twr-k60n512/src/k60_spi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/twr-k60n512/src/k60_spi.c +/**************************************************************************** + * boards/arm/kinetis/twr-k60n512/src/k60_spi.c * * Copyright (C) 2011 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 @@ -52,19 +52,19 @@ #include "twr-k60n512.h" #if defined(CONFIG_KINETIS_SPI0) || defined(CONFIG_KINETIS_SPI1) || \ - defined(CONFIG_KINETIS_SPI2) + defined(CONFIG_KINETIS_SPI2) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the TWR-K60N512 board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function kinetis_spidev_initialize(void) { @@ -75,31 +75,34 @@ void weak_function kinetis_spidev_initialize(void) * Name: kinetis_spi0/1/2select and kinetis_spi0/1/2status * * Description: - * The external functions, kinetis_spi0/1/2select and kinetis_spi0/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 kinetis_spibus_initialize()) - * are provided by common Kinetis logic. To use this common SPI logic on your - * board: + * The external functions, kinetis_spi0/1/2select and kinetis_spi0/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 kinetis_spibus_initialize()) are provided + * by common Kinetis logic. To use this common SPI logic on your board: * - * 1. Provide logic in kinetis_boardinitialize() to configure SPI chip select - * pins. - * 2. Provide kinetis_spi0/1/2select() and kinetis_spi0/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 kinetis_spibus_initialize() in your low level application - * initialization logic - * 4. The handle returned by kinetis_spibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 1. Provide logic in kinetis_boardinitialize() to configure SPI chip + * select pins. + * 2. Provide kinetis_spi0/1/2select() and kinetis_spi0/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 kinetis_spibus_initialize() in your low level + * application initialization logic + * 4. The handle returned by kinetis_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). * ****************************************************************************/ #ifdef CONFIG_KINETIS_SPI0 -void kinetis_spi0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi0select(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"); # warning "Missing logic" } @@ -111,9 +114,11 @@ uint8_t kinetis_spi0status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_KINETIS_SPI1 -void kinetis_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi1select(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"); # warning "Missing logic" } @@ -125,9 +130,11 @@ uint8_t kinetis_spi1status(FAR struct spi_dev_s *dev, uint32_t devid) #endif #ifdef CONFIG_KINETIS_SPI2 -void kinetis_spi2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) +void kinetis_spi2select(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"); # warning "Missing logic" } diff --git a/boards/arm/kinetis/twr-k60n512/src/k60_usbdev.c b/boards/arm/kinetis/twr-k60n512/src/k60_usbdev.c index ce5d9e0660e..025fda0fda9 100644 --- a/boards/arm/kinetis/twr-k60n512/src/k60_usbdev.c +++ b/boards/arm/kinetis/twr-k60n512/src/k60_usbdev.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/twr-k60n512/src/k60_usbdev.c +/**************************************************************************** + * boards/arm/kinetis/twr-k60n512/src/k60_usbdev.c * * Copyright (C) 2011 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,42 +51,43 @@ #include "kinetis.h" #include "twr-k60n512.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_usbinitialize * * Description: * Called to setup USB-related GPIO pins for the TWR_K60N512 board. * - ************************************************************************************/ + ****************************************************************************/ void kinetis_usbinitialize(void) { # warning "Missing logic" } -/************************************************************************************ +/**************************************************************************** * Name: kinetis_usbpullup * * Description: - * If USB is supported and the board supports a pullup via GPIO (for USB software - * connect and disconnect), then the board software must provide kinetis_pullup. + * If USB is supported and the board supports a pullup via GPIO + * (for USB software connect and disconnect), then the board software must + * provide kinetis_pullup. * See include/nuttx/usb/usbdev.h for additional description of this method. - * Alternatively, if no pull-up GPIO the following EXTERN can be redefined to be - * NULL. + * Alternatively, if no pull-up GPIO the following EXTERN can be redefined + * to be NULL. * - ************************************************************************************/ + ****************************************************************************/ int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable) { @@ -95,16 +96,17 @@ int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable) return OK; } -/************************************************************************************ +/**************************************************************************** * Name: kinetis_usbsuspend * * Description: - * Board logic must provide the kinetis_usbsuspend logic if the USBDEV driver is - * used. This function is called whenever the USB enters or leaves suspend mode. - * This is an opportunity for the board logic to shutdown clocks, power, etc. - * while the USB is suspended. + * Board logic must provide the kinetis_usbsuspend logic if the USBDEV + * driver is used. + * This function is called whenever the USB enters or leaves suspend mode. + * This is an opportunity for the board logic to shutdown clocks, power, + * etc. while the USB is suspended. * - ************************************************************************************/ + ****************************************************************************/ void kinetis_usbsuspend(FAR struct usbdev_s *dev, bool resume) { diff --git a/boards/arm/kinetis/twr-k60n512/src/k60_usbmsc.c b/boards/arm/kinetis/twr-k60n512/src/k60_usbmsc.c index 20d5aa9cc1c..2b82bae16bf 100644 --- a/boards/arm/kinetis/twr-k60n512/src/k60_usbmsc.c +++ b/boards/arm/kinetis/twr-k60n512/src/k60_usbmsc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/twr-k60n512/src/k60_usbmsc.c + * boards/arm/kinetis/twr-k60n512/src/k60_usbmsc.c * * Copyright (C) 2011, 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -67,7 +67,8 @@ # undef KINETIS_MMCSDSLOTNO # define KINETIS_MMCSDSLOTNO 0 #else - /* Add configuration for new Kinetis boards here */ + /* Add configuration for new Kinetis boards here */ + # error "Unrecognized Kinetis board" #endif @@ -87,7 +88,8 @@ int board_usbmsc_initialize(int port) { /* If system/usbmsc is built as an NSH command, then SD slot should - * already have been initialized in board_app_initialize() (see k60_appinit.c). + * already have been initialized in board_app_initialize() + * (see k60_appinit.c). * In this case, there is nothing further to be done here. */ @@ -95,5 +97,5 @@ int board_usbmsc_initialize(int port) # warning "Missing logic" #endif /* CONFIG_NSH_BUILTIN_APPS */ - return OK; + return OK; } diff --git a/boards/arm/kinetis/twr-k60n512/src/twr-k60n512.h b/boards/arm/kinetis/twr-k60n512/src/twr-k60n512.h index a932d5d20a2..798a9d79528 100644 --- a/boards/arm/kinetis/twr-k60n512/src/twr-k60n512.h +++ b/boards/arm/kinetis/twr-k60n512/src/twr-k60n512.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/twr-k60n512/src/twr-k60n512.h +/**************************************************************************** + * boards/arm/kinetis/twr-k60n512/src/twr-k60n512.h * * Copyright (C) 2011 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 __BOARDS_ARM_TWR_K60N512_SRC_TWRK60_H -#define __BOARDS_ARM_TWR_K60N512_SRC_TWRK60_H +#ifndef __BOARDS_ARM_KINETIS_TWR_K60N512_SRC_TWRK60_H +#define __BOARDS_ARM_KINETIS_TWR_K60N512_SRC_TWRK60_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* How many SPI modules does this chip support? The LM3S6918 supports 2 SPI * modules (others may support more -- in such case, the following must be @@ -61,7 +61,8 @@ # undef CONFIG_KINETIS_SPI2 #endif -/* TWR-K60N512 GPIOs ****************************************************************/ +/* TWR-K60N512 GPIOs ********************************************************/ + /* On-Board Connections * -------------------- ------------------------- -------- ------------------- * FEATURE CONNECTION PORT/PIN PIN FUNCTION @@ -258,39 +259,39 @@ * B80 EBI_D0 PTC15 */ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the TWR-K60N512 board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function kinetis_spidev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: kinetis_usbinitialize * * Description: * Called to setup USB-related GPIO pins for the TWR-K60N512 board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function kinetis_usbinitialize(void); #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_TWR_K60N512_SRC_TWRK60_H */ +#endif /* __BOARDS_ARM_KINETIS_TWR_K60N512_SRC_TWRK60_H */ diff --git a/boards/arm/kinetis/twr-k64f120m/include/board.h b/boards/arm/kinetis/twr-k64f120m/include/board.h index c84ccf03e02..4787a83497a 100644 --- a/boards/arm/kinetis/twr-k64f120m/include/board.h +++ b/boards/arm/kinetis/twr-k64f120m/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/twr-k64f120m/include/board.h +/**************************************************************************** + * boards/arm/kinetis/twr-k64f120m/include/board.h * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,33 +31,35 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_TWR_K64F120M_INCLUDE_BOARCH_H -#define __BOARDS_ARM_TWR_K64F120M_INCLUDE_BOARCH_H +#ifndef __BOARDS_ARM_KINETIS_TWR_K64F120M_INCLUDE_BOARCH_H +#define __BOARDS_ARM_KINETIS_TWR_K64F120M_INCLUDE_BOARCH_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #ifndef __ASSEMBLY__ # include #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* Clocking *****************************************************************/ -/* Clocking *************************************************************************/ /* The K64 tower board uses a 50MHz external clock */ #define BOARD_EXTCLOCK 1 /* External clock */ #define BOARD_EXTAL_FREQ 50000000 /* 50MHz Oscillator */ #define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator */ -/* PLL Configuration. Either the external clock or crystal frequency is used to - * select the PRDIV value. Only reference clock frequencies are supported that will +/* PLL Configuration. + * Either the external clock or crystal frequency is used to select the + * PRDIV value. Only reference clock frequencies are supported that will * produce a range 2MHz-4MHz reference clock to the PLL. * * PLL Input frequency: PLLIN = REFCLK/PRDIV = 50MHz/20 = 2.5 MHz @@ -65,8 +67,8 @@ * MCG Frequency: PLLOUT = 120 Mhz */ -#define BOARD_PRDIV 20 /* PLL External Reference Divider */ -#define BOARD_VDIV 48 /* PLL VCO Divider (frequency multiplier) */ +#define BOARD_PRDIV 20 /* PLL External Reference Divider */ +#define BOARD_VDIV 48 /* PLL VCO Divider (frequency multiplier) */ #define BOARD_PLLIN_FREQ (BOARD_EXTAL_FREQ / BOARD_PRDIV) #define BOARD_PLLOUT_FREQ (BOARD_PLLIN_FREQ * BOARD_VDIV) @@ -79,24 +81,25 @@ /* SIM CLKDIV1 dividers */ -#define BOARD_OUTDIV1 1 /* Core = MCG, 120MHz */ -#define BOARD_OUTDIV2 2 /* Bus = MCG/2, 60MHz */ -#define BOARD_OUTDIV3 2 /* FlexBus = MCG/2, 60MHz */ -#define BOARD_OUTDIV4 5 /* Flash clock = MCG/5, 24MHz */ +#define BOARD_OUTDIV1 1 /* Core = MCG, 120MHz */ +#define BOARD_OUTDIV2 2 /* Bus = MCG/2, 60MHz */ +#define BOARD_OUTDIV3 2 /* FlexBus = MCG/2, 60MHz */ +#define BOARD_OUTDIV4 5 /* Flash clock = MCG/5, 24MHz */ #define BOARD_CORECLK_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV1) #define BOARD_BUS_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV2) #define BOARD_FLEXBUS_FREQ (BOARD_MCG_FREQ / BOARD_OUTDIV3) #define BOARD_FLASHCLK_FREQ (BOARD_MCG_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: 375KHz = 120MHz / ( 64 * 5) <= 400 KHz */ @@ -104,12 +107,12 @@ #define BOARD_SDHC_IDMODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV64 #define BOARD_SDHC_IDMODE_DIVISOR SDHC_SYSCTL_DVS_DIV(5) -/* MMC normal mode: 15MHz = 120MHz / (8 * 1) <= 16 MHz*/ +/* MMC normal mode: 15MHz = 120MHz / (8 * 1) <= 16 MHz */ #define BOARD_SDHC_MMCMODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV8 #define BOARD_SDHC_MMCMODE_DIVISOR SDHC_SYSCTL_DVS_DIV(1) -/* SD normal mode (1-bit): 15MHz = 120MHz / (8 * 1) <= 16 MHz*/ +/* SD normal mode (1-bit): 15MHz = 120MHz / (8 * 1) <= 16 MHz */ #define BOARD_SDHC_SD1MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV8 #define BOARD_SDHC_SD1MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(1) @@ -126,8 +129,8 @@ # define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(1) #endif +/* LED definitions **********************************************************/ -/* LED definitions ******************************************************************/ /* The TWR-K64F120M has four LEDs: * * 1. D5 / Green LED PTE6 @@ -148,17 +151,15 @@ #define LED_ASSERTION 6 /* LED1 + LED2 + LED3 */ #define LED_PANIC 7 /* LED1 (blink) */ - /* Open SDA serial link */ #define PIN_UART1_RX PIN_UART1_RX_1 #define PIN_UART1_TX PIN_UART1_TX_1 - /* Ethernet */ #ifdef CONFIG_KINETIS_ENET # define CONFIG_KINETIS_NENET 1 #endif -#endif /* __BOARDS_ARM_TWR_K64F120M_INCLUDE_BOARCH_H */ +#endif /* __BOARDS_ARM_KINETIS_TWR_K64F120M_INCLUDE_BOARCH_H */ diff --git a/boards/arm/kinetis/twr-k64f120m/scripts/Make.defs b/boards/arm/kinetis/twr-k64f120m/scripts/Make.defs index e61ebec7b21..314c4928f01 100644 --- a/boards/arm/kinetis/twr-k64f120m/scripts/Make.defs +++ b/boards/arm/kinetis/twr-k64f120m/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/twr-k64f120m/scripts/Make.defs +# boards/arm/kinetis/twr-k64f120m/scripts/Make.defs # # Copyright (C) 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kinetis/twr-k64f120m/scripts/ld.script b/boards/arm/kinetis/twr-k64f120m/scripts/ld.script index a2ca45f86c9..b5c5e6df0ba 100644 --- a/boards/arm/kinetis/twr-k64f120m/scripts/ld.script +++ b/boards/arm/kinetis/twr-k64f120m/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/twr-k64f120m/scripts/ld.script + * boards/arm/kinetis/twr-k64f120m/scripts/ld.script * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/twr-k64f120m/src/Makefile b/boards/arm/kinetis/twr-k64f120m/src/Makefile index 351131da4ad..78e0c91e981 100644 --- a/boards/arm/kinetis/twr-k64f120m/src/Makefile +++ b/boards/arm/kinetis/twr-k64f120m/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/twr-k64f120m/src/Makefile +# boards/arm/kinetis/twr-k64f120m/src/Makefile # # Copyright (C) 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/kinetis/twr-k64f120m/src/k64_appinit.c b/boards/arm/kinetis/twr-k64f120m/src/k64_appinit.c index 3a436260d19..50b2b62d997 100644 --- a/boards/arm/kinetis/twr-k64f120m/src/k64_appinit.c +++ b/boards/arm/kinetis/twr-k64f120m/src/k64_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/twr-k64f120m/src/k64_appinit.c + * boards/arm/kinetis/twr-k64f120m/src/k64_appinit.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/kinetis/twr-k64f120m/src/k64_automount.c b/boards/arm/kinetis/twr-k64f120m/src/k64_automount.c index 32a6df52d68..94355414fc2 100644 --- a/boards/arm/kinetis/twr-k64f120m/src/k64_automount.c +++ b/boards/arm/kinetis/twr-k64f120m/src/k64_automount.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/twr-k64f120m/src/k64_automount.c +/**************************************************************************** + * boards/arm/kinetis/twr-k64f120m/src/k64_automount.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 @@ -53,9 +53,9 @@ #ifdef HAVE_AUTOMOUNTER -/************************************************************************************ +/**************************************************************************** * Private Types - ************************************************************************************/ + ****************************************************************************/ /* This structure represents the changeable state of the automounter */ @@ -71,26 +71,27 @@ struct k64_automount_state_s struct k64_automount_config_s { - /* This must be first thing in structure so that we can simply cast from struct - * automount_lower_s to struct k64_automount_config_s + /* This must be first thing in structure so that we can simply cast from + * struct automount_lower_s to struct k64_automount_config_s */ struct automount_lower_s lower; /* Publicly visible part */ FAR struct k64_automount_state_s *state; /* Changeable state */ }; -/************************************************************************************ +/**************************************************************************** * Private Function Prototypes - ************************************************************************************/ + ****************************************************************************/ static int k64_attach(FAR const struct automount_lower_s *lower, automount_handler_t isr, FAR void *arg); -static void k64_enable(FAR const struct automount_lower_s *lower, bool enable); +static void k64_enable(FAR const struct automount_lower_s *lower, + bool enable); static bool k64_inserted(FAR const struct automount_lower_s *lower); -/************************************************************************************ +/**************************************************************************** * Private Data - ************************************************************************************/ + ****************************************************************************/ static struct k64_automount_state_s g_sdhc_state; static const struct k64_automount_config_s g_sdhc_config = @@ -109,11 +110,11 @@ static const struct k64_automount_config_s g_sdhc_config = .state = &g_sdhc_state }; -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k64_attach * * Description: @@ -127,7 +128,7 @@ static const struct k64_automount_config_s g_sdhc_config = * Returned Value: * Always returns OK * - ************************************************************************************/ + ****************************************************************************/ static int k64_attach(FAR const struct automount_lower_s *lower, automount_handler_t isr, FAR void *arg) @@ -153,7 +154,7 @@ static int k64_attach(FAR const struct automount_lower_s *lower, return OK; } -/************************************************************************************ +/**************************************************************************** * Name: k64_enable * * Description: @@ -166,7 +167,7 @@ static int k64_attach(FAR const struct automount_lower_s *lower, * Returned Value: * None * - ************************************************************************************/ + ****************************************************************************/ static void k64_enable(FAR const struct automount_lower_s *lower, bool enable) { @@ -204,7 +205,7 @@ static void k64_enable(FAR const struct automount_lower_s *lower, bool enable) leave_critical_section(flags); } -/************************************************************************************ +/**************************************************************************** * Name: k64_inserted * * Description: @@ -216,18 +217,18 @@ static void k64_enable(FAR const struct automount_lower_s *lower, bool enable) * Returned Value: * True if the card is inserted; False otherwise * - ************************************************************************************/ + ****************************************************************************/ static bool k64_inserted(FAR const struct automount_lower_s *lower) { return k64_cardinserted(); } -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k64_automount_initialize * * Description: @@ -239,7 +240,7 @@ static bool k64_inserted(FAR const struct automount_lower_s *lower) * Returned Value: * None * - ************************************************************************************/ + ****************************************************************************/ void k64_automount_initialize(void) { @@ -256,20 +257,20 @@ void k64_automount_initialize(void) } } -/************************************************************************************ +/**************************************************************************** * Name: k64_automount_event * * Description: - * The SDHC card detection logic has detected an insertion or removal event. It - * has already scheduled the MMC/SD block driver operations. Now we need to - * schedule the auto-mount event which will occur with a substantial delay to make - * sure that everything has settle down. + * The SDHC card detection logic has detected an insertion or removal event. + * It has already scheduled the MMC/SD block driver operations. + * Now we need to schedule the auto-mount event which will occur with a + * substantial delay to make sure that everything has settle down. * * Input Parameters: - * slotno - Identifies the SDHC0 slot: SDHC0_SLOTNO or SDHC1_SLOTNO. There is a - * terminology problem here: Each SDHC supports two slots, slot A and slot B. - * Only slot A is used. So this is not a really a slot, but an HSCMI peripheral - * number. + * slotno - Identifies the SDHC0 slot: SDHC0_SLOTNO or SDHC1_SLOTNO. + * There is a terminology problem here: Each SDHC supports two slots, + * slot A and slot B. Only slot A is used. + * So this is not a really a slot, but an HSCMI peripheral number. * inserted - True if the card is inserted in the slot. False otherwise. * * Returned Value: @@ -278,7 +279,7 @@ void k64_automount_initialize(void) * Assumptions: * Interrupts are disabled. * - ************************************************************************************/ + ****************************************************************************/ void k64_automount_event(bool inserted) { diff --git a/boards/arm/kinetis/twr-k64f120m/src/k64_boot.c b/boards/arm/kinetis/twr-k64f120m/src/k64_boot.c index a636451321d..52078b19fb8 100644 --- a/boards/arm/kinetis/twr-k64f120m/src/k64_boot.c +++ b/boards/arm/kinetis/twr-k64f120m/src/k64_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/twr-k64f120m/src/k64_boot.c +/**************************************************************************** + * boards/arm/kinetis/twr-k64f120m/src/k64_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 @@ -47,32 +47,33 @@ #include "up_arch.h" #include "twrk64.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: kinetis_boardinitialize * * Description: - * All Kinetis 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 Kinetis 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 kinetis_boardinitialize(void) { - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function - * kinetis_spidev_initialize() has been brought into the link. + /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak + * function kinetis_spidev_initialize() has been brought into the link. */ #if defined(CONFIG_KINETIS_SPI1) || defined(CONFIG_KINETIS_SPI2) @@ -82,10 +83,10 @@ void kinetis_boardinitialize(void) } #endif - /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not - * disabled, and 3) the weak function kinetis_usbinitialize() has been brought - * into the build. - */ + /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not + * disabled, and 3) the weak function kinetis_usbinitialize() has been + * brought into the build. + */ #if defined(CONFIG_USBDEV) && defined(CONFIG_KINETIS_USB) if (kinetis_usbinitialize) diff --git a/boards/arm/kinetis/twr-k64f120m/src/k64_leds.c b/boards/arm/kinetis/twr-k64f120m/src/k64_leds.c index 7c6056cb884..794dfba1814 100644 --- a/boards/arm/kinetis/twr-k64f120m/src/k64_leds.c +++ b/boards/arm/kinetis/twr-k64f120m/src/k64_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/twr-k64f120m/src/k64_leds.c + * boards/arm/kinetis/twr-k64f120m/src/k64_leds.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -173,7 +173,6 @@ static inline void led_clrbits(unsigned int clrbits) { kinetis_gpiowrite(GPIO_LED3, true); } - } static inline void led_setbits(unsigned int setbits) @@ -192,7 +191,6 @@ static inline void led_setbits(unsigned int setbits) { kinetis_gpiowrite(GPIO_LED3, false); } - } static void led_setonoff(unsigned int bits) @@ -216,11 +214,11 @@ static void led_setonoff(unsigned int bits) #ifdef CONFIG_ARCH_LEDS void board_autoled_initialize(void) { - /* Configure LED1-3 GPIOs for output */ + /* Configure LED1-3 GPIOs for output */ - kinetis_pinconfig(GPIO_LED1); - kinetis_pinconfig(GPIO_LED2); - kinetis_pinconfig(GPIO_LED3); + kinetis_pinconfig(GPIO_LED1); + kinetis_pinconfig(GPIO_LED2); + kinetis_pinconfig(GPIO_LED3); } /**************************************************************************** diff --git a/boards/arm/kinetis/twr-k64f120m/src/k64_sdhc.c b/boards/arm/kinetis/twr-k64f120m/src/k64_sdhc.c index f7d4d1edff1..71c1679cd4d 100644 --- a/boards/arm/kinetis/twr-k64f120m/src/k64_sdhc.c +++ b/boards/arm/kinetis/twr-k64f120m/src/k64_sdhc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/twr-k64f120m/src/k64_sdhc.c + * boards/arm/kinetis/twr-k64f120m/src/k64_sdhc.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,10 +33,11 @@ * ****************************************************************************/ -/* A micro Secure Digital (SD) card slot is available on the FRDM-K64F connected to - * the SD Host Controller (SDHC) signals of the MCU. This slot will accept micro - * format SD memory cards. The SD card detect pin (PTE6) is an open switch that - * shorts with VDD when card is inserted. +/* A micro Secure Digital (SD) card slot is available on the FRDM-K64F + * connected to the SD Host Controller (SDHC) signals of the MCU. + * This slot will accept micro format SD memory cards. + * The SD card detect pin (PTE6) is an open switch that shorts with VDD when + * card is inserted. * * ------------ ------------- -------- * SD Card Slot Board Signal K64F Pin @@ -171,6 +172,7 @@ int k64_sdhc_initialize(void) /* Configure the write protect GPIO -- None */ /* Mount the SDHC-based MMC/SD block driver */ + /* First, get an instance of the SDHC interface */ mcinfo("Initializing SDHC slot %d\n", MMCSD_SLOTNO); @@ -189,7 +191,8 @@ int k64_sdhc_initialize(void) ret = mmcsd_slotinitialize(MMSCD_MINOR, g_sdhc.sdhc); if (ret != OK) { - syslog(LOG_ERR, "ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n", + ret); return ret; } @@ -204,6 +207,7 @@ int k64_sdhc_initialize(void) kinetis_pinirqenable(GPIO_SD_CARDDETECT); /* Initialize automount system if configured */ + #ifdef CONFIG_TWR_K64F120M_SDHC_AUTOMOUNT k64_automount_initialize(); #endif diff --git a/boards/arm/kinetis/twr-k64f120m/src/twrk64.h b/boards/arm/kinetis/twr-k64f120m/src/twrk64.h index 733e6dc0388..e20c79e3ece 100644 --- a/boards/arm/kinetis/twr-k64f120m/src/twrk64.h +++ b/boards/arm/kinetis/twr-k64f120m/src/twrk64.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/twr-k64f120m/src/twrk64.h +/**************************************************************************** + * boards/arm/kinetis/twr-k64f120m/src/twrk64.h * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -34,23 +34,23 @@ * * This header file is only accessible from the src directory. * For /arch/arm/src accessibilty use ../include/board.h instead. - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_TWR_K64F120M_SRC_TWRK64_H -#define __BOARDS_ARM_TWR_K64F120M_SRC_TWRK64_H +#ifndef __BOARDS_ARM_KINETIS_TWR_K64F120M_SRC_TWRK64_H +#define __BOARDS_ARM_KINETIS_TWR_K64F120M_SRC_TWRK64_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* Assume we have everything */ @@ -84,8 +84,8 @@ #define MMCSD_SLOTNO 0 -/* Can't support MMC/SD features if mountpoints are disabled or if SDHC support - * is not enabled. +/* Can't support MMC/SD features if mountpoints are disabled or if SDHC + * support is not enabled. */ #if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_KINETIS_SDHC) @@ -169,7 +169,8 @@ # undef CONFIG_KINETIS_SPI2 #endif -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* The TWR-K64F120M has 2 user buttons (plus a reset button): * * 1. SW1 (IRQ?) PTC6 @@ -182,12 +183,14 @@ #define BUTTON_SW1_BIT (1 << BUTTON_SW1) #define BUTTON_SW3_BIT (1 << BUTTON_SW3) -/* Alternative pin resolution *******************************************************/ +/* Alternative pin resolution ***********************************************/ + /* If there are alternative configurations for various pins in the - * kinetis_k64pinmux.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. + * kinetis_k64pinmux.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. * Please refer to board README for pin explanation. */ @@ -196,7 +199,7 @@ #define PIN_I2C0_SCL PIN_I2C0_SCL_3 /* Connections via the General Purpose Tower Plug-in (TWRPI) Socket -TODO See README + * TODO See README */ #define PIN_SPI2_SIN PIN_SPI2_SIN_2 @@ -204,7 +207,7 @@ TODO See README #define PIN_SPI2_SCK PIN_SPI2_SCK_2 /* Connections via the Tower Primary Connector Side A -TODO See README + * TODO See README */ /* PTE 26/27 */ @@ -218,14 +221,15 @@ TODO See README #define PIN_UART4_TX PIN_UART4_TX_2 /* Connections via the Tower Primary Connector Side B -TODO See README + * TODO See README */ #endif /* SDHC - important notice: on TWR-K64F120M, R521 (close to the SD card holder) is not placed, - hence WRPROTEC is always ON. Either place a 4.7KOhm resistor or change PIN config - to PULLDOWN, loosing Write Protect function */ + * important notice: on TWR-K64F120M, R521 (close to the SD card holder) is + * not placed, hence WRPROTEC is always ON. Either place a 4.7KOhm resistor + * or change PIN config to PULLDOWN, loosing Write Protect function + */ #define GPIO_SD_CARDDETECT (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTB | PIN20) #define GPIO_SD_WRPROTECT (GPIO_PULLUP | PIN_PORTB | PIN21) @@ -242,47 +246,47 @@ TODO See README #define GPIO_LED3 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTE | PIN8) #define GPIO_LED4 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTE | PIN9) -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: k64_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the TWR-K64F120M board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function k64_spidev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: k64_usbinitialize * * Description: * Called to setup USB-related GPIO pins for the TWR-K64F120M board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function k64_usbinitialize(void); -/************************************************************************************ +/**************************************************************************** * Name: k64_bringup * * Description: * Bring up board features * - ************************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LIB_BOARDCTL) || defined(CONFIG_BOARD_LATE_INITIALIZE) int k64_bringup(void); @@ -302,13 +306,13 @@ int k64_sdhc_initialize(void); # define k64_sdhc_initialize() (OK) #endif -/************************************************************************************ +/**************************************************************************** * Name: k64_cardinserted * * Description: * Check if a card is inserted into the SDHC slot * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUTOMOUNTER bool k64_cardinserted(void); @@ -316,13 +320,13 @@ bool k64_cardinserted(void); # define k64_cardinserted() (false) #endif -/************************************************************************************ +/**************************************************************************** * Name: k64_writeprotected * * Description: * Check if the card in the MMC/SD slot is write protected * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUTOMOUNTER bool k64_writeprotected(void); @@ -330,7 +334,7 @@ bool k64_writeprotected(void); # define k64_writeprotected() (false) #endif -/************************************************************************************ +/**************************************************************************** * Name: k64_automount_initialize * * Description: @@ -342,20 +346,20 @@ bool k64_writeprotected(void); * Returned Value: * None * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUTOMOUNTER void k64_automount_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: k64_automount_event * * Description: - * The SDHC card detection logic has detected an insertion or removal event. It - * has already scheduled the MMC/SD block driver operations. Now we need to - * schedule the auto-mount event which will occur with a substantial delay to make - * sure that everything has settle down. + * The SDHC card detection logic has detected an insertion or removal event. + * It has already scheduled the MMC/SD block driver operations. Now we need + * to schedule the auto-mount event which will occur with a substantial + * delay to make sure that everything has settle down. * * Input Parameters: * inserted - True if the card is inserted in the slot. False otherwise. @@ -366,23 +370,23 @@ void k64_automount_initialize(void); * Assumptions: * Interrupts are disabled. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUTOMOUNTER void k64_automount_event(bool inserted); #endif -/************************************************************************************ +/**************************************************************************** * Name: k64_pwm_setup * * Description: * Initialize PWM and register the PWM device. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_PWM int k64_pwm_setup(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_TWR_K64F120M_SRC_TWRK64_H */ +#endif /* __BOARDS_ARM_KINETIS_TWR_K64F120M_SRC_TWRK64_H */