Merged in alinjerpelea/nuttx (pull request #969)

avr: hc: mips: codestyle fixes

* avr: codestyle fixes

    After the board restructuration is time for codestyle cleanup

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* hc: codestyle fixes

    After the board restructuration is time for codestyle cleanup

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* mips: codestyle fixes

    After the board restructuration is time for codestyle cleanup

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Alin Jerpelea
2019-08-08 14:53:04 +00:00
committed by Gregory Nutt
parent 240926c995
commit 66565a69a7
168 changed files with 1814 additions and 1460 deletions
+2 -2
View File
@@ -34,7 +34,7 @@ The only GPIO pin usage is for LEDs (2) and Buttons (2):
PIN 24 PB2 KEY1
PIN 25 PB3 KEY2
(See boards/avr32dev1/src/avr32dev1.h). And also for
(See boards/avr/at32uc3/avr32dev1/src/avr32dev1.h). And also for
crystals (4), JTAG (1), and USB (1):
PIN 30 PA11 XIN32
@@ -83,7 +83,7 @@ RS-232 drivers or connectors on board. I use an off-board MAX232
module that I got on eBay (search for MAX232 if you want to find
one). I connect the MAX232 board as follows:
In boards/avr32dev/include/board.h:
In boards/avr/at32uc3/avr32dev/include/board.h:
#define PINMUX_USART1_RXD PINMUX_USART1_RXD_1
#define PINMUX_USART1_TXD PINMUX_USART1_TXD_1
+20 -18
View File
@@ -1,5 +1,5 @@
/************************************************************************************
* boards/avr/avr32dev1/include/board.h
/****************************************************************************
* boards/avr/at32uc3/avr32dev1/include/board.h
*
* Copyright (C) 2010-2011, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -31,27 +31,28 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
****************************************************************************/
#ifndef __BOARDS_AVR_AVR32DEV1_INCLUDE_BOARD_H
#define __BOARDS_AVR_AVR32DEV1_INCLUDE_BOARD_H
#ifndef __BOARDS_AVR_AT32UC3_AVR32DEV1_INCLUDE_BOARD_H
#define __BOARDS_AVR_AT32UC3_AVR32DEV1_INCLUDE_BOARD_H
/************************************************************************************
/****************************************************************************
* Included Files
************************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <nuttx/irq.h>
/************************************************************************************
/****************************************************************************
* Pre-processor Definitions
************************************************************************************/
****************************************************************************/
/* Clocking *************************************************************************/
/* Oscillator setup: RCOSC, OSC32, OSC0, OSC1. Only RCOSC, OSC0, or PLL0 can drive
* the main clock.
/* Clocking *****************************************************************/
/* Oscillator setup: RCOSC, OSC32, OSC0, OSC1. Only RCOSC, OSC0, or PLL0 can
* drive the main clock.
*/
/* The RCOSC frequency needs to be calibrated! */
@@ -62,7 +63,7 @@
#define AVR32_OSC32STARTUP 3 /* OSC32 startup time in RCOSC periods */
#define AVR32_FOSC0 12000000 /* OSC0 frequency in Hz */
#define AVR32_OSC0STARTUP 3 /* OSC0 startup time in RCOSC periods.
#define AVR32_OSC0STARTUP 3 /* OSC0 startup time in RCOSC periods. */
/* #define AVR32_FOSC1 12000000 OSC1 frequency: Hz.
* #define AVR32_OSC1STARTUP 3 OSC1 startup time in RCOSC periods.
@@ -135,12 +136,13 @@
#define AVR32_CPU_CLOCK AVR32_FOSC0
#define AVR32_PBA_CLOCK AVR32_FOSC0
/* Pin muliplexing selecion *********************************************************/
/* Pin muliplexing selecion *************************************************/
#define PINMUX_USART1_RXD PINMUX_USART1_RXD_1
#define PINMUX_USART1_TXD PINMUX_USART1_TXD_1
/* LED definitions ******************************************************************/
/* LED definitions **********************************************************/
/* The AVR32DEV1 board has 3 LEDs, two of which can be controlled through GPIO pins */
/* ON OFF */
@@ -154,11 +156,11 @@
#define LED_ASSERTION 2 /* ON ON ON OFF */
#define LED_PANIC 2 /* ON ON ON OFF */
/* Button definitions ***************************************************************/
/* Button definitions *******************************************************/
/* The AVR32DEV1 board has 3 BUTTONs, two of which can be sensed through GPIO pins. */
#define BUTTON1 1 /* Bit 0: Button 1 */
#define BUTTON2 2 /* Bit 1: Button 2 */
#endif /* __BOARDS_AVR_AVR32DEV1_INCLUDE_BOARD_H */
#endif /* __BOARDS_AVR_AT32UC3_AVR32DEV1_INCLUDE_BOARD_H */
@@ -1,5 +1,5 @@
############################################################################
# boards/avr/avr32dev1/scripts/Make.defs
# boards/avr/at32uc3/avr32dev1/scripts/Make.defs
#
# Copyright (C) 2010, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/avr32dev1/scripts/avr32dev1.ld
* boards/avr/at32uc3/avr32dev1/scripts/avr32dev1.ld
*
* Copyright (C) 2010, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
+1 -1
View File
@@ -1,5 +1,5 @@
############################################################################
# boards/avr/avr32dev1/src/Makefile
# boards/avr/at32uc3/avr32dev1/src/Makefile
#
# Copyright (C) 2010 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
+17 -16
View File
@@ -1,5 +1,5 @@
/************************************************************************************
* boards/avr/avr32dev1/src/avr32_boot.c
/****************************************************************************
* boards/avr/at32uc3/avr32dev1/src/avr32_boot.c
*
* Copyright (C) 2010, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -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 <nuttx/config.h>
@@ -50,27 +50,28 @@
#include "at32uc3.h"
#include "avr32dev1.h"
/************************************************************************************
/****************************************************************************
* Pre-processor Definitions
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Private Functions
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Public Functions
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Name: at32uc3_boardinitialize
*
* Description:
* All AVR32 AT32UC3 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 AVR32 AT32UC3 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 at32uc3_boardinitialize(void)
{
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/avr32dev1/src/avr32_buttons.c
* boards/avr/at32uc3/avr32dev1/src/avr32_buttons.c
*
* Copyright (C) 2010-2011, 2014-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -86,7 +86,7 @@ static int board_button_irqx(int irq, xcpt_t irqhandler, void *arg)
else
{
gpio_irqdisable(irq);
}
}
}
return OK;
@@ -102,9 +102,9 @@ static int board_button_irqx(int irq, xcpt_t irqhandler, void *arg)
*
* 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.
* 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.
*
****************************************************************************/
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/avr32dev1/src/avr32_leds.c
* boards/avr/at32uc3/avr32dev1/src/avr32_leds.c
*
* Copyright (C) 2010, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
+23 -20
View File
@@ -1,5 +1,5 @@
/************************************************************************************
* boards/avr/avr32dev1/src/avr32dev1.h
/****************************************************************************
* boards/avr/at32uc3/avr32dev1/src/avr32dev1.h
*
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -31,24 +31,24 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
****************************************************************************/
#ifndef _CONFIGS_AVR32DEV1_SRC_AVR32DEV1_H
#define _CONFIGS_AVR32DEV1_SRC_AVR32DEV1_H
#ifndef __BOARDS_AVR_AT32UC3_AVR32DEV1_SRC_AVR32DEV1_H
#define __BOARDS_AVR_AT32UC3_AVR32DEV1_SRC_AVR32DEV1_H
/************************************************************************************
/****************************************************************************
* Included Files
************************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include "at32uc3_config.h"
/************************************************************************************
/****************************************************************************
* Pre-processor Definitions
************************************************************************************/
****************************************************************************/
/* Configuration ********************************************************************/
/* Configuration ************************************************************/
#if (CONFIG_AVR32_GPIOIRQSETB & 4) == 1
# define CONFIG_AVR32DEV_BUTTON1_IRQ 1
@@ -58,10 +58,12 @@
# define CONFIG_AVR32DEV_BUTTON2_IRQ 1
#endif
/* AVRDEV1 GPIO Pin Definitions *****************************************************/
/* AVRDEV1 GPIO Pin Definitions *********************************************/
/* LEDs
*
* The AVR32DEV1 board has 3 LEDs, two of which can be controlled through GPIO pins.
* The AVR32DEV1 board has 3 LEDs,
* two of which can be controlled through GPIO pins.
*
* PIN 13 PA7 LED1
* PIN 14 PA8 LED2
@@ -72,7 +74,8 @@
/* BUTTONs
*
* The AVR32DEV1 board has 3 BUTTONs, two of which can be sensed through GPIO pins.
* The AVR32DEV1 board has 3 BUTTONs,
* two of which can be sensed through GPIO pins.
*
* PIN 24 PB2 KEY1
* PIN 25 PB3 KEY2
@@ -96,19 +99,19 @@
GPIO_PORTB | 3)
#endif
/************************************************************************************
/****************************************************************************
* Public Types
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Public data
************************************************************************************/
****************************************************************************/
#ifndef __ASSEMBLY__
/************************************************************************************
/****************************************************************************
* Public Functions
************************************************************************************/
****************************************************************************/
#endif /* __ASSEMBLY__ */
#endif /* _CONFIGS_AVR32DEV1_SRC_AVR32DEV1_H */
#endif /* __BOARDS_AVR_AT32UC3_AVR32DEV1_SRC_AVR32DEV1_H */
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/micropendous3/include/board.h
* boards/avr/at90usb/micropendous3/include/board.h
* include/arch/board/board.h
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
@@ -34,8 +34,8 @@
*
****************************************************************************/
#ifndef __BOARDS_AVR_MICROPENDOUS3_INCLUDE_BOARD_H
#define __BOARDS_AVR_MICROPENDOUS3_INCLUDE_BOARD_H
#ifndef __BOARDS_AVR_AT90USB_MICROPENDOUS3_INCLUDE_BOARD_H
#define __BOARDS_AVR_AT90USB_MICROPENDOUS3_INCLUDE_BOARD_H
/****************************************************************************
* Included Files
@@ -46,15 +46,18 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/* Clocking *****************************************************************/
/* Assume default CLKDIV8 fuse setting is overridden to CLKDIV1 */
#define BOARD_XTAL_FREQ 16000000 /* 16MHz crystal */
#define BOARD_CPU_CLOCK BOARD_XTAL_FREQ /* F_CPU = 16MHz */
/* LED definitions **********************************************************/
/* The Micropendous 3 has no on-board LEDs */
#define LED_STARTED 0
@@ -67,6 +70,7 @@
#define LED_PANIC 7
/* Button definitions *******************************************************/
/* SW1 = Connects to AT90USBxx RESET pin and is not available to software.
* SW2 = Connects (via a pull-up) to PE-2
*/
@@ -87,7 +91,8 @@
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@@ -98,4 +103,4 @@ extern "C" {
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_AVR_MICROPENDOUS3_INCLUDE_BOARD_H */
#endif /* __BOARDS_AVR_AT90USB_MICROPENDOUS3_INCLUDE_BOARD_H */
@@ -1,5 +1,5 @@
############################################################################
# boards/avr/micropendous3/scripts/Make.defs
# boards/avr/at90usb/micropendous3/scripts/Make.defs
#
# Copyright (C) 2011-2012, 2017 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
@@ -1,5 +1,5 @@
/**************************************************************************************
* boards/avr/micropendous3/scripts/micropendous3.ld
/****************************************************************************
* boards/avr/at90usb/micropendous3/scripts/micropendous3.ld
*
* Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -31,9 +31,9 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
**************************************************************************************/
****************************************************************************/
/* Memory Regions *********************************************************************/
/* Memory Regions ***********************************************************/
/* -------------- ------ ------+------- -- ------ -- ------ --- ------ ----+------- ---
* FLASH | REGISTERS I/O EXT I/O ISRAM | EEPROM
* | REGISTERS REGISTERS |
@@ -1,5 +1,5 @@
############################################################################
# boards/avr/micropendous3/src/Makefile
# boards/avr/at90usb/micropendous3/src/Makefile
#
# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
@@ -1,5 +1,5 @@
/************************************************************************************
* boards/avr/micropendous3/src/at90usb_boot.c
/****************************************************************************
* boards/avr/at90usb/micropendous3/src/at90usb_boot.c
*
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -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 <nuttx/config.h>
@@ -49,32 +49,34 @@
#include "at90usb.h"
#include "micropendous3.h"
/************************************************************************************
/****************************************************************************
* Pre-processor Definitions
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Private Functions
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Public Functions
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Name: at90usb_boardinitialize
*
* Description:
* All AT90USB 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 AT90USB 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 at90usb_boardinitialize(void)
{
/* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) the weak
* function at90usb_spidev_initialize() has been brought into the link.
/* Configure SSP chip selects if 1) at least one SSP is enabled, and 2)
* the weak function at90usb_spidev_initialize() has been brought into
* the link.
*/
#if defined(CONFIG_AVR_SPI1) || defined(CONFIG_AVR_SPI2)
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/micropendous3/src/micropendous3.h
* boards/avr/at90usb/micropendous3/src/micropendous3.h
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __BOARDS_AVR_MICROPENDOUS3_SRC_MICROPENDOUS3_H
#define __BOARDS_AVR_MICROPENDOUS3_SRC_MICROPENDOUS3_H
#ifndef __BOARDS_AVR_AT90USB_MICROPENDOUS3_SRC_MICROPENDOUS3_H
#define __BOARDS_AVR_AT90USB_MICROPENDOUS3_SRC_MICROPENDOUS3_H
/****************************************************************************
* Included Files
@@ -45,6 +45,7 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/****************************************************************************
@@ -63,30 +64,32 @@
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
/************************************************************************************
/****************************************************************************
* Name: at90usb_spidev_initialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the Micropendous3 board.
* Called to configure SPI chip select GPIO pins for the Micropendous3
* board.
*
************************************************************************************/
****************************************************************************/
#if defined(CONFIG_AVR_SPI1) || defined(CONFIG_AVR_SPI2)
EXTERN void weak_function at90usb_spidev_initialize(void);
#endif
/************************************************************************************
/****************************************************************************
* Name: at90usb_led_initialize
*
* Description:
* Configure on-board LEDs if LED support has been selected.
*
************************************************************************************/
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
EXTERN void at90usb_led_initialize(void);
@@ -98,4 +101,4 @@ EXTERN void at90usb_led_initialize(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_AVR_MICROPENDOUS3_SRC_MICROPENDOUS3_H */
#endif /* __BOARDS_AVR_AT90USB_MICROPENDOUS3_SRC_MICROPENDOUS3_H */
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/teensy-2.0/include/board.h
* boards/avr/at90usb/teensy-2.0/include/board.h
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __BOARDS_AVR_TEENSY_20_INCLUDE_BOARD_H
#define __BOARDS_AVR_TEENSY_20_INCLUDE_BOARD_H
#ifndef __BOARDS_AVR_AT90USB_TEENSY_20_INCLUDE_BOARD_H
#define __BOARDS_AVR_AT90USB_TEENSY_20_INCLUDE_BOARD_H
/****************************************************************************
* Included Files
@@ -45,16 +45,20 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/* Clocking *****************************************************************/
/* Assume default CLKDIV8 fuse setting is overridden to CLKDIV1 */
#define BOARD_XTAL_FREQ 16000000 /* 16MHz crystal */
#define BOARD_CPU_CLOCK BOARD_XTAL_FREQ /* F_CPU = 16MHz */
/* LED definitions **********************************************************/
/* The Teensy++ 2.0 has a single on-board LEDs connected to PortD, Pin 6 */
/* ON OFF */
#define LED_STARTED 0 /* OFF ON (never happens) */
#define LED_HEAPALLOCATE 0 /* OFF ON (never happens) */
@@ -66,6 +70,7 @@
#define LED_PANIC 0 /* OFF ON (1Hz flashing) */
/* Button definitions *******************************************************/
/* SW1 = Connects to AT90USBxx RESET pin and is not available to software */
/****************************************************************************
@@ -96,4 +101,4 @@ extern "C"
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_AVR_TEENSY_20_INCLUDE_BOARD_H */
#endif /* __BOARDS_AVR_AT90USB_TEENSY_20_INCLUDE_BOARD_H */
@@ -1,5 +1,5 @@
############################################################################
# boards/avr/teensy-2.0/scripts/Make.defs
# boards/avr/at90usb/teensy-2.0/scripts/Make.defs
#
# Copyright (C) 2011-2012, 2017 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
@@ -1,5 +1,5 @@
/************************************************************************************
* boards/avr/teensy-2.0/scripts/flash.ld
* boards/avr/at90usb/teensy-2.0/scripts/flash.ld
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
+1 -1
View File
@@ -1,5 +1,5 @@
############################################################################
# boards/avr/teensy-2.0/src/Makefile
# boards/avr/at90usb/teensy-2.0/src/Makefile
#
# Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/teensy-2.0/src/at90usb_appinit.c
* boards/avr/at90usb/teensy-2.0/src/at90usb_appinit.c
*
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -1,5 +1,5 @@
/************************************************************************************
* boards/avr/teensy-2.0/src/at90usb_boot.c
/****************************************************************************
* boards/avr/at90usb/teensy-2.0/src/at90usb_boot.c
*
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -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 <nuttx/config.h>
@@ -49,25 +49,26 @@
#include "at90usb.h"
#include "teensy-20.h"
/************************************************************************************
/****************************************************************************
* Public Functions
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Name: at90usb_boardinitialize
*
* Description:
* All AT90USB 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 AT90USB 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 at90usb_boardinitialize(void)
{
#ifdef CONFIG_AVR_SPI
/* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) the weak
* function at90usb_spidev_initialize() has been brought into the link.
/* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) the
* weak function at90usb_spidev_initialize() has been brought into the link.
*/
if (at90usb_spidev_initialize)
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/teensy-2.0/src/at90usb_leds.c
* boards/avr/at90usb/teensy-2.0/src/at90usb_leds.c
*
* Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -100,17 +100,20 @@ void board_autoled_on(int led)
switch (led)
{
case 0:
/* The steady state is OFF */
g_ncoff = true;
case 2:
/* Turn the LED off */
PORTD &= ~(1 << 6);
break;
case 1:
/* The steady state is ON */
PORTD |= (1 << 6);
@@ -142,6 +145,7 @@ void board_autoled_off(int led)
switch (led)
{
case 2:
/* If the "no-change" state is OFF, then turn the LED off */
if (g_ncoff)
@@ -154,6 +158,7 @@ void board_autoled_off(int led)
case 0:
case 1:
/* Turn the LED on */
PORTD |= (1 << 6);
+47 -40
View File
@@ -1,5 +1,5 @@
/************************************************************************************
* boards/avr/teensy-2.0/src/at90usb_spi.c
/****************************************************************************
* boards/avr/at90usb/teensy-2.0/src/at90usb_spi.c
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -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 <nuttx/config.h>
@@ -54,9 +54,10 @@
#ifdef CONFIG_AVR_SPI
/************************************************************************************
/****************************************************************************
* Pre-processor Definitions
************************************************************************************/
****************************************************************************/
/* Teensy SPI Connection
*
* -- ---- -- ------------------------- -------
@@ -80,65 +81,71 @@
#define TEENSY_CD (1 << 4)
#define TEENSY_WP (1 << 5)
/************************************************************************************
/****************************************************************************
* Public Functions
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Name: at90usb_spidev_initialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the LPC1766-STK.
*
************************************************************************************/
****************************************************************************/
void weak_function at90usb_spidev_initialize(void)
{
/* The Teensy board has no dedicated SPI devices so we assume that SS is used
* for chip select:
/* The Teensy board has no dedicated SPI devices so we assume that SS is
* used for chip select:
*
* "When the SPI is configured as a Master (MSTR in SPCR is set), the user
* can determine the direction of the SS pin. If SS is configured as an
* output, the pin is a general output pin which does not affect the SPI
* system. ...
* "When the SPI is configured as a Master (MSTR in SPCR is set), the
* user can determine the direction of the SS pin.
* If SS is configured as an output, the pin is a general output pin
* which does not affect the SPI system. ...
*
* "If SS is configured as an input, it must be held high to ensure Master
* SPI operation. If the SS pin is driven low by peripheral circuitry when
* the SPI is configured as a Master with the SS pin defined as an input,
* the SPI system interprets this as another master selecting the SPI ...
* "If SS is configured as an input, it must be held high to ensure
* Master SPI operation. If the SS pin is driven low by peripheral
* circuitry when the SPI is configured as a Master with the SS pin
* defined as an input, the SPI system interprets this as another
* master selecting the SPI ...
*/
DDRB |= TEENSY_CS; /* B0 is an output */
PORTB |= TEENSY_CS; /* Low de-selects */
DDRB &= ~(TEENSY_CD | TEENSY_WP); /* B4 and B5 are inputs */
PORTB |= (TEENSY_CD | TEENSY_WP); /* Pull high */
DDRB |= TEENSY_CS; /* B0 is an output */
PORTB |= TEENSY_CS; /* Low de-selects */
DDRB &= ~(TEENSY_CD | TEENSY_WP); /* B4 and B5 are inputs */
PORTB |= (TEENSY_CD | TEENSY_WP); /* Pull high */
}
/************************************************************************************
/****************************************************************************
* Name: avr_spiselect and avr_spistatus
*
* Description:
* The external functions, avr_spiselect and avr_spistatus must be provided by
* board-specific logic. They are implementations of the select and status methods
* of the SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). All
* other methods (including avr_spibus_initialize()) are provided by common AVR logic.
* The external functions, avr_spiselect and avr_spistatus must be provided
* by board-specific logic. They are implementations of the select and
* status methods of the SPI interface defined by struct spi_ops_s
* (see include/nuttx/spi/spi.h).
* All other methods (including avr_spibus_initialize()) are provided by
* common AVR logic.
* To use this common SPI logic on your board:
*
* 1. Provide logic in avr_spidev_initialize() to configure SPI chip select pins.
* 2. Provide avr_spiselect() and avr_spistatus() functions in your board-specific
* logic. These functions will perform chip selection and status operations
* in the way your board is configured.
* 3. Add a calls to at90usb_spidev_initialize() in your low level application
* initialization logic
* 4. The handle returned by avr_spibus_initialize() may then be used to bind the
* SPI driver to higher level logic (e.g., calling mmcsd_spislotinitialize(),
* 1. Provide logic in avr_spidev_initialize() to configure SPI
* chip select pins.
* 2. Provide avr_spiselect() and avr_spistatus() functions in your
* board-specific logic. These functions will perform chip selection and
* status operations in the way your board is configured.
* 3. Add a calls to at90usb_spidev_initialize() in your low level
* application initialization logic
* 4. The handle returned by avr_spibus_initialize() may then be used to
* bind the SPI driver to higher level logic
* (e.g., calling mmcsd_spislotinitialize(),
* for example, will bind the SPI driver to the SPI MMC/SD driver).
*
************************************************************************************/
****************************************************************************/
void avr_spiselect(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
spiinfo("devid: %d CS: %s\n", (int)devid,
selected ? "assert" : "de-assert");
/* Assert/de-assert the CS pin to the card */
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/teens-2.0/src/at90usb_usbmsc.c
* boards/avr/at90usb/teens-2.0/src/at90usb_usbmsc.c
*
* Copyright (C) 2011, 2016 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -101,7 +101,8 @@ int board_usbmsc_initialize(int port)
syslog(LOG_INFO, "Binding SPI port to MMC/SD slot\n");
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1, AVR_MMCSDSLOTNO, spi);
ret = mmcsd_spislotinitialize(CONFIG_SYSTEM_USBMSC_DEVMINOR1,
AVR_MMCSDSLOTNO, spi);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: mmcsd_spislotinitialize failed: %d\n", ret);
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/teensy-2.0/src/teensy-20.h
* boards/avr/at90usb/teensy-2.0/src/teensy-20.h
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __BOARDS_AVR_TEENSY_20_SRC_TEENSY_H
#define __BOARDS_AVR_TEENSY_20_SRC_TEENSY_H
#ifndef __BOARDS_AVR_AT90USB_TEENSY_20_SRC_TEENSY_H
#define __BOARDS_AVR_AT90USB_TEENSY_20_SRC_TEENSY_H
/****************************************************************************
* Included Files
@@ -56,25 +56,25 @@ extern "C"
#define EXTERN extern
#endif
/************************************************************************************
/****************************************************************************
* Name: at90usb_spidev_initialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the Teensy++ 2.0 board.
*
************************************************************************************/
****************************************************************************/
#ifdef CONFIG_AVR_SPI
void weak_function at90usb_spidev_initialize(void);
#endif
/************************************************************************************
/****************************************************************************
* Name: at90usb_led_initialize
*
* Description:
* Configure on-board LEDs if LED support has been selected.
*
************************************************************************************/
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void at90usb_led_initialize(void);
@@ -86,4 +86,4 @@ void at90usb_led_initialize(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_AVR_TEENSY_20_SRC_TEENSY_H */
#endif /* __BOARDS_AVR_AT90USB_TEENSY_20_SRC_TEENSY_H */
+9 -5
View File
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/amber/include/board.h
* boards/avr/atmega/amber/include/board.h
* include/arch/board/board.h
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
@@ -34,8 +34,8 @@
*
****************************************************************************/
#ifndef __BOARDS_AVR_AMBER_INCLUDE_BOARD_H
#define __BOARDS_AVR_AMBER_INCLUDE_BOARD_H
#ifndef __BOARDS_AVR_ATMEGA_AMBER_INCLUDE_BOARD_H
#define __BOARDS_AVR_ATMEGA_AMBER_INCLUDE_BOARD_H
/****************************************************************************
* Included Files
@@ -46,9 +46,11 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/* Clocking *****************************************************************/
/* Assume default CLKDIV8 fuse setting is overridden to CLKDIV1 */
#define BOARD_XTAL_FREQ 14745600 /* 14.7456MHz crystal */
@@ -56,6 +58,7 @@
#define BOARD_TOSCK_CLOCK 32768 /* TOSC = 32.768KHz */
/* LED definitions **********************************************************/
/* The Amber Web Server has a reset switch and four LEDs. The LEDs indicate
* the status of power, programming state, Ethernet link status and reset
* status (Active). None are available for software use.
@@ -86,7 +89,8 @@
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@@ -97,4 +101,4 @@ extern "C" {
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_AVR_AMBER_INCLUDE_BOARD_H */
#endif /* __BOARDS_AVR_ATMEGA_AMBER_INCLUDE_BOARD_H */
+1 -1
View File
@@ -1,5 +1,5 @@
############################################################################
# boards/avr/amber/scripts/Make.defs
# boards/avr/atmega/amber/scripts/Make.defs
#
# Copyright (C) 2011-2012, 2017 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
+5 -4
View File
@@ -1,5 +1,5 @@
/**************************************************************************************
* boards/avr/amber/scripts/amber.ld
/****************************************************************************
* boards/avr/atmega/amber/scripts/amber.ld
*
* Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -31,9 +31,10 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
**************************************************************************************/
****************************************************************************/
/* Memory Regions ***********************************************************/
/* Memory Regions *********************************************************************/
/* -------------- ------ ------+------- -- ------ -- ------ --- ------ ----+------- ---
* FLASH | REGISTERS I/O EXT I/O ISRAM | EEPROM
* | REGISTERS REGISTERS |
+1 -1
View File
@@ -1,5 +1,5 @@
############################################################################
# boards/avr/amber/src/Makefile
# boards/avr/atmega/amber/src/Makefile
#
# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
+9 -8
View File
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/amber/src/amber.h
* boards/avr/atmega/amber/src/amber.h
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __BOARDS_AVR_AMBER_SRC_AMBER_H
#define __BOARDS_AVR_AMBER_SRC_AMBER_H
#ifndef __BOARDS_AVR_ATMEGA_AMBER_SRC_AMBER_H
#define __BOARDS_AVR_ATMEGA_AMBER_SRC_AMBER_H
/****************************************************************************
* Included Files
@@ -45,6 +45,7 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/****************************************************************************
@@ -69,25 +70,25 @@ extern "C"
#define EXTERN extern
#endif
/************************************************************************************
/****************************************************************************
* Name: atmega_spidev_initialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the Amber Web Server.
*
************************************************************************************/
****************************************************************************/
#if defined(CONFIG_AVR_SPI1) || defined(CONFIG_AVR_SPI2)
void weak_function atmega_spidev_initialize(void);
#endif
/************************************************************************************
/****************************************************************************
* Name: atmega_led_initialize
*
* Description:
* Configure on-board LEDs if LED support has been selected.
*
************************************************************************************/
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void atmega_led_initialize(void);
@@ -99,4 +100,4 @@ void atmega_led_initialize(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_AVR_AMBER_SRC_AMBER_H */
#endif /* __BOARDS_AVR_ATMEGA_AMBER_SRC_AMBER_H */
+20 -18
View File
@@ -1,5 +1,5 @@
/************************************************************************************
* boards/avr/amber/src/atmega_boot.c
/****************************************************************************
* boards/avr/atmega/amber/src/atmega_boot.c
*
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -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 <nuttx/config.h>
@@ -49,32 +49,34 @@
#include "atmega.h"
#include "amber.h"
/************************************************************************************
/****************************************************************************
* Pre-processor Definitions
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Private Functions
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Public Functions
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Name: atmega_boardinitialize
*
* Description:
* All ATMega 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 ATMega 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 atmega_boardinitialize(void)
{
/* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) the weak
* function atmega_spidev_initialize() has been brought into the link.
/* Configure SSP chip selects if 1) at least one SSP is enabled, and 2)
* the weak function atmega_spidev_initialize() has been brought into
* the link.
*/
#if defined(CONFIG_AVR_SPI1) || defined(CONFIG_AVR_SPI2)
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/arduino-mega2560/include/board.h
* boards/avr/atmega/arduino-mega2560/include/board.h
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __BOARDS_AVR_ARDUINO_MEGA2560_INCLUDE_BOARD_H
#define __BOARDS_AVR_ARDUINO_MEGA2560_INCLUDE_BOARD_H
#ifndef __BOARDS_AVR_ATMEGA_ARDUINO_MEGA2560_INCLUDE_BOARD_H
#define __BOARDS_AVR_ATMEGA_ARDUINO_MEGA2560_INCLUDE_BOARD_H
/****************************************************************************
* Included Files
@@ -45,13 +45,15 @@
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/* Clocking *****************************************************************/
/* Assume default CLKDIV8 fuse setting is overridden to CLKDIV1 */
//#define BOARD_XTAL_FREQ 20000000 /* 20MHz crystal */
//#define BOARD_XTAL_FREQ 16700000 /* 16.7MHz crystal */
//#define BOARD_XTAL_FREQ 20000000 /* 20MHz crystal */
//#define BOARD_XTAL_FREQ 16700000 /* 16.7MHz crystal */
#define BOARD_XTAL_FREQ 16000000 /* 16MHz crystal */
#define BOARD_CPU_CLOCK BOARD_XTAL_FREQ /* F_CPU = 16MHz */
@@ -71,7 +73,8 @@
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@@ -82,4 +85,4 @@ extern "C" {
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_AVR_ARDUINO_MEGA2560_INCLUDE_BOARD_H */
#endif /* __BOARDS_AVR_ATMEGA_ARDUINO_MEGA2560_INCLUDE_BOARD_H */
@@ -1,5 +1,5 @@
############################################################################
# boards/avr/arduino-mega2560/scripts/Make.defs
# boards/avr/atmega/arduino-mega2560/scripts/Make.defs
#
# Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
@@ -1,5 +1,5 @@
/*******************************************************************************
* boards/avr/arduino-mega2560/scripts/flash.ld
/****************************************************************************
* boards/avr/atmega/arduino-mega2560/scripts/flash.ld
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -31,9 +31,10 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************/
****************************************************************************/
/* Memory Regions ***********************************************************/
/* Memory Regions *************************************************************/
/* ------ ------ ------+------- -- ------ -- ------ --- ------ ----+------- ---
* FLASH | REGISTERS I/O EXT I/O ISRAM | EEPROM
* | REGISTERS REGISTERS |
@@ -1,5 +1,5 @@
############################################################################
# boards/avr/arduino-mega2560/src/Makefile
# boards/avr/atmega/arduino-mega2560/src/Makefile
#
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/arduino-mega2560/src/arduino-mega2560.h
* boards/avr/atmega/arduino-mega2560/src/arduino-mega2560.h
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __BOARDS_AVR_ARDUINO_MEGA2560_SRC_ARDUINO_MEGA2560_H
#define __BOARDS_AVR_ARDUINO_MEGA2560_SRC_ARDUINO_MEGA2560_H
#ifndef __BOARDS_AVR_ATMEGA_ARDUINO_MEGA2560_SRC_ARDUINO_MEGA2560_H
#define __BOARDS_AVR_ATMEGA_ARDUINO_MEGA2560_SRC_ARDUINO_MEGA2560_H
/****************************************************************************
* Included Files
@@ -45,6 +45,7 @@
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/****************************************************************************
@@ -61,17 +62,17 @@
* Public Function Prototypes
****************************************************************************/
/*******************************************************************************
/****************************************************************************
* Name: atmega_ledinit
*
* Description:
* Configure on-board LEDs if LED support has been selected.
*
******************************************************************************/
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void atmega_led_initialize(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_AVR_ARDUINO_MEGA2560_SRC_ARDUINO_MEGA2560_H */
#endif /* __BOARDS_AVR_ATMEGA_ARDUINO_MEGA2560_SRC_ARDUINO_MEGA2560_H */
@@ -1,5 +1,5 @@
/******************************************************************************
* boards/avr/arduino-mega2560/src/avr_boot.c
/****************************************************************************
* boards/avr/atmega/arduino-mega2560/src/avr_boot.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -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 <nuttx/config.h>
@@ -49,19 +49,19 @@
#include "atmega.h"
#include "arduino_mega2560.h"
/******************************************************************************
/****************************************************************************
* Definitions
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Private Functions
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Public Functions
******************************************************************************/
****************************************************************************/
/******************************************************************************
/****************************************************************************
* Name: up_boardinitialize
*
* Description:
@@ -70,7 +70,7 @@
* memory has been configured and mapped but before any devices have been
* initialized.
*
******************************************************************************/
****************************************************************************/
void atmega_boardinitialize(void)
{
@@ -1,5 +1,5 @@
/******************************************************************************
* boards/avr/arduino-mega2560/src/avr_leds.c
/****************************************************************************
* boards/avr/atmega/arduino-mega2560/src/avr_leds.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -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 <nuttx/config.h>
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/moteino-mega/include/board.h
* boards/avr/atmega/moteino-mega/include/board.h
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __BOARDS_AVR_MOTEINO_MEGA_INCLUDE_BOARD_H
#define __BOARDS_AVR_MOTEINO_MEGA_INCLUDE_BOARD_H
#ifndef __BOARDS_AVR_ATMEGA_MOTEINO_MEGA_INCLUDE_BOARD_H
#define __BOARDS_AVR_ATMEGA_MOTEINO_MEGA_INCLUDE_BOARD_H
/****************************************************************************
* Included Files
@@ -45,9 +45,11 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/* Clocking *****************************************************************/
/* Assume default CLKDIV8 fuse setting is overridden to CLKDIV1 */
#define BOARD_XTAL_FREQ 16000000 /* 16MHz crystal */
@@ -94,4 +96,4 @@ extern "C"
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_AVR_MOTEINO_MEGA_INCLUDE_BOARD_H */
#endif /* __BOARDS_AVR_ATMEGA_MOTEINO_MEGA_INCLUDE_BOARD_H */
@@ -1,5 +1,5 @@
############################################################################
# boards/avr/moteino-mega/scripts/Make.defs
# boards/avr/atmega/moteino-mega/scripts/Make.defs
#
# Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
@@ -1,5 +1,5 @@
/**************************************************************************************
* boards/avr/moteino-mega/scripts/ld.script
/****************************************************************************
* boards/avr/atmega/moteino-mega/scripts/ld.script
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -31,9 +31,9 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
**************************************************************************************/
****************************************************************************/
/* Memory Regions *********************************************************************/
/* Memory Regions ***********************************************************/
/* -------------- ------ ------+------- -- ------ -- ------ --- ------ ----+------- ---
* FLASH | REGISTERS I/O EXT I/O ISRAM | EEPROM
* | REGISTERS REGISTERS |
+1 -1
View File
@@ -1,5 +1,5 @@
############################################################################
# boards/avr/moteino-mega/src/Makefile
# boards/avr/atmega/moteino-mega/src/Makefile
#
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
+20 -18
View File
@@ -1,5 +1,5 @@
/************************************************************************************
* boards/avr/moteino-mega/src/avr_boot.c
/****************************************************************************
* boards/avr/atmega/moteino-mega/src/avr_boot.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -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 <nuttx/config.h>
@@ -49,32 +49,34 @@
#include "atmega.h"
#include "moteino_mega.h"
/************************************************************************************
/****************************************************************************
* Pre-processor Definitions
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Private Functions
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Public Functions
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Name: atmega_boardinitialize
*
* Description:
* All ATMega 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 ATMega 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 atmega_boardinitialize(void)
{
/* Configure SSP chip selects if 1) at least one SSP is enabled, and 2) the weak
* function atmega_spidev_initialize() has been brought into the link.
/* Configure SSP chip selects if 1) at least one SSP is enabled, and 2)
* the weak function atmega_spidev_initialize() has been brought into the
* link.
*/
#if defined(CONFIG_AVR_SPI1) || defined(CONFIG_AVR_SPI2)
+10 -5
View File
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/moteino-mega/src/avr_leds.c
* boards/avr/atmega/moteino-mega/src/avr_leds.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -69,10 +69,10 @@ static bool g_ncoff;
void atmega_led_initialize(void)
{
/* The MoteinoMEGA's single LED is on Port D, Pin 7. Configure this pin as an
* output and turn it OFF. The "other" side of the LED is onnected to
* ground through a resistor. Therefore, a logic value of 0 should turn
* the LED off.
/* The MoteinoMEGA's single LED is on Port D, Pin 7.
* Configure this pin as an output and turn it OFF.
* The "other" side of the LED is onnected to ground through a resistor.
* Therefore, a logic value of 0 should turn the LED off.
*/
DDRD |= (1 << 7);
@@ -100,17 +100,20 @@ void board_autoled_on(int led)
switch (led)
{
case 0:
/* The steady state is OFF */
g_ncoff = true;
case 2:
/* Turn the LED off */
PORTD &= ~(1 << 7);
break;
case 1:
/* The steady state is ON */
PORTD |= (1 << 7);
@@ -142,6 +145,7 @@ void board_autoled_off(int led)
switch (led)
{
case 2:
/* If the "no-change" state is OFF, then turn the LED off */
if (g_ncoff)
@@ -154,6 +158,7 @@ void board_autoled_off(int led)
case 0:
case 1:
/* Turn the LED on */
PORTD |= (1 << 7);
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/avr/moteino-mega/src/moteino-mega.h
* boards/avr/atmega/moteino-mega/src/moteino-mega.h
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __BOARDS_AVR_MOTEINO_MEGA_SRC_MOTEINO_MEGA_H
#define __BOARDS_AVR_MOTEINO_MEGA_SRC_MOTEINO_MEGA_H
#ifndef __BOARDS_AVR_ATMEGA_MOTEINO_MEGA_SRC_MOTEINO_MEGA_H
#define __BOARDS_AVR_ATMEGA_MOTEINO_MEGA_SRC_MOTEINO_MEGA_H
/****************************************************************************
* Included Files
@@ -45,6 +45,7 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
/****************************************************************************
@@ -69,25 +70,25 @@ extern "C"
#define EXTERN extern
#endif
/************************************************************************************
/****************************************************************************
* Name: atmega_spidev_initialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the Amber Web Server.
*
************************************************************************************/
****************************************************************************/
#if defined(CONFIG_AVR_SPI1) || defined(CONFIG_AVR_SPI2)
void weak_function atmega_spidev_initialize(void);
#endif
/************************************************************************************
/****************************************************************************
* Name: atmega_led_initialize
*
* Description:
* Configure on-board LEDs if LED support has been selected.
*
************************************************************************************/
****************************************************************************/
#ifdef CONFIG_ARCH_LEDS
void atmega_led_initialize(void);
@@ -99,4 +100,4 @@ void atmega_led_initialize(void);
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_AVR_MOTEINO_MEGA_SRC_MOTEINO_MEGA_H */
#endif /* __BOARDS_AVR_ATMEGA_MOTEINO_MEGA_SRC_MOTEINO_MEGA_H */
@@ -1,5 +1,5 @@
/************************************************************************************
* boards/hc/demo9s12ne64/include/board.h
/****************************************************************************
* boards/hc/mcs92s12ne64/demo9s12ne64/include/board.h
* include/arch/board/board.h
*
* Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
@@ -32,38 +32,41 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
****************************************************************************/
#ifndef __ARCH_BOARD_BOARD_H
#define __ARCH_BOARD_BOARD_H
#ifndef __BOARDS_HC_MCS92S12NE64_DEMO9S12NE64_INCLUDE_BOARD_H
#define __BOARDS_HC_MCS92S12NE64_DEMO9S12NE64_INCLUDE_BOARD_H
/************************************************************************************
/****************************************************************************
* Included Files
************************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/************************************************************************************
/****************************************************************************
* Pre-processor Definitions
************************************************************************************/
****************************************************************************/
/* Clocking *****************************************************************/
/* Clocking *************************************************************************/
/* Frequency of the crystal oscillator */
#define HCS12_OSCCLK 16000000 /* 16MHz */
/* PLL Settings
*
* SYNR register controls the multiplication factor of the PLL. If the PLL is on, the
* count in the loop divider (SYNR) register effectively multiplies up the PLL clock
* (PLLCLK) from the reference frequency by 2 x (SYNR+1). PLLCLK will not be below
* the minimum VCO frequency (fSCM).
* SYNR register controls the multiplication factor of the PLL.
* If the PLL is on, the count in the loop divider (SYNR) register effectively
* multiplies up the PLL clock (PLLCLK) from the reference frequency by 2 x
* (SYNR+1).
* PLLCLK will not be below the minimum VCO frequency (fSCM).
*
* The REFDV register provides a finer granularity for the PLL multiplier steps. The
* count in the reference divider divides OSCCLK frequency by REFDV + 1.
* The REFDV register provides a finer granularity for the PLL multiplier
* steps.
* The count in the reference divider divides OSCCLK frequency by REFDV + 1.
*
* PLLCLK = 2 * OSCCLK * (SYNR + 1) / (REFDV + 1)
*
@@ -75,7 +78,7 @@
#define HCS12_PLLCLK (2*HCS12_OSCCLK*(HCS12_SYNR+1)/(HCS12_REFDV+1))
#define HCS12_BUSCLK (HSC12_PLLCLK/2)
/* LED definitions ******************************************************************/
/* LED definitions **********************************************************/
/* The DEMO9S12NE64 board has 2 LEDs that we will encode as: */
@@ -88,6 +91,6 @@
#define LED_ASSERTION 2 /* LED1 + LED2 */
#define LED_PANIC 7 /* LED2 + N/C */
/* Button definitions ***************************************************************/
/* Button definitions *******************************************************/
#endif /* __ARCH_BOARD_BOARD_H */
#endif /* __BOARDS_HC_MCS92S12NE64_DEMO9S12NE64_INCLUDE_BOARD_H */
@@ -1,5 +1,5 @@
############################################################################
# boards/hc/demo9s12ne64/scripts/Make.defs
# boards/hc/mcs92s12ne64/demo9s12ne64/scripts/Make.defs
#
# Copyright (C) 2009,2017 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/hc/demo9s12ne64/ostest/demo9s12ne64-banked.ld
* boards/hc/mcs92s12ne64/demo9s12ne64/ostest/demo9s12ne64-banked.ld
*
* Copyright (C) 2009, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -1,5 +1,5 @@
/****************************************************************************
* boards/hc/demo9s12ne64/ostest/demo9s12ne64-banked.ld
* boards/hc/mcs92s12ne64/demo9s12ne64/ostest/demo9s12ne64-banked.ld
*
* Copyright (C) 2009, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -1,5 +1,5 @@
############################################################################
# boards/hc/demo9s12ne64/src/Makefile
# boards/hc/mcs92s12ne64/demo9s12ne64/src/Makefile
#
# Copyright (C) 2009 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>

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