diff --git a/boards/arm/samd2l2/samd20-xplained/include/board.h b/boards/arm/samd2l2/samd20-xplained/include/board.h index 42680b62139..377c5bdde18 100644 --- a/boards/arm/samd2l2/samd20-xplained/include/board.h +++ b/boards/arm/samd2l2/samd20-xplained/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samd20-xplained/include/board.h +/**************************************************************************** + * boards/arm/samd2l2/samd20-xplained/include/board.h * * Copyright (C) 2014 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_SAMD20_XPLAINED_INCLUDE_BOARD_H -#define __BOARDS_ARM_SAMD20_XPLAINED_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_SAMD2L2_SAMD20_XPLAINED_INCLUDE_BOARD_H +#define __BOARDS_ARM_SAMD2L2_SAMD20_XPLAINED_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,11 +49,12 @@ # endif #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* Clocking *****************************************************************/ -/* Clocking *************************************************************************/ /* Overview * * OSC8M Output = 8MHz @@ -288,9 +289,10 @@ #undef BOARD_GCLK7_OUTPUT_ENABLE #define BOARD_GCLK7_FREQUENCY (BOARD_OSC8M_FREQUENCY / BOARD_GCLK7_PRESCALER) -/* The source of the main clock is always GCLK_MAIN. Also called GCLKGEN[0], this is - * the clock feeding the Power Manager. The Power Manager, in turn, generates main - * clock which is divided down to produce the CPU, AHB, and APB clocks. +/* The source of the main clock is always GCLK_MAIN. + * Also called GCLKGEN[0], this is the clock feeding the Power Manager. + * The Power Manager, in turn, generates main clock which is divided + * down to produce the CPU, AHB, and APB clocks. * * The main clock is initially OSC8M divided by 8. */ @@ -343,9 +345,10 @@ # define BOARD_FLASH_WAITSTATES 2 #endif -/* SERCOM definitions ***************************************************************/ -/* This is the source clock generator for the GCLK_SERCOM_SLOW clock that is common - * to all SERCOM modules. +/* SERCOM definitions *******************************************************/ + +/* This is the source clock generator for the GCLK_SERCOM_SLOW clock that + * is common to all SERCOM modules. */ #define BOARD_SERCOM05_SLOW_GCLKGEN 0 @@ -469,14 +472,15 @@ #define BOARD_SERCOM5_FREQUENCY BOARD_GCLK0_FREQUENCY -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* There are three LEDs on board the SAMD20 Xplained Pro board: The EDBG * controls two of the LEDs, a power LED and a status LED. There is only - * one user controllable LED, a yellow LED labelled STATUS near the SAMD20 USB - * connector. + * one user controllable LED, a yellow LED labelled STATUS near the SAMD20 + * USB connector. * - * This LED is controlled by PC07 and the LED can be activated by driving the - * PA14 to GND. + * This LED is controlled by PC07 and the LED can be activated by driving + * the PA14 to GND. */ /* LED index values for use with board_userled() */ @@ -489,10 +493,10 @@ #define BOARD_STATUS LED_BIT (1 << BOARD_STATUS_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 */ @@ -504,12 +508,14 @@ #define LED_ASSERTION 2 /* STATUS LED=no change */ #define LED_PANIC 3 /* STATUS LED=flashing */ -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* Mechanical buttons: * - * The SAMD20 Xplained Pro contains two mechanical buttons. One button is the - * RESET button connected to the SAMD20 reset line and the other is a generic user - * configurable button. When a button is pressed it will drive the I/O line to GND. + * The SAMD20 Xplained Pro contains two mechanical buttons. + * One button is the RESET button connected to the SAMD20 reset line and + * the other is a generic user configurable button. + * When a button is pressed it will drive the I/O line to GND. * * PA15 SW0 */ @@ -521,4 +527,4 @@ #define BUTTON_SW0_BIT (1 << BUTTON_SW0) -#endif /* __BOARDS_ARM_SAMD20_XPLAINED_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_SAMD2L2_SAMD20_XPLAINED_INCLUDE_BOARD_H */ diff --git a/boards/arm/samd2l2/samd20-xplained/scripts/Make.defs b/boards/arm/samd2l2/samd20-xplained/scripts/Make.defs index 3bd9c768f97..c99477a1e05 100644 --- a/boards/arm/samd2l2/samd20-xplained/scripts/Make.defs +++ b/boards/arm/samd2l2/samd20-xplained/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/samd20-xplained/scripts/Make.defs +# boards/arm/samd2l2/samd20-xplained/scripts/Make.defs # # Copyright (C) 2014, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/samd2l2/samd20-xplained/scripts/flash.ld b/boards/arm/samd2l2/samd20-xplained/scripts/flash.ld index fc68737e6f6..66c5b2fc664 100644 --- a/boards/arm/samd2l2/samd20-xplained/scripts/flash.ld +++ b/boards/arm/samd2l2/samd20-xplained/scripts/flash.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samd20-xplained/scripts/flash.ld + * boards/arm/samd2l2/samd20-xplained/scripts/flash.ld * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samd2l2/samd20-xplained/src/Makefile b/boards/arm/samd2l2/samd20-xplained/src/Makefile index 669b1df1fe8..22d2843c3d7 100644 --- a/boards/arm/samd2l2/samd20-xplained/src/Makefile +++ b/boards/arm/samd2l2/samd20-xplained/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/samd20-xplained/src/Makefile +# boards/arm/samd2l2/samd20-xplained/src/Makefile # # Copyright (C) 2014 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/samd2l2/samd20-xplained/src/sam_appinit.c b/boards/arm/samd2l2/samd20-xplained/src/sam_appinit.c index 276c3b8211f..eed85fd1c4e 100644 --- a/boards/arm/samd2l2/samd20-xplained/src/sam_appinit.c +++ b/boards/arm/samd2l2/samd20-xplained/src/sam_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/samd20-xplained/src/sam_appinit.c + * boards/samd20-xplained/src/sam_appinit.c * * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -50,6 +50,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Some configuration checks */ #ifdef CONFIG_SAMD20_XPLAINED_IOMODULE_EXT1 @@ -70,6 +71,7 @@ #ifdef CONFIG_SAMD20_XPLAINED_IOMODULE /* Support for the SD card slot on the I/O1 module */ + /* Verify NSH PORT and SLOT settings */ # define SAMD2L2_MMCSDSLOTNO 0 /* There is only one slot */ @@ -123,15 +125,13 @@ int board_app_initialize(uintptr_t arg) #if defined(SAMD2L2_HAVE_SPI0) && defined(CONFIG_SAMD20_XPLAINED_IOMODULE) /* Initialize the SPI-based MMC/SD slot */ - { - int ret = sam_sdinitialize(SPI_PORTNO, CONFIG_NSH_MMCSDMINOR); - if (ret < 0) - { - syslog(LOG_ERR, "ERROR: Failed to initialize MMC/SD slot: %d\n", - ret); - return ret; - } - } + int ret = sam_sdinitialize(SPI_PORTNO, CONFIG_NSH_MMCSDMINOR); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to initialize MMC/SD slot: %d\n", + ret); + return ret; + } #endif return OK; diff --git a/boards/arm/samd2l2/samd20-xplained/src/sam_autoleds.c b/boards/arm/samd2l2/samd20-xplained/src/sam_autoleds.c index fd6d599d7b5..083a5b46b7d 100644 --- a/boards/arm/samd2l2/samd20-xplained/src/sam_autoleds.c +++ b/boards/arm/samd2l2/samd20-xplained/src/sam_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samd20-xplained/src/sam_autoleds.c + * boards/arm/samd2l2/samd20-xplained/src/sam_autoleds.c * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -32,13 +32,14 @@ * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ + /* There are three LEDs on board the SAMD20 Xplained Pro board: The EDBG * controls two of the LEDs, a power LED and a status LED. There is only - * one user controllable LED, a yellow LED labelled STATUS near the SAMD20 USB - * connector. + * one user controllable LED, a yellow LED labelled STATUS near the SAMD20 + * USB connector. * - * This LED is controlled by PA14 and the LED can be activated by driving PA14 - * to GND. + * This LED is controlled by PA14 and the LED can be activated by driving + * PA14 to GND. * * When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will * control the LED as follows: @@ -100,20 +101,26 @@ void board_autoled_on(int led) switch (led) { - case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF */ - /* LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF */ - /* LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF */ - break; /* Leave ledstate == true to turn OFF */ + case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF + * LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF + * LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF + */ + + break; /* Leave ledstate == true to turn OFF */ default: - case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C */ - /* LED_SIGNAL: In a signal handler STATUS LED=N/C */ - /* LED_ASSERTION: An assertion failed STATUS LED=N/C */ - return; /* Return to leave STATUS LED unchanged */ + case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C + * LED_SIGNAL: In a signal handler STATUS LED=N/C + * LED_ASSERTION: An assertion failed STATUS LED=N/C + */ - case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ - case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ + return; /* Return to leave STATUS LED unchanged */ + + case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ + + case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ ledstate = false; /* Set ledstate == false to turn ON */ + break; } @@ -131,21 +138,25 @@ void board_autoled_off(int led) /* These should not happen and are ignored */ default: - case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF */ - /* LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF */ - /* LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF */ - case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ + case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF + * LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF + * LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF + */ + + case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ /* These result in no-change */ - case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C */ - /* LED_SIGNAL: In a signal handler STATUS LED=N/C */ - /* LED_ASSERTION: An assertion failed STATUS LED=N/C */ - return; /* Return to leave STATUS LED unchanged */ + case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C + * LED_SIGNAL: In a signal handler STATUS LED=N/C + * LED_ASSERTION: An assertion failed STATUS LED=N/C + */ + + return; /* Return to leave STATUS LED unchanged */ /* Turn STATUS LED off set driving the output high */ - case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ + case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ sam_portwrite(PORT_STATUS_LED, true); break; } diff --git a/boards/arm/samd2l2/samd20-xplained/src/sam_boot.c b/boards/arm/samd2l2/samd20-xplained/src/sam_boot.c index 7c652a39be4..8de5967a80e 100644 --- a/boards/arm/samd2l2/samd20-xplained/src/sam_boot.c +++ b/boards/arm/samd2l2/samd20-xplained/src/sam_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samd20-xplained/src/sam_boot.c +/**************************************************************************** + * boards/arm/samd2l2/samd20-xplained/src/sam_boot.c * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -46,31 +46,33 @@ #include "sam_config.h" #include "samd20-xplained.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_boardinitialize * * Description: - * All SAM3U 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 SAM3U 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 sam_boardinitialize(void) { - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function + /* Configure SPI chip selects if + * 1) SPI is not disabled, and 2) the weak function * sam_spidev_initialize() has been brought into the link. */ diff --git a/boards/arm/samd2l2/samd20-xplained/src/sam_buttons.c b/boards/arm/samd2l2/samd20-xplained/src/sam_buttons.c index ad2353f833e..a36ff79ec1a 100644 --- a/boards/arm/samd2l2/samd20-xplained/src/sam_buttons.c +++ b/boards/arm/samd2l2/samd20-xplained/src/sam_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samd20-xplained/src/sam_buttons.c + * boards/arm/samd2l2/samd20-xplained/src/sam_buttons.c * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -74,16 +74,18 @@ void board_button_initialize(void) (void)sam_configport(PORT_SW0); } -/************************************************************************************ +/**************************************************************************** * 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 + * 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. * - ************************************************************************************/ + ****************************************************************************/ uint32_t board_buttons(void) { diff --git a/boards/arm/samd2l2/samd20-xplained/src/sam_mmcsd.c b/boards/arm/samd2l2/samd20-xplained/src/sam_mmcsd.c index 776b56e5361..acf005049db 100644 --- a/boards/arm/samd2l2/samd20-xplained/src/sam_mmcsd.c +++ b/boards/arm/samd2l2/samd20-xplained/src/sam_mmcsd.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/samd20-xplained/src/sam_mmcsd.c + * boards/arm/samd2l2/samd20-xplained/src/sam_mmcsd.c * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -56,6 +56,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifdef CONFIG_DISABLE_MOUNTPOINT @@ -84,7 +85,8 @@ * - CONFIG_SAMD20_XPLAINED_IOMODULE=y, * - CONFIG_DISABLE_MOUNTPOINT=n, * - CONFIG_MMCSD=y, and - * - SAMD2L2_HAVE_SPI0=y (CONFIG_SAMD2L2_SERCOM0 && CONFIG_SAMD2L2_SERCOM0_ISSPI) + * - SAMD2L2_HAVE_SPI0=y + * (CONFIG_SAMD2L2_SERCOM0 && CONFIG_SAMD2L2_SERCOM0_ISSPI) * ****************************************************************************/ diff --git a/boards/arm/samd2l2/samd20-xplained/src/sam_spi.c b/boards/arm/samd2l2/samd20-xplained/src/sam_spi.c index f76e77f4c9d..82fb11b7a9b 100644 --- a/boards/arm/samd2l2/samd20-xplained/src/sam_spi.c +++ b/boards/arm/samd2l2/samd20-xplained/src/sam_spi.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samd20-xplained/src/sam_spi.c + * boards/arm/samd2l2/samd20-xplained/src/sam_spi.c * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -68,20 +68,20 @@ void weak_function sam_spidev_initialize(void) { - /* The I/O module containing the SD connector may or may not be installed. And, if - * it is installed, it may be in connector EXT1 or EXT2. + /* The I/O module containing the SD connector may or may not be installed. + * And, if it is installed, it may be in connector EXT1 or EXT2. */ #ifdef CONFIG_SAMD20_XPLAINED_IOMODULE /* TODO: enable interrupt on card detect */ - sam_configport(PORT_SD_CD); /* Card detect input */ - sam_configport(PORT_SD_CS); /* Chip select output */ + sam_configport(PORT_SD_CD); /* Card detect input */ + sam_configport(PORT_SD_CS); /* Chip select output */ #endif #ifdef CONFIG_SAMD20_XPLAINED_OLED1MODULE - sam_configport(PORT_OLED_DATA); /* Command/data */ - sam_configport(PORT_OLED_CS); /* Card detect input */ + sam_configport(PORT_OLED_DATA); /* Command/data */ + sam_configport(PORT_OLED_CS); /* Card detect input */ #endif } @@ -89,8 +89,8 @@ void weak_function sam_spidev_initialize(void) * Name: sam_spi[n]select, sam_spi[n]status, and sam_spi[n]cmddata * * Description: - * These external functions must be provided by board-specific logic. They - * include: + * These external functions must be provided by board-specific logic. + * They include: * * o sam_spi[n]select is a functions to manage the board-specific chip * selects @@ -114,8 +114,8 @@ void weak_function sam_spidev_initialize(void) * the way your board is configured. * 3. Add a call to sam_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by sam_spibus_initialize() may then be used to bind - * the SPI driver to higher level logic (e.g., calling + * 4. The handle returned by sam_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). * diff --git a/boards/arm/samd2l2/samd20-xplained/src/sam_ug2832hsweg04.c b/boards/arm/samd2l2/samd20-xplained/src/sam_ug2832hsweg04.c index dd2db3f547c..0878ac51052 100644 --- a/boards/arm/samd2l2/samd20-xplained/src/sam_ug2832hsweg04.c +++ b/boards/arm/samd2l2/samd20-xplained/src/sam_ug2832hsweg04.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/samd20-xplained/src/sam_ug2832hsweg04.c + * boards/arm/samd2l2/samd20-xplained/src/sam_ug2832hsweg04.c * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -125,7 +125,9 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ + /* The pin configurations here require that SPI1 is selected */ #ifndef CONFIG_LCD_SSD1306 diff --git a/boards/arm/samd2l2/samd20-xplained/src/sam_userleds.c b/boards/arm/samd2l2/samd20-xplained/src/sam_userleds.c index e913d6251f3..fbe6278d02b 100644 --- a/boards/arm/samd2l2/samd20-xplained/src/sam_userleds.c +++ b/boards/arm/samd2l2/samd20-xplained/src/sam_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samd20-xplained/src/sam_userleds.c + * boards/arm/samd2l2/samd20-xplained/src/sam_userleds.c * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -32,6 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ + /* There are three LEDs on board the SAMD20 Xplained Pro board: The EDBG * controls two of the LEDs, a power LED and a status LED. There is only * one user controllable LED, a yellow LED labeled STATUS near the SAMD20 USB @@ -41,8 +42,8 @@ * to GND. * * When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will - * control the LED. Otherwise, the LED can be controlled from user applications - * using the logic in this file. + * control the LED. Otherwise, the LED can be controlled from user + * applications using the logic in this file. */ /**************************************************************************** @@ -105,9 +106,10 @@ void board_userled(int led, bool ledon) * * Description: * If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board - * LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is - * available to control the LED from user application logic. NOTE: since - * there is only a single LED on-board, this is function is not very useful. + * LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() + * is available to control the LED from user application logic. + * NOTE: since there is only a single LED on-board, + * this is function is not very useful. * ****************************************************************************/ diff --git a/boards/arm/samd2l2/samd20-xplained/src/samd20-xplained.h b/boards/arm/samd2l2/samd20-xplained/src/samd20-xplained.h index ca051dc2db9..c22fa44bbe2 100644 --- a/boards/arm/samd2l2/samd20-xplained/src/samd20-xplained.h +++ b/boards/arm/samd2l2/samd20-xplained/src/samd20-xplained.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samd20-xplained/src/samd20-xplained.h +/**************************************************************************** + * boards/arm/samd2l2/samd20-xplained/src/samd20-xplained.h * * Copyright (C) 2014 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_SAMD20_XPLAINED_SRC_SAMD20_XPLAINED_H -#define __BOARDS_ARM_SAMD20_XPLAINED_SRC_SAMD20_XPLAINED_H +#ifndef __BOARDS_ARM_SAMD2L2_SAMD20_XPLAINED_SRC_SAMD20_XPLAINED_H +#define __BOARDS_ARM_SAMD2L2_SAMD20_XPLAINED_SRC_SAMD20_XPLAINED_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -51,16 +51,17 @@ #include "sam_config.h" #include "sam_pinmap.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* LEDs: There are three LEDs on board the SAMD20 Xplained Pro board: The EDBG - * controls two of the LEDs, a power LED and a status LED. There is only - * one user controllable LED, a yellow LED labelled STATIS near the SAMD20 USB - * connector. + ****************************************************************************/ + +/* LEDs: There are three LEDs on board the SAMD20 Xplained Pro board: + * The EDBG controls two of the LEDs, a power LED and a status LED. + * There is only one user controllable LED, a yellow LED labelled STATIS + * near the SAMD20 USB connector. * - * This LED is controlled by PA14 and the LED can be activated by driving PA14 - * to GND. + * This LED is controlled by PA14 and the LED can be activated by driving + * PA14 to GND. * * When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will * control the LED as follows: @@ -87,8 +88,9 @@ /* Mechanical buttons: * * The SAMD20 Xplained Pro contains two mechanical buttons. One button is the - * RESET button connected to the SAMD20 reset line and the other is a generic user - * configurable button. When a button is pressed it will drive the I/O line to GND. + * RESET button connected to the SAMD20 reset line and the other is a generic + * user configurable button. + * When a button is pressed it will drive the I/O line to GND. * * PA15 SW0 */ @@ -98,19 +100,22 @@ /* I/O1 * - * Support for the microSD card slot on the I/O1 module. The I/O1 requires - * SPI support and two PORTs. These the PORTs will vary if the I/O1 - * is installed on the EXT1 or EXT2 connector: + * Support for the microSD card slot on the I/O1 module. + * The I/O1 requires SPI support and two PORTs. + * These the PORTs will vary if the I/O1 is installed on the EXT1 or + * EXT2 connector: * - * --- ------------------ ---------------------- ------------------------------- + * --- ------------------ ---------------------- -------------------------- * PIN EXT1 EXT2 Description - * --- ------------------ ---------------------- ------------------------------- - * 15 PA05 SERCOM0 PAD[1] 15 PA17 SERCOM1 PAD[1] Active low chip select OUTPUT, - * SPI SS SPI SS pulled high on board. - * --- ------------------ ---------------------- ------------------------------- - * 10 PB05 PORT 10 PB15 PORT Active low card detect INPUT, - * must use internal pull-up. - * --- ------------------ ---------------------- ------------------------------- + * --- ------------------ ---------------------- -------------------------- + * 15 PA05 SERCOM0 PAD[1] 15 PA17 SERCOM1 PAD[1] Active low chip select + * SPI SS SPI SS OUTPUT, pulled high on + * board. + * --- ------------------ ---------------------- -------------------------- + * 10 PB05 PORT 10 PB15 PORT Active low card detect + * INPUT, must use internal + * pull-up. + * --- ------------------ ---------------------- -------------------------- */ #ifdef CONFIG_SAMD20_XPLAINED_IOMODULE @@ -152,13 +157,13 @@ /* OLED1 * - * Support for the microSD card slot on the I/O1 module. The I/O1 requires - * SPI support and three output PORTs. These the PORTs will vary if the OLED1 - * is installed on the EXT1 or EXT2 connector: - * + * Support for the microSD card slot on the I/O1 module. + * The I/O1 requires SPI support and three output PORTs. + * These the PORTs will vary if the OLED1is installed on the EXT1 or + * EXT2 connector: * * PIN EXT1 EXT2 Description - * --- ------------------- -------------------- ------------------------------------- + * --- ------------------- -------------------- --------------------------- * 5 PB06 PORT PA20 PORT DATA_CMD_SEL * 10 PB05 PORT PB15 PORT DISPLAY_RESET. Active low. * 15 PA05 SERCOM0 PAD[1] PA17 SERCOM1 PAD[1] DISPLAY_SS. Active low. @@ -221,44 +226,45 @@ PORTB | PORT_PIN11) /* REVISIT */ #endif -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select PORT pins for the SAM3U-EK board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function sam_spidev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: sam_sdinitialize * * Description: - * Initialize the SPI-based SD card. Requires CONFIG_SAMD20_XPLAINED_IOMODULE=y, - * CONFIG_DISABLE_MOUNTPOINT=n, CONFIG_MMCSD=y, and the appropriate SERCOM SPI + * Initialize the SPI-based SD card. + * Requires CONFIG_SAMD20_XPLAINED_IOMODULE=y, + * CONFIG_DISABLE_MOUNTPOINT=n, CONFIG_MMCSD=y, + * and the appropriate SERCOM SPI * port enabled. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMD20_XPLAINED_IOMODULE int sam_sdinitialize(int port, int minor); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_SAMD20_XPLAINED_SRC_SAMD20_XPLAINED_H */ - +#endif /* __BOARDS_ARM_SAMD2L2_SAMD20_XPLAINED_SRC_SAMD20_XPLAINED_H */ diff --git a/boards/arm/samd2l2/samd21-xplained/README.txt b/boards/arm/samd2l2/samd21-xplained/README.txt index ad20fa56bc0..1a6d602562d 100644 --- a/boards/arm/samd2l2/samd21-xplained/README.txt +++ b/boards/arm/samd2l2/samd21-xplained/README.txt @@ -27,8 +27,9 @@ Contents STATUS/ISSUES ============= - 1. See boards/samd20-xplained/README.txt. This port derives from the - SAMD20 Xplained board board and all issues there should apply. + 1. See boards/arm/samd2l2/samd20-xplained/README.txt. + This port derives from the SAMD20 Xplained board board and all issues + there should apply. 2. 2015-07-06: The basic NSH configuration is working properly, but not at 115200 baud which is the default BAUD selection in the diff --git a/boards/arm/samd2l2/samd21-xplained/include/board.h b/boards/arm/samd2l2/samd21-xplained/include/board.h index f3fb24c8f2e..d6cd7846534 100644 --- a/boards/arm/samd2l2/samd21-xplained/include/board.h +++ b/boards/arm/samd2l2/samd21-xplained/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samd21-xplained/include/board.h +/**************************************************************************** + * boards/arm/samd2l2/samd21-xplained/include/board.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_SAMD21_XPLAINED_INCLUDE_BOARD_H -#define __BOARDS_ARM_SAMD21_XPLAINED_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_SAMD2L2_SAMD21_XPLAINED_INCLUDE_BOARD_H +#define __BOARDS_ARM_SAMD2L2_SAMD21_XPLAINED_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,11 +49,12 @@ # endif #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* Clocking *****************************************************************/ -/* Clocking *************************************************************************/ /* Overview * * OSC8M Output = 8MHz @@ -288,9 +289,10 @@ #undef BOARD_GCLK7_OUTPUT_ENABLE #define BOARD_GCLK7_FREQUENCY (BOARD_OSC8M_FREQUENCY / BOARD_GCLK7_PRESCALER) -/* The source of the main clock is always GCLK_MAIN. Also called GCLKGEN[0], this is - * the clock feeding the Power Manager. The Power Manager, in turn, generates main - * clock which is divided down to produce the CPU, AHB, and APB clocks. +/* The source of the main clock is always GCLK_MAIN. Also called GCLKGEN[0], + * this is the clock feeding the Power Manager. + * The Power Manager, in turn, generates main clock which is divided down to + * produce the CPU, AHB, and APB clocks. * * The main clock is initially OSC8M divided by 8. */ @@ -343,9 +345,10 @@ # define BOARD_FLASH_WAITSTATES 2 #endif -/* SERCOM definitions ***************************************************************/ -/* This is the source clock generator for the GCLK_SERCOM_SLOW clock that is common - * to all SERCOM modules. +/* SERCOM definitions *******************************************************/ + +/* This is the source clock generator for the GCLK_SERCOM_SLOW clock that is + * common to all SERCOM modules. */ #define BOARD_SERCOM05_SLOW_GCLKGEN 0 @@ -469,7 +472,8 @@ #define BOARD_SERCOM5_FREQUENCY BOARD_GCLK0_FREQUENCY -/* USB definitions ******************************************************************/ +/* USB definitions **********************************************************/ + /* This is the source clock generator for the GCLK_USB clock */ @@ -482,14 +486,15 @@ #define BOARD_USB_PADCAL_N 5 #define BOARD_USB_PADCAL_TRIM 3 -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* There are three LEDs on board the SAMD21 Xplained Pro board: The EDBG * controls two of the LEDs, a power LED and a status LED. There is only - * one user controllable LED, a yellow LED labelled STATUS near the SAMD21 USB - * connector. + * one user controllable LED, a yellow LED labelled STATUS near the SAMD21 + * USB connector. * - * This LED is controlled by PC07 and the LED can be activated by driving the - * PB30 to GND. + * This LED is controlled by PC07 and the LED can be activated by driving + * the PB30 to GND. */ /* LED index values for use with board_userled() */ @@ -502,10 +507,10 @@ #define BOARD_STATUS LED_BIT (1 << BOARD_STATUS_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 */ @@ -517,12 +522,14 @@ #define LED_ASSERTION 2 /* STATUS LED=no change */ #define LED_PANIC 3 /* STATUS LED=flashing */ -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* Mechanical buttons: * - * The SAMD21 Xplained Pro contains two mechanical buttons. One button is the - * RESET button connected to the SAMD21 reset line and the other is a generic user - * configurable button. When a button is pressed it will drive the I/O line to GND. + * The SAMD21 Xplained Pro contains two mechanical buttons. + * One button is the RESET button connected to the SAMD21 reset line and the + * other is a generic user configurable button. + * When a button is pressed it will drive the I/O line to GND. * * PA15 SW0 */ @@ -534,4 +541,4 @@ #define BUTTON_SW0_BIT (1 << BUTTON_SW0) -#endif /* __BOARDS_ARM_SAMD21_XPLAINED_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_SAMD2L2_SAMD21_XPLAINED_INCLUDE_BOARD_H */ diff --git a/boards/arm/samd2l2/samd21-xplained/scripts/Make.defs b/boards/arm/samd2l2/samd21-xplained/scripts/Make.defs index 15b259502e5..c1dff70bc55 100644 --- a/boards/arm/samd2l2/samd21-xplained/scripts/Make.defs +++ b/boards/arm/samd2l2/samd21-xplained/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/samd21-xplained/scripts/Make.defs +# boards/arm/samd2l2/samd21-xplained/scripts/Make.defs # # Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/samd2l2/samd21-xplained/scripts/flash.ld b/boards/arm/samd2l2/samd21-xplained/scripts/flash.ld index 842d7cf7a16..4880e97c549 100644 --- a/boards/arm/samd2l2/samd21-xplained/scripts/flash.ld +++ b/boards/arm/samd2l2/samd21-xplained/scripts/flash.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samd21-xplained/scripts/flash.ld + * boards/arm/samd2l2/samd21-xplained/scripts/flash.ld * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samd2l2/samd21-xplained/src/Makefile b/boards/arm/samd2l2/samd21-xplained/src/Makefile index 143bf19db38..98ea3b9d96d 100644 --- a/boards/arm/samd2l2/samd21-xplained/src/Makefile +++ b/boards/arm/samd2l2/samd21-xplained/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/samd21-xplained/src/Makefile +# boards/arm/samd2l2/samd21-xplained/src/Makefile # # Copyright (C) 2015 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/samd2l2/samd21-xplained/src/sam_appinit.c b/boards/arm/samd2l2/samd21-xplained/src/sam_appinit.c index 3f15996a612..bca2841b05e 100644 --- a/boards/arm/samd2l2/samd21-xplained/src/sam_appinit.c +++ b/boards/arm/samd2l2/samd21-xplained/src/sam_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/samd21-xplained/src/sam_appinit.c + * boards/arm/samd2l2/samd21-xplained/src/sam_appinit.c * * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -50,6 +50,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Some configuration checks */ #ifdef CONFIG_SAMD21_XPLAINED_IOMODULE_EXT1 @@ -70,6 +71,7 @@ #ifdef CONFIG_SAMD21_XPLAINED_IOMODULE /* Support for the SD card slot on the I/O1 module */ + /* Verify NSH PORT and SLOT settings */ # define SAMD2L2_MMCSDSLOTNO 0 /* There is only one slot */ @@ -123,15 +125,13 @@ int board_app_initialize(uintptr_t arg) #if defined(SAMD2L2_HAVE_SPI0) && defined(CONFIG_SAMD21_XPLAINED_IOMODULE) /* Initialize the SPI-based MMC/SD slot */ - { - int ret = sam_sdinitialize(SPI_PORTNO, CONFIG_NSH_MMCSDMINOR); - if (ret < 0) - { - syslog(LOG_ERR, "ERROR: Failed to initialize MMC/SD slot: %d\n", - ret); - return ret; - } - } + int ret = sam_sdinitialize(SPI_PORTNO, CONFIG_NSH_MMCSDMINOR); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to initialize MMC/SD slot: %d\n", + ret); + return ret; + } #endif return OK; diff --git a/boards/arm/samd2l2/samd21-xplained/src/sam_autoleds.c b/boards/arm/samd2l2/samd21-xplained/src/sam_autoleds.c index c76f4783ce4..c48875b0650 100644 --- a/boards/arm/samd2l2/samd21-xplained/src/sam_autoleds.c +++ b/boards/arm/samd2l2/samd21-xplained/src/sam_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samd21-xplained/src/sam_autoleds.c + * boards/arm/samd2l2/samd21-xplained/src/sam_autoleds.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -32,6 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ + /* There are three LEDs on board the SAMD21 Xplained Pro board: The EDBG * controls two of the LEDs, a power LED and a status LED. There is only * one user controllable LED, a yellow LED labelled STATUS near the SAMD21 USB @@ -100,19 +101,23 @@ void board_autoled_on(int led) switch (led) { - case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF */ - /* LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF */ - /* LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF */ - break; /* Leave ledstate == true to turn OFF */ + case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF + * LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF + * LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF + */ + + break; /* Leave ledstate == true to turn OFF */ default: - case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C */ - /* LED_SIGNAL: In a signal handler STATUS LED=N/C */ - /* LED_ASSERTION: An assertion failed STATUS LED=N/C */ - return; /* Return to leave STATUS LED unchanged */ + case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C + * LED_SIGNAL: In a signal handler STATUS LED=N/C + * LED_ASSERTION: An assertion failed STATUS LED=N/C + */ - case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ - case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ + return; /* Return to leave STATUS LED unchanged */ + + case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ + case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ ledstate = false; /* Set ledstate == false to turn ON */ break; } @@ -131,21 +136,25 @@ void board_autoled_off(int led) /* These should not happen and are ignored */ default: - case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF */ - /* LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF */ - /* LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF */ - case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ + case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF + * LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF + * LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF + */ + + case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ /* These result in no-change */ - case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C */ - /* LED_SIGNAL: In a signal handler STATUS LED=N/C */ - /* LED_ASSERTION: An assertion failed STATUS LED=N/C */ - return; /* Return to leave STATUS LED unchanged */ + case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C + * LED_SIGNAL: In a signal handler STATUS LED=N/C + * LED_ASSERTION: An assertion failed STATUS LED=N/C + */ + + return; /* Return to leave STATUS LED unchanged */ /* Turn STATUS LED off set driving the output high */ - case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ + case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ sam_portwrite(PORT_STATUS_LED, true); break; } diff --git a/boards/arm/samd2l2/samd21-xplained/src/sam_boot.c b/boards/arm/samd2l2/samd21-xplained/src/sam_boot.c index 812ba306cbb..d529281f52c 100644 --- a/boards/arm/samd2l2/samd21-xplained/src/sam_boot.c +++ b/boards/arm/samd2l2/samd21-xplained/src/sam_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samd21-xplained/src/sam_boot.c +/**************************************************************************** + * boards/arm/samd2l2/samd21-xplained/src/sam_boot.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 @@ -46,31 +46,34 @@ #include "sam_config.h" #include "samd21-xplained.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_boardinitialize * * Description: - * All SAM3U 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 SAM3U 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 sam_boardinitialize(void) { - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function + /* Configure SPI chip selects if + * 1) SPI is not disabled, and + * 2) the weak function * sam_spidev_initialize() has been brought into the link. */ diff --git a/boards/arm/samd2l2/samd21-xplained/src/sam_buttons.c b/boards/arm/samd2l2/samd21-xplained/src/sam_buttons.c index 26d9d260579..698b0f466c1 100644 --- a/boards/arm/samd2l2/samd21-xplained/src/sam_buttons.c +++ b/boards/arm/samd2l2/samd21-xplained/src/sam_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samd21-xplained/src/sam_buttons.c + * boards/arm/samd2l2/samd21-xplained/src/sam_buttons.c * * Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -74,16 +74,18 @@ void board_button_initialize(void) (void)sam_configport(PORT_SW0); } -/************************************************************************************ +/**************************************************************************** * 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. * - ************************************************************************************/ + ****************************************************************************/ uint32_t board_buttons(void) { diff --git a/boards/arm/samd2l2/samd21-xplained/src/sam_mmcsd.c b/boards/arm/samd2l2/samd21-xplained/src/sam_mmcsd.c index efaf756adeb..826c5da21d5 100644 --- a/boards/arm/samd2l2/samd21-xplained/src/sam_mmcsd.c +++ b/boards/arm/samd2l2/samd21-xplained/src/sam_mmcsd.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/samd21-xplained/src/sam_mmcsd.c + * boards/arm/samd2l2/samd21-xplained/src/sam_mmcsd.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -56,6 +56,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifdef CONFIG_DISABLE_MOUNTPOINT @@ -84,7 +85,8 @@ * - CONFIG_SAMD21_XPLAINED_IOMODULE=y, * - CONFIG_DISABLE_MOUNTPOINT=n, * - CONFIG_MMCSD=y, and - * - SAMD2L2_HAVE_SPI0=y (CONFIG_SAMD2L2_SERCOM0 && CONFIG_SAMD2L2_SERCOM0_ISSPI) + * - SAMD2L2_HAVE_SPI0=y + * (CONFIG_SAMD2L2_SERCOM0 && CONFIG_SAMD2L2_SERCOM0_ISSPI) * ****************************************************************************/ diff --git a/boards/arm/samd2l2/samd21-xplained/src/sam_spi.c b/boards/arm/samd2l2/samd21-xplained/src/sam_spi.c index e1f0d2ea8ac..b0c9214c8b0 100644 --- a/boards/arm/samd2l2/samd21-xplained/src/sam_spi.c +++ b/boards/arm/samd2l2/samd21-xplained/src/sam_spi.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samd21-xplained/src/sam_spi.c + * boards/arm/samd2l2/samd21-xplained/src/sam_spi.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -68,20 +68,20 @@ void weak_function sam_spidev_initialize(void) { - /* The I/O module containing the SD connector may or may not be installed. And, if - * it is installed, it may be in connector EXT1 or EXT2. + /* The I/O module containing the SD connector may or may not be installed. + * And, if it is installed, it may be in connector EXT1 or EXT2. */ #ifdef CONFIG_SAMD21_XPLAINED_IOMODULE /* TODO: enable interrupt on card detect */ - sam_configport(PORT_SD_CD); /* Card detect input */ - sam_configport(PORT_SD_CS); /* Chip select output */ + sam_configport(PORT_SD_CD); /* Card detect input */ + sam_configport(PORT_SD_CS); /* Chip select output */ #endif #ifdef CONFIG_SAMD21_XPLAINED_OLED1MODULE - sam_configport(PORT_OLED_DATA); /* Command/data */ - sam_configport(PORT_OLED_CS); /* Card detect input */ + sam_configport(PORT_OLED_DATA); /* Command/data */ + sam_configport(PORT_OLED_CS); /* Card detect input */ #endif } @@ -114,8 +114,8 @@ void weak_function sam_spidev_initialize(void) * the way your board is configured. * 3. Add a call to sam_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by sam_spibus_initialize() may then be used to bind - * the SPI driver to higher level logic (e.g., calling + * 4. The handle returned by sam_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). * diff --git a/boards/arm/samd2l2/samd21-xplained/src/sam_ug2832hsweg04.c b/boards/arm/samd2l2/samd21-xplained/src/sam_ug2832hsweg04.c index ac0a4a16042..5c79ccba051 100644 --- a/boards/arm/samd2l2/samd21-xplained/src/sam_ug2832hsweg04.c +++ b/boards/arm/samd2l2/samd21-xplained/src/sam_ug2832hsweg04.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/samd21-xplained/src/sam_ug2832hsweg04.c + * boards/arm/samd2l2/samd21-xplained/src/sam_ug2832hsweg04.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -125,7 +125,9 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ + /* The pin configurations here require that SPI1 is selected */ #ifndef CONFIG_LCD_SSD1306 diff --git a/boards/arm/samd2l2/samd21-xplained/src/sam_userleds.c b/boards/arm/samd2l2/samd21-xplained/src/sam_userleds.c index 34e599a897a..5b35f07d2d3 100644 --- a/boards/arm/samd2l2/samd21-xplained/src/sam_userleds.c +++ b/boards/arm/samd2l2/samd21-xplained/src/sam_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samd21-xplained/src/sam_userleds.c + * boards/arm/samd2l2/samd21-xplained/src/sam_userleds.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -32,6 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ + /* There are three LEDs on board the SAMD21 Xplained Pro board: The EDBG * controls two of the LEDs, a power LED and a status LED. There is only * one user controllable LED, a yellow LED labelled STATUS near the SAMD21 USB @@ -41,8 +42,8 @@ * to GND. * * When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will - * control the LED. Otherwise, the LED can be controlled from user applications - * using the logic in this file. + * control the LED. Otherwise, the LED can be controlled from user + * applications using the logic in this file. */ /**************************************************************************** @@ -105,7 +106,8 @@ void board_userled(int led, bool ledon) * * Description: * If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board - * LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is + * LEDs. + * If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is * available to control the LED from user application logic. NOTE: since * there is only a single LED on-board, this is function is not very useful. * diff --git a/boards/arm/samd2l2/samd21-xplained/src/samd21-xplained.h b/boards/arm/samd2l2/samd21-xplained/src/samd21-xplained.h index 77b26013e46..7ea95b95bb8 100644 --- a/boards/arm/samd2l2/samd21-xplained/src/samd21-xplained.h +++ b/boards/arm/samd2l2/samd21-xplained/src/samd21-xplained.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samd21-xplained/src/samd21-xplained.h +/**************************************************************************** + * boards/arm/samd2l2/samd21-xplained/src/samd21-xplained.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_SAMD21_XPLAINED_SRC_SAMD21_XPLAINED_H -#define __BOARDS_ARM_SAMD21_XPLAINED_SRC_SAMD21_XPLAINED_H +#ifndef __BOARDS_ARM_SAMD2L2_SAMD21_XPLAINED_SRC_SAMD21_XPLAINED_H +#define __BOARDS_ARM_SAMD2L2_SAMD21_XPLAINED_SRC_SAMD21_XPLAINED_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -51,16 +51,18 @@ #include "sam_config.h" #include "sam_pinmap.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* LEDs: There are three LEDs on board the SAMD21 Xplained Pro board: The EDBG + ****************************************************************************/ + +/* LEDs: + * There are three LEDs on board the SAMD21 Xplained Pro board: The EDBG * controls two of the LEDs, a power LED and a status LED. There is only - * one user controllable LED, a yellow LED labelled STATIS near the SAMD21 USB - * connector. + * one user controllable LED, a yellow LED labelled STATIS near the SAMD21 + * USB connector. * - * This LED is controlled by PB30 and the LED can be activated by driving PB30 - * to GND. + * This LED is controlled by PB30 and the LED can be activated by driving + * PB30 to GND. * * When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will * control the LED as follows: @@ -87,8 +89,9 @@ /* Mechanical buttons: * * The SAMD21 Xplained Pro contains two mechanical buttons. One button is the - * RESET button connected to the SAMD21 reset line and the other is a generic user - * configurable button. When a button is pressed it will drive the I/O line to GND. + * RESET button connected to the SAMD21 reset line and the other is a generic + * user configurable button. + * When a button is pressed it will drive the I/O line to GND. * * PA15 SW0 */ @@ -102,15 +105,17 @@ * SPI support and two PORTs. These the PORTs will vary if the I/O1 * is installed on the EXT1 or EXT2 connector: * - * --- ------------------ ---------------------- ------------------------------- + * --- ------------------ ---------------------- -------------------------- * PIN EXT1 EXT2 Description - * --- ------------------ ---------------------- ------------------------------- - * 15 PA05 SERCOM0 PAD[1] 15 PA17 SERCOM1 PAD[1] Active low chip select OUTPUT, - * SPI SS SPI SS pulled high on board. - * --- ------------------ ---------------------- ------------------------------- - * 10 PB05 PORT 10 PB15 PORT Active low card detect INPUT, - * must use internal pull-up. - * --- ------------------ ---------------------- ------------------------------- + * --- ------------------ ---------------------- -------------------------- + * 15 PA05 SERCOM0 PAD[1] 15 PA17 SERCOM1 PAD[1] Active low chip select + * SPI SS SPI SS OUTPUT, pulled high on + * board. + * --- ------------------ ---------------------- -------------------------- + * 10 PB05 PORT 10 PB15 PORT Active low card detect + * INPUT, must use internal + * pull-up. + * --- ------------------ ---------------------- -------------------------- */ #ifdef CONFIG_SAMD21_XPLAINED_IOMODULE @@ -158,7 +163,7 @@ * * * PIN EXT1 EXT2 Description - * --- ------------------- -------------------- ------------------------------------- + * --- ------------------- -------------------- --------------------------- * 5 PB06 PORT PA20 PORT DATA_CMD_SEL * 10 PB05 PORT PB15 PORT DISPLAY_RESET. Active low. * 15 PA05 SERCOM0 PAD[1] PA17 SERCOM1 PAD[1] DISPLAY_SS. Active low. @@ -221,44 +226,44 @@ PORTB | PORT_PIN11) /* REVISIT */ #endif -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select PORT pins for the SAM3U-EK board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function sam_spidev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: sam_sdinitialize * * Description: - * Initialize the SPI-based SD card. Requires CONFIG_SAMD21_XPLAINED_IOMODULE=y, - * CONFIG_DISABLE_MOUNTPOINT=n, CONFIG_MMCSD=y, and the appropriate SERCOM SPI - * port enabled. + * Initialize the SPI-based SD card. + * Requires CONFIG_SAMD21_XPLAINED_IOMODULE=y, + * CONFIG_DISABLE_MOUNTPOINT=n, + * CONFIG_MMCSD=y, and the appropriate SERCOM SPI port enabled. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMD21_XPLAINED_IOMODULE int sam_sdinitialize(int port, int minor); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_SAMD21_XPLAINED_SRC_SAMD21_XPLAINED_H */ - +#endif /* __BOARDS_ARM_SAMD2L2_SAMD21_XPLAINED_SRC_SAMD21_XPLAINED_H */ diff --git a/boards/arm/samd2l2/saml21-xplained/include/board.h b/boards/arm/samd2l2/saml21-xplained/include/board.h index fbbf29d099a..49abf662982 100644 --- a/boards/arm/samd2l2/saml21-xplained/include/board.h +++ b/boards/arm/samd2l2/saml21-xplained/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/saml21-xplained/include/board.h +/**************************************************************************** + * boards/arm/samd2l2/saml21-xplained/include/board.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_SAML21_XPLAINED_INCLUDE_BOARD_H -#define __BOARDS_ARM_SAML21_XPLAINED_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_SAMD2L2_SAML21_XPLAINED_INCLUDE_BOARD_H +#define __BOARDS_ARM_SAMD2L2_SAML21_XPLAINED_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -49,27 +49,29 @@ # endif #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ + +/* Clocking *****************************************************************/ -/* Clocking *************************************************************************/ /* Overview * - * Since there is no high speed crystal, we will run from the OSC16M clock source. - * We will use its default, POR frequency of 4MHz to avoid an additional clock - * switch. + * Since there is no high speed crystal, we will run from the OSC16M clock + * source. + * We will use its default, POR frequency of 4MHz to avoid an additional + * clock switch. * - * OSC16M Output = 4MHz - * `- GCLK1 Input = 4MHz Prescaler = 1 output = 4MHz - * `- DFLL Input = 4MHz Multiplier = 12 output = 48MHz - * `- GCLK0 Input = 48MHz Prescaler = 1 output = 48MHz - * `- MCLK Input = 48Mhz CPU divider = 1 CPU frequency = 48MHz - * APBA divider = 1 APBA frequency = 48MHz - * APBB divider = 1 APBB frequency = 48MHz - * APBC divider = 1 APBC frequency = 48MHz - * APBD divider = 1 APBD frequency = 48MHz - * APBE divider = 1 APBE frequency = 48MHz + * OSC16M Output = 4MHz + * `- GCLK1 Input = 4MHz Prescaler = 1 output = 4MHz + * `- DFLL Input = 4MHz Multiplier = 12 output = 48MHz + * `- GCLK0 Input = 48MHz Prescaler = 1 output = 48MHz + * `- MCLK Input = 48Mhz CPU divider = 1 CPU frequency = 48MHz + * APBA divider = 1 APBA frequency = 48MHz + * APBB divider = 1 APBB frequency = 48MHz + * APBC divider = 1 APBC frequency = 48MHz + * APBD divider = 1 APBD frequency = 48MHz + * APBE divider = 1 APBE frequency = 48MHz * * The SAML21 Xplained Pro has one on-board crystal: * @@ -154,7 +156,6 @@ * BOARD_OSC16M_RUNINSTANDBY - Boolean (defined / not defined) */ - #if defined(CONFIG_SAML21_XPLAINED_OSC16M_4MHZ) # define BOARD_OSC16M_FSEL OSCCTRL_OSC16MCTRL_FSEL_4MHZ # define BOARD_OSC16M_ONDEMAND 1 @@ -427,9 +428,10 @@ #undef BOARD_GCLK8_OUTPUT_ENABLE #define BOARD_GCLK8_FREQUENCY (BOARD_OSC16M_FREQUENCY / BOARD_GCLK8_PRESCALER) -/* The source of the main clock is always GCLK_MAIN. Also called GCLKGEN[0], this is - * the clock feeding the Power Manager. The Power Manager, in turn, generates main - * clock which is divided down to produce the CPU, AHB, and APB clocks. +/* The source of the main clock is always GCLK_MAIN. Also called GCLKGEN[0], + * this is the clock feeding the Power Manager. + * The Power Manager, in turn, generates main clock which is divided + * down to produce the CPU, AHB, and APB clocks. * * The main clock is initially OSC16M divided by 8. */ @@ -483,13 +485,14 @@ # define BOARD_FLASH_WAITSTATES 1 #endif -/* SERCOM definitions ***************************************************************/ -/* This is the source clock generator for the GCLK_SERCOM_SLOW clock that is common - * to SERCOM modules 0-4. It will generate clocking on the common SERCOM0-4 - * channel. +/* SERCOM definitions *******************************************************/ + +/* This is the source clock generator for the GCLK_SERCOM_SLOW clock that is + * common to SERCOM modules 0-4. + * It will generate clocking on the common SERCOM0-4 channel. * - * SERCOM5 uses a different channel and will probably need to use a different GCLK - * generator. + * SERCOM5 uses a different channel and will probably need to use a different + * GCLK generator. */ #define BOARD_SERCOM04_SLOW_GCLKGEN 0 @@ -593,7 +596,8 @@ #define BOARD_SERCOM5_FREQUENCY BOARD_GCLK0_FREQUENCY -/* USB definitions ******************************************************************/ +/* USB definitions **********************************************************/ + /* This is the source clock generator for the GCLK_USB clock */ @@ -606,14 +610,15 @@ #define BOARD_USB_PADCAL_N 5 #define BOARD_USB_PADCAL_TRIM 3 -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* There are three LEDs on board the SAML21 Xplained Pro board: The EDBG * controls two of the LEDs, a power LED and a status LED. There is only - * one user controllable LED, a yellow LED labelled STATUS near the SAML21 USB - * connector. + * one user controllable LED, a yellow LED labelled STATUS near the SAML21 + * USB connector. * - * This LED is controlled by PC07 and the LED can be activated by driving the - * PB10 to GND. + * This LED is controlled by PC07 and the LED can be activated by driving + * the PB10 to GND. */ /* LED index values for use with board_userled() */ @@ -626,10 +631,11 @@ #define BOARD_STATUS LED_BIT (1 << BOARD_STATUS_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 */ @@ -641,12 +647,14 @@ #define LED_ASSERTION 2 /* STATUS LED=no change */ #define LED_PANIC 3 /* STATUS LED=flashing */ -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* Mechanical buttons: * - * The SAML21 Xplained Pro contains two mechanical buttons. One button is the - * RESET button connected to the SAML21 reset line and the other is a generic user - * configurable button. When a button is pressed it will drive the I/O line to GND. + * The SAML21 Xplained Pro contains two mechanical buttons. + * One button is the RESET button connected to the SAML21 reset line and the + * other is a generic user configurable button. + * When a button is pressed it will drive the I/O line to GND. * * PA02 SW0 */ @@ -658,4 +666,4 @@ #define BUTTON_SW0_BIT (1 << BUTTON_SW0) -#endif /* __BOARDS_ARM_SAML21_XPLAINED_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_SAMD2L2_SAML21_XPLAINED_INCLUDE_BOARD_H */ diff --git a/boards/arm/samd2l2/saml21-xplained/scripts/Make.defs b/boards/arm/samd2l2/saml21-xplained/scripts/Make.defs index 1ba572300e6..cfd12259bf5 100644 --- a/boards/arm/samd2l2/saml21-xplained/scripts/Make.defs +++ b/boards/arm/samd2l2/saml21-xplained/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/saml21-xplained/scripts/Make.defs +# boards/arm/samd2l2/saml21-xplained/scripts/Make.defs # # Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/samd2l2/saml21-xplained/scripts/flash.ld b/boards/arm/samd2l2/saml21-xplained/scripts/flash.ld index e65a8d97b84..028589acc79 100644 --- a/boards/arm/samd2l2/saml21-xplained/scripts/flash.ld +++ b/boards/arm/samd2l2/saml21-xplained/scripts/flash.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/saml21-xplained/scripts/flash.ld + * boards/arm/samd2l2/saml21-xplained/scripts/flash.ld * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samd2l2/saml21-xplained/src/Makefile b/boards/arm/samd2l2/saml21-xplained/src/Makefile index b9b3f5487cf..f9a78fcbd95 100644 --- a/boards/arm/samd2l2/saml21-xplained/src/Makefile +++ b/boards/arm/samd2l2/saml21-xplained/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/saml21-xplained/src/Makefile +# boards/arm/samd2l2/saml21-xplained/src/Makefile # # Copyright (C) 2014 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/samd2l2/saml21-xplained/src/sam_appinit.c b/boards/arm/samd2l2/saml21-xplained/src/sam_appinit.c index 48acf2c343b..ff431d561fd 100644 --- a/boards/arm/samd2l2/saml21-xplained/src/sam_appinit.c +++ b/boards/arm/samd2l2/saml21-xplained/src/sam_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/saml21-xplained/src/sam_appinit.c + * boards/arm/samd2l2/saml21-xplained/src/sam_appinit.c * * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -50,6 +50,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Some configuration checks */ #ifdef CONFIG_SAML21_XPLAINED_IOMODULE_EXT1 @@ -70,6 +71,7 @@ #ifdef CONFIG_SAML21_XPLAINED_IOMODULE /* Support for the SD card slot on the I/O1 module */ + /* Verify NSH PORT and SLOT settings */ # define SAMD2L2_MMCSDSLOTNO 0 /* There is only one slot */ @@ -123,15 +125,13 @@ int board_app_initialize(uintptr_t arg) #if defined(SAMD2L2_HAVE_SPI0) && defined(CONFIG_SAML21_XPLAINED_IOMODULE) /* Initialize the SPI-based MMC/SD slot */ - { - int ret = sam_sdinitialize(SPI_PORTNO, CONFIG_NSH_MMCSDMINOR); - if (ret < 0) - { - syslog(LOG_ERR, "ERROR: Failed to initialize MMC/SD slot: %d\n", - ret); - return ret; - } - } + int ret = sam_sdinitialize(SPI_PORTNO, CONFIG_NSH_MMCSDMINOR); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to initialize MMC/SD slot: %d\n", + ret); + return ret; + } #endif return OK; diff --git a/boards/arm/samd2l2/saml21-xplained/src/sam_autoleds.c b/boards/arm/samd2l2/saml21-xplained/src/sam_autoleds.c index 3e4c3d5d760..c557ac301ac 100644 --- a/boards/arm/samd2l2/saml21-xplained/src/sam_autoleds.c +++ b/boards/arm/samd2l2/saml21-xplained/src/sam_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/saml21-xplained/src/sam_autoleds.c + * boards/arm/samd2l2/saml21-xplained/src/sam_autoleds.c * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -100,19 +100,23 @@ void board_autoled_on(int led) switch (led) { - case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF */ - /* LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF */ - /* LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF */ - break; /* Leave ledstate == true to turn OFF */ + case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF + * LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF + * LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF + */ + + break; /* Leave ledstate == true to turn OFF */ default: - case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C */ - /* LED_SIGNAL: In a signal handler STATUS LED=N/C */ - /* LED_ASSERTION: An assertion failed STATUS LED=N/C */ - return; /* Return to leave STATUS LED unchanged */ + case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C + * LED_SIGNAL: In a signal handler STATUS LED=N/C + * LED_ASSERTION: An assertion failed STATUS LED=N/C + */ - case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ - case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ + return; /* Return to leave STATUS LED unchanged */ + + case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ + case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ ledstate = false; /* Set ledstate == false to turn ON */ break; } @@ -131,21 +135,25 @@ void board_autoled_off(int led) /* These should not happen and are ignored */ default: - case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF */ - /* LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF */ - /* LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF */ - case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ + case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF + * LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF + * LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF + */ + + case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ /* These result in no-change */ - case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C */ - /* LED_SIGNAL: In a signal handler STATUS LED=N/C */ - /* LED_ASSERTION: An assertion failed STATUS LED=N/C */ - return; /* Return to leave STATUS LED unchanged */ + case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C + * LED_SIGNAL: In a signal handler STATUS LED=N/C + * LED_ASSERTION: An assertion failed STATUS LED=N/C + */ + + return; /* Return to leave STATUS LED unchanged */ /* Turn STATUS LED off set driving the output high */ - case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ + case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ sam_portwrite(PORT_STATUS_LED, true); break; } diff --git a/boards/arm/samd2l2/saml21-xplained/src/sam_boot.c b/boards/arm/samd2l2/saml21-xplained/src/sam_boot.c index bd19ddb8ea7..f0c8e7e35ec 100644 --- a/boards/arm/samd2l2/saml21-xplained/src/sam_boot.c +++ b/boards/arm/samd2l2/saml21-xplained/src/sam_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/saml21-xplained/src/sam_boot.c +/**************************************************************************** + * boards/arm/samd2l2/saml21-xplained/src/sam_boot.c * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -46,31 +46,34 @@ #include "sam_config.h" #include "saml21-xplained.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_boardinitialize * * Description: - * All SAM3U 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 SAM3U 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 sam_boardinitialize(void) { - /* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function + /* Configure SPI chip selects if + * 1) SPI is not disabled, and + * 2) the weak function * sam_spidev_initialize() has been brought into the link. */ diff --git a/boards/arm/samd2l2/saml21-xplained/src/sam_buttons.c b/boards/arm/samd2l2/saml21-xplained/src/sam_buttons.c index 1693ecab678..c2311b7449a 100644 --- a/boards/arm/samd2l2/saml21-xplained/src/sam_buttons.c +++ b/boards/arm/samd2l2/saml21-xplained/src/sam_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/saml21-xplained/src/sam_buttons.c + * boards/arm/samd2l2/saml21-xplained/src/sam_buttons.c * * Copyright (C) 2014-2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -63,8 +63,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 + * 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. * ****************************************************************************/ @@ -74,16 +74,17 @@ void board_button_initialize(void) (void)sam_configport(PORT_SW0); } -/************************************************************************************ +/**************************************************************************** * 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 + * 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. * - ************************************************************************************/ + ****************************************************************************/ uint32_t board_buttons(void) { diff --git a/boards/arm/samd2l2/saml21-xplained/src/sam_mmcsd.c b/boards/arm/samd2l2/saml21-xplained/src/sam_mmcsd.c index c70258d4697..e12fb97a975 100644 --- a/boards/arm/samd2l2/saml21-xplained/src/sam_mmcsd.c +++ b/boards/arm/samd2l2/saml21-xplained/src/sam_mmcsd.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/saml21-xplained/src/sam_mmcsd.c + * boards/arm/samd2l2/saml21-xplained/src/sam_mmcsd.c * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -56,6 +56,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifdef CONFIG_DISABLE_MOUNTPOINT @@ -84,7 +85,8 @@ * - CONFIG_SAML21_XPLAINED_IOMODULE=y, * - CONFIG_DISABLE_MOUNTPOINT=n, * - CONFIG_MMCSD=y, and - * - SAMD2L2_HAVE_SPI0=y (CONFIG_SAMD2L2_SERCOM0 && CONFIG_SAMD2L2_SERCOM0_ISSPI) + * - SAMD2L2_HAVE_SPI0=y + * (CONFIG_SAMD2L2_SERCOM0 && CONFIG_SAMD2L2_SERCOM0_ISSPI) * ****************************************************************************/ diff --git a/boards/arm/samd2l2/saml21-xplained/src/sam_spi.c b/boards/arm/samd2l2/saml21-xplained/src/sam_spi.c index 5594f54b553..5cf38be4c8e 100644 --- a/boards/arm/samd2l2/saml21-xplained/src/sam_spi.c +++ b/boards/arm/samd2l2/saml21-xplained/src/sam_spi.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/saml21-xplained/src/sam_spi.c + * boards/arm/samd2l2/saml21-xplained/src/sam_spi.c * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -68,20 +68,20 @@ void weak_function sam_spidev_initialize(void) { - /* The I/O module containing the SD connector may or may not be installed. And, if - * it is installed, it may be in connector EXT1 or EXT2. + /* The I/O module containing the SD connector may or may not be installed. + * And, if it is installed, it may be in connector EXT1 or EXT2. */ #ifdef CONFIG_SAML21_XPLAINED_IOMODULE /* TODO: enable interrupt on card detect */ - sam_configport(PORT_SD_CD); /* Card detect input */ - sam_configport(PORT_SD_CS); /* Chip select output */ + sam_configport(PORT_SD_CD); /* Card detect input */ + sam_configport(PORT_SD_CS); /* Chip select output */ #endif #ifdef CONFIG_SAML21_XPLAINED_OLED1MODULE - sam_configport(PORT_OLED_DATA); /* Command/data */ - sam_configport(PORT_OLED_CS); /* Card detect input */ + sam_configport(PORT_OLED_DATA); /* Command/data */ + sam_configport(PORT_OLED_CS); /* Card detect input */ #endif } @@ -114,8 +114,8 @@ void weak_function sam_spidev_initialize(void) * the way your board is configured. * 3. Add a call to sam_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by sam_spibus_initialize() may then be used to bind - * the SPI driver to higher level logic (e.g., calling + * 4. The handle returned by sam_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). * diff --git a/boards/arm/samd2l2/saml21-xplained/src/sam_ug2832hsweg04.c b/boards/arm/samd2l2/saml21-xplained/src/sam_ug2832hsweg04.c index 1e207c8ef14..4b34da21163 100644 --- a/boards/arm/samd2l2/saml21-xplained/src/sam_ug2832hsweg04.c +++ b/boards/arm/samd2l2/saml21-xplained/src/sam_ug2832hsweg04.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/saml21-xplained/src/sam_ug2832hsweg04.c + * boards/arm/samd2l2/saml21-xplained/src/sam_ug2832hsweg04.c * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -125,7 +125,9 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ + /* The pin configurations here require that SPI1 is selected */ #ifndef CONFIG_LCD_SSD1306 diff --git a/boards/arm/samd2l2/saml21-xplained/src/sam_userleds.c b/boards/arm/samd2l2/saml21-xplained/src/sam_userleds.c index af3c2c7325b..b06e5b499fe 100644 --- a/boards/arm/samd2l2/saml21-xplained/src/sam_userleds.c +++ b/boards/arm/samd2l2/saml21-xplained/src/sam_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/saml21-xplained/src/sam_userleds.c + * boards/arm/samd2l2/saml21-xplained/src/sam_userleds.c * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -41,8 +41,9 @@ * to GND. * * When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will - * control the LED. Otherwise, the LED can be controlled from user applications - * using the logic in this file. + * control the LED. + * Otherwise, the LED can be controlled from user applications using the + * logic in this file. */ /**************************************************************************** @@ -105,7 +106,8 @@ void board_userled(int led, bool ledon) * * Description: * If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board - * LEDs. If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is + * LEDs. + * If CONFIG_ARCH_LEDS is not defined, then the board_userled_all() is * available to control the LED from user application logic. NOTE: since * there is only a single LED on-board, this is function is not very useful. * diff --git a/boards/arm/samd2l2/saml21-xplained/src/saml21-xplained.h b/boards/arm/samd2l2/saml21-xplained/src/saml21-xplained.h index 8735b4f29b2..e9fc7d1b10b 100644 --- a/boards/arm/samd2l2/saml21-xplained/src/saml21-xplained.h +++ b/boards/arm/samd2l2/saml21-xplained/src/saml21-xplained.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/saml21-xplained/src/saml21-xplained.h +/**************************************************************************** + * boards/arm/samd2l2/saml21-xplained/src/saml21-xplained.h * * Copyright (C) 2014 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_SAML21_XPLAINED_SRC_SAML21_XPLAINED_H -#define __BOARDS_ARM_SAML21_XPLAINED_SRC_SAML21_XPLAINED_H +#ifndef __BOARDS_ARM_SAMD2L2_SAML21_XPLAINED_SRC_SAML21_XPLAINED_H +#define __BOARDS_ARM_SAMD2L2_SAML21_XPLAINED_SRC_SAML21_XPLAINED_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -51,16 +51,17 @@ #include "sam_config.h" #include "sam_pinmap.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* LEDs: There are three LEDs on board the SAML21 Xplained Pro board: The EDBG - * controls two of the LEDs, a power LED and a status LED. There is only - * one user controllable LED, a yellow LED labelled STATIS near the SAML21 USB - * connector. + ****************************************************************************/ + +/* LEDs: There are three LEDs on board the SAML21 Xplained Pro board: + * The EDBG controls two of the LEDs, a power LED and a status LED. + * There is only one user controllable LED, a yellow LED labelled STATIS + * near the SAML21 USB connector. * - * This LED is controlled by PB10 and the LED can be activated by driving PB10 - * to GND. + * This LED is controlled by PB10 and the LED can be activated by driving + * PB10 to GND. * * When CONFIG_ARCH_LEDS is defined in the NuttX configuration, NuttX will * control the LED as follows: @@ -87,8 +88,9 @@ /* Mechanical buttons: * * The SAML21 Xplained Pro contains two mechanical buttons. One button is the - * RESET button connected to the SAML21 reset line and the other is a generic user - * configurable button. When a button is pressed it will drive the I/O line to GND. + * RESET button connected to the SAML21 reset line and the other is a generic + * user configurable button. + * When a button is pressed it will drive the I/O line to GND. * * PA02 SW0 */ @@ -102,14 +104,16 @@ * SPI support and two PORTs. These the PORTs will vary if the I/O1 * is installed on the EXT1 or EXT2 connector: * - * --- ------------------ ---------------------- ------------------------------- + * --- ------------------ ---------------------- -------------------------- * PIN EXT1 EXT2 Description - * --- ------------------ ---------------------- ------------------------------- - * 15 PA05 SERCOM0 PAD[1] 15 PA17 GPIO] Active low chip select OUTPUT, - * SPI SS pulled high on board. - * 10 PA02 GPIO 10 PB15 GPIO Active low card detect INPUT, - * must use internal pull-up. - * --- ------------------ ---------------------- ------------------------------- + * --- ------------------ ---------------------- -------------------------- + * 15 PA05 SERCOM0 PAD[1] 15 PA17 GPIO] Active low chip select + * SPI SS OUTPUT, pulled high on + * board. + * 10 PA02 GPIO 10 PB15 GPIO Active low card detect + * INPUT, must use internal + * pull-up. + * --- ------------------ ---------------------- -------------------------- */ #ifdef CONFIG_SAML21_XPLAINED_IOMODULE @@ -151,19 +155,19 @@ /* OLED1 * - * Support for the microSD card slot on the I/O1 module. The I/O1 requires - * SPI support and three output PORTs. These the PORTs will vary if the OLED1 - * is installed on the EXT1 or EXT2 connector: + * Support for the microSD card slot on the I/O1 module. + * The I/O1 requires SPI support and three output PORTs. + * These the PORTs will vary if the OLED1 is installed on the EXT1 + * or EXT2 connector: * - * - * --- ------------------- -------------------- ------------------------------------- + * --- ------------------- -------------------- --------------------------- * PIN EXT1 EXT2 Description - * --- ------------------- -------------------- ------------------------------------- + * --- ------------------- -------------------- --------------------------- * 5 PB06 PA02 PA20 PA02 DATA_CMD_SEL * 10 PA02 PA02 PB15 PA02 DISPLAY_RESET. Active low. * 15 PA05 SERCOM0 PAD[1] PA17 SERCOM1 PAD[1] DISPLAY_SS. Active low. * SPI SS SPI SS - * --- ------------------- -------------------- ------------------------------------- + * --- ------------------- -------------------- --------------------------- */ #ifdef CONFIG_SAML21_XPLAINED_OLED1MODULE @@ -222,43 +226,44 @@ PORTB | PORT_PIN11) /* REVISIT */ #endif -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select PORT pins for the SAM3U-EK board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function sam_spidev_initialize(void); -/************************************************************************************ +/**************************************************************************** * Name: sam_sdinitialize * * Description: - * Initialize the SPI-based SD card. Requires CONFIG_SAML21_XPLAINED_IOMODULE=y, - * CONFIG_DISABLE_MOUNTPOINT=n, CONFIG_MMCSD=y, and the appropriate SERCOM SPI - * port enabled. + * Initialize the SPI-based SD card. + * Requires CONFIG_SAML21_XPLAINED_IOMODULE=y, + * CONFIG_DISABLE_MOUNTPOINT=n, CONFIG_MMCSD=y, + * and the appropriate SERCOM SPI port enabled. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAML21_XPLAINED_IOMODULE int sam_sdinitialize(int port, int minor); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_SAML21_XPLAINED_SRC_SAML21_XPLAINED_H */ +#endif /* __BOARDS_ARM_SAMD2L2_SAML21_XPLAINED_SRC_SAML21_XPLAINED_H */ diff --git a/boards/arm/samd5e5/metro-m4/README.txt b/boards/arm/samd5e5/metro-m4/README.txt index 74e0444e3aa..538b15e8ce8 100644 --- a/boards/arm/samd5e5/metro-m4/README.txt +++ b/boards/arm/samd5e5/metro-m4/README.txt @@ -186,9 +186,9 @@ Unlocking FLASH into NVM. See https://en.m.wikipedia.org/wiki/SREC_(file_format) for a description of the Motorola SREC format. - I wrote a small program at boards/metro-m4-scripts/nvm.c that will + I wrote a small program at boards/arm/samd5e5/metro-m4-scripts/nvm.c that will generate this Motorola SREC file with the correct checksum. The file at - boards/metro-m4-scripts/nvm.c is the output of that program. + boards/arm/samd5e5/metro-m4-scripts/nvm.c is the output of that program. J-Link>mem8 804000,10 00804000 = 39 92 9A F6 80 FF EC AE FF FF FF FF FF FF FF FF diff --git a/boards/arm/samd5e5/metro-m4/include/board.h b/boards/arm/samd5e5/metro-m4/include/board.h index 49fae68214d..3a364b30198 100644 --- a/boards/arm/samd5e5/metro-m4/include/board.h +++ b/boards/arm/samd5e5/metro-m4/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/metro-m4/include/board.h +/**************************************************************************** + * boards/arm/samd5e5/metro-m4/include/board.h * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,20 +31,20 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_METRO_M4_INCLUDE_BOARD_H -#define __BOARDS_ARM_METRO_M4_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_SAMD5E5_METRO_M4_INCLUDE_BOARD_H +#define __BOARDS_ARM_SAMD5E5_METRO_M4_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #ifndef TRUE # define TRUE 1 @@ -54,17 +54,19 @@ # define FALSE 0 #endif -/* Clocking *************************************************************************/ +/* Clocking *****************************************************************/ + /* Overview * * Per the schematic Adafruit Metro M4 Pro has one on-board crystal: * * X4 32.768KHz XOSC32 * - * However, I have been unsuccessful using it and have fallen back to using OSCULP32K - * (Unless CONFIG_METRO_M4_32KHZXTAL=y) + * However, I have been unsuccessful using it and have fallen back to using + * OSCULP32K(Unless CONFIG_METRO_M4_32KHZXTAL=y) * - * Since there is no high speed crystal, we will run from the OSC16M clock source. + * Since there is no high speed crystal, we will run from the OSC16M clock + * source. * * OSC48M Output = 48Mhz * | @@ -360,8 +362,10 @@ #define BOARD_FLASH_WAITSTATES 6 -/* LED definitions ******************************************************************/ -/* The Adafruit Metro M4 has four LEDs, but only two are controllable by software: +/* LED definitions **********************************************************/ + +/* The Adafruit Metro M4 has four LEDs, but only two are controllable by + * software: * * 1. The red LED on the Arduino D13 pin, and * 2. A NeoPixel RGB LED. @@ -390,7 +394,8 @@ * * ------------------- ---------------------------- ------ * SYMBOL Meaning LED - * ------------------- ---------------------------- ------ */ + * ------------------- ---------------------------- ------ + */ #define LED_STARTED 0 /* NuttX has been started OFF */ #define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF */ @@ -407,17 +412,19 @@ * 2Hz, then a fatal error has been detected and the system has halted. */ -/* Alternate function pin selections ************************************************/ +/* Alternate function pin selections ****************************************/ -/* SERCOM definitions ***************************************************************/ -/* The SERCOM bus clock (CLK_SERCOMx_APB) can be enabled and disabled in the Main - * Clock Controller. The SERCOM uses two generic clocks: GCLK_SERCOMn_CORE and - * GCLK_SERCOM_SLOW. The core clock (GCLK_SERCOMx_CORE) is required to clock the - * SERCOM while working as a master. The slow clock (GCLK_SERCOM_SLOW) is only - * required for certain functions and is common to all SERCOM modules. +/* SERCOM definitions *******************************************************/ + +/* The SERCOM bus clock (CLK_SERCOMx_APB) can be enabled and disabled in the + * Main Clock Controller. + * The SERCOM uses two generic clocks: GCLK_SERCOMn_CORE and GCLK_SERCOM_SLOW. + * The core clock (GCLK_SERCOMx_CORE) is required to clock the SERCOM while + * working as a master. The slow clock (GCLK_SERCOM_SLOW) is only required + * for certain functions and is common to all SERCOM modules. * - * These clocks must be configured and enabled in the Generic Clock Controller (GCLK) - * before using the SERCOM. + * These clocks must be configured and enabled in the Generic Clock + * Controller (GCLK) before using the SERCOM. */ #define BOARD_SERCOM_SLOWGEN 3 /* 32.768KHz, common to all SERCOMS */ @@ -426,8 +433,9 @@ /* SERCOM3 * - * An Arduino compatible serial Shield is assumed (or equivalently, an external - * RS-232 or serial-to-USB adapter connected on Arduino pins D0 and D1): + * An Arduino compatible serial Shield is assumed (or equivalently, an + * external RS-232 or serial-to-USB adapter connected on Arduino pins D0 + * and D1): * * ------ ----------------- --------- * SHIELD SAMD5E5 FUNCTION @@ -457,4 +465,4 @@ #define BOARD_USB_GCLKGEN 1 /* GCLK1, 48MHz */ -#endif /* __BOARDS_ARM_METRO_M4_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_SAMD5E5_METRO_M4_INCLUDE_BOARD_H */ diff --git a/boards/arm/samd5e5/metro-m4/scripts/Make.defs b/boards/arm/samd5e5/metro-m4/scripts/Make.defs index 52b3053748b..876bd1cd259 100644 --- a/boards/arm/samd5e5/metro-m4/scripts/Make.defs +++ b/boards/arm/samd5e5/metro-m4/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/metro-m4/scripts/Make.defs +# boards/arm/samd5e5/metro-m4/scripts/Make.defs # # Copyright (C) 2018 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/samd5e5/metro-m4/scripts/flash.ld b/boards/arm/samd5e5/metro-m4/scripts/flash.ld index e68f7850763..33f81f66a68 100644 --- a/boards/arm/samd5e5/metro-m4/scripts/flash.ld +++ b/boards/arm/samd5e5/metro-m4/scripts/flash.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/metro-m4/scripts/flash.ld + * boards/arm/samd5e5/metro-m4/scripts/flash.ld * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samd5e5/metro-m4/scripts/sram.ld b/boards/arm/samd5e5/metro-m4/scripts/sram.ld index fb8b779233e..5d137b37965 100644 --- a/boards/arm/samd5e5/metro-m4/scripts/sram.ld +++ b/boards/arm/samd5e5/metro-m4/scripts/sram.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/metro-m4/scripts/sram.ld + * boards/arm/samd5e5/metro-m4/scripts/sram.ld * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samd5e5/metro-m4/src/Makefile b/boards/arm/samd5e5/metro-m4/src/Makefile index 9832872dab7..686107b0d56 100644 --- a/boards/arm/samd5e5/metro-m4/src/Makefile +++ b/boards/arm/samd5e5/metro-m4/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/metro-m4/src/Makefile +# boards/arm/samd5e5/metro-m4/src/Makefile # # Copyright (C) 2018 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/samd5e5/metro-m4/src/metro-m4.h b/boards/arm/samd5e5/metro-m4/src/metro-m4.h index 150aca8ab5e..b46fe04b8b7 100644 --- a/boards/arm/samd5e5/metro-m4/src/metro-m4.h +++ b/boards/arm/samd5e5/metro-m4/src/metro-m4.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/metro-m4/src/metro-m4.h + * boards/arm/samd5e5/metro-m4/src/metro-m4.h * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_METRO_M4_SRC_METRO_M4_H -#define __BOARDS_ARM_METRO_M4_SRC_METRO_M4_H +#ifndef __BOARDS_ARM_SAMD5E5_METRO_M4_SRC_METRO_M4_H +#define __BOARDS_ARM_SAMD5E5_METRO_M4_SRC_METRO_M4_H /**************************************************************************** * Included Files @@ -50,11 +50,12 @@ /* Configuration ************************************************************/ - /* Metro-M4 GPIOs ***********************************************************/ + /* LEDs * - * The Adafruit Metro M4 has four LEDs, but only two are controllable by software: + * The Adafruit Metro M4 has four LEDs, but only two are controllable by + * software: * * 1. The red LED on the Arduino D13 pin, and * 2. A NeoPixel RGB LED. @@ -113,4 +114,4 @@ void sam_led_pminitialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_METRO_M4_SRC_METRO_M4_H */ +#endif /* __BOARDS_ARM_SAMD5E5_METRO_M4_SRC_METRO_M4_H */ diff --git a/boards/arm/samd5e5/metro-m4/src/sam_appinit.c b/boards/arm/samd5e5/metro-m4/src/sam_appinit.c index ad7b72bb58f..8b635d50071 100644 --- a/boards/arm/samd5e5/metro-m4/src/sam_appinit.c +++ b/boards/arm/samd5e5/metro-m4/src/sam_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/metro-m4/src/sam_appinit.c + * boards/arm/samd5e5/metro-m4/src/sam_appinit.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samd5e5/metro-m4/src/sam_autoleds.c b/boards/arm/samd5e5/metro-m4/src/sam_autoleds.c index 5d20421c093..401d6dc64c9 100644 --- a/boards/arm/samd5e5/metro-m4/src/sam_autoleds.c +++ b/boards/arm/samd5e5/metro-m4/src/sam_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/metro-m4/src/sam_autoleds.c + * boards/arm/samd5e5/metro-m4/src/sam_autoleds.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,7 +33,8 @@ * ****************************************************************************/ -/* The Adafruit Metro M4 has four LEDs, but only two are controllable by software: +/* The Adafruit Metro M4 has four LEDs, but only two are controllable by + * software: * * 1. The red LED on the Arduino D13 pin, and * 2. A NeoPixel RGB LED. @@ -95,7 +96,7 @@ * Private Function Prototypes ****************************************************************************/ - /* LED Power Management */ +/* LED Power Management */ #ifdef CONFIG_PM static void led_pm_notify(struct pm_callback_s *cb, int domain, @@ -138,35 +139,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; } @@ -220,19 +216,23 @@ void board_autoled_on(int led) switch (led) { - case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF */ - /* LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF */ - /* LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF */ - break; /* Leave ledstate == true to turn OFF */ + case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF + * LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF + * LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF + */ + + break; /* Leave ledstate == true to turn OFF */ default: - case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C */ - /* LED_SIGNAL: In a signal handler STATUS LED=N/C */ - /* LED_ASSERTION: An assertion failed STATUS LED=N/C */ - return; /* Return to leave STATUS LED unchanged */ + case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C + * LED_SIGNAL: In a signal handler STATUS LED=N/C + * LED_ASSERTION: An assertion failed STATUS LED=N/C + */ - case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ - case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ + return; /* Return to leave STATUS LED unchanged */ + + case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ + case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ ledstate = false; /* Set ledstate == false to turn ON */ break; } @@ -251,21 +251,25 @@ void board_autoled_off(int led) /* These should not happen and are ignored */ default: - case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF */ - /* LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF */ - /* LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF */ - case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ + case 0: /* LED_STARTED: NuttX has been started STATUS LED=OFF + * LED_HEAPALLOCATE: Heap has been allocated STATUS LED=OFF + * LED_IRQSENABLED: Interrupts enabled STATUS LED=OFF + */ + + case 1: /* LED_STACKCREATED: Idle stack created STATUS LED=ON */ /* These result in no-change */ - case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C */ - /* LED_SIGNAL: In a signal handler STATUS LED=N/C */ - /* LED_ASSERTION: An assertion failed STATUS LED=N/C */ - return; /* Return to leave STATUS LED unchanged */ + case 2: /* LED_INIRQ: In an interrupt STATUS LED=N/C + * LED_SIGNAL: In a signal handler STATUS LED=N/C + * LED_ASSERTION: An assertion failed STATUS LED=N/C + */ + + return; /* Return to leave STATUS LED unchanged */ /* Turn STATUS LED off set driving the output high */ - case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ + case 3: /* LED_PANIC: The system has crashed STATUS LED=FLASH */ sam_portwrite(PORT_RED_LED, true); break; } diff --git a/boards/arm/samd5e5/metro-m4/src/sam_boot.c b/boards/arm/samd5e5/metro-m4/src/sam_boot.c index e4fb1023081..1d46dd4bec6 100644 --- a/boards/arm/samd5e5/metro-m4/src/sam_boot.c +++ b/boards/arm/samd5e5/metro-m4/src/sam_boot.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/metro-m4/src/sam_boot.c + * boards/arm/samd5e5/metro-m4/src/sam_boot.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samd5e5/metro-m4/src/sam_bringup.c b/boards/arm/samd5e5/metro-m4/src/sam_bringup.c index ea17d0c44c0..4f66060ec98 100644 --- a/boards/arm/samd5e5/metro-m4/src/sam_bringup.c +++ b/boards/arm/samd5e5/metro-m4/src/sam_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/metro-m4/src/sam_bringup.c + * boards/arm/samd5e5/metro-m4/src/sam_bringup.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samd5e5/metro-m4/src/sam_userleds.c b/boards/arm/samd5e5/metro-m4/src/sam_userleds.c index dfda6568f2b..d068384914e 100644 --- a/boards/arm/samd5e5/metro-m4/src/sam_userleds.c +++ b/boards/arm/samd5e5/metro-m4/src/sam_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/metro-m4/src/sam_userleds.c + * boards/arm/samd5e5/metro-m4/src/sam_userleds.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,7 +33,8 @@ * ****************************************************************************/ -/* The Adafruit Metro M4 has four LEDs, but only two are controllable by software: +/* The Adafruit Metro M4 has four LEDs, but only two are controllable by + * software: * * 1. The red LED on the Arduino D13 pin, and * 2. A NeoPixel RGB LED. @@ -85,7 +86,6 @@ static int led_pm_prepare(struct pm_callback_s *cb, int domain, enum pm_state_e pmstate); #endif - /**************************************************************************** * Private Data ****************************************************************************/ @@ -120,35 +120,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; } diff --git a/boards/arm/samv7/same70-xplained/README.txt b/boards/arm/samv7/same70-xplained/README.txt index 279a9753d86..6ba10242aa1 100644 --- a/boards/arm/samv7/same70-xplained/README.txt +++ b/boards/arm/samv7/same70-xplained/README.txt @@ -32,7 +32,7 @@ Status/Open Issues via the EDBG VCOM and LED and buttons support. SDRAM and the HSMCI SD card slot also appear to be fully functional. -See also boards/samv71-xult/README.txt +See also boards/arm/samv7/samv71-xult/README.txt Serial Console ============== @@ -581,7 +581,7 @@ Pre-requisites: prototyped in the nuttx/include/nuttx/arch.h, and (2) it must select CONFIG_ARCH_PHY_INTERRUPT in the board configuration file to advertise that it supports arch_phy_irq(). This logic can be found at - nuttx/boards/same70-xplained/src/sam_ethernet.c. + nuttx/boards/arm/samv7/same70-xplained/src/sam_ethernet.c. - One other thing: UDP support is required. @@ -982,7 +982,7 @@ Tickless OS you very bad timing. If you add a crystal to your board, you can select to use it with the - definition BOARD_HAVE_SLOWXTAL in the boards/same70-xplained/board.h + definition BOARD_HAVE_SLOWXTAL in the boards/arm/samv7/same70-xplained/board.h file. The slow clock has a resolution of about 30.518 microseconds. Ideally, @@ -1160,7 +1160,7 @@ Using OpenOCD and GDB to flash via the EDBG chip OpenOCD requires a configuration file. I keep the one I used last here: - boards/same70-xplained/tools/atmel_same70_xplained.cfg + boards/arm/samv7/same70-xplained/tools/atmel_same70_xplained.cfg However, the "correct" configuration script to use with OpenOCD may change as the features of OpenOCD evolve. So you should at least @@ -1178,13 +1178,13 @@ Using OpenOCD and GDB to flash via the EDBG chip - Possibly the value of OPENOCD_PATH and TARGET_PATH - It assumes that the correct script to use is the one at - boards/same70-xplained/tools/atmel_same70_xplained.cfg + boards/arm/samv7/same70-xplained/tools/atmel_same70_xplained.cfg Starting OpenOCD Then you should be able to start the OpenOCD daemon like: - boards/same70-xplained/tools/oocd.sh $PWD + boards/arm/samv7/same70-xplained/tools/oocd.sh $PWD Connecting GDB diff --git a/boards/arm/samv7/same70-xplained/include/board.h b/boards/arm/samv7/same70-xplained/include/board.h index 54c5de25d01..d39491dac0d 100644 --- a/boards/arm/samv7/same70-xplained/include/board.h +++ b/boards/arm/samv7/same70-xplained/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/same70-xplained/include/board.h +/**************************************************************************** + * boards/arm/samv7/same70-xplained/include/board.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,30 +31,33 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_SAME70_XPLAINED_INCLUDE_BOARD_H -#define __BOARDS_ARM_SAME70_XPLAINED_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_SAMV7_SAME70_XPLAINED_INCLUDE_BOARD_H +#define __BOARDS_ARM_SAMV7_SAME70_XPLAINED_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Clocking *************************************************************************/ -/* After power-on reset, the SAME70Q device is running out of the Master Clock using - * the Fast RC Oscillator running at 4 MHz. + ****************************************************************************/ + +/* Clocking *****************************************************************/ + +/* After power-on reset, the SAME70Q device is running out of the Master + * Clock using the Fast RC Oscillator running at 4 MHz. * * MAINOSC: Frequency = 12MHz (crystal) * * 300MHz Settings: * PLLA: PLL Divider = 1, Multiplier = 20 to generate PLLACK = 240MHz - * Master Clock (MCK): Source = PLLACK, Prescalar = 1 to generate MCK = 120MHz + * Master Clock (MCK): Source = PLLACK, + * Prescalar = 1 to generate MCK = 120MHz * CPU clock: 120MHz * * There can be two on-board crystals. However, the 32.768 crystal is not @@ -68,10 +71,10 @@ /* Main oscillator register settings. * - * The main oscillator could be either the embedded 4/8/12 MHz fast RC oscillators - * or an external 3-20 MHz crystal or ceramic resonator. The external clock source - * is selected by default in sam_clockconfig.c. Here we need to specify the main - * oscillator start-up time. + * The main oscillator could be either the embedded 4/8/12 MHz fast RC + * oscillators or an external 3-20 MHz crystal or ceramic resonator. + * The external clock source is selected by default in sam_clockconfig.c. + * Here we need to specify the main oscillator start-up time. * * REVISIT... this is old information: * The start up time should be should be: @@ -154,15 +157,21 @@ * Where CLKDIV has a range of 0-255. */ -/* MCK = 150MHz, CLKDIV = 186, MCI_SPEED = 150MHz / (2*186 + 1 + 2) = 400 KHz */ +/* MCK = 150MHz, CLKDIV = 186, + * MCI_SPEED = 150MHz / (2*186 + 1 + 2) = 400 KHz + */ #define HSMCI_INIT_CLKDIV ((186 << HSMCI_MR_CLKDIV_SHIFT) | HSMCI_MR_CLKODD) -/* MCK = 150MHz, CLKDIV = 3 w/CLOCKODD, MCI_SPEED = 150MHz /(2*3 + 0 + 2) = 18.75 MHz */ +/* MCK = 150MHz, CLKDIV = 3 w/CLOCKODD, + * MCI_SPEED = 150MHz /(2*3 + 0 + 2) = 18.75 MHz + */ #define HSMCI_MMCXFR_CLKDIV (2 << HSMCI_MR_CLKDIV_SHIFT) -/* MCK = 150MHz, CLKDIV = 2, MCI_SPEED = 150MHz /(2*2 + 0 + 2) = 25 MHz */ +/* MCK = 150MHz, CLKDIV = 2, + * MCI_SPEED = 150MHz /(2*2 + 0 + 2) = 25 MHz + */ #define HSMCI_SDXFR_CLKDIV (2 << HSMCI_MR_CLKDIV_SHIFT) #define HSMCI_SDWIDEXFR_CLKDIV HSMCI_SDXFR_CLKDIV @@ -186,7 +195,8 @@ #define BOARD_FWS 4 -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* LEDs * * A single LED is available driven by PC8. @@ -208,7 +218,8 @@ * * ------------------- ---------------------------- ------ * SYMBOL Meaning LED - * ------------------- ---------------------------- ------ */ + * ------------------- ---------------------------- ------ + */ #define LED_STARTED 0 /* NuttX has been started OFF */ #define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF */ @@ -225,13 +236,14 @@ * 2Hz, then a fatal error has been detected and the system has halted. */ -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* Buttons * * SAM E70 Xplained contains two mechanical buttons. One button is the RESET - * button connected to the SAM E70 reset line and the other, PA11, is a generic - * user configurable button. When a button is pressed it will drive the I/O - * line to GND. + * button connected to the SAM E70 reset line and the other, PA11, is a + * generic user configurable button. + * When a button is pressed it will drive the I/O line to GND. * * NOTE: There are no pull-up resistors connected to the generic user buttons * so it is necessary to enable the internal pull-up in the SAM E70 to use the @@ -243,11 +255,13 @@ #define BUTTON_SW0_BIT (1 << BUTTON_SW0) -/* PIO Disambiguation ***************************************************************/ +/* PIO Disambiguation *******************************************************/ + /* Serial Console * - * The SAME70-XPLD has no on-board RS-232 drivers so it will be necessary to use - * either the VCOM or an external RS-232 driver. Here are some options. + * The SAME70-XPLD has no on-board RS-232 drivers so it will be necessary to + * use either the VCOM or an external RS-232 driver. + * Here are some options. * * - Arduino Serial Shield: One option is to use an Arduino-compatible * serial shield. This will use the RXD and TXD signals available at pins @@ -267,7 +281,6 @@ #define GPIO_UART3_TXD GPIO_UART3_TXD_1 - /* - Arduino Communications. Additional UART/USART connections are available * on the Arduino Communications connection J505: * @@ -326,8 +339,8 @@ * * SAM E70 Xplained has two MCAN modules that performs communication according * to ISO11898-1 (Bosch CAN specification 2.0 part A,B) and Bosch CAN FD - * specification V1.0. MCAN1 is connected to an on-board ATA6561 CAN physical-layer - * transceiver. + * specification V1.0. + * MCAN1 is connected to an on-board ATA6561 CAN physical-layer transceiver. * * ------- -------- -------- ------------- * SAM E70 FUNCTION ATA6561 SHARED @@ -341,13 +354,13 @@ #define GPIO_MCAN1_TX GPIO_MCAN1_TX_2 #define GPIO_MCAN1_RX GPIO_MCAN1_RX_2 -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ @@ -360,20 +373,21 @@ extern "C" #define EXTERN extern #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_lcdclear * * Description: - * This is a non-standard LCD interface just for the SAM4e-EK board. Because - * of the various rotations, clearing the display in the normal way by writing a - * sequences of runs that covers the entire display can be very slow. Here the - * display is cleared by simply setting all GRAM memory to the specified color. + * This is a non-standard LCD interface just for the SAM4e-EK board. + * Because of the various rotations, clearing the display in the normal + * way by writing a sequences of runs that covers the entire display can + * be very slow. Here the display is cleared by simply setting all GRAM + * memory to the specified color. * - ************************************************************************************/ + ****************************************************************************/ void sam_lcdclear(uint16_t color); @@ -383,4 +397,4 @@ void sam_lcdclear(uint16_t color); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_SAME70_XPLAINED_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_SAMV7_SAME70_XPLAINED_INCLUDE_BOARD_H */ diff --git a/boards/arm/samv7/same70-xplained/kernel/Makefile b/boards/arm/samv7/same70-xplained/kernel/Makefile index bc80560e1ef..46b0fd92f7e 100644 --- a/boards/arm/samv7/same70-xplained/kernel/Makefile +++ b/boards/arm/samv7/same70-xplained/kernel/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/same70-xplainged/kernel/Makefile +# boards/arm/samv7/same70-xplainged/kernel/Makefile # # Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/samv7/same70-xplained/kernel/sam_userspace.c b/boards/arm/samv7/same70-xplained/kernel/sam_userspace.c index 4e3a1417375..c4a92d1916a 100644 --- a/boards/arm/samv7/same70-xplained/kernel/sam_userspace.c +++ b/boards/arm/samv7/same70-xplained/kernel/sam_userspace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/same70-xplained/kernel/sam_userspace.c + * boards/arm/samv7/same70-xplained/kernel/sam_userspace.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -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/samv7/same70-xplained/scripts/Make.defs b/boards/arm/samv7/same70-xplained/scripts/Make.defs index 61c0bfcdd1d..2c151974b82 100644 --- a/boards/arm/samv7/same70-xplained/scripts/Make.defs +++ b/boards/arm/samv7/same70-xplained/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/same70-xplained/scripts/Make.defs +# boards/arm/samv7/same70-xplained/scripts/Make.defs # # Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/samv7/same70-xplained/scripts/flash-dtcm.ld b/boards/arm/samv7/same70-xplained/scripts/flash-dtcm.ld index 955ef90d490..ebf9e26986f 100644 --- a/boards/arm/samv7/same70-xplained/scripts/flash-dtcm.ld +++ b/boards/arm/samv7/same70-xplained/scripts/flash-dtcm.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/same70-xplained/scripts/flash-dtcm.ld + * boards/arm/samv7/same70-xplained/scripts/flash-dtcm.ld * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/same70-xplained/scripts/flash-sram.ld b/boards/arm/samv7/same70-xplained/scripts/flash-sram.ld index c659c2dd88f..03fb72e6697 100644 --- a/boards/arm/samv7/same70-xplained/scripts/flash-sram.ld +++ b/boards/arm/samv7/same70-xplained/scripts/flash-sram.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/same70-xplained/scripts/flash-sram.ld + * boards/arm/samv7/same70-xplained/scripts/flash-sram.ld * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/same70-xplained/scripts/gnu-elf.ld b/boards/arm/samv7/same70-xplained/scripts/gnu-elf.ld index ceffa3055d9..fa3a2ff523d 100644 --- a/boards/arm/samv7/same70-xplained/scripts/gnu-elf.ld +++ b/boards/arm/samv7/same70-xplained/scripts/gnu-elf.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/same70-xplained/scripts/gnu-elf.ld + * boards/arm/samv7/same70-xplained/scripts/gnu-elf.ld * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/same70-xplained/scripts/kernel-space.ld b/boards/arm/samv7/same70-xplained/scripts/kernel-space.ld index ed566f027a5..f513d0c0d6b 100644 --- a/boards/arm/samv7/same70-xplained/scripts/kernel-space.ld +++ b/boards/arm/samv7/same70-xplained/scripts/kernel-space.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/same70-xplained/scripts/kernel-space.ld + * boards/arm/samv7/same70-xplained/scripts/kernel-space.ld * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/same70-xplained/scripts/memory.ld b/boards/arm/samv7/same70-xplained/scripts/memory.ld index 3662434dd1a..31ae99c78d7 100644 --- a/boards/arm/samv7/same70-xplained/scripts/memory.ld +++ b/boards/arm/samv7/same70-xplained/scripts/memory.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/same70-xplained/scripts/memory.ld + * boards/arm/samv7/same70-xplained/scripts/memory.ld * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/same70-xplained/scripts/user-space.ld b/boards/arm/samv7/same70-xplained/scripts/user-space.ld index c3085af5615..9de3e4ef6f8 100644 --- a/boards/arm/samv7/same70-xplained/scripts/user-space.ld +++ b/boards/arm/samv7/same70-xplained/scripts/user-space.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/same70-xplained/scripts/user-space.ld + * boards/arm/samv7/same70-xplained/scripts/user-space.ld * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/same70-xplained/src/Makefile b/boards/arm/samv7/same70-xplained/src/Makefile index 36c7df7ae33..99e454c7f00 100644 --- a/boards/arm/samv7/same70-xplained/src/Makefile +++ b/boards/arm/samv7/same70-xplained/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/same70-xplained/src/Makefile +# boards/arm/samv7/same70-xplained/src/Makefile # # Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/samv7/same70-xplained/src/sam_appinit.c b/boards/arm/samv7/same70-xplained/src/sam_appinit.c index 1912ad5ad3e..8eb794b0287 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_appinit.c +++ b/boards/arm/samv7/same70-xplained/src/sam_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/same70-xplained/src/sam_appinit.c + * boards/arm/samv7/same70-xplained/src/sam_appinit.c * * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/same70-xplained/src/sam_at24config.c b/boards/arm/samv7/same70-xplained/src/sam_at24config.c index 6585f85d0c5..96c9f49c873 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_at24config.c +++ b/boards/arm/samv7/same70-xplained/src/sam_at24config.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/same70-xplained/src/sam_at24config.c +/**************************************************************************** + * boards/arm/samv7/same70-xplained/src/sam_at24config.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 @@ -51,18 +51,18 @@ #ifdef HAVE_MTDCONFIG -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_at24config * * Description: - * Create an AT24xx-based MTD configuration device for storage device configuration - * information. + * Create an AT24xx-based MTD configuration device for storage device + * configuration information. * - ************************************************************************************/ + ****************************************************************************/ int sam_at24config(void) { diff --git a/boards/arm/samv7/same70-xplained/src/sam_autoleds.c b/boards/arm/samv7/same70-xplained/src/sam_autoleds.c index e6db8d39efd..c2259a0fca7 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_autoleds.c +++ b/boards/arm/samv7/same70-xplained/src/sam_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/same70-xplained/src/sam_autoleds.c + * boards/arm/samv7/same70-xplained/src/sam_autoleds.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/same70-xplained/src/sam_boot.c b/boards/arm/samv7/same70-xplained/src/sam_boot.c index acf94c03594..9d085871e37 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_boot.c +++ b/boards/arm/samv7/same70-xplained/src/sam_boot.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/same70-xplained/src/sam_boot.c + * boards/arm/samv7/same70-xplained/src/sam_boot.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/same70-xplained/src/sam_bringup.c b/boards/arm/samv7/same70-xplained/src/sam_bringup.c index acc2ad1ce2d..0ab84fae1a6 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_bringup.c +++ b/boards/arm/samv7/same70-xplained/src/sam_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/same70-xplained/src/sam_bringup.c + * boards/arm/samv7/same70-xplained/src/sam_bringup.c * * Copyright (C) 2015-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -104,7 +104,8 @@ static void sam_i2c_register(int bus) ret = i2c_register(i2c, bus); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to register I2C%d driver: %d\n", bus, ret); + syslog(LOG_ERR, + "ERROR: Failed to register I2C%d driver: %d\n", bus, ret); sam_i2cbus_uninitialize(i2c); } } @@ -164,7 +165,7 @@ int sam_bringup(void) #ifdef HAVE_MACADDR /* Read the Ethernet MAC address from the AT24 FLASH and configure the * Ethernet driver with that address. - */ + */ ret = sam_emac0_setmac(); if (ret < 0) @@ -210,6 +211,7 @@ int sam_bringup(void) else { /* REVISIT: A delay seems to be required here or the mount will fail. */ + /* Mount the volume on HSMCI0 */ ret = mount(CONFIG_SAME70XPLAINED_HSMCI0_MOUNT_BLKDEV, @@ -352,7 +354,8 @@ int sam_bringup(void) ret = sam_dacdev_initialize(); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Initialization of the DAC module failed: %d\n", ret); + syslog(LOG_ERR, + "ERROR: Initialization of the DAC module failed: %d\n", ret); } #endif diff --git a/boards/arm/samv7/same70-xplained/src/sam_buttons.c b/boards/arm/samv7/same70-xplained/src/sam_buttons.c index 9742476de10..61a39ead631 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_buttons.c +++ b/boards/arm/samv7/same70-xplained/src/sam_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/sam4e-ek/src/sam_buttons.c + * boards/arm/samv7/same70-xplained/src/sam_buttons.c * * Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/same70-xplained/src/sam_dac.c b/boards/arm/samv7/same70-xplained/src/sam_dac.c index b7557d69662..e16dd8efd56 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_dac.c +++ b/boards/arm/samv7/same70-xplained/src/sam_dac.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/same70-xplained/src/sam_dac.c +/**************************************************************************** + * boards/arm/samv7/same70-xplained/src/sam_dac.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,71 +53,71 @@ #if defined(CONFIG_SAMV7_DAC0) || defined(CONFIG_SAMV7_DAC1) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_dacdev_initialize * * Description: * Called to configure DAC peripheral module and register DAC device driver - ************************************************************************************/ + ****************************************************************************/ int sam_dacdev_initialize(void) { - static bool initialized = false; - struct dac_dev_s *dac; - int ret; + static bool initialized = false; + struct dac_dev_s *dac; + int ret; - /* Check if we have already initialized */ + /* Check if we have already initialized */ - if (!initialized) - { + if (!initialized) + { #ifdef CONFIG_SAMV7_DAC0 - /* Get an instance of the DAC0 interface */ + /* Get an instance of the DAC0 interface */ - dac = sam_dac_initialize(0); - if (dac == NULL) - { - aerr("ERROR: Failed to get DAC0 interface\n"); - return -ENODEV; - } + dac = sam_dac_initialize(0); + if (dac == NULL) + { + aerr("ERROR: Failed to get DAC0 interface\n"); + return -ENODEV; + } - /* Register the DAC driver at "/dev/dac0" */ + /* Register the DAC driver at "/dev/dac0" */ - ret = dac_register("/dev/dac0", dac); - if (ret < 0) - { - aerr("ERROR: dac_register failed: %d\n", ret); - return ret; - } + ret = dac_register("/dev/dac0", dac); + if (ret < 0) + { + aerr("ERROR: dac_register failed: %d\n", ret); + return ret; + } #endif #ifdef CONFIG_SAMV7_DAC1 - /* Get an instance of the DAC1 interface */ + /* Get an instance of the DAC1 interface */ - dac = sam_dac_initialize(1); - if (dac == NULL) - { - aerr("ERROR: Failed to get DAC1 interface\n"); - return -ENODEV; - } + dac = sam_dac_initialize(1); + if (dac == NULL) + { + aerr("ERROR: Failed to get DAC1 interface\n"); + return -ENODEV; + } - /* Register the DAC driver at "/dev/dac1" */ + /* Register the DAC driver at "/dev/dac1" */ - ret = dac_register("/dev/dac1", dac); - if (ret < 0) - { - aerr("ERROR: dac_register failed: %d\n", ret); - return ret; - } + ret = dac_register("/dev/dac1", dac); + if (ret < 0) + { + aerr("ERROR: dac_register failed: %d\n", ret); + return ret; + } #endif - /* Now we are initialized */ + /* Now we are initialized */ - initialized = true; - } - return OK; + initialized = true; + } + return OK; } #endif /* CONFIG_SAMV7_DAC0 || CONFIG_SAMV7_DAC1 */ diff --git a/boards/arm/samv7/same70-xplained/src/sam_ethernet.c b/boards/arm/samv7/same70-xplained/src/sam_ethernet.c index 95ed2d096d6..79a308a063a 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_ethernet.c +++ b/boards/arm/samv7/same70-xplained/src/sam_ethernet.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/same70-xplained/src/sam_ethernet.c +/**************************************************************************** + * boards/arm/samv7/same70-xplained/src/sam_ethernet.c * * Copyright (C) 2015-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -66,15 +66,16 @@ #ifdef HAVE_NETWORK -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #define SAMV7_EMAC0_DEVNAME "eth0" #define AT24XX_MACADDR_OFFSET 0x9a /* Debug ********************************************************************/ + /* Extra, in-depth debug output that is only available if * CONFIG_NETDEV_PHY_DEBUG us defined. */ @@ -89,13 +90,13 @@ # define phyinfo(x...) #endif -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_emac0_phy_enable - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMV7_GPIOA_IRQ static void sam_emac0_phy_enable(bool enable) @@ -112,17 +113,17 @@ static void sam_emac0_phy_enable(bool enable) } #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_netinitialize * * Description: * Configure board resources to support networking. * - ************************************************************************************/ + ****************************************************************************/ void weak_function sam_netinitialize(void) { @@ -136,14 +137,14 @@ void weak_function sam_netinitialize(void) sam_configgpio(GPIO_EMAC0_RESET); } -/************************************************************************************ +/**************************************************************************** * Name: sam_emac0_setmac * * Description: - * Read the Ethernet MAC address from the AT24 FLASH and configure the Ethernet - * driver with that address. + * Read the Ethernet MAC address from the AT24 FLASH and configure the + * Ethernet driver with that address. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_MACADDR int sam_emac0_setmac(void) @@ -188,7 +189,8 @@ int sam_emac0_setmac(void) nread = at24->read(at24, AT24XX_MACADDR_OFFSET, 6, mac); if (nread < 6) { - nerr("ERROR: AT24 read(AT24XX_MACADDR_OFFSET) failed: ld\n", (long)nread); + nerr("ERROR: AT24 read(AT24XX_MACADDR_OFFSET) failed: ld\n", + (long)nread); (void)sam_i2cbus_uninitialize(i2c); return (int)nread; } diff --git a/boards/arm/samv7/same70-xplained/src/sam_hsmci.c b/boards/arm/samv7/same70-xplained/src/sam_hsmci.c index 24d27d1c821..d04d9d78ff0 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_hsmci.c +++ b/boards/arm/samv7/same70-xplained/src/sam_hsmci.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/same70-xplained/src/sam_hsmci.c + * boards/arm/samv7/same70-xplained/src/sam_hsmci.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -79,6 +79,7 @@ /**************************************************************************** * Private Types ****************************************************************************/ + /* This structure holds static information unique to one HSMCI peripheral */ struct sam_hsmci_state_s @@ -159,8 +160,7 @@ static int sam_hsmci_cardetect(struct sam_hsmci_state_s *state) sdio_mediachange(state->hsmci, cd); } - - return OK; + return OK; } #ifdef CONFIG_SAMV7_HSMCI0 @@ -242,6 +242,7 @@ int sam_hsmci_initialize(int slotno, int minor) } /* Mount the SDIO-based MMC/SD block driver */ + /* First, get an instance of the SDIO interface */ state->hsmci = sdio_initialize(slotno); diff --git a/boards/arm/samv7/same70-xplained/src/sam_mcan.c b/boards/arm/samv7/same70-xplained/src/sam_mcan.c index 893f1d0ba14..e7fb5b7979c 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_mcan.c +++ b/boards/arm/samv7/same70-xplained/src/sam_mcan.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/same70-xplainedk/src/sam_mcan.c +/**************************************************************************** + * boards/arm/samv7/same70-xplained/src/sam_mcan.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 @@ -51,10 +51,11 @@ #ifdef CONFIG_SAMV7_MCAN -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ #if defined(CONFIG_SAMV7_MCAN0) && defined(CONFIG_SAMV7_MCAN1) # warning "Both MCAN0 and MCAN1 are enabled. Assuming only CAN1." @@ -67,17 +68,17 @@ # define CAN_PORT 1 #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_can_setup * * Description: * Initialize CAN and register the CAN device * - ************************************************************************************/ + ****************************************************************************/ int sam_can_setup(void) { diff --git a/boards/arm/samv7/same70-xplained/src/sam_mrf24j40.c b/boards/arm/samv7/same70-xplained/src/sam_mrf24j40.c index d34f078dbb2..9c96eb29d38 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_mrf24j40.c +++ b/boards/arm/samv7/same70-xplained/src/sam_mrf24j40.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/same70-xplained/src/sam_mrf24j40.c + * boards/arm/samv7/same70-xplained/src/sam_mrf24j40.c * * Copyright (C) 2017 Gregory Nutt, All rights reserver * Author: Gregory Nutt @@ -87,7 +87,7 @@ struct sam_priv_s * varying boards and MCUs. * * irq_attach - Attach the MRF24J40 interrupt handler to the GPIO - interrupt + * interrupt * irq_enable - Enable or disable the GPIO interrupt */ diff --git a/boards/arm/samv7/same70-xplained/src/sam_sdram.c b/boards/arm/samv7/same70-xplained/src/sam_sdram.c index 2e3d088007c..871b6047d63 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_sdram.c +++ b/boards/arm/samv7/same70-xplained/src/sam_sdram.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/same70-xplained/src/sam_sdram.c + * boards/arm/samv7/same70-xplained/src/sam_sdram.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -182,17 +182,18 @@ void sam_sdram_config(void) * asynchronous timings (TRC, TRAS, etc.), number of columns, rows, CAS * latency, and the data bus width. * - * SDRAMC_CR_NC_COL8 8 column bits - * SDRAMC_CR_NR_ROW11 1 row bits - * SDRAMC_CR_NB_BANK2 2 banks - * SDRAMC_CR_CAS_LATENCY3 3 cycle CAS latency - * SDRAMC_CR_DBW 16 bit - * SDRAMC_CR_TWR(4) 4 cycle write recovery delay - * SDRAMC_CR_TRCTRFC(11) 63 ns min - * SDRAMC_CR_TRP(5) 21 ns min Command period (PRE to ACT) - * SDRAMC_CR_TRCD(5) 21 ns min Active Command to read/Write Command delay time - * SDRAMC_CR_TRAS(8) 42 ns min Command period (ACT to PRE) - * SDRAMC_CR_TXSR(13) 70 ns min Exit self-refresh to active time + * SDRAMC_CR_NC_COL8 8 column bits + * SDRAMC_CR_NR_ROW11 1 row bits + * SDRAMC_CR_NB_BANK2 2 banks + * SDRAMC_CR_CAS_LATENCY3 3 cycle CAS latency + * SDRAMC_CR_DBW 16 bit + * SDRAMC_CR_TWR(4) 4 cycle write recovery delay + * SDRAMC_CR_TRCTRFC(11) 63 ns min + * SDRAMC_CR_TRP(5) 21 ns min Command period (PRE to ACT) + * SDRAMC_CR_TRCD(5) 21 ns min Active Command to read/Write + * Command delay time + * SDRAMC_CR_TRAS(8) 42 ns min Command period (ACT to PRE) + * SDRAMC_CR_TXSR(13) 70 ns min Exit self-refresh to active time */ regval = SDRAMC_CR_NC_COL8 | /* 8 column bits */ @@ -216,11 +217,11 @@ void sam_sdram_config(void) putreg32(0, SAM_SDRAMC_LPR); - /* 3. The SDRAM memory type must be set in the Memory Device Register.*/ + /* 3. The SDRAM memory type must be set in the Memory Device Register. */ putreg32(SDRAMC_MDR_SDRAM, SAM_SDRAMC_MDR); - /* 4. A minimum pause of 200 usec is provided to precede any signal toggle.*/ + /* 4. A minimum pause of 200 usec is provided to precede any signal toggle. */ up_udelay(200); @@ -247,13 +248,13 @@ void sam_sdram_config(void) * any SDRAM location eight times. */ - for (i = 0 ; i < 8; i++) - { - putreg32(SDRAMC_MR_MODE_AUTOREFRESH, SAM_SDRAMC_MR); - *psdram = 0; - } + for (i = 0 ; i < 8; i++) + { + putreg32(SDRAMC_MR_MODE_AUTOREFRESH, SAM_SDRAMC_MR); + *psdram = 0; + } - up_udelay(200); + up_udelay(200); /* 8. A Mode Register set (MRS) cycle is issued to program the parameters * of the SDRAM devices, in particular CAS latency and burst length. @@ -262,7 +263,7 @@ void sam_sdram_config(void) * that BA[1:0] are set to 0. For example, with a 16-bit 128 MB SDRAM * (12 rows, 9 columns, 4 banks) bank address, the SDRAM write access * should be done at the address 0x70000000. - */ + */ putreg32(SDRAMC_MR_MODE_LOADMODE, SAM_SDRAMC_MR); *psdram = 0; @@ -279,8 +280,9 @@ void sam_sdram_config(void) * address 0x70800000 or 0x70400000. */ - //putreg32(SDRAMC_MR_MODE_EXTLOADMODE, SDRAMC_MR_MODE_EXT_LOAD_MODEREG); - // *((uint8_t *)(psdram + SDRAM_BA0)) = 0; + /* putreg32(SDRAMC_MR_MODE_EXTLOADMODE, SDRAMC_MR_MODE_EXT_LOAD_MODEREG); + * ((uint8_t *)(psdram + SDRAM_BA0)) = 0; + */ /* 10. The application must go into Normal Mode, setting Mode to 0 in the * Mode Register and performing a write access at any location in the diff --git a/boards/arm/samv7/same70-xplained/src/sam_spi.c b/boards/arm/samv7/same70-xplained/src/sam_spi.c index 4d0241e2fe3..a65d58b0420 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_spi.c +++ b/boards/arm/samv7/same70-xplained/src/sam_spi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/same70-xplained/src/sam_spi.c +/**************************************************************************** + * boards/arm/samv7/same70-xplained/src/sam_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 @@ -55,17 +55,17 @@ #ifdef CONFIG_SAMV7_SPI -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select PIO pins for the SAME70-XPLD board. * - ************************************************************************************/ + ****************************************************************************/ void sam_spidev_initialize(void) { @@ -97,30 +97,33 @@ void sam_spidev_initialize(void) * Name: sam_spi[0|1]select, sam_spi[0|1]status, and sam_spi[0|1]cmddata * * Description: - * These external functions must be provided by board-specific logic. They - * include: + * These external functions must be provided by board-specific logic. + * They include: * - * o sam_spi[0|1]select is a functions tomanage the board-specific chip selects - * o sam_spi[0|1]status and sam_spi[0|1]cmddata: Implementations of the status - * and cmddata methods of the SPI interface defined by struct spi_ops_ - * (see include/nuttx/spi/spi.h). All other methods including - * sam_spibus_initialize()) are provided by common SAM3/4 logic. + * o sam_spi[0|1]select is a functions tomanage the board-specific chip + * selects + * o sam_spi[0|1]status and sam_spi[0|1]cmddata: Implementations of the + * status and cmddata methods of the SPI interface defined by struct + * spi_ops_ (see include/nuttx/spi/spi.h). + * All other methods including sam_spibus_initialize()) are provided by + * common SAM3/4 logic. * * To use this common SPI logic on your board: * * 1. Provide logic in sam_boardinitialize() to configure SPI chip select * pins. - * 2. Provide sam_spi[0|1]select() and sam_spi[0|1]status() functions in your board- - * specific logic. These functions will perform chip selection and - * status operations using PIOs in the way your board is configured. + * 2. Provide sam_spi[0|1]select() and sam_spi[0|1]status() functions in + * your board-specific logic. + * These functions will perform chip selection and status operations + * using PIOs in the way your board is configured. * 2. If CONFIG_SPI_CMDDATA is defined in the NuttX configuration, provide * sam_spi[0|1]cmddata() functions in your board-specific logic. This * function will perform cmd/data selection operations using PIOs in * the way your board is configured. * 3. Add a call to sam_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by sam_spibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 4. The handle returned by sam_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). * @@ -154,12 +157,14 @@ void sam_spidev_initialize(void) #ifdef CONFIG_SAMV7_SPI0_MASTER void sam_spi0select(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"); switch (devid) { #ifdef CONFIG_IEEE802154_MRF24J40 case SPIDEV_IEEE802154(0): + /* Set the GPIO low to select and high to de-select */ #if defined(CONFIG_SAME70XPLAINED_MB1_BEE) @@ -172,6 +177,7 @@ void sam_spi0select(uint32_t devid, bool selected) #ifdef CONFIG_IEEE802154_XBEE case SPIDEV_IEEE802154(0): + /* Set the GPIO low to select and high to de-select */ #if defined(CONFIG_SAME70XPLAINED_MB1_XBEE) @@ -191,7 +197,8 @@ void sam_spi0select(uint32_t devid, bool selected) #ifdef CONFIG_SAMV7_SPI1_MASTER void sam_spi1select(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"); } #endif diff --git a/boards/arm/samv7/same70-xplained/src/sam_usbdev.c b/boards/arm/samv7/same70-xplained/src/sam_usbdev.c index 7a9a79a84d4..73450540c67 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_usbdev.c +++ b/boards/arm/samv7/same70-xplained/src/sam_usbdev.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/same70-xplained/src/sam_usbdev.c +/**************************************************************************** + * boards/arm/samv7/same70-xplained/src/sam_usbdev.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 @@ -51,26 +51,26 @@ #include "sam_gpio.h" #include "same70-xplained.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_usbinitialize * * Description: - * Called from stm32_boardinitialize very early in initialization to setup USB- - * related GPIO pins for the SAME70-XPLD board. + * Called from stm32_boardinitialize very early in initialization to setup + * USB-related GPIO pins for the SAME70-XPLD board. * - ************************************************************************************/ + ****************************************************************************/ void sam_usbinitialize(void) { @@ -81,16 +81,17 @@ void sam_usbinitialize(void) sam_configgpio(GPIO_VBUSON); } -/************************************************************************************ +/**************************************************************************** * Name: sam_usbsuspend * * Description: * Board logic must provide the sam_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. + * 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 sam_usbsuspend(FAR struct usbdev_s *dev, bool resume) { diff --git a/boards/arm/samv7/same70-xplained/src/sam_userleds.c b/boards/arm/samv7/same70-xplained/src/sam_userleds.c index 289d083c9af..ca9e18327bf 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_userleds.c +++ b/boards/arm/samv7/same70-xplained/src/sam_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/same70-xplained/src/sam_userleds.c + * boards/arm/samv7/same70-xplained/src/sam_userleds.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -91,5 +91,5 @@ void board_userled_all(uint8_t ledset) { /* Low illuminates */ - sam_gpiowrite(GPIO_LED0, (ledset & BOARD_LED0_BIT) == 0)); + sam_gpiowrite(GPIO_LED0, (ledset & BOARD_LED0_BIT) == 0); } diff --git a/boards/arm/samv7/same70-xplained/src/sam_xbee.c b/boards/arm/samv7/same70-xplained/src/sam_xbee.c index 0f71fb05415..bb524f42fd2 100644 --- a/boards/arm/samv7/same70-xplained/src/sam_xbee.c +++ b/boards/arm/samv7/same70-xplained/src/sam_xbee.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/same70-xplained/src/sam_xbee.c + * boards/arm/samv7/same70-xplained/src/sam_xbee.c * * Copyright (C) 2017 Verge Inc, All rights reserver * Author: Anthony Merlino diff --git a/boards/arm/samv7/same70-xplained/src/same70-xplained.h b/boards/arm/samv7/same70-xplained/src/same70-xplained.h index cf3dac1c668..f5373b33d34 100644 --- a/boards/arm/samv7/same70-xplained/src/same70-xplained.h +++ b/boards/arm/samv7/same70-xplained/src/same70-xplained.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/same70-xplained/src/same70-xplained.h +/**************************************************************************** + * boards/arm/samv7/same70-xplained/src/same70-xplained.h * * Copyright (C) 2015, 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_SAME70_XPLAINED_SRC_SAME70_XPLAINED_H -#define __BOARDS_ARM_SAME70_XPLAINED_SRC_SAME70_XPLAINED_H +#ifndef __BOARDS_ARM_SAMV7_SAME70_XPLAINED_SRC_SAME70_XPLAINED_H +#define __BOARDS_ARM_SAMV7_SAME70_XPLAINED_SRC_SAME70_XPLAINED_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -48,10 +48,11 @@ #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ #define HAVE_HSMCI 1 #define HAVE_AUTOMOUNTER 1 @@ -67,6 +68,7 @@ #define HAVE_XBEE 1 /* HSMCI */ + /* Can't support MMC/SD if the card interface is not enabled */ #if !defined(CONFIG_SAMV7_HSMCI0) @@ -144,6 +146,7 @@ #endif /* HAVE_AUTOMOUNTER */ /* USB Device */ + /* CONFIG_SAMV7_UDP and CONFIG_USBDEV must be defined, or there is no USB * device. */ @@ -254,7 +257,7 @@ # undef HAVE_XBEE #endif -/* SAME70-XPLD GPIO Pin Definitions *************************************************/ +/* SAME70-XPLD GPIO Pin Definitions *****************************************/ /* Ethernet MAC. * @@ -298,9 +301,9 @@ /* Buttons * * SAM E70 Xplained contains two mechanical buttons. One button is the RESET - * button connected to the SAM E70 reset line and the other, PA11, is a generic - * user configurable button. When a button is pressed it will drive the I/O - * line to GND. + * button connected to the SAM E70 reset line and the other, PA11, is a + * generic user configurable button. + * When a button is pressed it will drive the I/O line to GND. * * NOTE: There are no pull-up resistors connected to the generic user buttons * so it is necessary to enable the internal pull-up in the SAM E70 to use the @@ -402,37 +405,37 @@ #define MB1_CSNO SPI0_CS1 /* GPIO_SPI0_NPCS1_1 */ #define MB2_CSNO SPI0_CS0 /* REVISIT PC9 is not one of the NPCS pins */ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_sdram_config * * Description: * Configures the on-board SDRAM. SAME70 Xplained features one external - * IS42S16100E-7BLI, 512Kx16x2, 10ns, SDRAM. SDRAM0 is connected to chip select - * NCS1. + * IS42S16100E-7BLI, 512Kx16x2, 10ns, SDRAM. SDRAM0 is connected to chip + * select NCS1. * * Input Parameters: * None * * Assumptions: - * The DDR memory regions is configured as strongly ordered memory. When we - * complete initialization of SDRAM and it is ready for use, we will make DRAM - * into normal memory. + * The DDR memory regions is configured as strongly ordered memory. + * When we complete initialization of SDRAM and it is ready for use, + * we will make DRAM into normal memory. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMV7_SDRAMC void sam_sdram_config(void); @@ -440,49 +443,49 @@ void sam_sdram_config(void); # define sam_sdram_config(t) #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_bringup * * Description: * Bring up board features * - ************************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LIB_BOARDCTL) || defined(CONFIG_BOARD_LATE_INITIALIZE) int sam_bringup(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_dacdev_initialize * * Description: * Called to configure DAC peripheral module * - ************************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_SAMV7_DAC0) || defined(CONFIG_SAMV7_DAC1) int sam_dacdev_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the SAME70-XPLD board. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMV7_SPI void sam_spidev_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_hsmci_initialize * * Description: * Initialize HSMCI support * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_HSMCI int sam_hsmci_initialize(int slot, int minor); @@ -490,14 +493,14 @@ int sam_hsmci_initialize(int slot, int minor); # define sam_hsmci_initialize(s,m) (-ENOSYS) #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_usbinitialize * * Description: - * Called from stm32_boardinitialize very early in initialization to setup USB- - * related GPIO pins for the SAME70-XPLD board. + * Called from stm32_boardinitialize very early in initialization to setup + * USB- related GPIO pins for the SAME70-XPLD board. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_USB void sam_usbinitialize(void); @@ -515,38 +518,38 @@ void sam_usbinitialize(void); int sam_can_setup(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_netinitialize * * Description: * Configure board resources to support networking. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_NETWORK void sam_netinitialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_emac0_setmac * * Description: - * Read the Ethernet MAC address from the AT24 FLASH and configure the Ethernet - * driver with that address. + * Read the Ethernet MAC address from the AT24 FLASH and configure the + * Ethernet driver with that address. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_MACADDR int sam_emac0_setmac(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_cardinserted * * Description: * Check if a card is inserted into the selected HSMCI slot * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_HSMCI bool sam_cardinserted(int slotno); @@ -554,19 +557,19 @@ bool sam_cardinserted(int slotno); # define sam_cardinserted(slotno) (false) #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_writeprotected * * Description: * Check if the card in the MMCSD slot is write protected * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_HSMCI bool sam_writeprotected(int slotno); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_automount_initialize * * Description: @@ -578,26 +581,26 @@ bool sam_writeprotected(int slotno); * Returned Value: * None * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUTOMOUNTER void sam_automount_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_automount_event * * Description: - * The HSMCI 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 HSMCI 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 HSMCI0 slot: HSMCI0 or HSMCI1_SLOTNO. There is a - * terminology problem here: Each HSMCI 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 HSMCI0 slot: HSMCI0 or HSMCI1_SLOTNO. + * There is a terminology problem here: Each HSMCI 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: @@ -606,19 +609,19 @@ void sam_automount_initialize(void); * Assumptions: * Interrupts are disabled. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUTOMOUNTER void sam_automount_event(int slotno, bool inserted); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_writeprotected * * Description: * Check if the card in the MMCSD slot is write protected * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_HSMCI bool sam_writeprotected(int slotno); @@ -626,14 +629,14 @@ bool sam_writeprotected(int slotno); # define sam_writeprotected(slotno) (false) #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_at24config * * Description: - * Create an AT24xx-based MTD configuration device for storage device configuration - * information. + * Create an AT24xx-based MTD configuration device for storage device + * configuration information. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_MTDCONFIG int sam_at24config(void); @@ -672,4 +675,4 @@ int sam_xbee_initialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_SAME70_XPLAINED_SRC_SAME70_XPLAINED_H */ +#endif /* __BOARDS_ARM_SAMV7_SAME70_XPLAINED_SRC_SAME70_XPLAINED_H */ diff --git a/boards/arm/samv7/same70-xplained/tools/oocd.sh b/boards/arm/samv7/same70-xplained/tools/oocd.sh index b561171a6f9..8ed4a9d1154 100755 --- a/boards/arm/samv7/same70-xplained/tools/oocd.sh +++ b/boards/arm/samv7/same70-xplained/tools/oocd.sh @@ -28,7 +28,7 @@ TARGET_PATH="/usr/local/share/openocd/scripts" #OPENOCD_EXE=openocd.exe OPENOCD_EXE=openocd -OPENOCD_CFG="${TOPDIR}/boards/same70-xplained/tools/atmel_same70_xplained.cfg" +OPENOCD_CFG="${TOPDIR}/boards/arm/samv7/same70-xplained/tools/atmel_same70_xplained.cfg" OPENOCD_ARGS="-f ${OPENOCD_CFG} -s ${TARGET_PATH}" if [ "X$2" = "X-d" ]; then diff --git a/boards/arm/samv7/samv71-xult/README.txt b/boards/arm/samv7/samv71-xult/README.txt index b3aa50f8487..83fd29502ea 100644 --- a/boards/arm/samv7/samv71-xult/README.txt +++ b/boards/arm/samv7/samv71-xult/README.txt @@ -910,7 +910,7 @@ Pre-requisites: prototyped in the nuttx/include/nuttx/arch.h, and (2) it must select CONFIG_ARCH_PHY_INTERRUPT in the board configuration file to advertise that it supports arch_phy_irq(). This logic can be found at - nuttx/boards/samv71-xult/src/sam_ethernet.c. + nuttx/boards/arm/samv7/samv71-xult/src/sam_ethernet.c. - One other thing: UDP support is required. @@ -1055,7 +1055,7 @@ Testing has also been performed using the maXTouch Xplained Pro LCD * maXTouch configuration with Nuttx you need to do these things: * * * * - Copy the function atmxt_config() from the file * - * boards/samv71-xult/src/atmxt_config.c into the file * + * boards/arm/samv7/samv71-xult/src/atmxt_config.c into the file * * drivers/input/mxt.c * * - Add a call to atmxt_config() in drivers/input/mxt.c in the * * function mxt_register() just before the touchscreen device is * @@ -1560,7 +1560,7 @@ Tickless OS NOTE: In most cases, the slow clock will be used as the timer/counter input. The 32.768KHz crystal is selected by the definition - BOARD_HAVE_SLOWXTAL in the boards/samv71-xult/board.h file. + BOARD_HAVE_SLOWXTAL in the boards/arm/samv7/samv71-xult/board.h file. The slow clock has a resolution of about 30.518 microseconds. Ideally, the value of CONFIG_USEC_PER_TICK should be the exact clock resolution. diff --git a/boards/arm/samv7/samv71-xult/include/board.h b/boards/arm/samv7/samv71-xult/include/board.h index fb1610d7265..d6a971f97f9 100644 --- a/boards/arm/samv7/samv71-xult/include/board.h +++ b/boards/arm/samv7/samv71-xult/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samv71-xult/include/board.h +/**************************************************************************** + * boards/arm/samv7/samv71-xult/include/board.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,30 +31,34 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_SAMV71_XULT_INCLUDE_BOARD_H -#define __BOARDS_ARM_SAMV71_XULT_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_SAMV7_SAMV71_XULT_INCLUDE_BOARD_H +#define __BOARDS_ARM_SAMV7_SAMV71_XULT_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Clocking *************************************************************************/ -/* After power-on reset, the SAMV71Q device is running out of the Master Clock using - * the Fast RC Oscillator running at 4 MHz. + ****************************************************************************/ + +/* Clocking *****************************************************************/ + +/* After power-on reset, the SAMV71Q device is running out of the Master + * Clock using the Fast RC Oscillator running at 4 MHz. * * MAINOSC: Frequency = 12MHz (crystal) * * 300MHz Settings: * PLLA: PLL Divider = 1, Multiplier = 20 to generate PLLACK = 240MHz - * Master Clock (MCK): Source = PLLACK, Prescalar = 1 to generate MCK = 120MHz + * Master Clock (MCK): + * Source = PLLACK, + * Prescalar = 1 to generate MCK = 120MHz * CPU clock: 120MHz * * There are two on-board crystals: @@ -66,10 +70,10 @@ /* Main oscillator register settings. * - * The main oscillator could be either the embedded 4/8/12 MHz fast RC oscillators - * or an external 3-20 MHz crystal or ceramic resonator. The external clock source - * is selected by default in sam_clockconfig.c. Here we need to specify the main - * oscillator start-up time. + * The main oscillator could be either the embedded 4/8/12 MHz fast RC + * oscillators or an external 3-20 MHz crystal or ceramic resonator. + * The external clock source is selected by default in sam_clockconfig.c. + * Here we need to specify the main oscillator start-up time. * * REVISIT... this is old information: * The start up time should be should be: @@ -80,7 +84,6 @@ #define BOARD_CKGR_MOR_MOSCXTST (62 << PMC_CKGR_MOR_MOSCXTST_SHIFT) /* Start-up Time */ #define BOARD_CKGR_MOR_MOSCXTENBY (PMC_CKGR_MOR_MOSCXTEN) /* Crystal Oscillator Enable */ - /* PLLA configuration. * * Divider = 1 @@ -185,11 +188,12 @@ #define BOARD_FWS 4 -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* LEDs * - * There are two yellow LED available on the SAM V71 Xplained Ultra board that - * can be turned on and off. The LEDs can be activated by driving the + * There are two yellow LED available on the SAM V71 Xplained Ultra board + * that can be turned on and off. The LEDs can be activated by driving the * connected I/O line to GND. * * ------ ----------- --------------------- @@ -200,8 +204,8 @@ * PC09 Yellow LED1 LCD, and Shield * ------ ----------- --------------------- * - * 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() */ @@ -222,7 +226,8 @@ * * SYMBOL Meaning LED state * LED2 LED1 - * ------------------------ -------------------------- ------ ------ */ + * ------------------------ -------------------------- ------ ------ + */ #define LED_STARTED 0 /* NuttX has been started OFF OFF */ #define LED_HEAPALLOCATE 0 /* Heap has been allocated OFF OFF */ @@ -242,7 +247,8 @@ * be used by other board-specific logic. */ -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* Buttons * * SAM V71 Xplained Ultra contains three mechanical buttons. One button is the @@ -262,8 +268,8 @@ * NOTES: * * - There are no pull-up resistors connected to the generic user buttons so - * it is necessary to enable the internal pull-up in the SAM V71 to use the - * button. + * it is necessary to enable the internal pull-up in the SAM V71 to use + * the button. * - PB12 is set up as a system flash ERASE pin when the firmware boots. To * use the SW1, PB12 has to be configured as a normal regular I/O pin in * the MATRIX module. For more information see the SAM V71 datasheet. @@ -276,11 +282,13 @@ #define BUTTON_SW0_BIT (1 << BUTTON_SW0) #define BUTTON_SW1_BIT (1 << BUTTON_SW1) -/* PIO Disambiguation ***************************************************************/ +/* PIO Disambiguation *******************************************************/ + /* Serial Console * - * The SAMV71-XULT has no on-board RS-232 drivers so it will be necessary to use - * either the VCOM or an external RS-232 driver. Here are some options. + * The SAMV71-XULT has no on-board RS-232 drivers so it will be necessary + * to use either the VCOM or an external RS-232 driver. + * Here are some options. * * - Arduino Serial Shield: One option is to use an Arduino-compatible * serial shield. This will use the RXD and TXD signals available at pins @@ -379,16 +387,16 @@ #define GPIO_SSC0_TD GPIO_SSC0_TD_1 -/* maXTouch Xplained Pro Standard Extension Header ********************************** +/* maXTouch Xplained Pro Standard Extension Header ************************** * ----------------------------------------------- * This LCD could be connected either via EXT1 or EXT2 using the 2x10 * 20-pin cable and the maXTouch Xplained Pro standard extension * header. Access is then performed in SPI mode. * - * ---- -------- ---- ----------- ---- ----------- ---------------------------------- + * ---- -------- ---- ----------- ---- ----------- -------------------------- * SAMV71-XULT maxTouch Xplained Pro * PIN FUNCTION EXT1 FUNC EXT2 FUNC Description - * ---- -------- ---- ----------- ---- ----------- ---------------------------------- + * ---- -------- ---- ----------- ---- ----------- -------------------------- * 1 ID - - - - Communication line to ID chip * 2 GND - - - - Ground * 3 N/C PC31 - PD30 - @@ -409,10 +417,10 @@ * 18 SPI SCK PD22 SPI0_SPCK PD22 SPI0_SPCK SPI Clock line * 19 GND - - - - Ground * 20 VCC - - - - Target supply voltage - * ---- -------- ---- ----------- ---- ----------- ---------------------------------- + * ---- -------- ---- ----------- ---- ----------- -------------------------- * - * There are no alternatives for SPI0 and TWI0 pins. Only the PWM pins require any - * disambiguration. + * There are no alternatives for SPI0 and TWI0 pins. + * Only the PWM pins require any disambiguration. */ #ifdef CONFIG_SAMV71XULT_MXTXPLND @@ -427,16 +435,16 @@ # define GPIO_PWMC0_H2 GPIO_PWMC0_H2_5 # define GPIO_MXTXLND_PWM GPIO_PWMC0_H2_5 -/* maXTouch Xplained Pro Xplained Pro LCD Connector ********************************* +/* maXTouch Xplained Pro Xplained Pro LCD Connector ************************* * - * Only the parallel is supported by this BSP (via SMC/EBI). The switch mode - * selector on the back of the maXtouch should be set in the OFF-ON-OFF - * positions to select 16-bit color mode. + * Only the parallel is supported by this BSP (via SMC/EBI). + * The switch mode selector on the back of the maXtouch should be set in + * the OFF-ON-OFF positions to select 16-bit color mode. * - * ----------------- ------------- ------------------------------------------------- + * ----------------- ------------- ------------------------------------------ * LCD SAMV71 Description * Pin Function Pin Function - * ---- ------------ ---- -------- ------------------------------------------------- + * ---- ------------ ---- -------- ------------------------------------------ * 1 ID - - Chip ID communication line * 2 GND - GND Ground * 3 D0 PC0 D0 Data line @@ -470,8 +478,9 @@ * 31 N/C - - * 32 GND - GND Ground * 33 PCLK/ PC30 GPIO SMC: Pixel clock Display RAM select. - * CMD_DATA_SEL SPI: One address line of the MCU for displays where - * it is possible to select either the register + * CMD_DATA_SEL SPI: One address line of the MCU for + * displays where it is possible + * to select either the register * or the data interface * 34 VSYNC/CS PD19 NCS3 SMC: Vertical synchronization. * SPI: Chip select @@ -493,7 +502,7 @@ * 48 VCC - - 3.3V power supply for extension board * 49 VCC - - 3.3V power supply for extension board * 50 GND - - Ground - * ---- ------------ ---- -------- -------------------------------------------------- + * ---- ------------ ---- -------- ------------------------------------------ */ # elif defined(CONFIG_SAMV71XULT_MXTXPLND_LCD) @@ -505,10 +514,10 @@ /* MCAN1 * - * SAM V71 Xplained Ultra has two MCAN modules that performs communication according - * to ISO11898-1 (Bosch CAN specification 2.0 part A,B) and Bosch CAN FD - * specification V1.0. MCAN1 is connected to an on-board ATA6561 CAN physical-layer - * transceiver. + * SAM V71 Xplained Ultra has two MCAN modules that performs communication + * according to ISO11898-1 (Bosch CAN specification 2.0 part A,B) and Bosch + * CAN FD specification V1.0. + * MCAN1 is connected to an on-board ATA6561 CAN physical-layer transceiver. * * ------- -------- -------- ------------- * SAM V71 FUNCTION ATA6561 SHARED @@ -522,13 +531,13 @@ #define GPIO_MCAN1_TX GPIO_MCAN1_TX_2 #define GPIO_MCAN1_RX GPIO_MCAN1_RX_2 -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ @@ -541,20 +550,22 @@ extern "C" #define EXTERN extern #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_lcdclear * * Description: - * This is a non-standard LCD interface just for the SAM4e-EK board. Because - * of the various rotations, clearing the display in the normal way by writing a - * sequences of runs that covers the entire display can be very slow. Here the - * display is cleared by simply setting all GRAM memory to the specified color. + * This is a non-standard LCD interface just for the SAM4e-EK board. + * Because of the various rotations, clearing the display in the normal + * way by writing a sequences of runs that covers the entire display can + * be very slow. + * Here the display is cleared by simply setting all GRAM memory to the + * specified color. * - ************************************************************************************/ + ****************************************************************************/ void sam_lcdclear(uint16_t color); @@ -564,4 +575,4 @@ void sam_lcdclear(uint16_t color); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_SAMV71_XULT_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_SAMV7_SAMV71_XULT_INCLUDE_BOARD_H */ diff --git a/boards/arm/samv7/samv71-xult/kernel/Makefile b/boards/arm/samv7/samv71-xult/kernel/Makefile index 488bfeb6757..6aa6ba577e3 100644 --- a/boards/arm/samv7/samv71-xult/kernel/Makefile +++ b/boards/arm/samv7/samv71-xult/kernel/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/samv7-xult/kernel/Makefile +# boards/arm/samv7/samv7-xult/kernel/Makefile # # Copyright (C) 2015 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/samv7/samv71-xult/kernel/sam_userspace.c b/boards/arm/samv7/samv71-xult/kernel/sam_userspace.c index b050272a52f..458397e2321 100644 --- a/boards/arm/samv7/samv71-xult/kernel/sam_userspace.c +++ b/boards/arm/samv7/samv71-xult/kernel/sam_userspace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samv71-xult/kernel/sam_userspace.c + * boards/arm/samv7/samv71-xult/kernel/sam_userspace.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/samv71-xult/scripts/Make.defs b/boards/arm/samv7/samv71-xult/scripts/Make.defs index e2b13961037..15106e05ef3 100644 --- a/boards/arm/samv7/samv71-xult/scripts/Make.defs +++ b/boards/arm/samv7/samv71-xult/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/samv71-xult/scripts/Make.defs +# boards/arm/samv7/samv71-xult/scripts/Make.defs # # Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/samv7/samv71-xult/scripts/flash-dtcm.ld b/boards/arm/samv7/samv71-xult/scripts/flash-dtcm.ld index 2f53d0eade2..a73d6c524e9 100644 --- a/boards/arm/samv7/samv71-xult/scripts/flash-dtcm.ld +++ b/boards/arm/samv7/samv71-xult/scripts/flash-dtcm.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samv71-xult/scripts/flash-dtcm.ld + * boards/arm/samv7/samv71-xult/scripts/flash-dtcm.ld * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/samv71-xult/scripts/flash-sram.ld b/boards/arm/samv7/samv71-xult/scripts/flash-sram.ld index 228fab21dad..e96741039c1 100644 --- a/boards/arm/samv7/samv71-xult/scripts/flash-sram.ld +++ b/boards/arm/samv7/samv71-xult/scripts/flash-sram.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samv71-xult/scripts/flash-sram.ld + * boards/arm/samv7/samv71-xult/scripts/flash-sram.ld * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/samv71-xult/scripts/gnu-elf.ld b/boards/arm/samv7/samv71-xult/scripts/gnu-elf.ld index c63e359a299..5face22629f 100644 --- a/boards/arm/samv7/samv71-xult/scripts/gnu-elf.ld +++ b/boards/arm/samv7/samv71-xult/scripts/gnu-elf.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samv71-xult/scripts/gnu-elf.ld + * boards/arm/samv7/samv71-xult/scripts/gnu-elf.ld * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/samv71-xult/scripts/kernel-space.ld b/boards/arm/samv7/samv71-xult/scripts/kernel-space.ld index 3fddc933dab..d41f0075e36 100644 --- a/boards/arm/samv7/samv71-xult/scripts/kernel-space.ld +++ b/boards/arm/samv7/samv71-xult/scripts/kernel-space.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samv71-xult/scripts/kernel-space.ld + * boards/arm/samv7/samv71-xult/scripts/kernel-space.ld * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/samv71-xult/scripts/memory.ld b/boards/arm/samv7/samv71-xult/scripts/memory.ld index 06998dc55f7..17adc713eae 100644 --- a/boards/arm/samv7/samv71-xult/scripts/memory.ld +++ b/boards/arm/samv7/samv71-xult/scripts/memory.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samv71-xult/scripts/memory.ld + * boards/arm/samv7/samv71-xult/scripts/memory.ld * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/samv71-xult/scripts/user-space.ld b/boards/arm/samv7/samv71-xult/scripts/user-space.ld index 8aa2a077f2e..1e329d1bf4f 100644 --- a/boards/arm/samv7/samv71-xult/scripts/user-space.ld +++ b/boards/arm/samv7/samv71-xult/scripts/user-space.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samv71-xult/scripts/user-space.ld + * boards/arm/samv7/samv71-xult/scripts/user-space.ld * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/samv71-xult/src/Makefile b/boards/arm/samv7/samv71-xult/src/Makefile index 5c001ebffcc..26cca946cd1 100644 --- a/boards/arm/samv7/samv71-xult/src/Makefile +++ b/boards/arm/samv7/samv71-xult/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/samv71-xult/src/Makefile +# boards/arm/samv7/samv71-xult/src/Makefile # # Copyright (C) 2015-2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/samv7/samv71-xult/src/atmxt-xpro.h b/boards/arm/samv7/samv71-xult/src/atmxt-xpro.h index 7a8e1935373..eb265fdcf8b 100644 --- a/boards/arm/samv7/samv71-xult/src/atmxt-xpro.h +++ b/boards/arm/samv7/samv71-xult/src/atmxt-xpro.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samv71-xult/src/atmxt-xpro.h +/**************************************************************************** + * boards/arm/samv7/samv71-xult/src/atmxt-xpro.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,29 +31,32 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_ATMXT_XPRO_SRC_ATMXT_XPRO_H -#define __BOARDS_ARM_ATMXT_XPRO_SRC_ATMXT_XPRO_H +#ifndef __BOARDS_ARM_SAMV7_SAMV71_XULT_SRC_ATMXT_XPRO_H +#define __BOARDS_ARM_SAMV7_SAMV71_XULT_SRC_ATMXT_XPRO_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ #define HAVE_MAXTOUCH 1 #define HAVE_ILI9488_SMC 1 #undef HAVE_ILI9488_SPI /* Not yet suppported */ -/* maXTouch and LCD only available if the maXTouch Xplained Pro is connected */ +/* maXTouch and LCD only available if the maXTouch Xplained Pro is + * connected + */ #ifndef CONFIG_SAMV71XULT_MXTXPLND # undef HAVE_MAXTOUCH @@ -111,7 +114,10 @@ /* ILI9488 LCD */ #ifdef HAVE_ILI9488_SMC -/* ILI9488 parallel mode requires use of LCD connector and SMC and DMA support */ + +/* ILI9488 parallel mode requires use of LCD connector and SMC and DMA + * support + */ # ifndef CONFIG_SAMV71XULT_MXTXPLND_LCD # warning The ILI8488 LCD must be connected on LCD EXT4 (CONFIG_SAMV71XULT_MXTXPLND_LCD) @@ -132,6 +138,7 @@ #endif #ifdef HAVE_ILI9488_SPI + /* ILI9488 serial mode requires use of EXT1 or EXT2 connector */ # if !defined(CONFIG_SAMV71XULT_MXTXPLND_EXT1) && !defined(CONFIG_SAMV71XULT_MXTXPLND_EXT2) @@ -147,7 +154,7 @@ # endif #endif -/* SAMV71-XULT GPIO Pin Definitions *************************************************/ +/* SAMV71-XULT GPIO Pin Definitions *****************************************/ /* maXTouch Xplained Pro LCD * @@ -157,10 +164,10 @@ * 20-pin cable and the maXTouch Xplained Pro standard extension * header. Access is then performed in SPI mode. * - * ---- -------- ---- ----------- ---- ----------- ---------------------------------- + * ---- -------- ---- ----------- ---- ----------- -------------------------- * SAMV71-XULT maxTouch Xplained Pro * PIN FUNCTION EXT1 FUNC EXT2 FUNC Description - * ---- -------- ---- ----------- ---- ----------- ---------------------------------- + * ---- -------- ---- ----------- ---- ----------- -------------------------- * 1 ID - - - - Communication line to ID chip * 2 GND - - - - Ground * 3 N/C PC31 - PD30 - @@ -181,7 +188,7 @@ * 18 SPI SCK PD22 SPI0_SPCK PD22 SPI0_SPCK SPI Clock line * 19 GND - - - - Ground * 20 VCC - - - - Target supply voltage - * ---- -------- ---- ----------- ---- ----------- ---------------------------------- + * ---- -------- ---- ----------- ---- ----------- -------------------------- */ #ifdef CONFIG_SAMV71XULT_MXTXPLND @@ -235,16 +242,16 @@ # define MXTXLPND_PORT SPI0_CS3 # endif /* HAVE_ILI9488_SPI */ -/* maXTouch Xplained Pro Xplained Pro LCD Connector *********************************/ -/* - * Only the parallel mode is supported by this BSP (via SMC/EBI). The switch mode - * selector on the back of the maXtouch should be set in the OFF-ON-OFF positions - * to select 16-bit color mode. +/* maXTouch Xplained Pro Xplained Pro LCD Connector *************************/ + +/* Only the parallel mode is supported by this BSP (via SMC/EBI). + * The switch mode selector on the back of the maXtouch should be set in the + * OFF-ON-OFF positions to select 16-bit color mode. * - * ----------------- ------------- -------------------------------------------------- + * ----------------- ------------- ------------------------------------------ * LCD SAMV71 Description * Pin Function Pin Function - * ---- ------------ ---- -------- -------------------------------------------------- + * ---- ------------ ---- -------- ------------------------------------------ * 1 ID - - Chip ID communication line * 2 GND - GND Ground * 3 D0 PC0 D0 Data line @@ -278,9 +285,10 @@ * 31 N/C - - * 32 GND - GND Ground * 33 PCLK/ PC30 GPIO SMC: Pixel clock Display RAM select. - * CMD_DATA_SEL SPI: One address line of the MCU for displays where it - * is possible to select either the register or the - * data interface + * CMD_DATA_SEL SPI: One address line of the MCU for + * displays where it is possible + * to select either the register + * or the data interface * 34 VSYNC/CS PD19 NCS3 SMC: Vertical synchronization. * SPI: Chip select * 35 HSYNC/WE PC8 NWE SMC: Horizontal synchronization @@ -301,7 +309,7 @@ * 48 VCC - - 3.3V power supply for extension board * 49 VCC - - 3.3V power supply for extension board * 50 GND - - Ground - * ---- ------------ ---- -------- -------------------------------------------------- + * ---- ------------ ---- -------- ------------------------------------------ */ # elif defined(CONFIG_SAMV71XULT_MXTXPLND_LCD) @@ -333,7 +341,9 @@ # endif # endif /* CONFIG_SAMV71XULT_MXTXLND_xyz */ -/* In all configurations, the touchscreen communicates on TWI0, I2C address 0x4a */ +/* In all configurations, the touchscreen communicates on TWI0, + * I2C address 0x4a + */ # ifdef HAVE_MAXTOUCH @@ -343,9 +353,9 @@ # endif /* HAVE_MAXTOUCH */ #endif /* CONFIG_SAMV71XULT_MXTXPLND */ -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ struct atmxt_config_s { @@ -355,23 +365,23 @@ struct atmxt_config_s FAR const uint8_t *bytes; }; -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ #ifdef HAVE_MAXTOUCH -/* List of configuration settings. Terminated with an entry with nbytes == 0 and - * bytes == NULL; +/* List of configuration settings. + * Terminated with an entry with nbytes == 0 andbytes == NULL; */ extern const struct atmxt_config_s g_atmxt_config[]; #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_ATMXT_XPRO_SRC_ATMXT_XPRO_H */ +#endif /* __BOARDS_ARM_SAMV7_SAMV71_XULT_SRC_ATMXT_XPRO_H */ diff --git a/boards/arm/samv7/samv71-xult/src/sam_appinit.c b/boards/arm/samv7/samv71-xult/src/sam_appinit.c index a0920d5a97f..3a66a22a1ac 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_appinit.c +++ b/boards/arm/samv7/samv71-xult/src/sam_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/samv71-xult/src/sam_appinit.c + * boards/arm/samv7/samv71-xult/src/sam_appinit.c * * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/samv71-xult/src/sam_at24config.c b/boards/arm/samv7/samv71-xult/src/sam_at24config.c index 835318306db..34319d4592e 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_at24config.c +++ b/boards/arm/samv7/samv71-xult/src/sam_at24config.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samv71-xult/src/sam_at24config.c +/**************************************************************************** + * boards/arm/samv7/samv71-xult/src/sam_at24config.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 @@ -51,18 +51,18 @@ #ifdef HAVE_MTDCONFIG -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_at24config * * Description: - * Create an AT24xx-based MTD configuration device for storage device configuration - * information. + * Create an AT24xx-based MTD configuration device for storage device + * configuration information. * - ************************************************************************************/ + ****************************************************************************/ int sam_at24config(void) { diff --git a/boards/arm/samv7/samv71-xult/src/sam_atmxtconfig.c b/boards/arm/samv7/samv71-xult/src/sam_atmxtconfig.c index 694d79b2d53..c318cda63eb 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_atmxtconfig.c +++ b/boards/arm/samv7/samv71-xult/src/sam_atmxtconfig.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samv71-xult/src/sam_atmxtconfig.c +/**************************************************************************** + * boards/arm/samv7/samv71-xult/src/sam_atmxtconfig.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,19 +31,19 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include "atmxt-xpro.h" -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_MAXTOUCH /* Configuration arrays referenced in g_atmxt_config[] */ @@ -144,12 +144,12 @@ static const uint8_t g_id42[0x03] = 0x02, 0x14, 0x0f }; -/************************************************************************************ +/**************************************************************************** * Public Data - ************************************************************************************/ + ****************************************************************************/ -/* List of configuration settings. Terminated with an entry with nbytes == 0 and - * bytes == NULL; +/* List of configuration settings. + * Terminated with an entry with nbytes == 0 and bytes == NULL; */ const struct atmxt_config_s g_atmxt_config[] = diff --git a/boards/arm/samv7/samv71-xult/src/sam_audio_null.c b/boards/arm/samv7/samv71-xult/src/sam_audio_null.c index 59305879aa4..6f2c8796a11 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_audio_null.c +++ b/boards/arm/samv7/samv71-xult/src/sam_audio_null.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samv71-xult/src/sam_audio_null.c +/**************************************************************************** + * boards/arm/samv7/samv71-xult/src/sam_audio_null.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Included Files @@ -144,7 +144,8 @@ int sam_audio_null_initialize(int minor) ret = audio_register(devname, pcm); if (ret < 0) { - auderr("ERROR: Failed to register /dev/%s device: %d\n", devname, ret); + auderr("ERROR: Failed to register /dev/%s device: %d\n", + devname, ret); goto errout_with_pcm; } diff --git a/boards/arm/samv7/samv71-xult/src/sam_autoleds.c b/boards/arm/samv7/samv71-xult/src/sam_autoleds.c index 714d2a00648..25700989eda 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_autoleds.c +++ b/boards/arm/samv7/samv71-xult/src/sam_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samv71-xult/include/sam_autoleds.c + * boards/arm/samv7/samv71-xult/include/sam_autoleds.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/samv71-xult/src/sam_boot.c b/boards/arm/samv7/samv71-xult/src/sam_boot.c index e251bf3ad0d..4adccb5a051 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_boot.c +++ b/boards/arm/samv7/samv71-xult/src/sam_boot.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samv71-xult/src/sam_boot.c + * boards/arm/samv7/samv71-xult/src/sam_boot.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/samv71-xult/src/sam_bringup.c b/boards/arm/samv7/samv71-xult/src/sam_bringup.c index 3779224e5ea..62eaa1a62d2 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_bringup.c +++ b/boards/arm/samv7/samv71-xult/src/sam_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/samv71-xult/src/sam_bringup.c + * boards/arm/samv7/samv71-xult/src/sam_bringup.c * * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -273,7 +273,7 @@ int sam_bringup(void) #ifdef HAVE_MACADDR /* Read the Ethernet MAC address from the AT24 FLASH and configure the * Ethernet driver with that address. - */ + */ ret = sam_emac0_setmac(); if (ret < 0) @@ -319,6 +319,7 @@ int sam_bringup(void) else { /* REVISIT: A delay seems to be required here or the mount will fail. */ + /* Mount the volume on HSMCI0 */ ret = mount(CONFIG_SAMV71XULT_HSMCI0_MOUNT_BLKDEV, diff --git a/boards/arm/samv7/samv71-xult/src/sam_buttons.c b/boards/arm/samv7/samv71-xult/src/sam_buttons.c index 5742cabd6c3..2adf81c7e29 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_buttons.c +++ b/boards/arm/samv7/samv71-xult/src/sam_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/sam4e-ek/src/sam_buttons.c + * boards/arm/samv7/samv71-xult/src/sam_buttons.c * * Copyright (C) 2014-2015, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/samv71-xult/src/sam_composite.c b/boards/arm/samv7/samv71-xult/src/sam_composite.c index a077502ccfe..d5e546b29ed 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_composite.c +++ b/boards/arm/samv7/samv71-xult/src/sam_composite.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samv71-xult/src/sam_composite.c + * boards/arm/samv7/samv71-xult/src/sam_composite.c * * Copyright (C) 2016, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -216,6 +216,7 @@ FAR void *board_composite_connect(int port, int configid) cdcacm_get_composite_devdesc(&dev[0]); /* Overwrite and correct some values... */ + /* The callback functions for the CDC/ACM class */ dev[0].classobject = cdcacm_classobject; @@ -242,6 +243,7 @@ FAR void *board_composite_connect(int port, int configid) strbase += dev[0].devinfo.nstrings; /* Configure the mass storage device device */ + /* Ask the usbmsc driver to fill in the constants we didn't * know here. */ @@ -249,6 +251,7 @@ FAR void *board_composite_connect(int port, int configid) usbmsc_get_composite_devdesc(&dev[1]); /* Overwrite and correct some values... */ + /* The callback functions for the USBMSC class */ dev[1].classobject = board_mscclassobject; @@ -314,6 +317,7 @@ FAR void *board_composite_connect(int port, int configid) cdcacm_get_composite_devdesc(&dev[ia]); /* Overwrite and correct some values... */ + /* The callback functions for the CDC/ACM class */ dev[ia].classobject = cdcacm_classobject; diff --git a/boards/arm/samv7/samv71-xult/src/sam_ethernet.c b/boards/arm/samv7/samv71-xult/src/sam_ethernet.c index 578e36aedff..e4d971d3edd 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_ethernet.c +++ b/boards/arm/samv7/samv71-xult/src/sam_ethernet.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samv71-xult/src/sam_ethernet.c +/**************************************************************************** + * boards/arm/samv7/samv71-xult/src/sam_ethernet.c * * Copyright (C) 2015-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -66,15 +66,16 @@ #ifdef HAVE_NETWORK -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #define SAMV7_EMAC0_DEVNAME "eth0" #define AT24XX_MACADDR_OFFSET 0x9a /* Debug ********************************************************************/ + /* Extra, in-depth debug output that is only available if * CONFIG_NETDEV_PHY_DEBUG us defined. */ @@ -89,13 +90,13 @@ # define phyinfo(x...) #endif -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_emac0_phy_enable - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMV7_GPIOA_IRQ static void sam_emac0_phy_enable(bool enable) @@ -112,17 +113,17 @@ static void sam_emac0_phy_enable(bool enable) } #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_netinitialize * * Description: * Configure board resources to support networking. * - ************************************************************************************/ + ****************************************************************************/ void weak_function sam_netinitialize(void) { @@ -140,14 +141,14 @@ void weak_function sam_netinitialize(void) sam_configgpio(GPIO_EMAC0_RESET); } -/************************************************************************************ +/**************************************************************************** * Name: sam_emac0_setmac * * Description: - * Read the Ethernet MAC address from the AT24 FLASH and configure the Ethernet - * driver with that address. + * Read the Ethernet MAC address from the AT24 FLASH and configure the + * Ethernet driver with that address. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_MACADDR int sam_emac0_setmac(void) @@ -192,7 +193,8 @@ int sam_emac0_setmac(void) nread = at24->read(at24, AT24XX_MACADDR_OFFSET, 6, mac); if (nread < 6) { - nerr("ERROR: AT24 read(AT24XX_MACADDR_OFFSET) failed: ld\n", (long)nread); + nerr("ERROR: AT24 read(AT24XX_MACADDR_OFFSET) failed: ld\n", + (long)nread); (void)sam_i2cbus_uninitialize(i2c); return (int)nread; } diff --git a/boards/arm/samv7/samv71-xult/src/sam_hsmci.c b/boards/arm/samv7/samv71-xult/src/sam_hsmci.c index 2f4e5e90175..7c0712bd802 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_hsmci.c +++ b/boards/arm/samv7/samv71-xult/src/sam_hsmci.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/samv71-xult/src/sam_hsmci.c + * boards/arm/samv7/samv71-xult/src/sam_hsmci.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -79,6 +79,7 @@ /**************************************************************************** * Private Types ****************************************************************************/ + /* This structure holds static information unique to one HSMCI peripheral */ struct sam_hsmci_state_s @@ -160,7 +161,7 @@ static int sam_hsmci_cardetect(struct sam_hsmci_state_s *state) sdio_mediachange(state->hsmci, cd); } - return OK; + return OK; } #ifdef CONFIG_SAMV7_HSMCI0 @@ -242,6 +243,7 @@ int sam_hsmci_initialize(int slotno, int minor) } /* Mount the SDIO-based MMC/SD block driver */ + /* First, get an instance of the SDIO interface */ state->hsmci = sdio_initialize(slotno); diff --git a/boards/arm/samv7/samv71-xult/src/sam_ili9488.c b/boards/arm/samv7/samv71-xult/src/sam_ili9488.c index 6a47b220437..25bac2f15cc 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_ili9488.c +++ b/boards/arm/samv7/samv71-xult/src/sam_ili9488.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samv71-xult/src/sam_ili9488.c + * boards/arm/samv7/samv71-xult/src/sam_ili9488.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -87,9 +87,10 @@ * 31 N/C - - * 32 GND - GND Ground * 33 PCLK/ PC30 GPIO RGB: Pixel clock Display RAM select. - * CMD_DATA_SEL MCU: One address line of the MCU for displays where it - * is possible to select either the register or the - * data interface + * CMD_DATA_SEL MCU: One address line of the MCU for + * displays where it is possible + * to select either the register + * or the data interface * 34 VSYNC/CS PD19 NCS3 RGB: Vertical synchronization. * MCU: Chip select * 35 HSYNC/WE PC8 NWE RGB: Horizontal synchronization @@ -155,6 +156,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* SMC must be selected */ #if !defined(CONFIG_SAMV7_SMC) @@ -203,6 +205,7 @@ #endif /* Display/Color Properties **************************************************/ + /* Display Resolution */ #if defined(CONFIG_LCD_LANDSCAPE) || defined(CONFIG_LCD_RLANDSCAPE) @@ -226,6 +229,7 @@ #define RGB_COLOR(r,g,b) RGBTO16(r,g,b) /* SAMV7-XULT LCD Hardware Definitions ***************************************/ + /* LCD /CS is NCS3 */ #define SAM_LCD_BASE ((uintptr_t)SAM_EXTCS3_BASE) @@ -256,9 +260,9 @@ /* Buffer Alignment. * - * If the data cache is enabled the a higher level of alignment is required. That is - * because the data will need to be invalidated and that cache invalidation will occur - * in multiples of full change lines. + * If the data cache is enabled the a higher level of alignment is required. + * That is because the data will need to be invalidated and that cache + * invalidation will occur in multiples of full change lines. */ #ifdef CONFIG_ARMV7M_DCACHE @@ -344,6 +348,7 @@ struct sam_dev_s /**************************************************************************** * Private Function Prototypes ****************************************************************************/ + /* Low Level LCD access */ static int sam_sendcmd(FAR struct sam_dev_s *priv, uint16_t cmd); @@ -387,8 +392,9 @@ static int sam_lcd_rxtransfer(FAR struct sam_dev_s *priv, /* LCD Data Transfer Methods */ -static int sam_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer, - size_t npixels); +static int sam_putrun(fb_coord_t row, fb_coord_t col, + FAR const uint8_t *buffer, + size_t npixels); static int sam_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer, size_t npixels); @@ -427,6 +433,7 @@ static inline int sam_lcd_initialize(void); /**************************************************************************** * Private Data ****************************************************************************/ + /* LCD GPIO configurations */ static const uint32_t g_lcdpin[] = @@ -487,6 +494,7 @@ static struct sam_dev_s g_lcddev = .getplaneinfo = sam_getplaneinfo, /* LCD RGB Mapping -- Not supported */ + /* Cursor Controls -- Not supported */ /* LCD Specific Controls */ @@ -527,8 +535,9 @@ static int sam_sendcmd(FAR struct sam_dev_s *priv, uint16_t cmd) lcderr("ERROR: Failed to send command %02x: %d\n", cmd, ret); } - /* Make sure that the CMD/DATA GPIO is reset for commands. I don't understand - * the delay loop... it comes from the SAMV7 sample code and is, apparently, a + /* Make sure that the CMD/DATA GPIO is reset for commands. + * I don't understand the delay loop... + * it comes from the SAMV7 sample code and is, apparently, a * work-around for some issue. */ @@ -569,7 +578,7 @@ static int sam_lcd_put(FAR struct sam_dev_s *priv, uint16_t cmd, if (ret < 0) { lcderr("ERROR: Failed to send command %02x data: %d\n", cmd, ret); - } + } } return ret; @@ -699,9 +708,11 @@ static int sam_setwindow(FAR struct sam_dev_s *priv, sam_color_t row, ****************************************************************************/ #if 0 /* Sometimes useful */ -static void sam_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npixels) +static void sam_dumprun(FAR const char *msg, FAR uint16_t *run, + size_t npixels) { - int i, j; + int i; + int j; syslog(LOG_DEBUG, "\n%s:\n", msg); for (i = 0; i < npixels; i += 16) @@ -728,8 +739,8 @@ static void sam_dumprun(FAR const char *msg, FAR uint16_t *run, size_t npixels) static void sam_disable_backlight(void) { - /* PWM support is not yet available. Backlight is currently just configured as a - * GPIO output. + /* PWM support is not yet available. + * Backlight is currently just configured as a GPIO output. */ #warning Missing logic @@ -770,8 +781,8 @@ static int sam_set_backlight(unsigned int power) * * Description: * Enable/disable LCD panel power (0: full off - CONFIG_LCD_MAXPOWER: - * full on). On backlit LCDs, this setting may correspond to the backlight - * setting. + * full on). On backlit LCDs, this setting may correspond to the backlight + * setting. * ****************************************************************************/ @@ -828,7 +839,8 @@ static void sam_lcd_sample(struct sam_dev_s *priv, int index) static void sam_lcd_sampleinit(struct sam_dev_s *priv) { priv->smplset = 0; - memset(priv->samples, 0xff, DEBUG_NDMASAMPLES * sizeof(struct sam_dmaregs_s)); + memset(priv->samples, 0xff, + DEBUG_NDMASAMPLES * sizeof(struct sam_dmaregs_s)); } #endif @@ -1043,7 +1055,8 @@ static int sam_lcd_txtransfer(FAR struct sam_dev_s *priv, /* Set up to transfer to the LCD */ - ret = sam_dmatxsetup(priv->dmach, (uint32_t)SAM_LCD_BASE, (uint32_t)buffer, buflen); + ret = sam_dmatxsetup(priv->dmach, (uint32_t)SAM_LCD_BASE, + (uint32_t)buffer, buflen); if (ret == OK) { flags = enter_critical_section(); @@ -1084,7 +1097,8 @@ static int sam_lcd_rxtransfer(FAR struct sam_dev_s *priv, /* Set up to transfer to the LCD */ - ret = sam_dmarxsetup(priv->dmach, (uint32_t)SAM_LCD_BASE, (uint32_t)buffer, buflen); + ret = sam_dmarxsetup(priv->dmach, (uint32_t)SAM_LCD_BASE, + (uint32_t)buffer, buflen); if (ret == OK) { flags = enter_critical_section(); @@ -1388,8 +1402,9 @@ static inline void sam_smc_initialize(void) regval = SMCCS_CYCLE_NWECYCLE(10) | SMCCS_CYCLE_NRDCYCLE(10); putreg32(regval, smcbase + SAM_SMCCS_CYCLE_OFFSET); - regval = SMCCS_MODE_READMODE | SMCCS_MODE_WRITEMODE | SMCCS_EXNWMODE_DISABLED | - SMCCS_MODE_DBW_16BIT | SMCCS_MODE_TDFCYCLES(15); + regval = SMCCS_MODE_READMODE | SMCCS_MODE_WRITEMODE | + SMCCS_EXNWMODE_DISABLED | SMCCS_MODE_DBW_16BIT | + SMCCS_MODE_TDFCYCLES(15); putreg32(regval, smcbase + SAM_SMCCS_MODE_OFFSET); } diff --git a/boards/arm/samv7/samv71-xult/src/sam_maxtouch.c b/boards/arm/samv7/samv71-xult/src/sam_maxtouch.c index 96cadf077c4..7bd3da6b4c7 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_maxtouch.c +++ b/boards/arm/samv7/samv71-xult/src/sam_maxtouch.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samv7-xult/src/sam_maxtouch.c +/**************************************************************************** + * boards/arm/samv7/samv7-xult/src/sam_maxtouch.c * * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Included Files @@ -62,6 +62,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifndef CONFIG_SAMV71XULT_MXT_I2CFREQUENCY @@ -158,8 +159,9 @@ static int mxt_attach(FAR const struct mxt_lower_s *lower, mxt_handler_t isr, { if (isr) { - /* Just save the address of the handler and its argument for now. The - * new handler will called via mxt_interrupt() when the interrupt occurs. + /* Just save the address of the handler and its argument for now. + * The new handler will called via mxt_interrupt() when the interrupt + * occurs. */ iinfo("Attaching %p\n", isr); @@ -267,7 +269,9 @@ int sam_tsc_setup(int minor) { ierr("ERROR: Failed to register touchscreen device\n"); irq_detach(IRQ_MXT_CHG); + /* sam_i2cbus_uninitialize(i2c); */ + return -ENODEV; } diff --git a/boards/arm/samv7/samv71-xult/src/sam_mcan.c b/boards/arm/samv7/samv71-xult/src/sam_mcan.c index f0206f028da..169281c3f34 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_mcan.c +++ b/boards/arm/samv7/samv71-xult/src/sam_mcan.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samv71-xultk/src/sam_mcan.c +/**************************************************************************** + * boards/arm/samv7/samv71-xultk/src/sam_mcan.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 @@ -51,10 +51,11 @@ #ifdef CONFIG_SAMV7_MCAN -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ #if defined(CONFIG_SAMV7_MCAN0) && defined(CONFIG_SAMV7_MCAN1) # warning "Both MCAN0 and MCAN1 are enabled. Assuming only CAN1." @@ -67,17 +68,17 @@ # define CAN_PORT 1 #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_can_setup * * Description: * Initialize CAN and register the CAN device * - ************************************************************************************/ + ****************************************************************************/ int sam_can_setup(void) { diff --git a/boards/arm/samv7/samv71-xult/src/sam_mrf24j40.c b/boards/arm/samv7/samv71-xult/src/sam_mrf24j40.c index 8b9720ea98b..30f8c37bce8 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_mrf24j40.c +++ b/boards/arm/samv7/samv71-xult/src/sam_mrf24j40.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samv71-xult/src/sam_mrf24j40.c + * boards/arm/samv7/samv71-xult/src/sam_mrf24j40.c * * Copyright (C) 2017 Gregory Nutt, All rights reserver * Author: Gregory Nutt @@ -87,7 +87,7 @@ struct sam_priv_s * varying boards and MCUs. * * irq_attach - Attach the MRF24J40 interrupt handler to the GPIO - interrupt + * interrupt * irq_enable - Enable or disable the GPIO interrupt */ diff --git a/boards/arm/samv7/samv71-xult/src/sam_sdram.c b/boards/arm/samv7/samv71-xult/src/sam_sdram.c index 2d408907311..f3d82d2bbfd 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_sdram.c +++ b/boards/arm/samv7/samv71-xult/src/sam_sdram.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samv71-xult/src/sam_sdram.c + * boards/arm/samv7/samv71-xult/src/sam_sdram.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -190,7 +190,8 @@ void sam_sdram_config(void) * SDRAMC_CR_TWR(4) 4 cycle write recovery delay * SDRAMC_CR_TRCTRFC(11) 63 ns min * SDRAMC_CR_TRP(5) 21 ns min Command period (PRE to ACT) - * SDRAMC_CR_TRCD(5) 21 ns min Active Command to read/Write Command delay time + * SDRAMC_CR_TRCD(5) 21 ns min Active Command to read/Write + * Command delay time * SDRAMC_CR_TRAS(8) 42 ns min Command period (ACT to PRE) * SDRAMC_CR_TXSR(13) 70 ns min Exit self-refresh to active time */ @@ -216,11 +217,11 @@ void sam_sdram_config(void) putreg32(0, SAM_SDRAMC_LPR); - /* 3. The SDRAM memory type must be set in the Memory Device Register.*/ + /* 3. The SDRAM memory type must be set in the Memory Device Register. */ putreg32(SDRAMC_MDR_SDRAM, SAM_SDRAMC_MDR); - /* 4. A minimum pause of 200 usec is provided to precede any signal toggle.*/ + /* 4. A minimum pause of 200 usec is provided to precede any signal toggle. */ up_udelay(200); @@ -247,13 +248,13 @@ void sam_sdram_config(void) * any SDRAM location eight times. */ - for (i = 0 ; i < 8; i++) - { - putreg32(SDRAMC_MR_MODE_AUTOREFRESH, SAM_SDRAMC_MR); - *psdram = 0; - } + for (i = 0 ; i < 8; i++) + { + putreg32(SDRAMC_MR_MODE_AUTOREFRESH, SAM_SDRAMC_MR); + *psdram = 0; + } - up_udelay(200); + up_udelay(200); /* 8. A Mode Register set (MRS) cycle is issued to program the parameters * of the SDRAM devices, in particular CAS latency and burst length. @@ -262,7 +263,7 @@ void sam_sdram_config(void) * that BA[1:0] are set to 0. For example, with a 16-bit 128 MB SDRAM * (12 rows, 9 columns, 4 banks) bank address, the SDRAM write access * should be done at the address 0x70000000. - */ + */ putreg32(SDRAMC_MR_MODE_LOADMODE, SAM_SDRAMC_MR); *psdram = 0; @@ -279,8 +280,9 @@ void sam_sdram_config(void) * address 0x70800000 or 0x70400000. */ - //putreg32(SDRAMC_MR_MODE_EXTLOADMODE, SDRAMC_MR_MODE_EXT_LOAD_MODEREG); - // *((uint8_t *)(psdram + SDRAM_BA0)) = 0; + /* putreg32(SDRAMC_MR_MODE_EXTLOADMODE, SDRAMC_MR_MODE_EXT_LOAD_MODEREG); + * *((uint8_t *)(psdram + SDRAM_BA0)) = 0; + */ /* 10. The application must go into Normal Mode, setting Mode to 0 in the * Mode Register and performing a write access at any location in the diff --git a/boards/arm/samv7/samv71-xult/src/sam_spi.c b/boards/arm/samv7/samv71-xult/src/sam_spi.c index 2f64a1109d8..7c792cd00d5 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_spi.c +++ b/boards/arm/samv7/samv71-xult/src/sam_spi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samv71-xult/src/sam_spi.c +/**************************************************************************** + * boards/arm/samv7/samv71-xult/src/sam_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 @@ -55,17 +55,17 @@ #ifdef CONFIG_SAMV7_SPI -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the SAMV71-XULT board. * - ************************************************************************************/ + ****************************************************************************/ void sam_spidev_initialize(void) { @@ -102,30 +102,33 @@ void sam_spidev_initialize(void) * Name: sam_spi[0|1]select, sam_spi[0|1]status, and sam_spi[0|1]cmddata * * Description: - * These external functions must be provided by board-specific logic. They - * include: + * These external functions must be provided by board-specific logic. + * They include: * - * o sam_spi[0|1]select is a functions tomanage the board-specific chip selects - * o sam_spi[0|1]status and sam_spi[0|1]cmddata: Implementations of the status - * and cmddata methods of the SPI interface defined by struct spi_ops_ - * (see include/nuttx/spi/spi.h). All other methods including - * sam_spibus_initialize()) are provided by common SAM3/4 logic. + * o sam_spi[0|1]select is a functions tomanage the board-specific chip + * selects + * o sam_spi[0|1]status and sam_spi[0|1]cmddata: Implementations of the + * status and cmddata methods of the SPI interface defined by struct + * spi_ops_ (see include/nuttx/spi/spi.h). + * All other methods including sam_spibus_initialize()) are + * provided by common SAM3/4 logic. * * To use this common SPI logic on your board: * * 1. Provide logic in sam_boardinitialize() to configure SPI chip select * pins. - * 2. Provide sam_spi[0|1]select() and sam_spi[0|1]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. + * 2. Provide sam_spi[0|1]select() and sam_spi[0|1]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. * 2. If CONFIG_SPI_CMDDATA is defined in the NuttX configuration, provide * sam_spi[0|1]cmddata() functions in your board-specific logic. This * function will perform cmd/data selection operations using GPIOs in * the way your board is configured. * 3. Add a call to sam_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by sam_spibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 4. The handle returned by sam_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). * @@ -159,12 +162,14 @@ void sam_spidev_initialize(void) #ifdef CONFIG_SAMV7_SPI0_MASTER void sam_spi0select(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"); switch (devid) { #ifdef CONFIG_IEEE802154_MRF24J40 case SPIDEV_IEEE802154(0): + /* Set the GPIO low to select and high to de-select */ #if defined(CONFIG_SAMV71XULT_MB1_BEE) @@ -184,7 +189,8 @@ void sam_spi0select(uint32_t devid, bool selected) #ifdef CONFIG_SAMV7_SPI1_MASTER void sam_spi1select(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"); } #endif diff --git a/boards/arm/samv7/samv71-xult/src/sam_usbdev.c b/boards/arm/samv7/samv71-xult/src/sam_usbdev.c index 93b586b26ae..4eae7629142 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_usbdev.c +++ b/boards/arm/samv7/samv71-xult/src/sam_usbdev.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samv71-xult/src/sam_usbdev.c +/**************************************************************************** + * boards/arm/samv7/samv71-xult/src/sam_usbdev.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 @@ -51,26 +51,26 @@ #include "sam_gpio.h" #include "samv71-xult.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_usbinitialize * * Description: - * Called from stm32_boardinitialize very early in initialization to setup USB- - * related GPIO pins for the SAMV71-XULT board. + * Called from stm32_boardinitialize very early in initialization to setup + * USB- related GPIO pins for the SAMV71-XULT board. * - ************************************************************************************/ + ****************************************************************************/ void sam_usbinitialize(void) { @@ -81,16 +81,17 @@ void sam_usbinitialize(void) sam_configgpio(GPIO_VBUSON); } -/************************************************************************************ +/**************************************************************************** * Name: sam_usbsuspend * * Description: * Board logic must provide the sam_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. + * 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 sam_usbsuspend(FAR struct usbdev_s *dev, bool resume) { diff --git a/boards/arm/samv7/samv71-xult/src/sam_usbmsc.c b/boards/arm/samv7/samv71-xult/src/sam_usbmsc.c index c46233ca1d7..d245065d49c 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_usbmsc.c +++ b/boards/arm/samv7/samv71-xult/src/sam_usbmsc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samv71-xult/src/sam_usbmsc.c + * boards/arm/samv7/samv71-xult/src/sam_usbmsc.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/samv71-xult/src/sam_userleds.c b/boards/arm/samv7/samv71-xult/src/sam_userleds.c index f262f06e6c4..d631a20a80a 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_userleds.c +++ b/boards/arm/samv7/samv71-xult/src/sam_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/samv71-xult/src/sam_userleds.c + * boards/arm/samv7/samv71-xult/src/sam_userleds.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/samv7/samv71-xult/src/sam_wm8904.c b/boards/arm/samv7/samv71-xult/src/sam_wm8904.c index a6c5f8d9857..b86d4c083c9 100644 --- a/boards/arm/samv7/samv71-xult/src/sam_wm8904.c +++ b/boards/arm/samv7/samv71-xult/src/sam_wm8904.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samv71-xult/src/sam_wm8904.c +/**************************************************************************** + * boards/arm/samv7/samv71-xult/src/sam_wm8904.c * * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ /**************************************************************************** * Included Files @@ -153,8 +153,9 @@ static int wm8904_attach(FAR const struct wm8904_lower_s *lower, { if (isr) { - /* Just save the address of the handler and its argument for now. The - * new handler will called via wm8904_interrupt() when the interrupt occurs. + /* Just save the address of the handler and its argument for now. + * The new handler will called via wm8904_interrupt() when the + * interrupt occurs. */ audinfo("Attaching %p\n", isr); @@ -288,7 +289,8 @@ int sam_wm8904_initialize(int minor) goto errout_with_i2c; } - /* Configure the DAC master clock. This clock is provided by PCK2 (PB10) + /* Configure the DAC master clock. + * This clock is provided by PCK2 (PB10) * that is connected to the WM8904 MCLK. */ @@ -355,7 +357,8 @@ int sam_wm8904_initialize(int minor) ret = audio_register(devname, pcm); if (ret < 0) { - auderr("ERROR: Failed to register /dev/%s device: %d\n", devname, ret); + auderr("ERROR: Failed to register /dev/%s device: %d\n", + devname, ret); goto errout_with_pcm; } diff --git a/boards/arm/samv7/samv71-xult/src/samv71-xult.h b/boards/arm/samv7/samv71-xult/src/samv71-xult.h index ac408843e09..d0a588125c5 100644 --- a/boards/arm/samv7/samv71-xult/src/samv71-xult.h +++ b/boards/arm/samv7/samv71-xult/src/samv71-xult.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/samv71-xult/src/samv71-xult.h +/**************************************************************************** + * boards/arm/samv7/samv71-xult/src/samv71-xult.h * * Copyright (C) 2015-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_SAMV71_XULT_SRC_SAMV71_XULT_H -#define __BOARDS_ARM_SAMV71_XULT_SRC_SAMV71_XULT_H +#ifndef __BOARDS_ARM_SAMV7_SAMV71_XULT_SRC_SAMV71_XULT_H +#define __BOARDS_ARM_SAMV7_SAMV71_XULT_SRC_SAMV71_XULT_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -48,10 +48,11 @@ #include #include -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ #define HAVE_HSMCI 1 #define HAVE_AUTOMOUNTER 1 @@ -75,6 +76,7 @@ #define HAVE_MRF24J40 1 /* HSMCI */ + /* Can't support MMC/SD if the card interface is not enabled */ #if !defined(CONFIG_SAMV7_HSMCI0) @@ -152,6 +154,7 @@ #endif /* HAVE_AUTOMOUNTER */ /* USB Device */ + /* CONFIG_SAMV7_UDP and CONFIG_USBDEV must be defined, or there is no USB * device. */ @@ -257,6 +260,7 @@ #define PROGMEM_MTD_MINOR 1 /* Audio */ + /* PCM/WM8904 driver */ #ifndef CONFIG_AUDIO_WM8904 @@ -398,7 +402,7 @@ # undef HAVE_MRF24J40 #endif -/* SAMV71-XULT GPIO Pin Definitions *************************************************/ +/* SAMV71-XULT GPIO Pin Definitions *****************************************/ /* Ethernet MAC. * @@ -473,8 +477,8 @@ * NOTES: * * - There are no pull-up resistors connected to the generic user buttons so - * it is necessary to enable the internal pull-up in the SAM V71 to use the - * button. + * it is necessary to enable the internal pull-up in the SAM V71 to use + * the button. * - PB12 is set up as a system flash ERASE pin when the firmware boots. To * use the SW1, PB12 has to be configured as a normal regular I/O pin in * the MATRIX module. For more information see the SAM V71 datasheet. @@ -514,16 +518,17 @@ /* USB Host * - * The SAM V71 Xplained Ultra has a Micro-USB connector for use with the SAM V71 - * USB module labeled as TARGET USB on the kit. In USB host mode VBUS voltage is - * provided by the kit and has to be enabled by setting the "VBUS Host Enable" - * pin (PC16) low. + * The SAM V71 Xplained Ultra has a Micro-USB connector for use with the SAM + * V71 USB module labeled as TARGET USB on the kit. In USB host mode VBUS + * voltage is provided by the kit and has to be enabled by setting the + * "VBUS Host Enable" pin (PC16) low. */ #define GPIO_VBUSON (GPIO_OUTPUT | GPIO_CFG_DEFAULT | GPIO_OUTPUT_SET | \ GPIO_PORT_PIOC | GPIO_PIN16) -/* WM8904 Audio Codec ***************************************************************/ +/* WM8904 Audio Codec *******************************************************/ + /* SAMV71 Interface WM8904 Interface * ---- ------------ ------- ---------------------------------- * GPIO Usage Pin Function @@ -621,37 +626,37 @@ #define EDBG_CSNO SPI0_CS2 -/************************************************************************************ +/**************************************************************************** * Public Types - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public data - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: sam_sdram_config * * Description: - * Configures the on-board SDRAM. SAMV71 Xplained Ultra features one external - * IS42S16100E-7BLI, 512Kx16x2, 10ns, SDRAM. SDRAM0 is connected to chip select - * NCS1. + * Configures the on-board SDRAM. SAMV71 Xplained Ultra features one + * external IS42S16100E-7BLI, 512Kx16x2, 10ns, SDRAM. SDRAM0 is connected + * to chip select NCS1. * * Input Parameters: * None * * Assumptions: - * The DDR memory regions is configured as strongly ordered memory. When we - * complete initialization of SDRAM and it is ready for use, we will make DRAM - * into normal memory. + * The DDR memory regions is configured as strongly ordered memory. + * When we complete initialization of SDRAM and it is ready for use, + * we will make DRAM into normal memory. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMV7_SDRAMC void sam_sdram_config(void); @@ -659,49 +664,49 @@ void sam_sdram_config(void); # define sam_sdram_config(t) #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_bringup * * Description: * Bring up board features * - ************************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_LIB_BOARDCTL) || defined(CONFIG_BOARD_LATE_INITIALIZE) int sam_bringup(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the SAMV71-XULT board. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMV7_SPI void sam_spidev_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_can_setup * * Description: * Initialize CAN and register the CAN device * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_SAMV7_MCAN int sam_can_setup(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_hsmci_initialize * * Description: * Initialize HSMCI support * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_HSMCI int sam_hsmci_initialize(int slot, int minor); @@ -709,51 +714,51 @@ int sam_hsmci_initialize(int slot, int minor); # define sam_hsmci_initialize(s,m) (-ENOSYS) #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_usbinitialize * * Description: - * Called from stm32_boardinitialize very early in initialization to setup USB- - * related GPIO pins for the SAMV71-XULT board. + * Called from stm32_boardinitialize very early in initialization to setup + * USB- related GPIO pins for the SAMV71-XULT board. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_USB void sam_usbinitialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_netinitialize * * Description: * Configure board resources to support networking. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_NETWORK void sam_netinitialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_emac0_setmac * * Description: - * Read the Ethernet MAC address from the AT24 FLASH and configure the Ethernet - * driver with that address. + * Read the Ethernet MAC address from the AT24 FLASH and configure the + * Ethernet driver with that address. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_MACADDR int sam_emac0_setmac(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_cardinserted * * Description: * Check if a card is inserted into the selected HSMCI slot * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_HSMCI bool sam_cardinserted(int slotno); @@ -761,19 +766,19 @@ bool sam_cardinserted(int slotno); # define sam_cardinserted(slotno) (false) #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_writeprotected * * Description: * Check if the card in the MMCSD slot is write protected * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_HSMCI bool sam_writeprotected(int slotno); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_automount_initialize * * Description: @@ -785,26 +790,27 @@ bool sam_writeprotected(int slotno); * Returned Value: * None * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUTOMOUNTER void sam_automount_initialize(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_automount_event * * Description: - * The HSMCI 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 HSMCI 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 HSMCI0 slot: HSMCI0 or HSMCI1_SLOTNO. There is a - * terminology problem here: Each HSMCI 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 HSMCI0 slot: HSMCI0 or HSMCI1_SLOTNO. There + * is a terminology problem here: + * Each HSMCI 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: @@ -813,19 +819,19 @@ void sam_automount_initialize(void); * Assumptions: * Interrupts are disabled. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUTOMOUNTER void sam_automount_event(int slotno, bool inserted); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_writeprotected * * Description: * Check if the card in the MMCSD slot is write protected * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_HSMCI bool sam_writeprotected(int slotno); @@ -833,62 +839,62 @@ bool sam_writeprotected(int slotno); # define sam_writeprotected(slotno) (false) #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_at24config * * Description: - * Create an AT24xx-based MTD configuration device for storage device configuration - * information. + * Create an AT24xx-based MTD configuration device for storage device + * configuration information. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_MTDCONFIG int sam_at24config(void); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_tsc_setup * * Description: - * This function is called by board-bringup logic to configure the touchscreen - * device. This function will register the driver as /dev/inputN where N is the - * minor device number. + * This function is called by board-bringup logic to configure the + * touchscreen device. This function will register the driver as + * /dev/inputN where N is the minor device number. * * Input Parameters: * minor - The input device minor number * * Returned Value: - * Zero is returned on success. Otherwise, a negated errno value is returned to - * indicate the nature of the failure. + * Zero is returned on success. Otherwise, a negated errno value is + * returned to indicate the nature of the failure. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_MAXTOUCH int sam_tsc_setup(int minor); #endif -/************************************************************************************ +/**************************************************************************** * Name: sam_wm8904_initialize * * Description: - * This function is called by platform-specific, setup logic to configure and - * register the WM8904 device. This function will register the driver as - * /dev/wm8904[x] where x is determined by the minor device number. + * This function is called by platform-specific, setup logic to configure + * and register the WM8904 device. This function will register the driver + * as /dev/wm8904[x] where x is determined by the minor device number. * * Input Parameters: * minor - The input device minor number * * Returned Value: - * Zero is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero is returned on success. Otherwise, a negated errno value is + * returned to indicate the nature of the failure. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_WM8904 int sam_wm8904_initialize(int minor); #endif /* HAVE_WM8904 */ -/************************************************************************************ +/**************************************************************************** * Name: sam_audio_null_initialize * * Description: @@ -898,30 +904,30 @@ int sam_wm8904_initialize(int minor); * minor - The input device minor number * * Returned Value: - * Zero is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero is returned on success. Otherwise, a negated errno value is + * returned to indicate the nature of the failure. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_AUDIO_NULL int sam_audio_null_initialize(int minor); #endif /* HAVE_AUDIO_NULL */ -/************************************************************************************ +/**************************************************************************** * Name: stm32_mrf24j40_initialize * * Description: * Initialize the MRF24J40 device. * * Returned Value: - * Zero is returned on success. Otherwise, a negated errno value is returned - * to indicate the nature of the failure. + * Zero is returned on success. Otherwise, a negated errno value is + * returned to indicate the nature of the failure. * - ************************************************************************************/ + ****************************************************************************/ #ifdef HAVE_MRF24J40 int sam_mrf24j40_initialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_SAMV71_XULT_SRC_SAMV71_XULT_H */ +#endif /* __BOARDS_ARM_SAMV7_SAMV71_XULT_SRC_SAMV71_XULT_H */ diff --git a/boards/arm/tiva/dk-tm4c129x/README.txt b/boards/arm/tiva/dk-tm4c129x/README.txt index f12aedd1cae..b64787c88e4 100644 --- a/boards/arm/tiva/dk-tm4c129x/README.txt +++ b/boards/arm/tiva/dk-tm4c129x/README.txt @@ -56,7 +56,7 @@ Using OpenOCD and GDB with ICDI I have been using the on-board In-Circuit Debug Interface (ICDI) interface. OpenOCD requires a configuration file. I keep the one I used last here: - boards/dk-tm4c129x/tools/dk-tm4c129x.cfg + boards/arm/tiva/dk-tm4c129x/tools/dk-tm4c129x.cfg However, the "correct" configuration script to use with OpenOCD may change as the features of OpenOCD evolve. So you should at least @@ -74,7 +74,7 @@ Using OpenOCD and GDB with ICDI - Possibly the value of OPENOCD_PATH and TARGET_PATH - It assumes that the correct script to use is the one at - boards/dk-tm4c129x/tools/dk-tm4c129x.cfg + boards/arm/tiva/dk-tm4c129x/tools/dk-tm4c129x.cfg Starting OpenOCD @@ -84,7 +84,7 @@ Using OpenOCD and GDB with ICDI oocd.sh $PWD Assuming that you have included the path to the oocd.sh script, - boards/dk-tm4c129x/tools, in PATH variable. + boards/arm/tiva/dk-tm4c129x/tools, in PATH variable. Note that OpenOCD needs to be run with administrator privileges in some environments (sudo). @@ -513,7 +513,7 @@ Temperature Sensor More complex temperature sensor operations are also available. See the IOCTL commands enumerated in include/nuttx/sensors/lm75.h. Also read the descriptions of the tiva_tmp100_initialize() and tiva_tmp100_attach() interfaces in the - arch/board/board.h file (sames as boards/dk-tm4c129x/include/board.h). + arch/board/board.h file (sames as boards/arm/tiva/dk-tm4c129x/include/board.h). NSH Command Line Application ---------------------------- diff --git a/boards/arm/tiva/dk-tm4c129x/include/board.h b/boards/arm/tiva/dk-tm4c129x/include/board.h index 93b3811f4e2..0c1605fa043 100644 --- a/boards/arm/tiva/dk-tm4c129x/include/board.h +++ b/boards/arm/tiva/dk-tm4c129x/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/dk-tm4c129x/include/board.h +/**************************************************************************** + * boards/arm/tiva/dk-tm4c129x/include/board.h * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,29 +31,29 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_DK_TM4C129X_INCLUDE_BOARD_H -#define __BOARDS_ARM_DK_TM4C129X_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_TIVA_DK_TM4C129X_INCLUDE_BOARD_H +#define __BOARDS_ARM_TIVA_DK_TM4C129X_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ # include #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ +/* Clocking *****************************************************************/ /* Crystals on-board the DK-TM4C129X include: * - * 1. 25.0MHz (Y2) is connected to OSC0/1 pins and is used as the run mode input to - * the PLL. + * 1. 25.0MHz (Y2) is connected to OSC0/1 pins and is used as the run mode + * input to the PLL. * 2. 32.768kHz (Y3) connected to XOSC0/1 and clocks the hibernation module. */ @@ -66,16 +66,17 @@ #define RTCOSC_FREQUENCY 32768 /* Hibernation Module RTC Oscillator */ #define LFIOSC_FREQUENCY 33000 /* Low frequency internal oscillator */ -/* The PLL generates Fvco according to the following formulae. The input clock to - * the PLL may be either the external crystal (Fxtal) or PIOSC (Fpiosc). This - * logic supports only the external crystal as the PLL source clock. +/* The PLL generates Fvco according to the following formulae. + * The input clock to the PLL may be either the external crystal + * (Fxtal) or PIOSC (Fpiosc). + * This logic supports only the external crystal as the PLL source clock. * * Fin = Fxtal / (Q + 1 )(N + 1) -OR- Fpiosc / (Q + 1)(N + 1) * Mdiv = Mint + (MFrac / 1024) * Fvco = Fin * Mdiv * - * Where the register fields Q and N actually hold (Q-1) and (N-1). The following - * setup then generates Fvco = 480MHz: + * Where the register fields Q and N actually hold (Q-1) and (N-1). + * The following setup then generates Fvco = 480MHz: * * Fin = 25 MHz / 1 / 5 = 5 MHz * Mdiv = 96 @@ -89,8 +90,8 @@ #define BOARD_FVCO_FREQUENCY 480000000 /* Resulting Fvco */ -/* When the PLL is active, the system clock frequency (SysClk) is calculated using - * the following equation: +/* When the PLL is active, the system clock frequency (SysClk) is + * calculated using the following equation: * * SysClk = Fvco / (sysdiv + 1) * @@ -109,20 +110,22 @@ /* Alternate Clock (ALTCLK) * - * The ALTCLK provides a clock source of numerous frequencies to the general-purpose - * timer, SSI, and UART modules. The default source for the ALTCLK is the Precision - * Internal Oscillator (PIOSC). The Hibernation Real-time Clock (RTCOSC) and Low - * Frequency Internal Oscillator (LFIOSC) are alternatives. If the RTCOSC Output is + * The ALTCLK provides a clock source of numerous frequencies to the + * general-purpose timer, SSI, and UART modules. + * The default source for the ALTCLK is the Precision Internal Oscillator + * (PIOSC). The Hibernation Real-time Clock (RTCOSC) and Low Frequency + * Internal Oscillator (LFIOSC) are alternatives. If the RTCOSC Output is * selected, the clock source must also be enabled in the Hibernation module. */ #define BOARD_ALTCLKCFG SYSCON_ALTCLKCFG_ALTCLK_PIOSC #define ALTCLK_FREQUENCY PIOSC_FREQUENCY -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* The DK-TM4C129X has a single RGB LED. There is only one visible LED which - * will vary in color. But, from the standpoint of the firmware, this appears as - * three LEDs: + * will vary in color. But, from the standpoint of the firmware, this + * appears as three LEDs: * * --- ------------ ----------------- * Pin Pin Function Jumper @@ -146,10 +149,11 @@ #define BOARD_LED_G_BIT (1 << BOARD_LED_G) #define BOARD_LED_B_BIT (1 << BOARD_LED_B) -/* If CONFIG_ARCH_LEDS is defined, then automated support for the DK-TM4C129X LED - * will be included in the build: +/* If CONFIG_ARCH_LEDS is defined, then automated support for the DK-TM4C129X + * LED will be included in the build: + * RED GREEN BLUE */ - /* RED GREEN BLUE */ + #define LED_STARTED 0 /* OFF OFF ON */ #define LED_HEAPALLOCATE 1 /* NC NC NC */ #define LED_IRQSENABLED 1 /* NC NC NC */ @@ -159,7 +163,8 @@ #define LED_ASSERTION 1 /* NC NC NC */ #define LED_PANIC 3 /* ON OFF OFF (flashing 2Hz) */ -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* There are three push buttons on the board. * * --- ------------ ----------------- @@ -180,12 +185,13 @@ #define BUTTON_SW3_BIT (1 << BUTTON_SW3) #define BUTTON_SW4_BIT (1 << BUTTON_SW4) -/* Pin Multiplexing Disambiguation **************************************************/ +/* Pin Multiplexing Disambiguation ******************************************/ + /* UARTs * * UART0: PA0-1 (fixed configuration) - * UART3: PJ0-1 to EM_TX/EM_RX or BOOSTER_PACK2_RX/BOOSTER_PACK2_TX(Depending - * on J12/J13) + * UART3: PJ0-1 to EM_TX/EM_RX or BOOSTER_PACK2_RX/BOOSTER_PACK2_TX + * (Depending on J12/J13) * UART5: PH6-7 to BOOSTER_PACK1_RX/BOOSTER_PACK1_TX */ @@ -197,8 +203,10 @@ /* SSI: * - * SSI0: PA2-5 are used for SSI0 to the second booster pack (fixed configuration) - * SSI3: PF0/PF4-5/PH4/PQ0-2 are used for the SPI flash (on-board and SD card). + * SSI0: PA2-5 are used for SSI0 to the second booster pack + * (fixed configuration) + * SSI3: PF0/PF4-5/PH4/PQ0-2 are used for the SPI flash + * (on-board and SD card). * PH4 selects the SD card and PQ1 selects the on-board SPI flash. */ @@ -227,7 +235,8 @@ /* USB: * - * PB0-1/PD6-7/PL6-7 are used for USB (Only PD6-7 are not fixed configuration) + * PB0-1/PD6-7/PL6-7 are used for USB + * (Only PD6-7 are not fixed configuration) */ #define GPIO_USB0_EPEN GPIO_USB0_EPEN_3 @@ -250,13 +259,13 @@ * PF6-7/PJ6/PS4-5/PR0-7 are used for the LCD (fixed configuration). */ -/************************************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Name: tiva_tmp100_initialize * * Description: @@ -268,11 +277,11 @@ * Returned Value: * Zero (OK) on success; a negated errno value on failure. * - ************************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_I2C) && defined(CONFIG_LM75_I2C) && defined(CONFIG_TIVA_I2C6) int tiva_tmp100_initialize(FAR const char *devpath); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_DK_TM4C129X_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_TIVA_DK_TM4C129X_INCLUDE_BOARD_H */ diff --git a/boards/arm/tiva/dk-tm4c129x/scripts/Make.defs b/boards/arm/tiva/dk-tm4c129x/scripts/Make.defs index b76ecf23f71..94b5270d22a 100644 --- a/boards/arm/tiva/dk-tm4c129x/scripts/Make.defs +++ b/boards/arm/tiva/dk-tm4c129x/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/dk-tm4c129x/scripts/Make.defs +# boards/arm/tiva/dk-tm4c129x/scripts/Make.defs # # Copyright (C) 2014, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/dk-tm4c129x/scripts/ld.script b/boards/arm/tiva/dk-tm4c129x/scripts/ld.script index 8b8ce1fbee6..6614c12082c 100644 --- a/boards/arm/tiva/dk-tm4c129x/scripts/ld.script +++ b/boards/arm/tiva/dk-tm4c129x/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/dk-tm4c129x/scripts/ld.script + * boards/arm/tiva/dk-tm4c129x/scripts/ld.script * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/dk-tm4c129x/src/Makefile b/boards/arm/tiva/dk-tm4c129x/src/Makefile index 2589dd69373..9dc665fc89c 100644 --- a/boards/arm/tiva/dk-tm4c129x/src/Makefile +++ b/boards/arm/tiva/dk-tm4c129x/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/dk-tm4c129x/src/Makefile +# boards/arm/tiva/dk-tm4c129x/src/Makefile # # Copyright (C) 2014 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/dk-tm4c129x/src/dk-tm4c129x.h b/boards/arm/tiva/dk-tm4c129x/src/dk-tm4c129x.h index 5a8c69d1463..0a9d123c776 100644 --- a/boards/arm/tiva/dk-tm4c129x/src/dk-tm4c129x.h +++ b/boards/arm/tiva/dk-tm4c129x/src/dk-tm4c129x.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/dk-tm4c129x/src/dk-tm4c129x.h +/**************************************************************************** + * boards/arm/tiva/dk-tm4c129x/src/dk-tm4c129x.h * * Copyright (C) 2014 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_DK_TM4C129X_DK_TM4C129X_H -#define __BOARDS_ARM_DK_TM4C129X_DK_TM4C129X_H +#ifndef __BOARDS_ARM_TIVA_DK_TM4C129X_DK_TM4C129X_H +#define __BOARDS_ARM_TIVA_DK_TM4C129X_DK_TM4C129X_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -46,10 +46,11 @@ #include "chip.h" #include "tiva_gpio.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ /* How many SSI modules does this chip support? */ @@ -67,9 +68,11 @@ # undef HAVE_I2CTOOL #endif -/* LED definitions ******************************************************************/ -/* The TMC4C123G LaunchPad has a single RGB LED. There is only one visible LED which - * will vary in color. But, from the standpoint of the firmware, this appears as +/* LED definitions **********************************************************/ + +/* The TMC4C123G LaunchPad has a single RGB LED. + * There is only one visible LED which will vary in color. + * But, from the standpoint of the firmware, this appears as * three LEDs: * * --- ------------ ----------------- @@ -87,7 +90,8 @@ #define GPIO_LED_G (GPIO_FUNC_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORTQ | GPIO_PIN_7) #define GPIO_LED_B (GPIO_FUNC_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORTQ | GPIO_PIN_4) -/* Button definitions ***************************************************************/ +/* Button definitions *******************************************************/ + /* There are three push buttons on the board. * * --- ------------ ----------------- @@ -98,7 +102,8 @@ * PE5 Down SW3 J37 pins 5 and 6 * --- ------------ ----------------- * - * Interrupts are supported only on port P and Q so only SW4 interrupts are supported. + * Interrupts are supported only on port P and Q so only SW4 interrupts are + * supported. */ #define GPIO_SW2 (GPIO_FUNC_INPUT | GPIO_PORTE | GPIO_PIN_5) @@ -107,11 +112,12 @@ #define IRQ_SW4 TIVA_IRQ_GPIOP_1 -/* SPI Chip selects ****************************************************************/ -/* SSI0: PA3 is used for SSI0 chip select to the second booster pack (No pull- -* ups) - * SSI3: PH4 selects the SD card and PQ1 selects the on-board SPI flash. Both - * pulled up on board. +/* SPI Chip selects *********************************************************/ + +/* SSI0: PA3 is used for SSI0 chip select to the second booster pack + * (No pull-ups) + * SSI3: PH4 selects the SD card and PQ1 selects the on-board SPI flash. + * Both pulled up on board. */ #define GPIO_BSTR2_CS (GPIO_FUNC_OUTPUT | GPIO_PADTYPE_STDWPU | GPIO_STRENGTH_4MA | \ @@ -121,7 +127,8 @@ #define GPIO_SD_CS (GPIO_FUNC_OUTPUT | GPIO_PADTYPE_STD | GPIO_STRENGTH_4MA | \ GPIO_VALUE_ONE | GPIO_PORTH | GPIO_PIN_4) -/* I2C *****************************************************************************/ +/* I2C **********************************************************************/ + /* I2C3: PG4-5 are provide to the BoostPack 1 interface * I2C7: PA4-5 are provide to the BoostPack 2 interface * I2C6: PB6-7 are used for I2C to the TMP100 and the EM connector. @@ -132,25 +139,27 @@ #define TMP100_I2CBUS 6 #define TMP100_I2CADDR 0x4a -/* Speaker outputs *****************************************************************/ +/* Speaker outputs **********************************************************/ + /* PB2/PD4 are used for the speaker output */ -/* Touchscreen *********************************************************************/ +/* Touchscreen **************************************************************/ + /* PE7/PP7/PT2-3 are used for the touch screen */ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Name: tm4c_ssidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the DK-TM4C129X. * - ************************************************************************************/ + ****************************************************************************/ void weak_function tm4c_ssidev_initialize(void); @@ -189,5 +198,4 @@ int tiva_timer_configure(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_DK_TM4C129X_DK_TM4C129X_H */ - +#endif /* __BOARDS_ARM_TIVA_DK_TM4C129X_DK_TM4C129X_H */ diff --git a/boards/arm/tiva/dk-tm4c129x/src/tm4c_appinit.c b/boards/arm/tiva/dk-tm4c129x/src/tm4c_appinit.c index bc77635ce71..56951442e5d 100644 --- a/boards/arm/tiva/dk-tm4c129x/src/tm4c_appinit.c +++ b/boards/arm/tiva/dk-tm4c129x/src/tm4c_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/dk-tm4c129x/src/tm4c_appinit.c + * boards/arm/tiva/dk-tm4c129x/src/tm4c_appinit.c * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/dk-tm4c129x/src/tm4c_autoleds.c b/boards/arm/tiva/dk-tm4c129x/src/tm4c_autoleds.c index 3e6c87cb116..fe22ad62d7c 100644 --- a/boards/arm/tiva/dk-tm4c129x/src/tm4c_autoleds.c +++ b/boards/arm/tiva/dk-tm4c129x/src/tm4c_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/dk-tm4c129x/src/tm4c_autoleds.c + * boards/arm/tiva/dk-tm4c129x/src/tm4c_autoleds.c * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -94,6 +94,7 @@ void board_autoled_on(int led) switch (led) { case 0: /* R=OFF, G=OFF, B=ON */ + /* Previous state was all OFF */ tiva_gpiowrite(GPIO_LED_B, true); @@ -104,6 +105,7 @@ void board_autoled_on(int led) break; case 2: /* R=OFF, G=ON, B=OFF */ + /* Previous state was all: R=OFF, G=OFF, B=ON */ tiva_gpiowrite(GPIO_LED_G, true); @@ -111,6 +113,7 @@ void board_autoled_on(int led) break; case 3: /* R=ON, G=OFF, B=OFF */ + /* Previous state was all: R=OFF, G=Unknown, B=Unknown */ tiva_gpiowrite(GPIO_LED_R, true); @@ -151,6 +154,7 @@ void board_autoled_off(int led) break; case 3: /* R=OFF, G=OFF, B=OFF */ + /* Previous state was all: R=ON, G=OFF, B=OFF */ tiva_gpiowrite(GPIO_LED_R, false); diff --git a/boards/arm/tiva/dk-tm4c129x/src/tm4c_boot.c b/boards/arm/tiva/dk-tm4c129x/src/tm4c_boot.c index 2e44c1d2cba..0dd76730115 100644 --- a/boards/arm/tiva/dk-tm4c129x/src/tm4c_boot.c +++ b/boards/arm/tiva/dk-tm4c129x/src/tm4c_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/dk-tm4c129x/src/tm4c_boot.c +/**************************************************************************** + * boards/arm/tiva/dk-tm4c129x/src/tm4c_boot.c * * Copyright (C) 2014 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 @@ -48,31 +48,33 @@ #include "up_internal.h" #include "dk-tm4c129x.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tiva_boardinitialize * * Description: - * All Tiva 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 Tiva 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 tiva_boardinitialize(void) { - /* Configure SPI chip selects if 1) SSI is not disabled, and 2) the weak function + /* Configure SPI chip selects if + * 1) SSI is not disabled, and 2) the weak function * tm4c_ssidev_initialize() has been brought into the link. */ diff --git a/boards/arm/tiva/dk-tm4c129x/src/tm4c_bringup.c b/boards/arm/tiva/dk-tm4c129x/src/tm4c_bringup.c index b938dd74c5a..6ec8fb94f4a 100644 --- a/boards/arm/tiva/dk-tm4c129x/src/tm4c_bringup.c +++ b/boards/arm/tiva/dk-tm4c129x/src/tm4c_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/dk-tm4c129x/src/tm4c_bringup.c + * boards/arm/tiva/dk-tm4c129x/src/tm4c_bringup.c * * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/dk-tm4c129x/src/tm4c_buttons.c b/boards/arm/tiva/dk-tm4c129x/src/tm4c_buttons.c index f9a37d0cdab..4397baba24d 100644 --- a/boards/arm/tiva/dk-tm4c129x/src/tm4c_buttons.c +++ b/boards/arm/tiva/dk-tm4c129x/src/tm4c_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/dk-tm4c/src/tm4c_buttons.c + * boards/arm/tiva/dk-tm4c/src/tm4c_buttons.c * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -59,6 +59,7 @@ /**************************************************************************** * Private Data ****************************************************************************/ + /* Pin configuration for each STM3210E-EVAL button. This array is indexed by * the BUTTON_* and JOYSTICK_* definitions in board.h */ @@ -127,27 +128,29 @@ uint32_t board_buttons(void) return ret; } -/************************************************************************************ +/**************************************************************************** * Button support. * * Description: - * board_button_initialize() must be called to initialize button resources. After - * that, board_buttons() may be called to collect the current state of all - * buttons or board_button_irq() may be called to register button interrupt - * handlers. + * board_button_initialize() must be called to initialize button resources. + * After that, board_buttons() may be called to collect the current state + * of all buttons or board_button_irq() may be called to register button + * interrupt handlers. * - * After board_button_initialize() has been called, board_buttons() may be called to - * collect the state of all buttons. board_buttons() returns an 32-bit bit set - * with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT - * definitions in board.h for the meaning of each bit. + * After board_button_initialize() has been called, board_buttons() may be + * called to collect the state of all buttons. + * board_buttons() returns an 32-bit bit set with each bit associated with + * a button. + * See the BUTTON_*_BIT and JOYSTICK_*_BIT definitions in board.h for the + * meaning of each bit. * - * board_button_irq() may be called to register an interrupt handler that will - * be called when a button is depressed or released. The ID value is a - * button enumeration value that uniquely identifies a button resource. See the - * BUTTON_* and JOYSTICK_* definitions in board.h for the meaning of enumeration - * value. + * board_button_irq() may be called to register an interrupt handler that + * will be called when a button is depressed or released. The ID value is + * a button enumeration value that uniquely identifies a button resource. + * See the BUTTON_* and JOYSTICK_* definitions in board.h for the meaning + * of enumeration value. * - ************************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_ARCH_IRQBUTTONS) && defined(CONFIG_TIVA_GPIOP_IRQS) int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) diff --git a/boards/arm/tiva/dk-tm4c129x/src/tm4c_ethernet.c b/boards/arm/tiva/dk-tm4c129x/src/tm4c_ethernet.c index 72c2fbef9a7..a769deae4ed 100644 --- a/boards/arm/tiva/dk-tm4c129x/src/tm4c_ethernet.c +++ b/boards/arm/tiva/dk-tm4c129x/src/tm4c_ethernet.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/dk-tm4c129x/src/tm4c_ethernet.c +/**************************************************************************** + * boards/arm/tiva/dk-tm4c129x/src/tm4c_ethernet.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -51,27 +51,28 @@ #include "hardware/tiva_flash.h" #include "tiva_ethernet.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tiva_ethernetmac * * Description: - * For the Ethernet Eval Kits, the MAC address will be stored in the non-volatile - * USER0 and USER1 registers. If CONFIG_TIVA_BOARDMAC is defined, this function - * will obtain the MAC address from these registers. + * For the Ethernet Eval Kits, the MAC address will be stored in the + * non-volatile USER0 and USER1 registers. + * If CONFIG_TIVA_BOARDMAC is defined, this function will obtain the MAC + * address from these registers. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_TIVA_BOARDMAC void tiva_ethernetmac(struct ether_addr *ethaddr) diff --git a/boards/arm/tiva/dk-tm4c129x/src/tm4c_ssi.c b/boards/arm/tiva/dk-tm4c129x/src/tm4c_ssi.c index 8fdb0d75815..324e049d47e 100644 --- a/boards/arm/tiva/dk-tm4c129x/src/tm4c_ssi.c +++ b/boards/arm/tiva/dk-tm4c129x/src/tm4c_ssi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/dk-tm4c129x/src/tm4c_ssi.c +/**************************************************************************** + * boards/arm/tiva/dk-tm4c129x/src/tm4c_ssi.c * * Copyright (C) 2014 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,9 +55,9 @@ #if defined(CONFIG_TIVA_SSI0) || defined(CONFIG_TIVA_SSI1) -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* Enables debug output from this file */ @@ -67,17 +67,17 @@ # define ssi_dumpgpio(m) #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tm4c_ssidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the DK-TM4C129X. * - ************************************************************************************/ + ****************************************************************************/ void weak_function tm4c_ssidev_initialize(void) { @@ -86,17 +86,19 @@ void weak_function tm4c_ssidev_initialize(void) /**************************************************************************** * The external functions, tiva_ssiselect and tiva_ssistatus must be provided * by board-specific logic. The are implementations of the select and status - * methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). - * All othermethods (including tiva_ssibus_initialize()) are provided by common - * logic. To use this common SPI logic on your board: + * methods SPI interface defined by struct spi_ops_s + * (see include/nuttx/spi/spi.h). + * All othermethods (including tiva_ssibus_initialize()) are provided by + * common logic. + * To use this common SPI logic on your board: * * 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your * board-specific logic. This function will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 2. Add a call to tiva_ssibus_initialize() in your low level initialization - * logic - * 3. The handle returned by tiva_ssibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 2. Add a call to tiva_ssibus_initialize() in your low level + * initialization logic + * 3. The handle returned by tiva_ssibus_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). * @@ -104,7 +106,8 @@ void weak_function tm4c_ssidev_initialize(void) void tiva_ssiselect(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"); ssi_dumpgpio("tiva_ssiselect() Entry"); ssi_dumpgpio("tiva_ssiselect() Exit"); } diff --git a/boards/arm/tiva/dk-tm4c129x/src/tm4c_timer.c b/boards/arm/tiva/dk-tm4c129x/src/tm4c_timer.c index f3317810885..0099ef6a931 100644 --- a/boards/arm/tiva/dk-tm4c129x/src/tm4c_timer.c +++ b/boards/arm/tiva/dk-tm4c129x/src/tm4c_timer.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/dk-tm4c129x/src/tm4c_timer.c + * boards/arm/tiva/dk-tm4c129x/src/tm4c_timer.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -49,6 +49,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifndef CONFIG_TIMER @@ -102,7 +103,8 @@ int tiva_timer_configure(void) { int ret; - tmrinfo("Registering TIMER%d at %s\n", GPTM, CONFIG_DK_TM4C129X_TIMER_DEVNAME); + tmrinfo("Registering TIMER%d at %s\n", GPTM, + CONFIG_DK_TM4C129X_TIMER_DEVNAME); ret = tiva_timer_register(CONFIG_DK_TM4C129X_TIMER_DEVNAME, GPTM, ALTCLK); if (ret < 0) diff --git a/boards/arm/tiva/dk-tm4c129x/src/tm4c_tmp100.c b/boards/arm/tiva/dk-tm4c129x/src/tm4c_tmp100.c index 09e3eb20d72..a4a53373e1b 100644 --- a/boards/arm/tiva/dk-tm4c129x/src/tm4c_tmp100.c +++ b/boards/arm/tiva/dk-tm4c129x/src/tm4c_tmp100.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/dk-tm4c129x/src/tiva_tmp100.c + * boards/arm/tiva/dk-tm4c129x/src/tiva_tmp100.c * * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/dk-tm4c129x/src/tm4c_userleds.c b/boards/arm/tiva/dk-tm4c129x/src/tm4c_userleds.c index 4d5da44da62..b37270667f7 100644 --- a/boards/arm/tiva/dk-tm4c129x/src/tm4c_userleds.c +++ b/boards/arm/tiva/dk-tm4c129x/src/tm4c_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/dk-tm4c129x/src/tm4c_userleds.c + * boards/arm/tiva/dk-tm4c129x/src/tm4c_userleds.c * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/dk-tm4c129x/tools/oocd.sh b/boards/arm/tiva/dk-tm4c129x/tools/oocd.sh index 7590ba9c55f..2cbc9abd64c 100755 --- a/boards/arm/tiva/dk-tm4c129x/tools/oocd.sh +++ b/boards/arm/tiva/dk-tm4c129x/tools/oocd.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# See boards/dk-tm4c129x/README.txt for information about +# See boards/arm/tiva/dk-tm4c129x/README.txt for information about # this file. TOPDIR=$1 @@ -28,7 +28,7 @@ TARGET_PATH="/usr/share/openocd/scripts" # OPENOCD_EXE=openocd.exe OPENOCD_EXE=openocd -OPENOCD_CFG="${TOPDIR}/boards/dk-tm4c129x/tools/dk-tm4c129x.cfg" +OPENOCD_CFG="${TOPDIR}/boards/arm/tiva/dk-tm4c129x/tools/dk-tm4c129x.cfg" OPENOCD_ARGS="-f ${OPENOCD_CFG} -s ${TARGET_PATH}" if [ "X$2" = "X-d" ]; then diff --git a/boards/arm/tiva/eagle100/include/board.h b/boards/arm/tiva/eagle100/include/board.h index ec26237a68d..1b84252d6ba 100644 --- a/boards/arm/tiva/eagle100/include/board.h +++ b/boards/arm/tiva/eagle100/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/eagle100/include/board.h +/**************************************************************************** + * boards/arm/tiva/eagle100/include/board.h * include/arch/board/board.h * * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. @@ -32,28 +32,29 @@ * 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_TIVA_EAGLE100_INCLUDE_BOARD_H +#define __BOARDS_ARM_TIVA_EAGLE100_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ +/* Clocking *****************************************************************/ /* RCC settings */ #define SYSCON_RCC_XTAL SYSCON_RCC_XTAL8000KHZ /* Eagle100 on-board crystall is 8.00 MHz */ #define XTAL_FREQUENCY 8000000 -/* Oscillator source is the main oscillator (not internal, internal/4, 30KHz or - * 30KHz from hibernate module) */ +/* Oscillator source is the main oscillator (not internal, internal/4, + * 30KHz or 30KHz from hibernate module) + */ #define SYSCON_RCC_OSCSRC SYSCON_RCC_OSCSRC_MOSC #define SYSCON_RCC2_OSCSRC SYSCON_RCC2_OSCSRC2_MOSC @@ -92,17 +93,21 @@ #define TIVA_RCC2_VALUE (SYSCON_RCC2_OSCSRC | SYSCON_RCC2_SYSDIV(TIVA_SYSDIV)) -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ -/* The Eagle-100 has only one user LED: Port E, Bit 1. Below is the mapping of this - * single LED. From this single LED, we can get the following information: +/* The Eagle-100 has only one user LED: Port E, Bit 1. Below is the mapping + * of this single LED. + * From this single LED, we can get the following information: * - * OFF Steady: The system has failed to boot to the point of enabling interrupts - * ON Steady: The systems has enabled interrupts, but none have been received + * OFF Steady: The system has failed to boot to the point of + * enabling interrupts + * ON Steady: The systems has enabled interrupts, + * but none have been received * Dull glow: The system is taking interrupts * Slow blinking: The system has panicked + * ON OFF */ - /* ON OFF */ + #define LED_STARTED 0 /* OFF OFF */ #define LED_HEAPALLOCATE 1 /* OFF OFF */ #define LED_IRQSENABLED 2 /* ON ON */ @@ -112,4 +117,4 @@ #define LED_ASSERTION 6 /* ON OFF */ #define LED_PANIC 7 /* ON OFF */ -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __BOARDS_ARM_TIVA_EAGLE100_INCLUDE_BOARD_H */ diff --git a/boards/arm/tiva/eagle100/scripts/Make.defs b/boards/arm/tiva/eagle100/scripts/Make.defs index 10126426696..35b6eef2b3a 100644 --- a/boards/arm/tiva/eagle100/scripts/Make.defs +++ b/boards/arm/tiva/eagle100/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/eagle100/scripts/Make.defs +# boards/arm/tiva/eagle100/scripts/Make.defs # # Copyright (C) 2009, 2014, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/eagle100/scripts/ld.script b/boards/arm/tiva/eagle100/scripts/ld.script index 6f72c4b7d6d..b4c64742048 100644 --- a/boards/arm/tiva/eagle100/scripts/ld.script +++ b/boards/arm/tiva/eagle100/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/eagle100/scripts/ld.script + * boards/arm/tiva/eagle100/scripts/ld.script * * Copyright (C) 2009, 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/eagle100/src/Makefile b/boards/arm/tiva/eagle100/src/Makefile index 2012c7815d9..385a0d39e00 100644 --- a/boards/arm/tiva/eagle100/src/Makefile +++ b/boards/arm/tiva/eagle100/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/eagle100/src/Makefile +# boards/arm/tiva/eagle100/src/Makefile # # Copyright (C) 2009 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/eagle100/src/eagle100.h b/boards/arm/tiva/eagle100/src/eagle100.h index 9db02fa2852..ac641b5463b 100644 --- a/boards/arm/tiva/eagle100/src/eagle100.h +++ b/boards/arm/tiva/eagle100/src/eagle100.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/eagle100/src/eagle100.h +/**************************************************************************** + * boards/arm/tiva/eagle100/src/eagle100.h * * Copyright (C) 2009-2010 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_EAGLE100_SRC_EAGLE100_H -#define __BOARDS_ARM_EAGLE100_SRC_EAGLE100_H +#ifndef __BOARDS_ARM_TIVA_EAGLE100_SRC_EAGLE100_H +#define __BOARDS_ARM_TIVA_EAGLE100_SRC_EAGLE100_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -46,9 +46,9 @@ #include "chip.h" #include "tiva_gpio.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* How many SSI modules does this chip support? The LM3S6918 supports 2 SSI * modules (others may support more -- in such case, the following must be @@ -70,22 +70,21 @@ GPIO_VALUE_ONE | GPIO_PORTG | 1) #define LED_GPIO (GPIO_FUNC_OUTPUT | GPIO_VALUE_ONE | GPIO_PORTE | 1) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Name: lm_ssidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the Eagle100 board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lm_ssidev_initialize(void); #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_EAGLE100_SRC_EAGLE100_H */ - +#endif /* __BOARDS_ARM_TIVA_EAGLE100_SRC_EAGLE100_H */ diff --git a/boards/arm/tiva/eagle100/src/lm_appinit.c b/boards/arm/tiva/eagle100/src/lm_appinit.c index b62fce3f24d..37ec1aae833 100644 --- a/boards/arm/tiva/eagle100/src/lm_appinit.c +++ b/boards/arm/tiva/eagle100/src/lm_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/eagle100/src/lm_appinit.c + * boards/arm/tiva/eagle100/src/lm_appinit.c * * Copyright (C) 2009, 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -146,10 +146,12 @@ int board_app_initialize(uintptr_t arg) syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n", CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); - ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi); + ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, + CONFIG_NSH_MMCSDSLOTNO, spi); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", + syslog(LOG_ERR, + "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret); return ret; } diff --git a/boards/arm/tiva/eagle100/src/lm_boot.c b/boards/arm/tiva/eagle100/src/lm_boot.c index 174ec59d8a9..9e5aa49bbb6 100644 --- a/boards/arm/tiva/eagle100/src/lm_boot.c +++ b/boards/arm/tiva/eagle100/src/lm_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/eagle100/src/lm_boot.c +/**************************************************************************** + * boards/arm/tiva/eagle100/src/lm_boot.c * * Copyright (C) 2009-2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -47,35 +47,38 @@ #include "up_arch.h" #include "eagle100.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tiva_boardinitialize * * Description: - * All Stellaris architectures must provide the following entry point. This entry - * point is called early in the intitialization -- after all memory has been - * configured and mapped but before any devices have been initialized. + * All Stellaris architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void tiva_boardinitialize(void) { - /* Configure SPI chip selects if 1) SSI is not disabled, and 2) the weak function + /* Configure SPI chip selects if + * 1) SSI is not disabled, and + * 2) the weak function * lm_ssidev_initialize() has been brought into the link. */ -/* The Eagle100 microSD CS is on SSI0 */ + /* The Eagle100 microSD CS is on SSI0 */ #if defined(CONFIG_TIVA_SSI0) /* || defined(CONFIG_TIVA_SSI1) */ if (lm_ssidev_initialize) diff --git a/boards/arm/tiva/eagle100/src/lm_ethernet.c b/boards/arm/tiva/eagle100/src/lm_ethernet.c index 4f9a202d58d..36754f359b7 100644 --- a/boards/arm/tiva/eagle100/src/lm_ethernet.c +++ b/boards/arm/tiva/eagle100/src/lm_ethernet.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/eagle100/src/lm_ethernet.c +/**************************************************************************** + * boards/arm/tiva/eagle100/src/lm_ethernet.c * * Copyright (C) 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -50,27 +50,28 @@ #include "chip.h" #include "tiva_ethernet.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tiva_ethernetmac * * Description: - * For the Ethernet Eval Kits, the MAC address will be stored in the non-volatile - * USER0 and USER1 registers. If CONFIG_TIVA_BOARDMAC is defined, this function - * will obtain the MAC address from these registers. + * For the Ethernet Eval Kits, the MAC address will be stored in the + * non-volatile USER0 and USER1 registers. + * If CONFIG_TIVA_BOARDMAC is defined, this function will obtain the + * MAC address from these registers. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_TIVA_BOARDMAC void tiva_ethernetmac(struct ether_addr *ethaddr) diff --git a/boards/arm/tiva/eagle100/src/lm_leds.c b/boards/arm/tiva/eagle100/src/lm_leds.c index f58795a8166..5ecc5492a12 100644 --- a/boards/arm/tiva/eagle100/src/lm_leds.c +++ b/boards/arm/tiva/eagle100/src/lm_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/eagle100/src/lm_leds.c + * boards/arm/tiva/eagle100/src/lm_leds.c * * Copyright (C) 2009-2010, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/eagle100/src/lm_ssi.c b/boards/arm/tiva/eagle100/src/lm_ssi.c index 6597a4b6ff1..4f86716ee98 100644 --- a/boards/arm/tiva/eagle100/src/lm_ssi.c +++ b/boards/arm/tiva/eagle100/src/lm_ssi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/eagle100/src/lm_ssi.c +/**************************************************************************** + * boards/arm/tiva/eagle100/src/lm_ssi.c * * Copyright (C) 2009-2010 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,9 +55,9 @@ #if defined(CONFIG_TIVA_SSI0) /* || defined(CONFIG_TIVA_SSI1) */ -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* CONFIG_DEBUG_SPI enables debug output from this file */ @@ -67,17 +67,17 @@ # define ssi_dumpgpio(m) #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lm_ssidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the Eagle100 board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lm_ssidev_initialize(void) { @@ -91,17 +91,19 @@ void weak_function lm_ssidev_initialize(void) /**************************************************************************** * The external functions, tiva_ssiselect and tiva_ssistatus must be provided * by board-specific logic. The are implementations of the select and status - * methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). - * All othermethods (including tiva_ssibus_initialize()) are provided by common - * logic. To use this common SPI logic on your board: + * methods SPI interface defined by struct spi_ops_s + * (see include/nuttx/spi/spi.h). + * All othermethods (including tiva_ssibus_initialize()) are provided by + * common logic. + * To use this common SPI logic on your board: * * 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your * board-specific logic. This function will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 2. Add a call to tiva_ssibus_initialize() in your low level initialization - * logic - * 3. The handle returned by tiva_ssibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 2. Add a call to tiva_ssibus_initialize() in your low level + * initialization logic + * 3. The handle returned by tiva_ssibus_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). * @@ -109,7 +111,8 @@ void weak_function lm_ssidev_initialize(void) void tiva_ssiselect(FAR struct spi_dev_s *dev, uint32_t devid, bool selected) { - spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); + spiinfo("devid: %d CS: %s\n", (int)devid, + selected ? "assert" : "de-assert"); if (devid == SPIDEV_MMCSD(0)) { /* Assert the CS pin to the card */ diff --git a/boards/arm/tiva/ekk-lm3s9b96/include/board.h b/boards/arm/tiva/ekk-lm3s9b96/include/board.h index 76fdcfeca44..d1a4e3ec419 100644 --- a/boards/arm/tiva/ekk-lm3s9b96/include/board.h +++ b/boards/arm/tiva/ekk-lm3s9b96/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ekk-lm3s9b96/include/board.h +/**************************************************************************** + * boards/arm/tiva/ekk-lm3s9b96/include/board.h * include/arch/board/board.h * * Copyright (C) 2012 Gregory Nutt. All rights reserved. @@ -33,28 +33,29 @@ * 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_TIVA_EKK_LM3S9B96_INCLUDE_BOARD_H +#define __BOARDS_ARM_TIVA_EKK_LM3S9B96_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ +/* Clocking *****************************************************************/ /* RCC settings */ #define SYSCON_RCC_XTAL SYSCON_RCC_XTAL16000KHZ /* 16.000 MHz crystal */ #define XTAL_FREQUENCY 16000000 -/* Oscillator source is the main oscillator (not internal, internal/4, 30KHz or - * 30KHz from hibernate module) */ +/* Oscillator source is the main oscillator (not internal, internal/4, + * 30KHz or 30KHz from hibernate module) + */ #define SYSCON_RCC_OSCSRC SYSCON_RCC_OSCSRC_MOSC #define SYSCON_RCC2_OSCSRC SYSCON_RCC2_OSCSRC2_MOSC @@ -93,17 +94,21 @@ #define TIVA_RCC2_VALUE (SYSCON_RCC2_OSCSRC | SYSCON_RCC2_SYSDIV(TIVA_SYSDIV)) -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ -/* The EKK-LMS39B96 Eval Kit has only one user LED: Port D, Bit 0. Below is the mapping of this - * single LED. From this single LED, we can get the following information: +/* The EKK-LMS39B96 Eval Kit has only one user LED: Port D, Bit 0. + * Below is the mapping of this single LED. + * From this single LED, we can get the following information: * - * OFF Steady: The system has failed to boot to the point of enabling interrupts - * ON Steady: The systems has enabled interrupts, but none have been received + * OFF Steady: The system has failed to boot to the point of + * enabling interrupts + * ON Steady: The systems has enabled interrupts, + * but none have been received * Dull glow: The system is taking interrupts * Slow blinking: The system has panicked + * ON OFF */ - /* ON OFF */ + #define LED_STARTED 0 /* OFF OFF */ #define LED_HEAPALLOCATE 1 /* OFF OFF */ #define LED_IRQSENABLED 2 /* ON ON */ @@ -113,4 +118,4 @@ #define LED_ASSERTION 6 /* ON OFF */ #define LED_PANIC 7 /* ON OFF */ -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __BOARDS_ARM_TIVA_EKK_LM3S9B96_INCLUDE_BOARD_H */ diff --git a/boards/arm/tiva/ekk-lm3s9b96/scripts/Make.defs b/boards/arm/tiva/ekk-lm3s9b96/scripts/Make.defs index ad092060ce5..834fdfcba4d 100644 --- a/boards/arm/tiva/ekk-lm3s9b96/scripts/Make.defs +++ b/boards/arm/tiva/ekk-lm3s9b96/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/ekk-lm3s9b96/scripts/Make.defs +# boards/arm/tiva/ekk-lm3s9b96/scripts/Make.defs # # Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved. # Authors: Gregory Nutt diff --git a/boards/arm/tiva/ekk-lm3s9b96/scripts/ekk-lm3s9b96.ld b/boards/arm/tiva/ekk-lm3s9b96/scripts/ekk-lm3s9b96.ld index b9095e0fad4..df6d07615e6 100644 --- a/boards/arm/tiva/ekk-lm3s9b96/scripts/ekk-lm3s9b96.ld +++ b/boards/arm/tiva/ekk-lm3s9b96/scripts/ekk-lm3s9b96.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/ekk-lm3s9b96/ostest/ekk-lm3s9b96.ld + * boards/arm/tiva/ekk-lm3s9b96/ostest/ekk-lm3s9b96.ld * * Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt diff --git a/boards/arm/tiva/ekk-lm3s9b96/src/Makefile b/boards/arm/tiva/ekk-lm3s9b96/src/Makefile index 5abaae924e0..8e233046451 100644 --- a/boards/arm/tiva/ekk-lm3s9b96/src/Makefile +++ b/boards/arm/tiva/ekk-lm3s9b96/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/ekk-lm3s9b96/src/Makefile +# boards/arm/tiva/ekk-lm3s9b96/src/Makefile # # Copyright (C) 2012 Gregory Nutt. All rights reserved. # Authors: Gregory Nutt diff --git a/boards/arm/tiva/ekk-lm3s9b96/src/ekk-lm3s9b96.h b/boards/arm/tiva/ekk-lm3s9b96/src/ekk-lm3s9b96.h index c57f4bc843a..f5de72661c3 100644 --- a/boards/arm/tiva/ekk-lm3s9b96/src/ekk-lm3s9b96.h +++ b/boards/arm/tiva/ekk-lm3s9b96/src/ekk-lm3s9b96.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ekk-lm3s9b96/src/ekk-lm3s9b96.h +/**************************************************************************** + * boards/arm/tiva/ekk-lm3s9b96/src/ekk-lm3s9b96.h * * Copyright (C) 2012 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_EKK_LM3S9B96_SRC_EKKLM3S9B96_H -#define __BOARDS_ARM_EKK_LM3S9B96_SRC_EKKLM3S9B96_H +#ifndef __BOARDS_ARM_TIVA_EKK_LM3S9B96_SRC_EKKLM3S9B96_H +#define __BOARDS_ARM_TIVA_EKK_LM3S9B96_SRC_EKKLM3S9B96_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -47,13 +47,13 @@ #include "chip.h" #include "tiva_gpio.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* How many SSI modules does this chip support? The LM3S9B96 supports 2 SSI - * modules (others may support more than 2 -- in such case, the following must be - * expanded). + * modules (others may support more than 2 -- in such case, the following must + * be expanded). */ #if TIVA_NSSI == 0 @@ -91,22 +91,21 @@ #define LED_GPIO (GPIO_FUNC_OUTPUT | GPIO_VALUE_ONE | GPIO_PORTD | 0) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Name: lm_ssidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the LM3S6965 Eval Kit. * - ************************************************************************************/ + ****************************************************************************/ extern void weak_function lm_ssidev_initialize(void); #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_EKK_LM3S9B96_SRC_EKKLM3S9B96_H */ - +#endif /* __BOARDS_ARM_TIVA_EKK_LM3S9B96_SRC_EKKLM3S9B96_H */ diff --git a/boards/arm/tiva/ekk-lm3s9b96/src/lm_appinit.c b/boards/arm/tiva/ekk-lm3s9b96/src/lm_appinit.c index f7136cdd8a1..bf69ed0c071 100644 --- a/boards/arm/tiva/ekk-lm3s9b96/src/lm_appinit.c +++ b/boards/arm/tiva/ekk-lm3s9b96/src/lm_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/ekk-lm3s9b96/src/lm_appinit.c + * boards/arm/tiva/ekk-lm3s9b96/src/lm_appinit.c * * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt diff --git a/boards/arm/tiva/ekk-lm3s9b96/src/lm_boot.c b/boards/arm/tiva/ekk-lm3s9b96/src/lm_boot.c index 17cf1f9c1c7..34dc87f2ad3 100644 --- a/boards/arm/tiva/ekk-lm3s9b96/src/lm_boot.c +++ b/boards/arm/tiva/ekk-lm3s9b96/src/lm_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ekk-lm3s9b96/src/lm_boot.c +/**************************************************************************** + * boards/arm/tiva/ekk-lm3s9b96/src/lm_boot.c * * Copyright (C) 2012, 2015 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 @@ -49,32 +49,35 @@ #include "up_internal.h" #include "ekk-lm3s9b96.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tiva_boardinitialize * * Description: - * All Stellaris architectures must provide the following entry point. This entry - * point is called early in the intitialization -- after all memory has been - * configured and mapped but before any devices have been initialized. + * All Stellaris architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void tiva_boardinitialize(void) { - /* Configure chip selects if 1) SSI is not disabled, and 2) the weak function - * lm_ssidev_initialize() has been brought into the link. + /* Configure chip selects if + * 1) SSI is not disabled, and + * 2) the weak function lm_ssidev_initialize() has been brought into the + * link. */ #if defined(CONFIG_TIVA_SSI0) || defined(CONFIG_TIVA_SSI1) diff --git a/boards/arm/tiva/ekk-lm3s9b96/src/lm_ethernet.c b/boards/arm/tiva/ekk-lm3s9b96/src/lm_ethernet.c index 8e977bed6f0..ef9fe65b3c8 100644 --- a/boards/arm/tiva/ekk-lm3s9b96/src/lm_ethernet.c +++ b/boards/arm/tiva/ekk-lm3s9b96/src/lm_ethernet.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm3s6965-ek/src/lm_ethernet.c +/**************************************************************************** + * boards/arm/tiva/ekk-lm3s9b96/src/lm_ethernet.c * * Copyright (C) 2012 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 @@ -51,27 +51,28 @@ #include "chip.h" #include "tiva_ethernet.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tiva_ethernetmac * * Description: - * For the Ethernet Eval Kits, the MAC address will be stored in the non-volatile - * USER0 and USER1 registers. If CONFIG_TIVA_BOARDMAC is defined, this function - * will obtain the MAC address from these registers. + * For the Ethernet Eval Kits, the MAC address will be stored in the + * non-volatile USER0 and USER1 registers. + * If CONFIG_TIVA_BOARDMAC is defined, this function will obtain + * the MAC address from these registers. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_TIVA_BOARDMAC void tiva_ethernetmac(struct ether_addr *ethaddr) diff --git a/boards/arm/tiva/ekk-lm3s9b96/src/lm_leds.c b/boards/arm/tiva/ekk-lm3s9b96/src/lm_leds.c index 4de0573fd8c..9872ad0ce7a 100644 --- a/boards/arm/tiva/ekk-lm3s9b96/src/lm_leds.c +++ b/boards/arm/tiva/ekk-lm3s9b96/src/lm_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lm3s6965-ek/src/lm_leds.c + * boards/arm/tiva/ekk-lm3s9b96/src/lm_leds.c * * Copyright (C) 2012-2013, 2015 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt diff --git a/boards/arm/tiva/ekk-lm3s9b96/src/lm_ssi.c b/boards/arm/tiva/ekk-lm3s9b96/src/lm_ssi.c index 505863ced06..a740fff2ede 100644 --- a/boards/arm/tiva/ekk-lm3s9b96/src/lm_ssi.c +++ b/boards/arm/tiva/ekk-lm3s9b96/src/lm_ssi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/ekk-lm3s9b96/src/lm_ssi.c +/**************************************************************************** + * boards/arm/tiva/ekk-lm3s9b96/src/lm_ssi.c * * Copyright (C) 2012 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 @@ #if defined(CONFIG_TIVA_SSI0) || defined(CONFIG_TIVA_SSI1) -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* CONFIG_DEBUG_SPI enables debug output from this file */ @@ -66,21 +66,22 @@ # define ssi_dumpgpio(m) #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lm_ssidev_initialize * * Description: * Called to configure chip select GPIO pins for the LM3S9B96 Eval board. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lm_ssidev_initialize(void) { /* Configure the CS GPIO */ + #if 0 ssi_dumpgpio("lm_ssidev_initialize() Entry"); ssi_dumpgpio("lm_ssidev_initialize() Exit"); @@ -91,17 +92,18 @@ void weak_function lm_ssidev_initialize(void) /**************************************************************************** * The external functions, tiva_ssiselect and tiva_ssistatus must be provided * by board-specific logic. The are implementations of the select and status - * methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). - * All othermethods (including tiva_ssibus_initialize()) are provided by common - * logic. To use this common SPI logic on your board: + * methods SPI interface defined by struct spi_ops_s + * (see include/nuttx/spi/spi.h). + * All othermethods (including tiva_ssibus_initialize()) are provided by + * common logic. To use this common SPI logic on your board: * * 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your * board-specific logic. This function will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 2. Add a call to tiva_ssibus_initialize() in your low level initialization - * logic - * 3. The handle returned by tiva_ssibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 2. Add a call to tiva_ssibus_initialize() in your low level + * initialization logic + * 3. The handle returned by tiva_ssibus_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). * @@ -109,7 +111,8 @@ void weak_function lm_ssidev_initialize(void) void tiva_ssiselect(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"); ssi_dumpgpio("tiva_ssiselect() Entry"); if (devid == SPIDEV_MMCSD(0)) { diff --git a/boards/arm/tiva/launchxl-cc1310/include/board.h b/boards/arm/tiva/launchxl-cc1310/include/board.h index a79bf50a390..dbfcfae4db9 100644 --- a/boards/arm/tiva/launchxl-cc1310/include/board.h +++ b/boards/arm/tiva/launchxl-cc1310/include/board.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1310/include/board.h + * boards/arm/tiva/launchxl-cc1310/include/board.h * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_LAUNCH_CC1310_INCLUDE_BOARD_H -#define __BOARDS_ARM_LAUNCH_CC1310_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_TIVA_LAUNCH_CC1310_INCLUDE_BOARD_H +#define __BOARDS_ARM_TIVA_LAUNCH_CC1310_INCLUDE_BOARD_H /**************************************************************************** * Included Files @@ -86,7 +86,8 @@ * * ------------------- ---------------------------- ---- ---- * SYMBOL Meaning GLED RLED - * ------------------- ---------------------------- ---- ---- */ + * ------------------- ---------------------------- ---- ---- + */ #define LED_STARTED 0 /* NuttX has been started OFF OFF */ #define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF ON */ @@ -148,4 +149,4 @@ extern const struct cc13xx_pinconfig_s g_gpio_uart0_rx; extern const struct cc13xx_pinconfig_s g_gpio_uart0_tx; #endif -#endif /* __BOARDS_ARM_NUCLEO_F303ZE_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_TIVA_LAUNCH_CC1310_INCLUDE_BOARD_H */ diff --git a/boards/arm/tiva/launchxl-cc1310/scripts/Make.defs b/boards/arm/tiva/launchxl-cc1310/scripts/Make.defs index 2e94d0b8636..118523ba3cf 100644 --- a/boards/arm/tiva/launchxl-cc1310/scripts/Make.defs +++ b/boards/arm/tiva/launchxl-cc1310/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/launchxl-cc1310/scripts/Make.defs +# boards/arm/tiva/launchxl-cc1310/scripts/Make.defs # # Copyright (C) 2019 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1310/scripts/flash.ld b/boards/arm/tiva/launchxl-cc1310/scripts/flash.ld index b7600fdf491..ac96c9b9576 100644 --- a/boards/arm/tiva/launchxl-cc1310/scripts/flash.ld +++ b/boards/arm/tiva/launchxl-cc1310/scripts/flash.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1310/scripts/flash.ld + * boards/arm/tiva/launchxl-cc1310/scripts/flash.ld * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1310/src/Makefile b/boards/arm/tiva/launchxl-cc1310/src/Makefile index d84f37b56b4..3e20bbb5c58 100644 --- a/boards/arm/tiva/launchxl-cc1310/src/Makefile +++ b/boards/arm/tiva/launchxl-cc1310/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/launchxl-cc1310/src/Makefile +# boards/arm/tiva/launchxl-cc1310/src/Makefile # # Copyright (C) 2019 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1310/src/cc1310_appinit.c b/boards/arm/tiva/launchxl-cc1310/src/cc1310_appinit.c index 8a3e2c5ca27..9c4efe671f9 100644 --- a/boards/arm/tiva/launchxl-cc1310/src/cc1310_appinit.c +++ b/boards/arm/tiva/launchxl-cc1310/src/cc1310_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/launchxl-cc1310/src/cc1310_appinit.c + * boards/arm/tiva/launchxl-cc1310/src/cc1310_appinit.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1310/src/cc1310_autoleds.c b/boards/arm/tiva/launchxl-cc1310/src/cc1310_autoleds.c index 023862600e8..a0b1f2f3f52 100644 --- a/boards/arm/tiva/launchxl-cc1310/src/cc1310_autoleds.c +++ b/boards/arm/tiva/launchxl-cc1310/src/cc1310_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1310/src/cc1310_autoleds.c + * boards/arm/tiva/launchxl-cc1310/src/cc1310_autoleds.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1310/src/cc1310_boot.c b/boards/arm/tiva/launchxl-cc1310/src/cc1310_boot.c index b7379351356..55ca2f7421d 100644 --- a/boards/arm/tiva/launchxl-cc1310/src/cc1310_boot.c +++ b/boards/arm/tiva/launchxl-cc1310/src/cc1310_boot.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1310/src/cc1310_boot.c + * boards/arm/tiva/launchxl-cc1310/src/cc1310_boot.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -83,6 +83,7 @@ void tiva_boardinitialize(void) #endif /* TODO: Initialize antenna switch */ + /* TODO: Shutdown external FLASH */ } diff --git a/boards/arm/tiva/launchxl-cc1310/src/cc1310_bringup.c b/boards/arm/tiva/launchxl-cc1310/src/cc1310_bringup.c index 10a11a515fa..db2e72dcc8e 100644 --- a/boards/arm/tiva/launchxl-cc1310/src/cc1310_bringup.c +++ b/boards/arm/tiva/launchxl-cc1310/src/cc1310_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/launchxl-cc1310/src/cc1310_bringup.c + * boards/arm/tiva/launchxl-cc1310/src/cc1310_bringup.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -62,7 +62,8 @@ * If CONFIG_BOARD_LATE_INITIALIZE=y, then this function will be called from * board_late_initialize(). * - * If CONFIG_BOARD_LATE_INITIALIZE is not selected, but CONFIG_LIB_BOARDCTL=y + * If CONFIG_BOARD_LATE_INITIALIZE is not selected, + * but CONFIG_LIB_BOARDCTL=y * then this function will *probably* be called from application logic via * boardctl(). * diff --git a/boards/arm/tiva/launchxl-cc1310/src/cc1310_buttons.c b/boards/arm/tiva/launchxl-cc1310/src/cc1310_buttons.c index bff1d132afc..334ea2c6e62 100644 --- a/boards/arm/tiva/launchxl-cc1310/src/cc1310_buttons.c +++ b/boards/arm/tiva/launchxl-cc1310/src/cc1310_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1310/src/cc1310_buttons.c + * boards/arm/tiva/launchxl-cc1310/src/cc1310_buttons.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1310/src/cc1310_pinconfig.c b/boards/arm/tiva/launchxl-cc1310/src/cc1310_pinconfig.c index 75d6583e388..e622d322679 100644 --- a/boards/arm/tiva/launchxl-cc1310/src/cc1310_pinconfig.c +++ b/boards/arm/tiva/launchxl-cc1310/src/cc1310_pinconfig.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1310/src/cc1310_userleds.c + * boards/arm/tiva/launchxl-cc1310/src/cc1310_userleds.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1310/src/cc1310_ssi.c b/boards/arm/tiva/launchxl-cc1310/src/cc1310_ssi.c index 5d19cdaa47c..53da216a3de 100644 --- a/boards/arm/tiva/launchxl-cc1310/src/cc1310_ssi.c +++ b/boards/arm/tiva/launchxl-cc1310/src/cc1310_ssi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/launchxl-cc1310/src/cc1310_ssi.c +/**************************************************************************** + * boards/arm/tiva/launchxl-cc1310/src/cc1310_ssi.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -54,9 +54,9 @@ #ifdef CONFIG_TIVA_SSI -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* Enables debug output from this file */ @@ -66,17 +66,17 @@ # define ssi_dumpgpio(m) #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: cc1310_ssidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the DK-TM4C129X. * - ************************************************************************************/ + ****************************************************************************/ void cc1310_ssidev_initialize(void) { @@ -85,15 +85,16 @@ void cc1310_ssidev_initialize(void) /**************************************************************************** * The external functions, tiva_ssiselect and tiva_ssistatus must be provided * by board-specific logic. The are implementations of the select and status - * methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). - * All othermethods (including tiva_ssibus_initialize()) are provided by common - * logic. To use this common SPI logic on your board: + * methods SPI interface defined by struct spi_ops_s + * (see include/nuttx/spi/spi.h). + * All othermethods (including tiva_ssibus_initialize()) are provided by + * common logic. To use this common SPI logic on your board: * * 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your * board-specific logic. This function will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 2. Add a call to tiva_ssibus_initialize() in your low level initialization - * logic + * 2. Add a call to tiva_ssibus_initialize() in your low level + * initialization logic * 3. The handle returned by tiva_ssibus_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 @@ -103,7 +104,8 @@ void cc1310_ssidev_initialize(void) void tiva_ssiselect(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"); ssi_dumpgpio("tiva_ssiselect() Entry"); ssi_dumpgpio("tiva_ssiselect() Exit"); } diff --git a/boards/arm/tiva/launchxl-cc1310/src/cc1310_userleds.c b/boards/arm/tiva/launchxl-cc1310/src/cc1310_userleds.c index 7dea79e47a3..92c62b63471 100644 --- a/boards/arm/tiva/launchxl-cc1310/src/cc1310_userleds.c +++ b/boards/arm/tiva/launchxl-cc1310/src/cc1310_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1310/src/cc1310_userleds.c + * boards/arm/tiva/launchxl-cc1310/src/cc1310_userleds.c * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1310/src/launchxl-cc1310.h b/boards/arm/tiva/launchxl-cc1310/src/launchxl-cc1310.h index dd516f67464..388f9959235 100644 --- a/boards/arm/tiva/launchxl-cc1310/src/launchxl-cc1310.h +++ b/boards/arm/tiva/launchxl-cc1310/src/launchxl-cc1310.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1310/src/launchxl-cc1310.h + * boards/arm/tiva/launchxl-cc1310/src/launchxl-cc1310.h * * Copyright (C) 2019 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_LAUNCH_CC1310_SRC_LAUNCH_CC1310_H -#define __BOARDS_ARM_LAUNCH_CC1310_SRC_LAUNCH_CC1310_H +#ifndef __BOARDS_ARM_TIVA_LAUNCH_CC1310_SRC_LAUNCH_CC1310_H +#define __BOARDS_ARM_TIVA_LAUNCH_CC1310_SRC_LAUNCH_CC1310_H /**************************************************************************** * Included Files @@ -93,7 +93,8 @@ extern const struct cc13xx_pinconfig_s g_gpio_sw2; * If CONFIG_BOARD_LATE_INITIALIZE=y, then this function will be called from * board_late_initialize(). * - * If CONFIG_BOARD_LATE_INITIALIZE is not selected, but CONFIG_LIB_BOARDCTL=y + * If CONFIG_BOARD_LATE_INITIALIZE is not selected, + * but CONFIG_LIB_BOARDCTL=y * then this function will *probably* be called from application logic via * boardctl(). * @@ -104,16 +105,17 @@ extern const struct cc13xx_pinconfig_s g_gpio_sw2; int cc1310_bringup(void); -/************************************************************************************ +/**************************************************************************** * Name: cc1310_ssidev_initialize * * Description: - * Called to configure SSI chip select GPIO pins for the LAUNCHXL-CC1310 board. + * Called to configure SSI chip select GPIO pins for the LAUNCHXL-CC1310 + * board. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_TIVA_SSI void cc1310_ssidev_initialize(void); #endif -#endif /* __BOARDS_ARM_NUCLEO_F303ZE_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_TIVA_LAUNCH_CC1310_SRC_LAUNCH_CC1310_H */ diff --git a/boards/arm/tiva/launchxl-cc1312r1/include/board.h b/boards/arm/tiva/launchxl-cc1312r1/include/board.h index 777cd0dab17..37fc51415da 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/include/board.h +++ b/boards/arm/tiva/launchxl-cc1312r1/include/board.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1312r1/include/board.h + * boards/arm/tiva/launchxl-cc1312r1/include/board.h * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_LAUNCHXL_CC1312R1_INCLUDE_BOARD_H -#define __BOARDS_ARM_LAUNCHXL_CC1312R1_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_TIVA_LAUNCHXL_CC1312R1_INCLUDE_BOARD_H +#define __BOARDS_ARM_TIVA_LAUNCHXL_CC1312R1_INCLUDE_BOARD_H /**************************************************************************** * Included Files @@ -86,7 +86,8 @@ * * ------------------- ---------------------------- ---- ---- * SYMBOL Meaning GLED RLED - * ------------------- ---------------------------- ---- ---- */ + * ------------------- ---------------------------- ---- ---- + */ #define LED_STARTED 0 /* NuttX has been started OFF OFF */ #define LED_HEAPALLOCATE 1 /* Heap has been allocated OFF ON */ @@ -148,4 +149,4 @@ extern const struct cc13xx_pinconfig_s g_gpio_uart0_rx; extern const struct cc13xx_pinconfig_s g_gpio_uart0_tx; #endif -#endif /* __BOARDS_ARM_NUCLEO_F303ZE_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_TIVA_LAUNCHXL_CC1312R1_INCLUDE_BOARD_H */ diff --git a/boards/arm/tiva/launchxl-cc1312r1/scripts/Make.defs b/boards/arm/tiva/launchxl-cc1312r1/scripts/Make.defs index 1fd1f7f59c1..2117868381f 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/scripts/Make.defs +++ b/boards/arm/tiva/launchxl-cc1312r1/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/launchxl-cc1312r1/scripts/Make.defs +# boards/arm/tiva/launchxl-cc1312r1/scripts/Make.defs # # Copyright (C) 2018 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1312r1/scripts/flash.ld b/boards/arm/tiva/launchxl-cc1312r1/scripts/flash.ld index ed090e031d6..f02c26cd2e6 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/scripts/flash.ld +++ b/boards/arm/tiva/launchxl-cc1312r1/scripts/flash.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1312r1/scripts/flash.ld + * boards/arm/tiva/launchxl-cc1312r1/scripts/flash.ld * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1312r1/scripts/sram.ld b/boards/arm/tiva/launchxl-cc1312r1/scripts/sram.ld index 8ab46ed4b6b..15ea9bf7c99 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/scripts/sram.ld +++ b/boards/arm/tiva/launchxl-cc1312r1/scripts/sram.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1312r1/scripts/sram.ld + * boards/arm/tiva/launchxl-cc1312r1/scripts/sram.ld * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1312r1/src/Makefile b/boards/arm/tiva/launchxl-cc1312r1/src/Makefile index 3c625dea625..0047a72a39e 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/src/Makefile +++ b/boards/arm/tiva/launchxl-cc1312r1/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/launchxl-cc1312r1/src/Makefile +# boards/arm/tiva/launchxl-cc1312r1/src/Makefile # # Copyright (C) 2018 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_appinit.c b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_appinit.c index 919b838ff94..f01dfa1c7fe 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_appinit.c +++ b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/launchxl-cc1312r1/src/cc1312_appinit.c + * boards/arm/tiva/launchxl-cc1312r1/src/cc1312_appinit.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_autoleds.c b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_autoleds.c index 7e25a36f09e..680a1c6b807 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_autoleds.c +++ b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1312r1/src/cc1312_autoleds.c + * boards/arm/tiva/launchxl-cc1312r1/src/cc1312_autoleds.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_boot.c b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_boot.c index 844fa6fc9d5..5627e6d422a 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_boot.c +++ b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_boot.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1312r1/src/cc1312_boot.c + * boards/arm/tiva/launchxl-cc1312r1/src/cc1312_boot.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -83,6 +83,7 @@ void tiva_boardinitialize(void) #endif /* TODO: Initialize antenna switch */ + /* TODO: Shutdown external FLASH */ } diff --git a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_bringup.c b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_bringup.c index 55cc4f0e812..e9f2eaadea6 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_bringup.c +++ b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/launchxl-cc1312r1/src/cc1312_bringup.c + * boards/arm/tiva/launchxl-cc1312r1/src/cc1312_bringup.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -62,7 +62,8 @@ * If CONFIG_BOARD_LATE_INITIALIZE=y, then this function will be called from * board_late_initialize(). * - * If CONFIG_BOARD_LATE_INITIALIZE is not selected, but CONFIG_LIB_BOARDCTL=y + * If CONFIG_BOARD_LATE_INITIALIZE is not selected, + * but CONFIG_LIB_BOARDCTL=y * then this function will *probably* be called from application logic via * boardctl(). * diff --git a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_buttons.c b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_buttons.c index 7528983aa17..56f34677bcb 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_buttons.c +++ b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1312r1/src/cc1312_buttons.c + * boards/arm/tiva/launchxl-cc1312r1/src/cc1312_buttons.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_pinconfig.c b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_pinconfig.c index 799e3ecc2b2..367ee8de5b2 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_pinconfig.c +++ b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_pinconfig.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1312r1/src/cc1312_userleds.c + * boards/arm/tiva/launchxl-cc1312r1/src/cc1312_userleds.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_ssi.c b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_ssi.c index b4a61dbe8bc..f10884cd0c5 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_ssi.c +++ b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_ssi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/launchxl-cc1312r1/src/cc1312_ssi.c +/**************************************************************************** + * boards/arm/tiva/launchxl-cc1312r1/src/cc1312_ssi.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,9 +54,9 @@ #ifdef CONFIG_TIVA_SSI -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* Enables debug output from this file */ @@ -66,17 +66,17 @@ # define ssi_dumpgpio(m) #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: cc1312_ssidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the DK-TM4C129X. * - ************************************************************************************/ + ****************************************************************************/ void cc1312_ssidev_initialize(void) { @@ -85,15 +85,16 @@ void cc1312_ssidev_initialize(void) /**************************************************************************** * The external functions, tiva_ssiselect and tiva_ssistatus must be provided * by board-specific logic. The are implementations of the select and status - * methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). - * All othermethods (including tiva_ssibus_initialize()) are provided by common - * logic. To use this common SPI logic on your board: + * methods SPI interface defined by struct spi_ops_s + * (see include/nuttx/spi/spi.h). + * All othermethods (including tiva_ssibus_initialize()) are provided by + * common logic. To use this common SPI logic on your board: * * 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your * board-specific logic. This function will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 2. Add a call to tiva_ssibus_initialize() in your low level initialization - * logic + * 2. Add a call to tiva_ssibus_initialize() in your low level + * initialization logic * 3. The handle returned by tiva_ssibus_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 @@ -103,7 +104,8 @@ void cc1312_ssidev_initialize(void) void tiva_ssiselect(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"); ssi_dumpgpio("tiva_ssiselect() Entry"); ssi_dumpgpio("tiva_ssiselect() Exit"); } diff --git a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_userleds.c b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_userleds.c index 687b76d3d2c..315b377d332 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_userleds.c +++ b/boards/arm/tiva/launchxl-cc1312r1/src/cc1312_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1312r1/src/cc1312_userleds.c + * boards/arm/tiva/launchxl-cc1312r1/src/cc1312_userleds.c * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/launchxl-cc1312r1/src/launchxl-cc1312r1.h b/boards/arm/tiva/launchxl-cc1312r1/src/launchxl-cc1312r1.h index 86925f88686..f09be492a67 100644 --- a/boards/arm/tiva/launchxl-cc1312r1/src/launchxl-cc1312r1.h +++ b/boards/arm/tiva/launchxl-cc1312r1/src/launchxl-cc1312r1.h @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/launchxl-cc1312r1/src/launchxl-cc1312r1.h + * boards/arm/tiva/launchxl-cc1312r1/src/launchxl-cc1312r1.h * * Copyright (C) 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __BOARDS_ARM_LAUNCHXL_CC1312R1_SRC_LAUNCHXL_CC1312R1_H -#define __BOARDS_ARM_LAUNCHXL_CC1312R1_SRC_LAUNCHXL_CC1312R1_H +#ifndef __BOARDS_ARM_TIVA_LAUNCHXL_CC1312R1_SRC_LAUNCHXL_CC1312R1_H +#define __BOARDS_ARM__TIVA_LAUNCHXL_CC1312R1_SRC_LAUNCHXL_CC1312R1_H /**************************************************************************** * Included Files @@ -93,7 +93,8 @@ extern const struct cc13xx_pinconfig_s g_gpio_sw2; * If CONFIG_BOARD_LATE_INITIALIZE=y, then this function will be called from * board_late_initialize(). * - * If CONFIG_BOARD_LATE_INITIALIZE is not selected, but CONFIG_LIB_BOARDCTL=y + * If CONFIG_BOARD_LATE_INITIALIZE is not selected, + * but CONFIG_LIB_BOARDCTL=y * then this function will *probably* be called from application logic via * boardctl(). * @@ -104,16 +105,17 @@ extern const struct cc13xx_pinconfig_s g_gpio_sw2; int cc1312_bringup(void); -/************************************************************************************ +/**************************************************************************** * Name: cc1312_ssidev_initialize * * Description: - * Called to configure SSI chip select GPIO pins for the LAUNCHXL-CC1312R1 board. + * Called to configure SSI chip select GPIO pins for the LAUNCHXL-CC1312R1 + * board. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_TIVA_SSI void cc1312_ssidev_initialize(void); #endif -#endif /* __BOARDS_ARM_NUCLEO_F303ZE_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_TIVA_LAUNCHXL_CC1312R1_SRC_LAUNCHXL_CC1312R1_H */ diff --git a/boards/arm/tiva/lm3s6432-s2e/include/board.h b/boards/arm/tiva/lm3s6432-s2e/include/board.h index 153e1cd762e..58bd4a2cdf6 100644 --- a/boards/arm/tiva/lm3s6432-s2e/include/board.h +++ b/boards/arm/tiva/lm3s6432-s2e/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm3s6432-s2e/include/board.h +/**************************************************************************** + * boards/arm/tiva/lm3s6432-s2e/include/board.h * include/arch/board/board.h * * Copyright (C) 2010 Gregory Nutt. All rights reserved. @@ -32,28 +32,29 @@ * 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_TIVA_LM3S6432_S2E_INCLUDE_BOARD_H +#define __BOARDS_ARM_TIVA_LM3S6432_S2E_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ +/* Clocking *****************************************************************/ /* RCC settings */ #define SYSCON_RCC_XTAL SYSCON_RCC_XTAL8000KHZ /* S2E on-board crystal is 8.00 MHz */ #define XTAL_FREQUENCY 8000000 -/* Oscillator source is the main oscillator (not internal, internal/4, 30KHz or - * 30KHz from hibernate module) */ +/* Oscillator source is the main oscillator (not internal, internal/4, + * 30KHz or 30KHz from hibernate module) + */ #define SYSCON_RCC_OSCSRC SYSCON_RCC_OSCSRC_MOSC #define SYSCON_RCC2_OSCSRC SYSCON_RCC2_OSCSRC2_MOSC @@ -92,19 +93,23 @@ #define TIVA_RCC2_VALUE (SYSCON_RCC2_OSCSRC | SYSCON_RCC2_SYSDIV(TIVA_SYSDIV)) -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ /* The S2E has two LEDs on PF2/PF3, shared with the Ethernet. - * In keeping with the other lm3s6xxx port, we use one of these for debugging. - * Below is the mapping of this - * single LED. From this single LED, we can get the following information: + * In keeping with the other lm3s6xxx port, we use one of these for + * debugging. + * Below is the mapping of this single LED. + * From this single LED, we can get the following information: * - * OFF Steady: The system has failed to boot to the point of enabling interrupts - * ON Steady: The systems has enabled interrupts, but none have been received + * OFF Steady: The system has failed to boot to the point of + * enabling interrupts + * ON Steady: The systems has enabled interrupts, + * but none have been received * Dull glow: The system is taking interrupts * Slow blinking: The system has panicked + * ON OFF */ - /* ON OFF */ + #define LED_STARTED 0 /* OFF OFF */ #define LED_HEAPALLOCATE 1 /* OFF OFF */ #define LED_IRQSENABLED 2 /* ON ON */ @@ -114,4 +119,4 @@ #define LED_ASSERTION 6 /* ON OFF */ #define LED_PANIC 7 /* ON OFF */ -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __BOARDS_ARM_TIVA_LM3S6432_S2E_INCLUDE_BOARD_H */ diff --git a/boards/arm/tiva/lm3s6432-s2e/scripts/Make.defs b/boards/arm/tiva/lm3s6432-s2e/scripts/Make.defs index 1a7ffa5cd14..08b2b50485f 100644 --- a/boards/arm/tiva/lm3s6432-s2e/scripts/Make.defs +++ b/boards/arm/tiva/lm3s6432-s2e/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/lm3s6432-s2e/scripts/Make.defs +# boards/arm/tiva/lm3s6432-s2e/scripts/Make.defs # # Copyright (C) 2010, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/lm3s6432-s2e/scripts/lm3s6432-s2e.ld b/boards/arm/tiva/lm3s6432-s2e/scripts/lm3s6432-s2e.ld index 4b5435d2a88..f8f90e1f26c 100644 --- a/boards/arm/tiva/lm3s6432-s2e/scripts/lm3s6432-s2e.ld +++ b/boards/arm/tiva/lm3s6432-s2e/scripts/lm3s6432-s2e.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lm3s6432-s2e/scripts/lm3s6432-s2e.ld + * boards/arm/tiva/lm3s6432-s2e/scripts/lm3s6432-s2e.ld * * Copyright (C) 2010, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/lm3s6432-s2e/src/Makefile b/boards/arm/tiva/lm3s6432-s2e/src/Makefile index 40005da4469..5d71823dd00 100644 --- a/boards/arm/tiva/lm3s6432-s2e/src/Makefile +++ b/boards/arm/tiva/lm3s6432-s2e/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lm3s6432-s2e/src/Makefile +# boards/arm/tiva/lm3s6432-s2e/src/Makefile # # Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/lm3s6432-s2e/src/lm3s6432-s2e.h b/boards/arm/tiva/lm3s6432-s2e/src/lm3s6432-s2e.h index ea44eb31ec7..37635331535 100644 --- a/boards/arm/tiva/lm3s6432-s2e/src/lm3s6432-s2e.h +++ b/boards/arm/tiva/lm3s6432-s2e/src/lm3s6432-s2e.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm3s6432-s2e/src/lm3s6432-s2e.h +/**************************************************************************** + * boards/arm/tiva/lm3s6432-s2e/src/lm3s6432-s2e.h * * Copyright (C) 2010 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_LM3S6432_S2E_SRC_LM3S6432S2E_H -#define __BOARDS_ARM_LM3S6432_S2E_SRC_LM3S6432S2E_H +#ifndef __BOARDS_ARM_TIVA_LM3S6432_S2E_SRC_LM3S6432S2E_H +#define __BOARDS_ARM_TIVA_LM3S6432_S2E_SRC_LM3S6432S2E_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -46,12 +46,13 @@ #include "chip.h" #include "tiva_gpio.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* How many SSI modules does this chip support? The LM3S6432 supports 1 SSI - * module (others may support more than 2 -- in such case, the following must be +/* How many SSI modules does this chip support? + * The LM3S6432 supports 1 SSI module + * (others may support more than 2 -- in such case, the following must be * expanded). */ @@ -60,7 +61,7 @@ #endif #undef CONFIG_TIVA_SSI1 -/* LM3S6432 MDL-S2E *****************************************************************/ +/* LM3S6432 MDL-S2E *********************************************************/ /* GPIO Usage * @@ -103,22 +104,21 @@ #define XCVR_ON_GPIO (GPIO_FUNC_OUTPUT | GPIO_VALUE_ONE | GPIO_PORTB | 4) #define XCVR_OFF_GPIO (GPIO_FUNC_OUTPUT | GPIO_VALUE_ONE | GPIO_PORTB | 5) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Name: lm_ssidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the MDL-S2E. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lm_ssidev_initialize(void); #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_LM3S6432_S2E_SRC_LM3S6432S2E_H */ - +#endif /* __BOARDS_ARM_TIVA_LM3S6432_S2E_SRC_LM3S6432S2E_H */ diff --git a/boards/arm/tiva/lm3s6432-s2e/src/lm_appinit.c b/boards/arm/tiva/lm3s6432-s2e/src/lm_appinit.c index c7fffb64d98..630be42e729 100644 --- a/boards/arm/tiva/lm3s6432-s2e/src/lm_appinit.c +++ b/boards/arm/tiva/lm3s6432-s2e/src/lm_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lm3s6432-s2e/src/lm_appinit.c + * boards/arm/tiva/lm3s6432-s2e/src/lm_appinit.c * * Copyright (C) 2010, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/lm3s6432-s2e/src/lm_boot.c b/boards/arm/tiva/lm3s6432-s2e/src/lm_boot.c index 4d4f2024cba..1c49eb0ea4b 100644 --- a/boards/arm/tiva/lm3s6432-s2e/src/lm_boot.c +++ b/boards/arm/tiva/lm3s6432-s2e/src/lm_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm3s6432-s2e/src/lm_boot.c +/**************************************************************************** + * boards/arm/tiva/lm3s6432-s2e/src/lm_boot.c * * Copyright (C) 2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -50,35 +50,38 @@ #include "tiva_gpio.h" #include "lm3s6432-s2e.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #if defined(CONFIG_TIVA_UART1) && defined(CONFIG_TIVA_SSI0) # error Only one of UART1 and SSI0 can be enabled on this board. #endif -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tiva_boardinitialize * * Description: - * All Stellaris architectures must provide the following entry point. This entry - * point is called early in the intitialization -- after all memory has been - * configured and mapped but before any devices have been initialized. + * All Stellaris architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void tiva_boardinitialize(void) { - /* Configure SPI chip selects if 1) SSI is not disabled, and 2) the weak function + /* Configure SPI chip selects if + * 1) SSI is not disabled, and + * 2) the weak function * lm_ssidev_initialize() has been brought into the link. */ diff --git a/boards/arm/tiva/lm3s6432-s2e/src/lm_ethernet.c b/boards/arm/tiva/lm3s6432-s2e/src/lm_ethernet.c index d212e1caa2f..99b22150985 100644 --- a/boards/arm/tiva/lm3s6432-s2e/src/lm_ethernet.c +++ b/boards/arm/tiva/lm3s6432-s2e/src/lm_ethernet.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm3s6432-s3e/src/lm_ethernet.c +/**************************************************************************** + * boards/arm/tiva/lm3s6432-s3e/src/lm_ethernet.c * * Copyright (C) 2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -50,27 +50,28 @@ #include "chip.h" #include "tiva_ethernet.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tiva_ethernetmac * * Description: - * For the Ethernet Eval Kits, the MAC address will be stored in the non-volatile - * USER0 and USER1 registers. If CONFIG_TIVA_BOARDMAC is defined, this function + * For the Ethernet Eval Kits, the MAC address will be stored in the + * non-volatile USER0 and USER1 registers. + * If CONFIG_TIVA_BOARDMAC is defined, this function * will obtain the MAC address from these registers. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_TIVA_BOARDMAC void tiva_ethernetmac(struct ether_addr *ethaddr) diff --git a/boards/arm/tiva/lm3s6432-s2e/src/lm_leds.c b/boards/arm/tiva/lm3s6432-s2e/src/lm_leds.c index d251ac3656b..030a2f0b935 100644 --- a/boards/arm/tiva/lm3s6432-s2e/src/lm_leds.c +++ b/boards/arm/tiva/lm3s6432-s2e/src/lm_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lm3s6432-s2e/src/lm_leds.c + * boards/arm/tiva/lm3s6432-s2e/src/lm_leds.c * * Copyright (C) 2010, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/lm3s6432-s2e/src/lm_ssi.c b/boards/arm/tiva/lm3s6432-s2e/src/lm_ssi.c index 5a36c112395..a079d4fde63 100644 --- a/boards/arm/tiva/lm3s6432-s2e/src/lm_ssi.c +++ b/boards/arm/tiva/lm3s6432-s2e/src/lm_ssi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm3s6432-s2e/src/lm_ssi.c +/**************************************************************************** + * boards/arm/tiva/lm3s6432-s2e/src/lm_ssi.c * * Copyright (C) 2010 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 @@ #if defined(CONFIG_TIVA_SSI0) -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* CONFIG_DEBUG_SPI enables debug output from this file */ @@ -65,17 +65,17 @@ # define ssi_dumpgpio(m) #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lm_ssidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the MDL-S2E. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lm_ssidev_initialize(void) { @@ -89,17 +89,19 @@ void weak_function lm_ssidev_initialize(void) /**************************************************************************** * The external functions, tiva_ssiselect and tiva_ssistatus must be provided * by board-specific logic. The are implementations of the select and status - * methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). - * All othermethods (including tiva_ssibus_initialize()) are provided by common - * logic. To use this common SPI logic on your board: + * methods SPI interface defined by struct spi_ops_s + * (see include/nuttx/spi/spi.h). + * All othermethods (including tiva_ssibus_initialize()) are provided by + * common logic. + * To use this common SPI logic on your board: * * 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your * board-specific logic. This function will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 2. Add a call to tiva_ssibus_initialize() in your low level initialization - * logic - * 3. The handle returned by tiva_ssibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 2. Add a call to tiva_ssibus_initialize() in your low level + * initialization logic + * 3. The handle returned by tiva_ssibus_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). * @@ -107,7 +109,8 @@ void weak_function lm_ssidev_initialize(void) void tiva_ssiselect(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"); ssi_dumpgpio("tiva_ssiselect() Entry"); if (devid == SPIDEV_MMCSD(0)) diff --git a/boards/arm/tiva/lm3s6965-ek/README.txt b/boards/arm/tiva/lm3s6965-ek/README.txt index 6a96746a17e..31001078fd5 100644 --- a/boards/arm/tiva/lm3s6965-ek/README.txt +++ b/boards/arm/tiva/lm3s6965-ek/README.txt @@ -114,7 +114,7 @@ Using OpenOCD and GDB with an FT2232 JTAG emulator I have been using the on-board FT2232 JTAG/SWD/SWO interface. OpenOCD requires a configuration file. I keep the one I used last here: - boards/lm3s6965-ek/tools/lm3s6965-ek.cfg + boards/arm/tiva/lm3s6965-ek/tools/lm3s6965-ek.cfg However, the "correct" configuration script to use with OpenOCD may change as the features of OpenOCD evolve. So you should at least @@ -132,13 +132,13 @@ Using OpenOCD and GDB with an FT2232 JTAG emulator - Possibly the value of OPENOCD_PATH and TARGET_PATH - It assumes that the correct script to use is the one at - boards/lm3s6965-ek/tools/lm3s6965-ek.cfg + boards/arm/tiva/lm3s6965-ek/tools/lm3s6965-ek.cfg Starting OpenOCD Then you should be able to start the OpenOCD daemon like: - boards/lm3s6965-ek/tools/oocd.sh $PWD + boards/arm/tiva/lm3s6965-ek/tools/oocd.sh $PWD Connecting GDB diff --git a/boards/arm/tiva/lm3s6965-ek/include/board.h b/boards/arm/tiva/lm3s6965-ek/include/board.h index cbaca24edc8..3971f778706 100644 --- a/boards/arm/tiva/lm3s6965-ek/include/board.h +++ b/boards/arm/tiva/lm3s6965-ek/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm3s6965-ek/include/board.h +/**************************************************************************** + * boards/arm/tiva/lm3s6965-ek/include/board.h * include/arch/board/board.h * * Copyright (C) 2010 Gregory Nutt. All rights reserved. @@ -32,18 +32,18 @@ * 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_TIVA_LM3S6965_EK_INCLUDE_BOARD_H +#define __BOARDS_ARM_TIVA_LM3S6965_EK_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* Clocking *************************************************************************/ @@ -52,8 +52,9 @@ #define SYSCON_RCC_XTAL SYSCON_RCC_XTAL8000KHZ /* Eagle100 on-board crystall is 8.00 MHz */ #define XTAL_FREQUENCY 8000000 -/* Oscillator source is the main oscillator (not internal, internal/4, 30KHz or - * 30KHz from hibernate module) */ +/* Oscillator source is the main oscillator (not internal, internal/4, + * 30KHz or 30KHz from hibernate module) + */ #define SYSCON_RCC_OSCSRC SYSCON_RCC_OSCSRC_MOSC #define SYSCON_RCC2_OSCSRC SYSCON_RCC2_OSCSRC2_MOSC @@ -92,17 +93,21 @@ #define TIVA_RCC2_VALUE (SYSCON_RCC2_OSCSRC | SYSCON_RCC2_SYSDIV(TIVA_SYSDIV)) -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ -/* The LMS36965 Eval Kit has only one user LED: Port F, Bit 0. Below is the mapping of this - * single LED. From this single LED, we can get the following information: +/* The LMS36965 Eval Kit has only one user LED: Port F, Bit 0. + * Below is the mapping of this single LED. + * From this single LED, we can get the following information: * - * OFF Steady: The system has failed to boot to the point of enabling interrupts - * ON Steady: The systems has enabled interrupts, but none have been received + * OFF Steady: The system has failed to boot to the point of + * enabling interrupts + * ON Steady: The systems has enabled interrupts, + * but none have been received * Dull glow: The system is taking interrupts * Slow blinking: The system has panicked + * ON OFF */ - /* ON OFF */ + #define LED_STARTED 0 /* OFF OFF */ #define LED_HEAPALLOCATE 1 /* OFF OFF */ #define LED_IRQSENABLED 2 /* ON ON */ @@ -112,4 +117,4 @@ #define LED_ASSERTION 6 /* ON OFF */ #define LED_PANIC 7 /* ON OFF */ -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __BOARDS_ARM_TIVA_LM3S6965_EK_INCLUDE_BOARD_H */ diff --git a/boards/arm/tiva/lm3s6965-ek/scripts/Make.defs b/boards/arm/tiva/lm3s6965-ek/scripts/Make.defs index 99850e05100..69da70175e9 100644 --- a/boards/arm/tiva/lm3s6965-ek/scripts/Make.defs +++ b/boards/arm/tiva/lm3s6965-ek/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/lm3s6965-ek/scripts/Make.defs +# boards/arm/tiva/lm3s6965-ek/scripts/Make.defs # # Copyright (C) 2010, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/lm3s6965-ek/scripts/ld.script b/boards/arm/tiva/lm3s6965-ek/scripts/ld.script index 2355298cd2a..60103ab9f0c 100644 --- a/boards/arm/tiva/lm3s6965-ek/scripts/ld.script +++ b/boards/arm/tiva/lm3s6965-ek/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lm3s6965-ek/scripts/ld.script + * boards/arm/tiva/lm3s6965-ek/scripts/ld.script * * Copyright (C) 2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/lm3s6965-ek/src/Makefile b/boards/arm/tiva/lm3s6965-ek/src/Makefile index 43fd14293f2..ff159a753e4 100644 --- a/boards/arm/tiva/lm3s6965-ek/src/Makefile +++ b/boards/arm/tiva/lm3s6965-ek/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lm3s6965-ek/src/Makefile +# boards/arm/tiva/lm3s6965-ek/src/Makefile # # Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/lm3s6965-ek/src/lm3s6965-ek.h b/boards/arm/tiva/lm3s6965-ek/src/lm3s6965-ek.h index a6c19818402..e43f71b4e9e 100644 --- a/boards/arm/tiva/lm3s6965-ek/src/lm3s6965-ek.h +++ b/boards/arm/tiva/lm3s6965-ek/src/lm3s6965-ek.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm3s6965-ek/src/lm3s6965-ek.h +/**************************************************************************** + * boards/arm/tiva/lm3s6965-ek/src/lm3s6965-ek.h * * Copyright (C) 2010 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_LM3S6965_EK_SRC_LM3S6965EK_H -#define __BOARDS_ARM_LM3S6965_EK_SRC_LM3S6965EK_H +#ifndef __BOARDS_ARM_TIVA_LM3S6965_EK_SRC_LM3S6965EK_H +#define __BOARDS_ARM_TIVA_LM3S6965_EK_SRC_LM3S6965EK_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -46,13 +46,13 @@ #include "chip.h" #include "tiva_gpio.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* How many SSI modules does this chip support? The LM3S6965 supports 1 SSI - * module (others may support more than 2 -- in such case, the following must be - * expanded). + * module (others may support more than 2 -- in such case, the following must + * be expanded). */ #if TIVA_NSSI == 0 @@ -112,21 +112,21 @@ #define OLEDEN_GPIO (GPIO_FUNC_OUTPUT | GPIO_PADTYPE_STD | GPIO_STRENGTH_8MA | \ GPIO_VALUE_ONE | GPIO_PORTC | 6) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Name: lm_ssidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the LM3S6965 Eval Kit. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lm_ssidev_initialize(void); #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_LM3S6965_EK_SRC_LM3S6965EK_H */ +#endif /* __BOARDS_ARM_TIVA_LM3S6965_EK_SRC_LM3S6965EK_H */ diff --git a/boards/arm/tiva/lm3s6965-ek/src/lm_appinit.c b/boards/arm/tiva/lm3s6965-ek/src/lm_appinit.c index 07153314eae..43e4194c8bf 100644 --- a/boards/arm/tiva/lm3s6965-ek/src/lm_appinit.c +++ b/boards/arm/tiva/lm3s6965-ek/src/lm_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lm3s6965-ek/src/lm_appinit.c + * boards/arm/tiva/lm3s6965-ek/src/lm_appinit.c * * Copyright (C) 2010, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -151,10 +151,12 @@ int board_app_initialize(uintptr_t arg) syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n", CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); - ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi); + ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, + CONFIG_NSH_MMCSDSLOTNO, spi); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", + syslog(LOG_ERR, + "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret); return ret; } diff --git a/boards/arm/tiva/lm3s6965-ek/src/lm_boot.c b/boards/arm/tiva/lm3s6965-ek/src/lm_boot.c index 0a0dd5f5ee8..372472e1820 100644 --- a/boards/arm/tiva/lm3s6965-ek/src/lm_boot.c +++ b/boards/arm/tiva/lm3s6965-ek/src/lm_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm3s6965-ek/src/lm_boot.c +/**************************************************************************** + * boards/arm/tiva/lm3s6965-ek/src/lm_boot.c * * Copyright (C) 2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -48,31 +48,34 @@ #include "up_internal.h" #include "lm3s6965-ek.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tiva_boardinitialize * * Description: - * All Stellaris architectures must provide the following entry point. This entry - * point is called early in the intitialization -- after all memory has been - * configured and mapped but before any devices have been initialized. + * All Stellaris architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void tiva_boardinitialize(void) { - /* Configure SPI chip selects if 1) SSI is not disabled, and 2) the weak function + /* Configure SPI chip selects if + * 1) SSI is not disabled, and + * 2) the weak function * lm_ssidev_initialize() has been brought into the link. */ diff --git a/boards/arm/tiva/lm3s6965-ek/src/lm_ethernet.c b/boards/arm/tiva/lm3s6965-ek/src/lm_ethernet.c index 106cefb708a..8d35a128388 100644 --- a/boards/arm/tiva/lm3s6965-ek/src/lm_ethernet.c +++ b/boards/arm/tiva/lm3s6965-ek/src/lm_ethernet.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm3s6965-ek/src/lm_ethernet.c +/**************************************************************************** + * boards/arm/tiva/lm3s6965-ek/src/lm_ethernet.c * * Copyright (C) 2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -50,27 +50,28 @@ #include "chip.h" #include "tiva_ethernet.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tiva_ethernetmac * * Description: - * For the Ethernet Eval Kits, the MAC address will be stored in the non-volatile - * USER0 and USER1 registers. If CONFIG_TIVA_BOARDMAC is defined, this function + * For the Ethernet Eval Kits, the MAC address will be stored in the + * non-volatile USER0 and USER1 registers. + * If CONFIG_TIVA_BOARDMAC is defined, this function * will obtain the MAC address from these registers. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_TIVA_BOARDMAC void tiva_ethernetmac(struct ether_addr *ethaddr) diff --git a/boards/arm/tiva/lm3s6965-ek/src/lm_leds.c b/boards/arm/tiva/lm3s6965-ek/src/lm_leds.c index 267a12605dc..e9343c8249b 100644 --- a/boards/arm/tiva/lm3s6965-ek/src/lm_leds.c +++ b/boards/arm/tiva/lm3s6965-ek/src/lm_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lm3s6965-ek/src/lm_leds.c + * boards/arm/tiva/lm3s6965-ek/src/lm_leds.c * * Copyright (C) 2010, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/lm3s6965-ek/src/lm_oled.c b/boards/arm/tiva/lm3s6965-ek/src/lm_oled.c index 3172e019af2..d8ddb3e3f1b 100644 --- a/boards/arm/tiva/lm3s6965-ek/src/lm_oled.c +++ b/boards/arm/tiva/lm3s6965-ek/src/lm_oled.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lm3s6965-ek/src/lm_oled.c + * boards/arm/tiva/lm3s6965-ek/src/lm_oled.c * * Copyright (C) 2010-2011, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/lm3s6965-ek/src/lm_ssi.c b/boards/arm/tiva/lm3s6965-ek/src/lm_ssi.c index df6d7010941..5c53542f14e 100644 --- a/boards/arm/tiva/lm3s6965-ek/src/lm_ssi.c +++ b/boards/arm/tiva/lm3s6965-ek/src/lm_ssi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm3s6965-ek/src/lm_ssi.c +/**************************************************************************** + * boards/arm/tiva/lm3s6965-ek/src/lm_ssi.c * * Copyright (C) 2010 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,9 +55,9 @@ #if defined(CONFIG_TIVA_SSI0) /* || defined(CONFIG_TIVA_SSI1) */ -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* CONFIG_DEBUG_SPI enables debug output from this file */ @@ -67,17 +67,17 @@ # define ssi_dumpgpio(m) #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lm_ssidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the LM3S6965 Eval Kit. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lm_ssidev_initialize(void) { @@ -94,17 +94,18 @@ void weak_function lm_ssidev_initialize(void) /**************************************************************************** * The external functions, tiva_ssiselect and tiva_ssistatus must be provided * by board-specific logic. The are implementations of the select and status - * methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). - * All othermethods (including tiva_ssibus_initialize()) are provided by common - * logic. To use this common SPI logic on your board: + * methods SPI interface defined by struct spi_ops_s + * (see include/nuttx/spi/spi.h). + * All othermethods (including tiva_ssibus_initialize()) are provided by + * common logic. To use this common SPI logic on your board: * * 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your * board-specific logic. This function will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 2. Add a call to tiva_ssibus_initialize() in your low level initialization - * logic - * 3. The handle returned by tiva_ssibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 2. Add a call to tiva_ssibus_initialize() in your low level + * initialization logic + * 3. The handle returned by tiva_ssibus_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). * @@ -112,7 +113,8 @@ void weak_function lm_ssidev_initialize(void) void tiva_ssiselect(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"); ssi_dumpgpio("tiva_ssiselect() Entry"); if (devid == SPIDEV_MMCSD(0)) diff --git a/boards/arm/tiva/lm3s6965-ek/tools/oocd.sh b/boards/arm/tiva/lm3s6965-ek/tools/oocd.sh index beb3764e43d..64fca16c38d 100755 --- a/boards/arm/tiva/lm3s6965-ek/tools/oocd.sh +++ b/boards/arm/tiva/lm3s6965-ek/tools/oocd.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# See boards/lm3s6965-ek/README.txt for information about +# See boards/arm/tiva/lm3s6965-ek/README.txt for information about # this file. TOPDIR=$1 @@ -28,7 +28,7 @@ TARGET_PATH="/usr/local/share/openocd/scripts" OPENOCD_EXE=openocd.exe # OPENOCD_EXE=openocd -OPENOCD_CFG="${TOPDIR}/boards/lm3s6965-ek/tools/lm3s6965-ek.cfg" +OPENOCD_CFG="${TOPDIR}/boards/arm/tiva/lm3s6965-ek/tools/lm3s6965-ek.cfg" OPENOCD_ARGS="-f ${OPENOCD_CFG} -s ${TARGET_PATH}" if [ "X$2" = "X-d" ]; then diff --git a/boards/arm/tiva/lm3s8962-ek/include/board.h b/boards/arm/tiva/lm3s8962-ek/include/board.h index 5c7533d14f0..968f970dddd 100644 --- a/boards/arm/tiva/lm3s8962-ek/include/board.h +++ b/boards/arm/tiva/lm3s8962-ek/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm3s8962-ek/include/board.h +/**************************************************************************** + * boards/arm/tiva/lm3s8962-ek/include/board.h * include/arch/board/board.h * * Copyright (C) 2010 Gregory Nutt. All rights reserved. @@ -32,18 +32,18 @@ * 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_TIVA_LM3S8962_EK_INCLUDE_BOARD_H +#define __BOARDS_ARM_TIVA_LM3S8962_EK_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* Clocking *************************************************************************/ @@ -52,8 +52,9 @@ #define SYSCON_RCC_XTAL SYSCON_RCC_XTAL8000KHZ /* Eagle100 on-board crystall is 8.00 MHz */ #define XTAL_FREQUENCY 8000000 -/* Oscillator source is the main oscillator (not internal, internal/4, 30KHz or - * 30KHz from hibernate module) */ +/* Oscillator source is the main oscillator (not internal, internal/4, + * 30KHz or 30KHz from hibernate module) + */ #define SYSCON_RCC_OSCSRC SYSCON_RCC_OSCSRC_MOSC #define SYSCON_RCC2_OSCSRC SYSCON_RCC2_OSCSRC2_MOSC @@ -92,17 +93,20 @@ #define TIVA_RCC2_VALUE (SYSCON_RCC2_OSCSRC | SYSCON_RCC2_SYSDIV(TIVA_SYSDIV)) -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ -/* The LMS38962 Eval Kit has only one user LED: Port F, Bit 0. Below is the mapping of this - * single LED. From this single LED, we can get the following information: +/* The LMS38962 Eval Kit has only one user LED: Port F, Bit 0. + * Below is the mapping of this single LED. + * From this single LED, we can get the following information: * - * OFF Steady: The system has failed to boot to the point of enabling interrupts - * ON Steady: The systems has enabled interrupts, but none have been received + * OFF Steady: The system has failed to boot to the point of + * enabling interrupts + * ON Steady: The systems has enabled interrupts, + * but none have been received * Dull glow: The system is taking interrupts * Slow blinking: The system has panicked + * ON OFF */ - /* ON OFF */ #define LED_STARTED 0 /* OFF OFF */ #define LED_HEAPALLOCATE 1 /* OFF OFF */ #define LED_IRQSENABLED 2 /* ON ON */ @@ -112,4 +116,4 @@ #define LED_ASSERTION 6 /* ON OFF */ #define LED_PANIC 7 /* ON OFF */ -#endif /* __ARCH_BOARD_BOARD_H */ +#endif /* __BOARDS_ARM_TIVA_LM3S8962_EK_INCLUDE_BOARD_H */ diff --git a/boards/arm/tiva/lm3s8962-ek/scripts/Make.defs b/boards/arm/tiva/lm3s8962-ek/scripts/Make.defs index 23b9ad98364..556599043da 100644 --- a/boards/arm/tiva/lm3s8962-ek/scripts/Make.defs +++ b/boards/arm/tiva/lm3s8962-ek/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/lm3s8962-ek/scripts/Make.defs +# boards/arm/tiva/lm3s8962-ek/scripts/Make.defs # # Copyright (C) 2010, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/lm3s8962-ek/scripts/ld.script b/boards/arm/tiva/lm3s8962-ek/scripts/ld.script index 5cb78871b37..2e252c02199 100644 --- a/boards/arm/tiva/lm3s8962-ek/scripts/ld.script +++ b/boards/arm/tiva/lm3s8962-ek/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lm3s8962-ek/scripts/ld.script + * boards/arm/tiva/lm3s8962-ek/scripts/ld.script * * Copyright (C) 2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/lm3s8962-ek/src/Makefile b/boards/arm/tiva/lm3s8962-ek/src/Makefile index 1e8e3a722e6..80b3b526687 100644 --- a/boards/arm/tiva/lm3s8962-ek/src/Makefile +++ b/boards/arm/tiva/lm3s8962-ek/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lm3s8962-ek/src/Makefile +# boards/arm/tiva/lm3s8962-ek/src/Makefile # # Copyright (C) 2010, 2012, 2015 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/lm3s8962-ek/src/lm3s8962-ek.h b/boards/arm/tiva/lm3s8962-ek/src/lm3s8962-ek.h index c19a0d7d8c4..0e1432f5ad8 100644 --- a/boards/arm/tiva/lm3s8962-ek/src/lm3s8962-ek.h +++ b/boards/arm/tiva/lm3s8962-ek/src/lm3s8962-ek.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm3s8962-ek/src/lm3s8962-ek.h +/**************************************************************************** + * boards/arm/tiva/lm3s8962-ek/src/lm3s8962-ek.h * * Copyright (C) 2010 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_LM3S8962_EK_SRC_LM3S8962EK_H -#define __BOARDS_ARM_LM3S8962_EK_SRC_LM3S8962EK_H +#ifndef __BOARDS_ARM_TIVA_LM3S8962_EK_SRC_LM3S8962EK_H +#define __BOARDS_ARM_TIVA_LM3S8962_EK_SRC_LM3S8962EK_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -46,13 +46,13 @@ #include "chip.h" #include "tiva_gpio.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* How many SSI modules does this chip support? The LM3S8962 supports 1 SSI - * module (others may support more than 2 -- in such case, the following must be - * expanded). + * module (others may support more than 2 -- in such case, the following must + * be expanded). */ #if TIVA_NSSI == 0 @@ -62,7 +62,7 @@ # undef CONFIG_TIVA_SSI1 #endif -/* LM3S8962 Eval Kit ***************************************************************/ +/* LM3S8962 Eval Kit ********************************************************/ /* GPIO Usage * @@ -112,22 +112,21 @@ #define OLEDEN_GPIO (GPIO_FUNC_OUTPUT | GPIO_PADTYPE_STD | GPIO_STRENGTH_8MA | \ GPIO_VALUE_ONE | GPIO_PORTC | 6) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Name: lm_ssidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the LM3S8962 Eval Kit. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lm_ssidev_initialize(void); #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_LM3S8962_EK_SRC_LM3S8962EK_H */ - +#endif /* __BOARDS_ARM_TIVA_LM3S8962_EK_SRC_LM3S8962EK_H */ diff --git a/boards/arm/tiva/lm3s8962-ek/src/lm_appinit.c b/boards/arm/tiva/lm3s8962-ek/src/lm_appinit.c index 2a9e3b4bdb4..1c406497f98 100644 --- a/boards/arm/tiva/lm3s8962-ek/src/lm_appinit.c +++ b/boards/arm/tiva/lm3s8962-ek/src/lm_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lm3s8962-ek/src/lm_appinit.c + * boards/arm/tiva/lm3s8962-ek/src/lm_appinit.c * * Copyright (C) 2010, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -153,10 +153,12 @@ int board_app_initialize(uintptr_t arg) syslog(LOG_INFO, "Binding SPI port %d to MMC/SD slot %d\n", CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO); - ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, CONFIG_NSH_MMCSDSLOTNO, spi); + ret = mmcsd_spislotinitialize(CONFIG_NSH_MMCSDMINOR, + CONFIG_NSH_MMCSDSLOTNO, spi); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", + syslog(LOG_ERR, + "ERROR: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", CONFIG_NSH_MMCSDSPIPORTNO, CONFIG_NSH_MMCSDSLOTNO, ret); return ret; } diff --git a/boards/arm/tiva/lm3s8962-ek/src/lm_boot.c b/boards/arm/tiva/lm3s8962-ek/src/lm_boot.c index 803f4850557..e9615eb88ef 100644 --- a/boards/arm/tiva/lm3s8962-ek/src/lm_boot.c +++ b/boards/arm/tiva/lm3s8962-ek/src/lm_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm3s8962-ek/src/lm_boot.c +/**************************************************************************** + * boards/arm/tiva/lm3s8962-ek/src/lm_boot.c * * Copyright (C) 2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -48,31 +48,34 @@ #include "up_internal.h" #include "lm3s8962-ek.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tiva_boardinitialize * * Description: - * All Stellaris architectures must provide the following entry point. This entry - * point is called early in the intitialization -- after all memory has been - * configured and mapped but before any devices have been initialized. + * All Stellaris architectures must provide the following entry point. + * This entry point is called early in the intitialization -- after all + * memory has been configured and mapped but before any devices have been + * initialized. * - ************************************************************************************/ + ****************************************************************************/ void tiva_boardinitialize(void) { - /* Configure SPI chip selects if 1) SSI is not disabled, and 2) the weak function + /* Configure SPI chip selects if + * 1) SSI is not disabled, and + * 2) the weak function * lm_ssidev_initialize() has been brought into the link. */ diff --git a/boards/arm/tiva/lm3s8962-ek/src/lm_ethernet.c b/boards/arm/tiva/lm3s8962-ek/src/lm_ethernet.c index 2ce531dc456..1df67fc5630 100644 --- a/boards/arm/tiva/lm3s8962-ek/src/lm_ethernet.c +++ b/boards/arm/tiva/lm3s8962-ek/src/lm_ethernet.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm3s8962-ek/src/lm_ethernet.c +/**************************************************************************** + * boards/arm/tiva/lm3s8962-ek/src/lm_ethernet.c * * Copyright (C) 2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -50,27 +50,28 @@ #include "chip.h" #include "tiva_ethernet.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tiva_ethernetmac * * Description: - * For the Ethernet Eval Kits, the MAC address will be stored in the non-volatile - * USER0 and USER1 registers. If CONFIG_TIVA_BOARDMAC is defined, this function + * For the Ethernet Eval Kits, the MAC address will be stored in the + * non-volatile USER0 and USER1 registers. + * If CONFIG_TIVA_BOARDMAC is defined, this function * will obtain the MAC address from these registers. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_TIVA_BOARDMAC void tiva_ethernetmac(struct ether_addr *ethaddr) diff --git a/boards/arm/tiva/lm3s8962-ek/src/lm_leds.c b/boards/arm/tiva/lm3s8962-ek/src/lm_leds.c index 94b4dcf806f..cfd444e5788 100644 --- a/boards/arm/tiva/lm3s8962-ek/src/lm_leds.c +++ b/boards/arm/tiva/lm3s8962-ek/src/lm_leds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lm3s8962-ek/src/lm_leds.c + * boards/arm/tiva/lm3s8962-ek/src/lm_leds.c * * Copyright (C) 2010, 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/lm3s8962-ek/src/lm_oled.c b/boards/arm/tiva/lm3s8962-ek/src/lm_oled.c index cffc1e8a3ce..a7ecb62cde1 100644 --- a/boards/arm/tiva/lm3s8962-ek/src/lm_oled.c +++ b/boards/arm/tiva/lm3s8962-ek/src/lm_oled.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lm3s8962-ek/src/lm_oled.c + * boards/arm/tiva/lm3s8962-ek/src/lm_oled.c * * Copyright (C) 2010, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/lm3s8962-ek/src/lm_ssi.c b/boards/arm/tiva/lm3s8962-ek/src/lm_ssi.c index 39110e7831c..8a0101108a8 100644 --- a/boards/arm/tiva/lm3s8962-ek/src/lm_ssi.c +++ b/boards/arm/tiva/lm3s8962-ek/src/lm_ssi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm3s8962-ek/src/lm_ssi.c +/**************************************************************************** + * boards/arm/tiva/lm3s8962-ek/src/lm_ssi.c * * Copyright (C) 2010 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,9 +55,9 @@ #if defined(CONFIG_TIVA_SSI0) /* || defined(CONFIG_TIVA_SSI1) */ -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* CONFIG_DEBUG_SPI enables debug output from this file */ @@ -67,17 +67,17 @@ # define ssi_dumpgpio(m) #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lm_ssidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the LM3S8962 Eval Kit. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lm_ssidev_initialize(void) { @@ -94,17 +94,19 @@ void weak_function lm_ssidev_initialize(void) /**************************************************************************** * The external functions, tiva_ssiselect and tiva_ssistatus must be provided * by board-specific logic. The are implementations of the select and status - * methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). - * All othermethods (including tiva_ssibus_initialize()) are provided by common - * logic. To use this common SPI logic on your board: + * methods SPI interface defined by struct spi_ops_s + * (see include/nuttx/spi/spi.h). + * All othermethods (including tiva_ssibus_initialize()) are provided by + * common logic. + * To use this common SPI logic on your board: * * 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your * board-specific logic. This function will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 2. Add a call to tiva_ssibus_initialize() in your low level initialization - * logic - * 3. The handle returned by tiva_ssibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 2. Add a call to tiva_ssibus_initialize() in your low level + * initialization logic + * 3. The handle returned by tiva_ssibus_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). * @@ -112,7 +114,8 @@ void weak_function lm_ssidev_initialize(void) void tiva_ssiselect(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"); ssi_dumpgpio("tiva_ssiselect() Entry"); if (devid == SPIDEV_MMCSD(0)) diff --git a/boards/arm/tiva/lm4f120-launchpad/README.txt b/boards/arm/tiva/lm4f120-launchpad/README.txt index 1e8e6a51651..c0b4a2e3b60 100644 --- a/boards/arm/tiva/lm4f120-launchpad/README.txt +++ b/boards/arm/tiva/lm4f120-launchpad/README.txt @@ -1,7 +1,9 @@ README ^^^^^^ -README for NuttX port to the Stellaris LM4F120 LaunchPad. The Stellaris® LM4F120 LaunchPad Evaluation Board is a low-cost evaluation platform for ARM® Cortex™-M4F-based microcontrollers from Texas Instruments. +README for NuttX port to the Stellaris LM4F120 LaunchPad. +The Stellaris® LM4F120 LaunchPad Evaluation Board is a low-cost evaluation +platform for ARM® Cortex™-M4F-based microcontrollers from Texas Instruments. Contents ^^^^^^^^ @@ -159,7 +161,7 @@ Using OpenOCD and GDB with an FT2232 JTAG emulator I have been using the on-board In-Circuit Debug Interface (ICDI) interface. OpenOCD requires a configuration file. I keep the one I used last here: - boards/lm4f120-launchpad/tools/lm4f120-launchpad.cfg + boards/arm/tiva/lm4f120-launchpad/tools/lm4f120-launchpad.cfg However, the "correct" configuration script to use with OpenOCD may change as the features of OpenOCD evolve. So you should at least @@ -177,7 +179,7 @@ Using OpenOCD and GDB with an FT2232 JTAG emulator - Possibly the value of OPENOCD_PATH and TARGET_PATH - It assumes that the correct script to use is the one at - boards/lm4f120-launchpad/tools/lm4f120-launchpad.cfg + boards/arm/tiva/lm4f120-launchpad/tools/lm4f120-launchpad.cfg Starting OpenOCD @@ -186,7 +188,7 @@ Using OpenOCD and GDB with an FT2232 JTAG emulator oocd.sh $PWD - provided that you have the path to the oocd.sh script, boards/lm4f120-launchpad/tools, + provided that you have the path to the oocd.sh script, boards/arm/tiva/lm4f120-launchpad/tools, added to your PATH variable. Note that OpenOCD needs to be run with administrator privileges in @@ -234,12 +236,12 @@ LEDs The LM4F120 has a single RGB LED. If CONFIG_ARCH_LEDS is defined, then support for the LaunchPad LEDs will be included in the build. See: - - boards/lm4f120-launchpad/include/board.h - Defines LED constants, types and + - boards/arm/tiva/lm4f120-launchpad/include/board.h - Defines LED constants, types and prototypes the LED interface functions. - - boards/lm4f120-launchpad/src/lm4f120-launchpad.h - GPIO settings for the LEDs. + - boards/arm/tiva/lm4f120-launchpad/src/lm4f120-launchpad.h - GPIO settings for the LEDs. - - boards/lm4f120-launchpad/src/up_leds.c - LED control logic. + - boards/arm/tiva/lm4f120-launchpad/src/up_leds.c - LED control logic. OFF: - OFF means that the OS is still initializing. Initialization is very fast so diff --git a/boards/arm/tiva/lm4f120-launchpad/include/board.h b/boards/arm/tiva/lm4f120-launchpad/include/board.h index 6c9c68f2c13..38415c69735 100644 --- a/boards/arm/tiva/lm4f120-launchpad/include/board.h +++ b/boards/arm/tiva/lm4f120-launchpad/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm4f120-launchpad/include/board.h +/**************************************************************************** + * boards/arm/tiva/lm4f120-launchpad/include/board.h * * Copyright (C) 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,20 +31,20 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_LM4F120_LAUNCHPAD_INCLUDE_BOARD_H -#define __BOARDS_ARM_LM4F120_LAUNCHPAD_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_TIVA_LM4F120_LAUNCHPAD_INCLUDE_BOARD_H +#define __BOARDS_ARM_TIVA_LM4F120_LAUNCHPAD_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ +/* Clocking *****************************************************************/ /* RCC settings. Crytals on-board the LM4F120 LaunchPad include: * @@ -114,10 +114,11 @@ SYSCON_RCC2_DIV400 | SYSCON_RCC2_USERCC2) #endif -/* LED definitions ******************************************************************/ -/* The LM4F120 LaunchPad has a single RGB LED. There is only one visible LED which - * will vary in color. But, from the standpoint of the firmware, this appears as - * three LEDs: +/* LED definitions **********************************************************/ + +/* The LM4F120 LaunchPad has a single RGB LED. + * There is only one visible LED which will vary in color. + *But, from the standpoint of the firmware, this appears as three LEDs: * * BOARD_LED_R -- Connected to PF1 * BOARD_LED_G -- Connected to PF3 @@ -136,13 +137,13 @@ #define BOARD_LED1_BIT (1 << BOARD_LED1) #define BOARD_LED2_BIT (1 << BOARD_LED2) -/* If CONFIG_ARCH_LEDS is defined, then automated support for the LaunchPad LEDs - * will be included in the build: +/* If CONFIG_ARCH_LEDS is defined, then automated support for the LaunchPad + * LEDs will be included in the build: * * OFF: - * - OFF means that the OS is still initializing. Initialization is very fast so - * if you see this at all, it probably means that the system is hanging up - * somewhere in the initialization phases. + * - OFF means that the OS is still initializing. Initialization is very fast + * so if you see this at all, it probably means that the system is hanging + * up somewhere in the initialization phases. * * GREEN or GREEN-ish * - This means that the OS completed initialization. @@ -154,13 +155,15 @@ * * Redish: * - If a recovered assertion occurs, the RED component will be illuminated - * briefly while the assertion is handled. You will probably never see this. + * briefly while the assertion is handled. + * You will probably never see this. * * Flashing RED: * - In the event of a fatal crash, the BLUE and GREEN components will be * extinguished and the RED component will FLASH at a 2Hz rate. + * RED GREEN BLUE */ - /* RED GREEN BLUE */ + #define LED_STARTED 0 /* OFF OFF OFF */ #define LED_HEAPALLOCATE 0 /* OFF OFF OFF */ #define LED_IRQSENABLED 0 /* OFF OFF OFF */ @@ -170,7 +173,8 @@ #define LED_ASSERTION 3 /* ON NC NC (momentary) */ #define LED_PANIC 4 /* ON OFF OFF (flashing 2Hz) */ -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* The LM4F120 LaunchPad has a two buttons: * * BOARD_SW1 -- Connected to PF4 @@ -184,11 +188,11 @@ #define BUTTON_SW1_BIT (1 << BUTTON_SW1) #define BUTTON_SW2_BIT (1 << BUTTON_SW2) -/* Pin Multiplexing Disambiguation **************************************************/ +/* Pin Multiplexing Disambiguation ******************************************/ #define GPIO_UART1_CTS GPIO_UART1_CTS_1 #define GPIO_UART1_RTS GPIO_UART1_RTS_1 #define GPIO_UART1_RX GPIO_UART1_RX_1 #define GPIO_UART1_TX GPIO_UART1_TX_1 -#endif /* __BOARDS_ARM_LM4F120_LAUNCHPAD_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_TIVA_LM4F120_LAUNCHPAD_INCLUDE_BOARD_H */ diff --git a/boards/arm/tiva/lm4f120-launchpad/scripts/Make.defs b/boards/arm/tiva/lm4f120-launchpad/scripts/Make.defs index 9ddc963ed29..525cc1fb9f3 100644 --- a/boards/arm/tiva/lm4f120-launchpad/scripts/Make.defs +++ b/boards/arm/tiva/lm4f120-launchpad/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/lm4f120-launchpad/scripts/Make.defs +# boards/arm/tiva/lm4f120-launchpad/scripts/Make.defs # # Copyright (C) 2010, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/lm4f120-launchpad/scripts/lm4f120-launchpad.ld b/boards/arm/tiva/lm4f120-launchpad/scripts/lm4f120-launchpad.ld index d3c290b7dd3..34dbb0a1c72 100644 --- a/boards/arm/tiva/lm4f120-launchpad/scripts/lm4f120-launchpad.ld +++ b/boards/arm/tiva/lm4f120-launchpad/scripts/lm4f120-launchpad.ld @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lm4f120-launchpad/scripts/lm4f120-launchpad.ld + * boards/arm/tiva/lm4f120-launchpad/scripts/lm4f120-launchpad.ld * * Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/lm4f120-launchpad/src/Makefile b/boards/arm/tiva/lm4f120-launchpad/src/Makefile index 076f6797d3d..e5db5eed0b9 100644 --- a/boards/arm/tiva/lm4f120-launchpad/src/Makefile +++ b/boards/arm/tiva/lm4f120-launchpad/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/lm4f120-launchpad/src/Makefile +# boards/arm/tiva/lm4f120-launchpad/src/Makefile # # Copyright (C) 2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/lm4f120-launchpad/src/lm4f_appinit.c b/boards/arm/tiva/lm4f120-launchpad/src/lm4f_appinit.c index 6b19ebdad39..feabfe17e28 100644 --- a/boards/arm/tiva/lm4f120-launchpad/src/lm4f_appinit.c +++ b/boards/arm/tiva/lm4f120-launchpad/src/lm4f_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/lm4f120-launchpad/src/lm4f_appinit.c + * boards/arm/tiva/lm4f120-launchpad/src/lm4f_appinit.c * arch/arm/src/board/lm4f_appinit.c * * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. diff --git a/boards/arm/tiva/lm4f120-launchpad/src/lm4f_autoleds.c b/boards/arm/tiva/lm4f120-launchpad/src/lm4f_autoleds.c index 867aa92c304..90d856cdf9e 100644 --- a/boards/arm/tiva/lm4f120-launchpad/src/lm4f_autoleds.c +++ b/boards/arm/tiva/lm4f120-launchpad/src/lm4f_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/lm4f120-launchpad/src/lm4f_leds.c + * boards/arm/tiva/lm4f120-launchpad/src/lm4f_leds.c * * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -54,6 +54,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* The LM4F120 LaunchPad has a single RGB LED. There is only one visible LED * which will vary in color. But, from the standpoint of the firmware, this * appears as three LEDs: @@ -62,13 +63,13 @@ * BOARD_LED_G -- Connected to PF3 * BOARD_LED_B -- Connected to PF2 * - * If CONFIG_ARCH_LEDS is defined, then automated support for the LaunchPad LEDs - * will be included in the build: + * If CONFIG_ARCH_LEDS is defined, then automated support for the LaunchPad + * LEDs will be included in the build: * * OFF: - * - OFF means that the OS is still initializing. Initialization is very fast so - * if you see this at all, it probably means that the system is hanging up - * somewhere in the initialization phases. + * - OFF means that the OS is still initializing. Initialization is very fast + * so if you see this at all, it probably means that the system is hanging + * up somewhere in the initialization phases. * * GREEN or GREEN-ish * - This means that the OS completed initialization. @@ -80,7 +81,8 @@ * * Redish: * - If a recovered assertion occurs, the RED component will be illuminated - * briefly while the assertion is handled. You will probably never see this. + * briefly while the assertion is handled. + * You will probably never see this. * * Flashing RED: * - In the event of a fatal crash, the BLUE and GREEN components will be diff --git a/boards/arm/tiva/lm4f120-launchpad/src/lm4f_boot.c b/boards/arm/tiva/lm4f120-launchpad/src/lm4f_boot.c index 40af0cf91cd..4364ee7e78e 100644 --- a/boards/arm/tiva/lm4f120-launchpad/src/lm4f_boot.c +++ b/boards/arm/tiva/lm4f120-launchpad/src/lm4f_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm4f120-launchpad/src/lm4f_boot.c +/**************************************************************************** + * boards/arm/tiva/lm4f120-launchpad/src/lm4f_boot.c * arch/arm/src/board/lm4f_boot.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -32,11 +32,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -48,31 +48,34 @@ #include "up_internal.h" #include "lmf4120-launchpad.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tiva_boardinitialize * * Description: - * All Stellaris 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 Stellaris 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 tiva_boardinitialize(void) { - /* Configure SPI chip selects if 1) SSI is not disabled, and 2) the weak function + /* Configure SPI chip selects if + * 1) SSI is not disabled, and + * 2) the weak function * lm_ssidev_initialize() has been brought into the link. */ diff --git a/boards/arm/tiva/lm4f120-launchpad/src/lm4f_ssi.c b/boards/arm/tiva/lm4f120-launchpad/src/lm4f_ssi.c index b6d01605f34..ea57371986e 100644 --- a/boards/arm/tiva/lm4f120-launchpad/src/lm4f_ssi.c +++ b/boards/arm/tiva/lm4f120-launchpad/src/lm4f_ssi.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm4f120-launchpad/src/lm4f_ssi.c +/**************************************************************************** + * boards/arm/tiva/lm4f120-launchpad/src/lm4f_ssi.c * arch/arm/src/board/lm4f_ssi.c * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -32,11 +32,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -56,9 +56,9 @@ #if defined(CONFIG_TIVA_SSI0) || defined(CONFIG_TIVA_SSI1) -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* CONFIG_DEBUG_SPI enables debug output from this file */ @@ -68,17 +68,17 @@ # define ssi_dumpgpio(m) #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: lm4f_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the LM4F LaunchPad. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lm4f_spidev_initialize(void) { @@ -87,17 +87,19 @@ void weak_function lm4f_spidev_initialize(void) /**************************************************************************** * The external functions, tiva_ssiselect and tiva_ssistatus must be provided * by board-specific logic. The are implementations of the select and status - * methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). - * All othermethods (including tiva_ssibus_initialize()) are provided by common - * logic. To use this common SPI logic on your board: + * methods SPI interface defined by struct spi_ops_s + * (see include/nuttx/spi/spi.h). + * All othermethods (including tiva_ssibus_initialize()) are provided by + * common logic. + * To use this common SPI logic on your board: * * 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your * board-specific logic. This function will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 2. Add a call to tiva_ssibus_initialize() in your low level initialization - * logic - * 3. The handle returned by tiva_ssibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 2. Add a call to tiva_ssibus_initialize() in your low level + * initialization logic + * 3. The handle returned by tiva_ssibus_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). * @@ -105,7 +107,8 @@ void weak_function lm4f_spidev_initialize(void) void tiva_ssiselect(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"); ssi_dumpgpio("tiva_ssiselect() Entry"); ssi_dumpgpio("tiva_ssiselect() Exit"); } diff --git a/boards/arm/tiva/lm4f120-launchpad/src/lmf4120-launchpad.h b/boards/arm/tiva/lm4f120-launchpad/src/lmf4120-launchpad.h index 052edad76d5..e6f6fbb189a 100644 --- a/boards/arm/tiva/lm4f120-launchpad/src/lmf4120-launchpad.h +++ b/boards/arm/tiva/lm4f120-launchpad/src/lmf4120-launchpad.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/lm4f120-launchpad/src/lmf4120-launchpad.h +/**************************************************************************** + * boards/arm/tiva/lm4f120-launchpad/src/lmf4120-launchpad.h * arch/arm/src/board/lmf4120-launchpad.h * * Copyright (C) 2013 Gregory Nutt. All rights reserved. @@ -32,14 +32,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_LM4F120_LAUNCHPAD_LM4F120_LAUNCHPAD_H -#define __BOARDS_ARM_LM4F120_LAUNCHPAD_LM4F120_LAUNCHPAD_H +#ifndef __BOARDS_ARM_TIVA_LM4F120_LAUNCHPAD_LM4F120_LAUNCHPAD_H +#define __BOARDS_ARM_TIVA_LM4F120_LAUNCHPAD_LM4F120_LAUNCHPAD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -47,13 +47,13 @@ #include "chip.h" #include "tiva_gpio.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ /* How many SSI modules does this chip support? The LM3S6965 supports 1 SSI - * module (others may support more than 2 -- in such case, the following must be - * expanded). + * module (others may support more than 2 -- in such case, the following must + * be expanded). */ #if TIVA_NSSI < 1 @@ -63,22 +63,23 @@ # undef CONFIG_TIVA_SSI1 #endif -/* LM4F LaunchPad *******************************************************************/ -/* The LM4F120 LaunchPad has a single RGB LED. There is only one visible LED which - * will vary in color. But, from the standpoint of the firmware, this appears as - * three LEDs: +/* LM4F LaunchPad ***********************************************************/ + +/* The LM4F120 LaunchPad has a single RGB LED. + * There is only one visible LED which will vary in color. + * But, from the standpoint of the firmware, this appears as three LEDs: * * BOARD_LED_R -- Connected to PF1 * BOARD_LED_G -- Connected to PF3 * BOARD_LED_B -- Connected to PF2 * - * If CONFIG_ARCH_LEDS is defined, then automated support for the LaunchPad LEDs - * will be included in the build: + * If CONFIG_ARCH_LEDS is defined, then automated support for the LaunchPad + * LEDs will be included in the build: * * OFF: - * - OFF means that the OS is still initializing. Initialization is very fast so - * if you see this at all, it probably means that the system is hanging up - * somewhere in the initialization phases. + * - OFF means that the OS is still initializing. Initialization is very fast + * so if you see this at all, it probably means that the system is hanging + * up somewhere in the initialization phases. * * GREEN or GREEN-ish * - This means that the OS completed initialization. @@ -90,7 +91,8 @@ * * Redish: * - If a recovered assertion occurs, the RED component will be illuminated - * briefly while the assertion is handled. You will probably never see this. + * briefly while the assertion is handled. + * You will probably never see this. * * Flashing RED: * - In the event of a fatal crash, the BLUE and GREEN components will be @@ -120,19 +122,19 @@ #define GPIO_SW1 (GPIO_FUNC_INTERRUPT | GPIO_INT_BOTHEDGES | GPIO_PORTF | GPIO_PIN_1) #define GPIO_SW2 (GPIO_FUNC_INTERRUPT | GPIO_INT_BOTHEDGES | GPIO_PORTF | GPIO_PIN_1) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Name: lm4f_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the LM4F LaunchPad. * - ************************************************************************************/ + ****************************************************************************/ void weak_function lm4f_spidev_initialize(void); @@ -149,5 +151,4 @@ void lm4f_led_initialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_LM4F120_LAUNCHPAD_LM4F120_LAUNCHPAD_H */ - +#endif /* __BOARDS_ARM_TIVA_LM4F120_LAUNCHPAD_LM4F120_LAUNCHPAD_H */ diff --git a/boards/arm/tiva/lm4f120-launchpad/tools/oocd.sh b/boards/arm/tiva/lm4f120-launchpad/tools/oocd.sh index 35e5c6b73be..80f72afdd1f 100755 --- a/boards/arm/tiva/lm4f120-launchpad/tools/oocd.sh +++ b/boards/arm/tiva/lm4f120-launchpad/tools/oocd.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# See boards/lm4f120-launchpad/README.txt for information about +# See boards/arm/tiva/lm4f120-launchpad/README.txt for information about # this file. TOPDIR=$1 @@ -28,7 +28,7 @@ TARGET_PATH="/usr/local/share/openocd/scripts" # OPENOCD_EXE=openocd.exe OPENOCD_EXE=openocd -OPENOCD_CFG="${TOPDIR}/boards/lm4f120-launchpad/tools/lm4f120-launchpad.cfg" +OPENOCD_CFG="${TOPDIR}/boards/arm/tiva/lm4f120-launchpad/tools/lm4f120-launchpad.cfg" OPENOCD_ARGS="-f ${OPENOCD_CFG} -s ${TARGET_PATH}" if [ "X$2" = "X-d" ]; then diff --git a/boards/arm/tiva/tm4c123g-launchpad/include/board.h b/boards/arm/tiva/tm4c123g-launchpad/include/board.h index 9c4ad4a68ea..514e325eac8 100644 --- a/boards/arm/tiva/tm4c123g-launchpad/include/board.h +++ b/boards/arm/tiva/tm4c123g-launchpad/include/board.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * boards/arm/tiva/tm4c123g-launchpad/include/board.h * * Copyright (C) 2014 Gregory Nutt. All rights reserved. @@ -31,20 +31,20 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_TMC4C123G_LAUNCHPAD_INCLUDE_BOARD_H -#define __BOARDS_ARM_TMC4C123G_LAUNCHPAD_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_TIVA_TMC4C123G_LAUNCHPAD_INCLUDE_BOARD_H +#define __BOARDS_ARM_TIVA_TMC4C123G_LAUNCHPAD_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ +/* Clocking *****************************************************************/ /* RCC settings. Crystals on-board the TMC4C123G LaunchPad include: * @@ -114,10 +114,11 @@ SYSCON_RCC2_DIV400 | SYSCON_RCC2_USERCC2) #endif -/* LED definitions ******************************************************************/ -/* The TMC4C123G LaunchPad has a single RGB LED. There is only one visible LED which - * will vary in color. But, from the standpoint of the firmware, this appears as - * three LEDs: +/* LED definitions **********************************************************/ + +/* The TMC4C123G LaunchPad has a single RGB LED. + * There is only one visible LED which will vary in color. + * But, from the standpoint of the firmware, this appears as three LEDs: * * BOARD_LED_R -- Connected to PF1 * BOARD_LED_G -- Connected to PF3 @@ -136,13 +137,13 @@ #define BOARD_LED1_BIT (1 << BOARD_LED1) #define BOARD_LED2_BIT (1 << BOARD_LED2) -/* If CONFIG_ARCH_LEDS is defined, then automated support for the LaunchPad LEDs - * will be included in the build: +/* If CONFIG_ARCH_LEDS is defined, then automated support for the LaunchPad + * LEDs will be included in the build: * * OFF: - * - OFF means that the OS is still initializing. Initialization is very fast so - * if you see this at all, it probably means that the system is hanging up - * somewhere in the initialization phases. + * - OFF means that the OS is still initializing. Initialization is very fast + * so if you see this at all, it probably means that the system is hanging + * up somewhere in the initialization phases. * * GREEN or GREEN-ish * - This means that the OS completed initialization. @@ -154,13 +155,15 @@ * * Redish: * - If a recovered assertion occurs, the RED component will be illuminated - * briefly while the assertion is handled. You will probably never see this. + * briefly while the assertion is handled. + * You will probably never see this. * * Flashing RED: * - In the event of a fatal crash, the BLUE and GREEN components will be * extinguished and the RED component will FLASH at a 2Hz rate. + * RED GREEN BLUE */ - /* RED GREEN BLUE */ + #define LED_STARTED 0 /* OFF OFF OFF */ #define LED_HEAPALLOCATE 0 /* OFF OFF OFF */ #define LED_IRQSENABLED 0 /* OFF OFF OFF */ @@ -170,7 +173,8 @@ #define LED_ASSERTION 3 /* ON NC NC (momentary) */ #define LED_PANIC 4 /* ON OFF OFF (flashing 2Hz) */ -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* The TMC4C123G LaunchPad has a two buttons: * * BOARD_SW1 -- Connected to PF4 @@ -184,7 +188,7 @@ #define BUTTON_SW1_BIT (1 << BUTTON_SW1) #define BUTTON_SW2_BIT (1 << BUTTON_SW2) -/* Pin Multiplexing Disambiguation **************************************************/ +/* Pin Multiplexing Disambiguation ******************************************/ #define GPIO_UART1_CTS GPIO_UART1_CTS_1 #define GPIO_UART1_RTS GPIO_UART1_RTS_1 diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c123g-launchpad.h b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c123g-launchpad.h index 9e23f845fce..18333690259 100644 --- a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c123g-launchpad.h +++ b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c123g-launchpad.h @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * boards/arm/tiva/tm4c123g-launchpad/src/tm4c123g-launchpad.h * * Copyright (C) 2014-2016 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_TM4C123G_LAUNCHPAD_TM4C123G_LAUNCHPAD_H -#define __BOARDS_ARM_TM4C123G_LAUNCHPAD_TM4C123G_LAUNCHPAD_H +#ifndef __BOARDS_ARM_TIVA_TM4C123G_LAUNCHPAD_TM4C123G_LAUNCHPAD_H +#define __BOARDS_ARM_TIVA_TM4C123G_LAUNCHPAD_TM4C123G_LAUNCHPAD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -47,10 +47,11 @@ #include "chip.h" #include "tiva_gpio.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ #define HAVE_AT24 1 @@ -114,22 +115,23 @@ # undef CONFIG_TM4C123G_LAUNCHPAD_AT24_NXFFS #endif -/* TM4C123G LaunchPad ***************************************************************/ -/* The TM4C123G LaunchPad has a single RGB LED. There is only one visible LED which - * will vary in color. But, from the standpoint of the firmware, this appears as - * three LEDs: +/* TM4C123G LaunchPad *******************************************************/ + +/* The TM4C123G LaunchPad has a single RGB LED. + * There is only one visible LED which will vary in color. + * But, from the standpoint of the firmware, this appears as three LEDs: * * BOARD_LED_R -- Connected to PF1 * BOARD_LED_G -- Connected to PF3 * BOARD_LED_B -- Connected to PF2 * - * If CONFIG_ARCH_LEDS is defined, then automated support for the LaunchPad LEDs - * will be included in the build: + * If CONFIG_ARCH_LEDS is defined, then automated support for the LaunchPad + * LEDs will be included in the build: * * OFF: - * - OFF means that the OS is still initializing. Initialization is very fast so - * if you see this at all, it probably means that the system is hanging up - * somewhere in the initialization phases. + * - OFF means that the OS is still initializing. Initialization is very fast + * so if you see this at all, it probably means that the system is hanging + * up somewhere in the initialization phases. * * GREEN or GREEN-ish * - This means that the OS completed initialization. @@ -141,7 +143,8 @@ * * Redish: * - If a recovered assertion occurs, the RED component will be illuminated - * briefly while the assertion is handled. You will probably never see this. + * briefly while the assertion is handled. + * You will probably never see this. * * Flashing RED: * - In the event of a fatal crash, the BLUE and GREEN components will be @@ -175,19 +178,19 @@ GPIO_STRENGTH_2MA | GPIO_PADTYPE_STDWPU | \ GPIO_PORTF | GPIO_PIN_0) -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Name: tm4c_ssidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the TM4C123G LaunchPad. * - ************************************************************************************/ + ****************************************************************************/ void weak_function tm4c_ssidev_initialize(void); @@ -213,13 +216,13 @@ void tm4c_led_initialize(void); int tm4c_bringup(void); -/************************************************************************************ +/**************************************************************************** * Name: tm4c_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_TIVA_ADC int tm4c_adc_setup(void); @@ -250,4 +253,4 @@ int tiva_timer_configure(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_TM4C123G_LAUNCHPAD_TM4C123G_LAUNCHPAD_H */ +#endif /* __BOARDS_ARM_TIVA_TM4C123G_LAUNCHPAD_TM4C123G_LAUNCHPAD_H */ diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_adc.c b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_adc.c index 069a5751c4c..e837a92ab98 100644 --- a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_adc.c +++ b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_adc.c @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * boards/arm/tiva/tm4c123g-launchpad/tm4c_adc.c * * Copyright (C) 2015-2016 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 @@ -52,17 +52,17 @@ #ifdef CONFIG_TIVA_ADC -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tm4c_adc_setup * * Description: * Initialize ADC and register the ADC driver. * - ************************************************************************************/ + ****************************************************************************/ int tm4c_adc_setup(void) { @@ -126,13 +126,13 @@ int tm4c_adc_setup(void) return OK; } -/************************************************************************************ +/**************************************************************************** * Name: adc_timer_init * * Description: * Initialize timer specifically for ADC use. * - ************************************************************************************/ + ****************************************************************************/ /* Tiva timer interface does not currently support user configuration */ @@ -151,7 +151,7 @@ TIMER_HANDLE adc_timer_init(void) { .flags = TIMER_FLAG_ADCTIMEOUT; .handler = NULL; - .u.periodic = TIVA_TIME_MS_TO_TICKS(100); // in clock ticks + .u.periodic = TIVA_TIME_MS_TO_TICKS(100); /* in clock ticks */ }; }; diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_appinit.c b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_appinit.c index 43909835ed4..6a9022f12eb 100644 --- a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_appinit.c +++ b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/tm4c123g-launchpad/src/tm4c_appinit.c + * boards/arm/tiva/tm4c123g-launchpad/src/tm4c_appinit.c * * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_at24.c b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_at24.c index 01a447e1e6e..3a6300ecdae 100644 --- a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_at24.c +++ b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_at24.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/sama5d3x-ek/src/tm4c_at24.c + * boards/arm/tiva/tm4c123g-launchpad/src/tm4c_at24.c * * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -118,12 +118,15 @@ int tm4c_at24_automount(int minor) } #if defined(CONFIG_TM4C123G_LAUNCHPAD_AT24_FTL) - /* And finally, use the FTL layer to wrap the MTD driver as a block driver */ + /* And finally, + * use the FTL layer to wrap the MTD driver as a block driver + */ ret = ftl_initialize(AT24_MINOR, mtd); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to initialize the FTL layer: %d\n", ret); + syslog(LOG_ERR, "ERROR: Failed to initialize the FTL layer: %d\n", + ret); return ret; } @@ -142,7 +145,8 @@ int tm4c_at24_automount(int minor) ret = mount(NULL, "/mnt/at24", "nxffs", 0, NULL); if (ret < 0) { - syslog(LOG_ERR, "ERROR: Failed to mount the NXFFS volume: %d\n", errno); + syslog(LOG_ERR, "ERROR: Failed to mount the NXFFS volume: %d\n", + errno); return ret; } #endif diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_autoleds.c b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_autoleds.c index a817d221a74..d5f84620107 100644 --- a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_autoleds.c +++ b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_autoleds.c @@ -54,21 +54,22 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -/* The TM4C123G LaunchPad has a single RGB LED. There is only one visible LED - * which will vary in color. But, from the standpoint of the firmware, this - * appears as three LEDs: + +/* The TM4C123G LaunchPad has a single RGB LED. + * There is only one visible LED which will vary in color. + * But, from the standpoint of the firmware, this appears as three LEDs: * * BOARD_LED_R -- Connected to PF1 * BOARD_LED_G -- Connected to PF3 * BOARD_LED_B -- Connected to PF2 * - * If CONFIG_ARCH_LEDS is defined, then automated support for the LaunchPad LEDs - * will be included in the build: + * If CONFIG_ARCH_LEDS is defined, then automated support for the LaunchPad + * LEDs will be included in the build: * * OFF: - * - OFF means that the OS is still initializing. Initialization is very fast so - * if you see this at all, it probably means that the system is hanging up - * somewhere in the initialization phases. + * - OFF means that the OS is still initializing. Initialization is very fast + * so if you see this at all, it probably means that the system is hanging + * up somewhere in the initialization phases. * * GREEN or GREEN-ish * - This means that the OS completed initialization. @@ -80,7 +81,8 @@ * * Redish: * - If a recovered assertion occurs, the RED component will be illuminated - * briefly while the assertion is handled. You will probably never see this. + * briefly while the assertion is handled. + * You will probably never see this. * * Flashing RED: * - In the event of a fatal crash, the BLUE and GREEN components will be diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_boot.c b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_boot.c index 78697244e03..2dfdf4aa619 100644 --- a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_boot.c +++ b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_boot.c @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * boards/arm/tiva/tm4c123g-launchpad/src/tm4c_boot.c * * Copyright (C) 2014, 2015 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 @@ -48,31 +48,34 @@ #include "up_internal.h" #include "tm4c123g-launchpad.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tiva_boardinitialize * * Description: - * All Tiva 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 Tiva 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 tiva_boardinitialize(void) { - /* Configure SPI chip selects if 1) SSI is not disabled, and 2) the weak function + /* Configure SPI chip selects if + * 1) SSI is not disabled, and + * 2) the weak function * tm4c_ssidev_initialize() has been brought into the link. */ diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_bringup.c b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_bringup.c index d70b9156bab..da4b0dc5195 100644 --- a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_bringup.c +++ b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/tm4c123g-launchpad/src/tm4c_bringup.c + * boards/arm/tiva/tm4c123g-launchpad/src/tm4c_bringup.c * * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_buttons.c b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_buttons.c index 24eb21ea04a..fdafcc63a2e 100644 --- a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_buttons.c +++ b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/tm4c123g-launchpad/src/tm4c_buttons.c + * boards/arm/tiva/tm4c123g-launchpad/src/tm4c_buttons.c * * Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. * Author: Bradley Noyes @@ -33,9 +33,9 @@ * ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -73,8 +73,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. * ****************************************************************************/ diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_ssi.c b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_ssi.c index 2e49d919b41..f96d815409a 100644 --- a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_ssi.c +++ b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_ssi.c @@ -1,4 +1,4 @@ -/************************************************************************************ +/**************************************************************************** * boards/arm/tiva/tm4c123g-launchpad/src/tm4c_ssi.c * * Copyright (C) 2014 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 @@ -55,9 +55,9 @@ #if defined(CONFIG_TIVA_SSI0) || defined(CONFIG_TIVA_SSI1) -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_DEBUG_SPI_INFO # define ssi_dumpgpio(m) tiva_dumpgpio(SDCCS_GPIO, m) @@ -65,17 +65,17 @@ # define ssi_dumpgpio(m) #endif -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tm4c_ssidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the TM4C123G LaunchPad. * - ************************************************************************************/ + ****************************************************************************/ void weak_function tm4c_ssidev_initialize(void) { @@ -84,17 +84,19 @@ void weak_function tm4c_ssidev_initialize(void) /**************************************************************************** * The external functions, tiva_ssiselect and tiva_ssistatus must be provided * by board-specific logic. The are implementations of the select and status - * methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). - * All othermethods (including tiva_ssibus_initialize()) are provided by common - * logic. To use this common SPI logic on your board: + * methods SPI interface defined by struct spi_ops_s + * (see include/nuttx/spi/spi.h). + * All othermethods (including tiva_ssibus_initialize()) are provided by + * common logic. + * To use this common SPI logic on your board: * * 1. Provide tiva_ssiselect() and tiva_ssistatus() functions in your * board-specific logic. This function will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 2. Add a call to tiva_ssibus_initialize() in your low level initialization - * logic - * 3. The handle returned by tiva_ssibus_initialize() may then be used to bind the - * SPI driver to higher level logic (e.g., calling + * 2. Add a call to tiva_ssibus_initialize() in your low level + * initialization logic + * 3. The handle returned by tiva_ssibus_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). * @@ -102,7 +104,8 @@ void weak_function tm4c_ssidev_initialize(void) void tiva_ssiselect(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"); ssi_dumpgpio("tiva_ssiselect() Entry"); ssi_dumpgpio("tiva_ssiselect() Exit"); } diff --git a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_timer.c b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_timer.c index 959d0a944f2..161cc19be69 100644 --- a/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_timer.c +++ b/boards/arm/tiva/tm4c123g-launchpad/src/tm4c_timer.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/tm4c123g-launchpad/src/tm4c_timer.c + * boards/arm/tiva/tm4c123g-launchpad/src/tm4c_timer.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -51,6 +51,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifndef CONFIG_TIVA_TIMER32_PERIODIC @@ -87,11 +88,13 @@ int tiva_timer_configure(void) timer_config.config.handler = 0; timer_config.config.arg = 0; - ret = tiva_timer_initialize(CONFIG_EXAMPLES_TIMER_DEVNAME, &timer_config); + ret = tiva_timer_initialize(CONFIG_EXAMPLES_TIMER_DEVNAME, + &timer_config); if (ret < 0) - { - syslog(LOG_ERR, "ERROR: Failed to register timer driver: %d\n", ret); - } + { + syslog(LOG_ERR, "ERROR: Failed to register timer driver: %d\n", + ret); + } /* now we are initialized */ diff --git a/boards/arm/tiva/tm4c1294-launchpad/include/board.h b/boards/arm/tiva/tm4c1294-launchpad/include/board.h index b144ff0ce19..74829b2c3ec 100644 --- a/boards/arm/tiva/tm4c1294-launchpad/include/board.h +++ b/boards/arm/tiva/tm4c1294-launchpad/include/board.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/tm4c1294-launchpad/include/board.h +/**************************************************************************** + * boards/arm/tiva/tm4c1294-launchpad/include/board.h * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,29 +31,29 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -#ifndef __BOARDS_ARM_TM4C1294_LAUNCHPAD_INCLUDE_BOARD_H -#define __BOARDS_ARM_TM4C1294_LAUNCHPAD_INCLUDE_BOARD_H +#ifndef __BOARDS_ARM_TIVA_TM4C1294_LAUNCHPAD_INCLUDE_BOARD_H +#define __BOARDS_ARM_TIVA_TM4C1294_LAUNCHPAD_INCLUDE_BOARD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ # include #endif -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/* Clocking *************************************************************************/ +/* Clocking *****************************************************************/ /* Crystals on-board the EK-TM4C1294XL include: * - * 1. 25.0MHz (Y2) is connected to OSC0/1 pins and is used as the run mode input to - * the PLL. + * 1. 25.0MHz (Y2) is connected to OSC0/1 pins and is used as the run mode + * input to the PLL. * 2. 32.768kHz (Y3) connected to XOSC0/1 and clocks the hibernation module. */ @@ -66,16 +66,17 @@ #define RTCOSC_FREQUENCY 32768 /* Hibernation module RTC oscillator */ #define LFIOSC_FREQUENCY 33000 /* Low frequency internal oscillator */ -/* The PLL generates Fvco according to the following formulae. The input clock to - * the PLL may be either the external crystal (Fxtal) or PIOSC (Fpiosc). This - * logic supports only the external crystal as the PLL source clock. +/* The PLL generates Fvco according to the following formulae. + * The input clock to the PLL may be either the external crystal (Fxtal) + * or PIOSC (Fpiosc). + * This logic supports only the external crystal as the PLL source clock. * * Fin = Fxtal / (Q + 1 )(N + 1) -OR- Fpiosc / (Q + 1)(N + 1) * Mdiv = Mint + (MFrac / 1024) * Fvco = Fin * Mdiv * - * Where the register fields Q and N actually hold (Q-1) and (N-1). The following - * setup then generates Fvco = 480MHz: + * Where the register fields Q and N actually hold (Q-1) and (N-1). + * The following setup then generates Fvco = 480MHz: * * Fin = 25 MHz / 1 / 5 = 5 MHz * Mdiv = 96 @@ -89,8 +90,8 @@ #define BOARD_FVCO_FREQUENCY 480000000 /* Resulting Fvco */ -/* When the PLL is active, the system clock frequency (SysClk) is calculated using - * the following equation: +/* When the PLL is active, the system clock frequency (SysClk) is calculated + * using the following equation: * * SysClk = Fvco/ (sysdiv + 1) * @@ -109,17 +110,21 @@ /* Alternate Clock (ALTCLK) * - * The ALTCLK provides a clock source of numerous frequencies to the general-purpose - * timer, SSI, and UART modules. The default source for the ALTCLK is the Precision - * Internal Oscillator (PIOSC). The Hibernation Real-time Clock (RTCOSC) and Low - * Frequency Internal Oscillator (LFIOSC) are alternatives. If the RTCOSC Output is - * selected, the clock source must also be enabled in the Hibernation module. + * The ALTCLK provides a clock source of numerous frequencies to the + * general-purpose timer, SSI, and UART modules. + * The default source for the ALTCLK is the Precision + * Internal Oscillator (PIOSC). + * The Hibernation Real-time Clock (RTCOSC) and Low + * Frequency Internal Oscillator (LFIOSC) are alternatives. + * If the RTCOSC Output is selected, the clock source must also be enabled + * in the Hibernation module. */ #define BOARD_ALTCLKCFG SYSCON_ALTCLKCFG_ALTCLK_PIOSC #define ALTCLK_FREQUENCY PIOSC_FREQUENCY -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* The EK-TM4C1294XL has 5 green LEDs. * LED D0 is lit when 3.3V power supply is available . * LEDs D1 and D2 are general purpose LEDs. @@ -150,10 +155,12 @@ #define BOARD_LED_D3_BIT (1 << BOARD_LED_D3) #define BOARD_LED_D4_BIT (1 << BOARD_LED_D4) -/* If CONFIG_ARCH_LEDS is defined, then automated support for the EK-TM4C1294XL LED +/* If CONFIG_ARCH_LEDS is defined, + * then automated support for the EK-TM4C1294XL LED * will be included in the build: + * LED1 LED2 LED3 LED4 */ - /* LED1 LED2 LED3 LED4 */ + #define LED_STARTED 1 /* ON OFF NC NC */ #define LED_HEAPALLOCATE 0 /* NC NC NC NC */ #define LED_IRQSENABLED 0 /* NC NC NC NC */ @@ -163,8 +170,10 @@ #define LED_ASSERTION 0 /* NC NC NC NC */ #define LED_PANIC 3 /* OFF ON NC NC (flashing 2Hz) */ -/* Button definitions ***************************************************************/ -/* There are four push buttons on the board. Two of them are user controllable. +/* Button definitions *******************************************************/ + +/* There are four push buttons on the board. + * Two of them are user controllable. * The others are RESET and WAKE * * --- ------------ @@ -182,7 +191,8 @@ #define BUTTON_SW1_BIT (1 << BUTTON_SW1) #define BUTTON_SW2_BIT (1 << BUTTON_SW2) -/* Pin Multiplexing Disambiguation **************************************************/ +/* Pin Multiplexing Disambiguation ******************************************/ + /* Ethernet LEDs * * PF0/PF4/PF1 are used for Ethernet LEDs. @@ -210,4 +220,4 @@ #define UART7_GPIO_RTS (GPIO_FUNC_OUTPUT | GPIO_PORTG | GPIO_PIN_0) #define UART7_GPIO_CTS (GPIO_FUNC_INPUT | GPIO_PORTL | GPIO_PIN_4) -#endif /* __BOARDS_ARM_TM4C1294_LAUNCHPAD_INCLUDE_BOARD_H */ +#endif /* __BOARDS_ARM_TIVA_TM4C1294_LAUNCHPAD_INCLUDE_BOARD_H */ diff --git a/boards/arm/tiva/tm4c1294-launchpad/scripts/Make.defs b/boards/arm/tiva/tm4c1294-launchpad/scripts/Make.defs index 175b58e68d7..388330b2b0a 100644 --- a/boards/arm/tiva/tm4c1294-launchpad/scripts/Make.defs +++ b/boards/arm/tiva/tm4c1294-launchpad/scripts/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# boards/tm4c1294-launchpad/scripts/Make.defs +# boards/arm/tiva/tm4c1294-launchpad/scripts/Make.defs # # Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/tm4c1294-launchpad/scripts/ld.script b/boards/arm/tiva/tm4c1294-launchpad/scripts/ld.script index d86b8623be2..d3d91f06c55 100644 --- a/boards/arm/tiva/tm4c1294-launchpad/scripts/ld.script +++ b/boards/arm/tiva/tm4c1294-launchpad/scripts/ld.script @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/tm4c1294-launchpad/scripts/ld.script + * boards/arm/tiva/tm4c1294-launchpad/scripts/ld.script * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/tm4c1294-launchpad/src/Makefile b/boards/arm/tiva/tm4c1294-launchpad/src/Makefile index 58e73871698..f1ea8c49abd 100644 --- a/boards/arm/tiva/tm4c1294-launchpad/src/Makefile +++ b/boards/arm/tiva/tm4c1294-launchpad/src/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# boards/tm4c1294-launchpad/src/Makefile +# boards/arm/tiva/tm4c1294-launchpad/src/Makefile # # Copyright (C) 2015 Gregory Nutt. All rights reserved. # Author: Gregory Nutt diff --git a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c1294-launchpad.h b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c1294-launchpad.h index c8d4daa8f0a..06eb3dabf61 100644 --- a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c1294-launchpad.h +++ b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c1294-launchpad.h @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/tm4c1294-launchpad/src/ek-tm4c1294xl.h +/**************************************************************************** + * boards/arm/tiva/tm4c1294-launchpad/src/ek-tm4c1294xl.h * * Copyright (C) 2015, 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_TM4C1294_LAUNCHPAD_TM4C1294_LAUNCHPAD_H -#define __BOARDS_ARM_TM4C1294_LAUNCHPAD_TM4C1294_LAUNCHPAD_H +#ifndef __BOARDS_ARM_TIVA_TM4C1294_LAUNCHPAD_TM4C1294_LAUNCHPAD_H +#define __BOARDS_ARM_TIVA_TM4C1294_LAUNCHPAD_TM4C1294_LAUNCHPAD_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include @@ -46,10 +46,12 @@ #include "chip.h" #include "tiva_gpio.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ -/* Configuration ********************************************************************/ + ****************************************************************************/ + +/* Configuration ************************************************************/ + #define HAVE_HCIUART 1 #if !defined(CONFIG_TIVA_HCIUART) || !defined(CONFIG_BLUETOOTH_UART) @@ -74,7 +76,6 @@ # error No HCI UART specifified #endif - /* How many SSI modules does this chip support? */ #if TIVA_NSSI < 1 @@ -91,7 +92,8 @@ # undef HAVE_I2CTOOL #endif -/* LED definitions ******************************************************************/ +/* LED definitions **********************************************************/ + /* The EK-TM4C1294XL has a four green LEDs. * * --- ------------ @@ -118,8 +120,10 @@ # undef HAVE_USERLED_DRIVER #endif -/* Button definitions ***************************************************************/ -/* There are four push buttons on the board. Two of them are user controllable. +/* Button definitions *******************************************************/ + +/* There are four push buttons on the board. + * Two of them are user controllable. * The others are RESET and WAKE * * --- ------------ @@ -142,11 +146,12 @@ # define GPIO_SW2 (GPIO_FUNC_INPUT | GPIO_PORTJ | GPIO_PIN_1) #endif -/* SPI Chip selects ****************************************************************/ -/* SSI0: PA3 is used for SSI0 chip select to the second booster pack (No pull- -* ups) - * SSI3: PH4 selects the SD card and PQ1 selects the on-board SPI flash. Both - * pulled up on board. +/* SPI Chip selects *********************************************************/ + +/* SSI0: PA3 is used for SSI0 chip select to the second booster pack + * (No pull- ups) + * SSI3: PH4 selects the SD card and PQ1 selects the on-board SPI flash. + * Both pulled up on board. */ #define GPIO_BSTR2_CS (GPIO_FUNC_OUTPUT | GPIO_PADTYPE_STDWPU | GPIO_STRENGTH_4MA | \ @@ -156,31 +161,34 @@ #define GPIO_SD_CS (GPIO_FUNC_OUTPUT | GPIO_PADTYPE_STD | GPIO_STRENGTH_4MA | \ GPIO_VALUE_ONE | GPIO_PORTH | GPIO_PIN_4) -/* I2C *****************************************************************************/ +/* I2C **********************************************************************/ + /* I2C3: PG4-5 are provide to the BoostPack 1 interface * I2C7: PA4-5 are provide to the BoostPack 2 interface * I2C6: PB6-7 are used for I2C to the connector. */ -/* Speaker outputs *****************************************************************/ +/* Speaker outputs **********************************************************/ + /* PB2/PD4 are used for the speaker output */ -/* Touchscreen *********************************************************************/ +/* Touchscreen **************************************************************/ + /* PE7/PP7/PT2-3 are used for the touch screen */ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ #ifndef __ASSEMBLY__ -/************************************************************************************ +/**************************************************************************** * Name: tm4c_ssidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the EK-TM4C1294XL. * - ************************************************************************************/ + ****************************************************************************/ void weak_function tm4c_ssidev_initialize(void); @@ -239,4 +247,4 @@ int hciuart_dev_initialize(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* __BOARDS_ARM_TM4C1294_LAUNCHPAD_TM4C1294_LAUNCHPAD_H */ +#endif /* __BOARDS_ARM_TIVA_TM4C1294_LAUNCHPAD_TM4C1294_LAUNCHPAD_H */ diff --git a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_appinit.c b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_appinit.c index 11c0dd8f443..04f7abc6bd7 100644 --- a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_appinit.c +++ b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_appinit.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/tm4c1294-launchpad/src/tm4c_appinit.c + * boards/arm/tiva/tm4c1294-launchpad/src/tm4c_appinit.c * * Copyright (C) 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -76,8 +76,8 @@ int board_app_initialize(uintptr_t arg) { - /* If CONFIG_BOARD_LATE_INITIALIZE is selected then board initialization was - * already performed in board_late_initialize. + /* If CONFIG_BOARD_LATE_INITIALIZE is selected then board initialization + * was already performed in board_late_initialize. */ #ifndef CONFIG_BOARD_LATE_INITIALIZE diff --git a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_autoleds.c b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_autoleds.c index 5762b7b1c06..910f6042946 100644 --- a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_autoleds.c +++ b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_autoleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/tm4c1294-launchpad/src/tm4c_autoleds.c + * boards/arm/tiva/tm4c1294-launchpad/src/tm4c_autoleds.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -63,6 +63,7 @@ void tm4c_led_initialize(void) { /* Configure LED PIOs for output */ + tiva_configgpio(GPIO_LED_D1); tiva_configgpio(GPIO_LED_D2); tiva_configgpio(GPIO_LED_D3); diff --git a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_boot.c b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_boot.c index 0bcec55dec8..e85f1552a10 100644 --- a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_boot.c +++ b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_boot.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/tm4c1294xl/src/tm4c_boot.c +/**************************************************************************** + * boards/arm/tiva/tm4c1294xl/src/tm4c_boot.c * * Copyright (C) 2014-2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -48,31 +48,34 @@ #include "up_arch.h" #include "up_internal.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tiva_boardinitialize * * Description: - * All Tiva 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 Tiva 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 tiva_boardinitialize(void) { - /* Configure SPI chip selects if 1) SSI is not disabled, and 2) the weak function + /* Configure SPI chip selects if + * 1) SSI is not disabled, and + * 2) the weak function * tm4c_ssidev_initialize() has been brought into the link. */ @@ -98,10 +101,11 @@ void tiva_boardinitialize(void) * Description: * If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional * initialization call will be performed in the boot-up sequence to a - * function called board_late_initialize(). board_late_initialize() will be - * called immediately after up_initialize() is called and just before the - * initial application is started. This additional initialization phase - * may be used, for example, to initialize board-specific device drivers. + * 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/tiva/tm4c1294-launchpad/src/tm4c_bringup.c b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_bringup.c index a23f97196f0..5d5a04b4bc4 100644 --- a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_bringup.c +++ b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_bringup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/tm4c1294-launchpad/src/tm4c_bringup.c + * boards/arm/tiva/tm4c1294-launchpad/src/tm4c_bringup.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -166,18 +166,18 @@ static void tm4c_i2ctool(void) #endif /**************************************************************************** -* Name: tm4c_pwm_register -* -* Description: -* Register a PWM dev file with the upper_level PWM driver. -* -* Input Parameters: -* channel - A number identifying the PWM channel use. -* -* Returned Value: -* None. -* -****************************************************************************/ + * Name: tm4c_pwm_register + * + * Description: + * Register a PWM dev file with the upper_level PWM driver. + * + * Input Parameters: + * channel - A number identifying the PWM channel use. + * + * Returned Value: + * None. + * + ****************************************************************************/ #ifdef HAVE_PWM static void tm4c_pwm_register(int channel) diff --git a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_buttons.c b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_buttons.c index e66552b1c6b..8ae859086d6 100644 --- a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_buttons.c +++ b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_buttons.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/tm4c1294-launchpad/src/tm4c_buttons.c + * boards/arm/tiva/tm4c1294-launchpad/src/tm4c_buttons.c * * Copyright (C) 2015, 2018 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -146,7 +146,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg) { int ret; - if (id < 0 || id >= NUM_BUTTONS ) + if (id < 0 || id >= NUM_BUTTONS) { ret = -EINVAL; } diff --git a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_ethernet.c b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_ethernet.c index ba822f1be7e..ef907ecd228 100644 --- a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_ethernet.c +++ b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_ethernet.c @@ -1,5 +1,5 @@ -/************************************************************************************ - * boards/tm4c1294-launchpad/src/tm4c_ethernet.c +/**************************************************************************** + * boards/arm/tiva/tm4c1294-launchpad/src/tm4c_ethernet.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Authors: Gregory Nutt @@ -31,11 +31,11 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include @@ -51,27 +51,28 @@ #include "hardware/tiva_flash.h" #include "tiva_ethernet.h" -/************************************************************************************ +/**************************************************************************** * Pre-processor Definitions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Private Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Public Functions - ************************************************************************************/ + ****************************************************************************/ -/************************************************************************************ +/**************************************************************************** * Name: tiva_ethernetmac * * Description: - * For the Ethernet Eval Kits, the MAC address will be stored in the non-volatile - * USER0 and USER1 registers. If CONFIG_TIVA_BOARDMAC is defined, this function + * For the Ethernet Eval Kits, the MAC address will be stored in the + * non-volatile USER0 and USER1 registers. + * If CONFIG_TIVA_BOARDMAC is defined, this function * will obtain the MAC address from these registers. * - ************************************************************************************/ + ****************************************************************************/ #ifdef CONFIG_TIVA_BOARDMAC void tiva_ethernetmac(struct ether_addr *ethaddr) diff --git a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_hciuart.c b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_hciuart.c index 3b183d1af57..74da902a591 100644 --- a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_hciuart.c +++ b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_hciuart.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/tm4c1294-launchpad/src/tm4c_hciuart.c + * boards/arm/tiva/tm4c1294-launchpad/src/tm4c_hciuart.c * * Copyright (C) 2016 Gregory Nutt. All rights reserved. * Author: Alan Carvalho de Assis diff --git a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_timer.c b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_timer.c index 7405bcc06d6..1909eb06b49 100644 --- a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_timer.c +++ b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_timer.c @@ -1,5 +1,5 @@ /**************************************************************************** - * config/tm4c1294-launchpad/src/tm4c_timer.c + * boards/arm/tiva/tm4c1294-launchpad/src/tm4c_timer.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -48,6 +48,7 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ + /* Configuration ************************************************************/ #ifndef CONFIG_TIMER diff --git a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_userleds.c b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_userleds.c index e98e867fd5b..5b5a22936c6 100644 --- a/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_userleds.c +++ b/boards/arm/tiva/tm4c1294-launchpad/src/tm4c_userleds.c @@ -1,5 +1,5 @@ /**************************************************************************** - * boards/tm4c1294-launchpad/src/tm4c_userleds.c + * boards/arm/tiva/tm4c1294-launchpad/src/tm4c_userleds.c * * Copyright (C) 2015 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/boards/arm/tiva/tm4c1294-launchpad/tools/oocd.sh b/boards/arm/tiva/tm4c1294-launchpad/tools/oocd.sh index de8eac5e101..796f6ef3965 100755 --- a/boards/arm/tiva/tm4c1294-launchpad/tools/oocd.sh +++ b/boards/arm/tiva/tm4c1294-launchpad/tools/oocd.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# See boards/tm4c1294-launchpad/README.txt for information about +# See boards/arm/tiva/tm4c1294-launchpad/README.txt for information about # this file. TOPDIR=$1 @@ -28,7 +28,7 @@ TARGET_PATH="/usr/share/openocd/scripts" # OPENOCD_EXE=openocd.exe OPENOCD_EXE=openocd -OPENOCD_CFG="${TOPDIR}/boards/tm4c1294-launchpad/tools/ek-tm4c1294xl.cfg" +OPENOCD_CFG="${TOPDIR}/boards/arm/tiva/tm4c1294-launchpad/tools/ek-tm4c1294xl.cfg" OPENOCD_ARGS="-f ${OPENOCD_CFG} -s ${TARGET_PATH}" if [ "X$2" = "X-d" ]; then