LPC1788 updates from Rommel Marcelo; NUC120 updates
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5658 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
877ad54e96
commit
7c919b80a1
@ -124,8 +124,8 @@
|
||||
|
||||
/* FLASH Configuration */
|
||||
|
||||
#undef CONFIG_LP17_FLASH
|
||||
#define CONFIG_LP17_FLASH 1
|
||||
#undef CONFIG_LPC17_FLASH
|
||||
#define CONFIG_LPC17_FLASH 1
|
||||
#define BOARD_FLASHCFG_VALUE 0x0000303a
|
||||
|
||||
/* LED definitions *********************************************************/
|
||||
|
@ -119,8 +119,8 @@
|
||||
|
||||
/* FLASH Configuration */
|
||||
|
||||
#undef CONFIG_LP17_FLASH
|
||||
#define CONFIG_LP17_FLASH 1
|
||||
#undef CONFIG_LPC17_FLASH
|
||||
#define CONFIG_LPC17_FLASH 1
|
||||
#define BOARD_FLASHCFG_VALUE 0x0000303a
|
||||
|
||||
/* Ethernet configuration */
|
||||
|
@ -119,8 +119,8 @@
|
||||
|
||||
/* FLASH Configuration */
|
||||
|
||||
#undef CONFIG_LP17_FLASH
|
||||
#define CONFIG_LP17_FLASH 1
|
||||
#undef CONFIG_LPC17_FLASH
|
||||
#define CONFIG_LPC17_FLASH 1
|
||||
#define BOARD_FLASHCFG_VALUE 0x0000303a
|
||||
|
||||
/* LED definitions ******************************************************************/
|
||||
|
@ -119,8 +119,8 @@
|
||||
|
||||
/* FLASH Configuration */
|
||||
|
||||
#undef CONFIG_LP17_FLASH
|
||||
#define CONFIG_LP17_FLASH 1
|
||||
#undef CONFIG_LPC17_FLASH
|
||||
#define CONFIG_LPC17_FLASH 1
|
||||
#define BOARD_FLASHCFG_VALUE 0x0000303a
|
||||
|
||||
/* LED definitions ******************************************************************/
|
||||
|
@ -34,8 +34,8 @@
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef _BITNO
|
||||
#define _BITNO
|
||||
#ifndef __CONFIGS_NUTINY_NUC12_INCLUDE_BOARD_H
|
||||
#define __CONFIGS_NUTINY_NUC12_INCLUDE_BOARD_H
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
@ -54,18 +54,11 @@
|
||||
|
||||
/* LED definitions ******************************************************************/
|
||||
/* The NuTiny has a single green LED that can be controlled from sofware. This LED
|
||||
* is connected to PIN17.
|
||||
* is connected to PIN17. It is pulled high so a low value will illuminate the LED.
|
||||
*/
|
||||
|
||||
/* LED index values for use with nuc_setled() */
|
||||
|
||||
#define BOARD_LED 0 /* Green LED */
|
||||
#define BOARD_NLEDS 1
|
||||
|
||||
/* LED bits for use with nuc_setleds() */
|
||||
|
||||
#define BOARD_LED_BIT (1 << BOARD_LED)
|
||||
|
||||
/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
||||
* NuTiny. The following definitions describe how NuttX controls the LEDs:
|
||||
*
|
||||
@ -80,7 +73,7 @@
|
||||
* LED_SIGNAL In a signal handler LED might glow
|
||||
* LED_ASSERTION An assertion failed LED ON while handling the assertion
|
||||
* LED_PANIC The system has crashed LED Blinking at 2Hz
|
||||
* LED_IDLE STM32 is is sleep mode (Optional, not used)
|
||||
* LED_IDLE NUC1XX is is sleep mode (Optional, not used)
|
||||
*/
|
||||
|
||||
#define LED_STARTED 0
|
||||
@ -106,7 +99,8 @@
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
#define EXTERN extern "C"
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
@ -118,29 +112,13 @@ extern "C" {
|
||||
* Name: nuc_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All STM32 architectures must provide the following entry point. This entry point
|
||||
* All NUC1XX 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.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
EXTERN void nuc_boardinitialize(void);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: nuc_ledinit, nuc_setled, and nuc_setleds
|
||||
*
|
||||
* Description:
|
||||
* If CONFIG_ARCH_LEDS is defined, then NuttX will control the on-board LEDs. If
|
||||
* CONFIG_ARCH_LEDS is not defined, then the following interfacesare available to
|
||||
* control the LEDs from user applications.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef CONFIG_ARCH_LEDS
|
||||
EXTERN void nuc_ledinit(void);
|
||||
EXTERN void nuc_setled(int led, bool ledon);
|
||||
EXTERN void nuc_setleds(uint8_t ledset);
|
||||
#endif
|
||||
void nuc_boardinitialize(void);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
@ -148,4 +126,4 @@ EXTERN void nuc_setleds(uint8_t ledset);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _BITNO */
|
||||
#endif /* __CONFIGS_NUTINY_NUC12_INCLUDE_BOARD_H */
|
||||
|
116
configs/nutiny-nuc120/src/Makefile
Normal file
116
configs/nutiny-nuc120/src/Makefile
Normal file
@ -0,0 +1,116 @@
|
||||
############################################################################
|
||||
# configs/nutiny-nuc120/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in
|
||||
# the documentation and/or other materials provided with the
|
||||
# distribution.
|
||||
# 3. Neither the name NuttX nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
-include $(TOPDIR)/Make.defs
|
||||
|
||||
CFLAGS += -I$(TOPDIR)/sched
|
||||
|
||||
ASRCS =
|
||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||
|
||||
CSRCS = nuc_boardinitialize.c
|
||||
|
||||
ifeq ($(CONFIG_HAVE_CXX),y)
|
||||
CSRCS += nuc_cxxinitialize.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARCH_LEDS),y)
|
||||
CSRCS += nuc_led.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NUC1XX_USBD),y)
|
||||
CSRCS += nuc_usbd.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PWM),y)
|
||||
CSRCS += nuc_pwm.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_QENCODER),y)
|
||||
CSRCS += nuc_qencoder.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_WATCHDOG),y)
|
||||
CSRCS += nuc_watchdog.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NSH_ARCHINIT),y)
|
||||
CSRCS += nuc_nsh.c
|
||||
endif
|
||||
|
||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||
|
||||
SRCS = $(ASRCS) $(CSRCS)
|
||||
OBJS = $(AOBJS) $(COBJS)
|
||||
|
||||
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
|
||||
ifeq ($(CONFIG_WINDOWS_NATIVE),y)
|
||||
CFLAGS += -I$(ARCH_SRCDIR)\chip -I$(ARCH_SRCDIR)\common -I$(ARCH_SRCDIR)\armv7-m
|
||||
else
|
||||
ifeq ($(WINTOOL),y)
|
||||
CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
|
||||
-I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
|
||||
-I "${shell cygpath -w $(ARCH_SRCDIR)/armv7-m}"
|
||||
else
|
||||
CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/armv7-m
|
||||
endif
|
||||
endif
|
||||
|
||||
all: libboard$(LIBEXT)
|
||||
|
||||
$(AOBJS): %$(OBJEXT): %.S
|
||||
$(call ASSEMBLE, $<, $@)
|
||||
|
||||
$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
|
||||
$(call COMPILE, $<, $@)
|
||||
|
||||
libboard$(LIBEXT): $(OBJS)
|
||||
$(call ARCHIVE, $@, $(OBJS))
|
||||
|
||||
.depend: Makefile $(SRCS)
|
||||
$(Q) $(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||
$(Q) touch $@
|
||||
|
||||
depend: .depend
|
||||
|
||||
clean:
|
||||
$(call DELFILE, libboard$(LIBEXT))
|
||||
$(call CLEAN)
|
||||
|
||||
distclean: clean
|
||||
$(call DELFILE, Make.dep)
|
||||
$(call DELFILE, .depend)
|
||||
|
||||
-include Make.dep
|
102
configs/nutiny-nuc120/src/nuc_boardinitialize.c
Normal file
102
configs/nutiny-nuc120/src/nuc_boardinitialize.c
Normal file
@ -0,0 +1,102 @@
|
||||
/************************************************************************************
|
||||
* configs/nutiny-nuc120/src/up_boot.c
|
||||
* arch/arm/src/board/up_boot.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <debug.h>
|
||||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "nutiny-nuc120.h"
|
||||
|
||||
/************************************************************************************
|
||||
* Definitions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Private Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: nuc_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All NUC1XX 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 nuc_boardinitialize(void)
|
||||
{
|
||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function
|
||||
* nuc_spiinitialize() has been brought into the link.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_NUC1XX_SPI1) || defined(CONFIG_NUC1XX_SPI2) || defined(CONFIG_NUC1XX_SPI3)
|
||||
if (nuc_spiinitialize)
|
||||
{
|
||||
nuc_spiinitialize();
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Initialize USB if the 1) USB device controller is in the configuration and 2)
|
||||
* disabled, and 3) the weak function nuc_usbinitialize() has been brought
|
||||
* into the build. Presumeably either CONFIG_USBDEV is also selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_NUC1XX_USB
|
||||
if (nuc_usbinitialize)
|
||||
{
|
||||
nuc_usbinitialize();
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Configure on-board LED if LED support has been selected. */
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
nuc_ledinit();
|
||||
#endif
|
||||
}
|
132
configs/nutiny-nuc120/src/nuc_led.c
Normal file
132
configs/nutiny-nuc120/src/nuc_led.c
Normal file
@ -0,0 +1,132 @@
|
||||
/****************************************************************************
|
||||
* configs/nutiny-nuc120/src/up_autoleds.c
|
||||
* arch/arm/src/board/up_autoleds.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
/* The NuTiny has a single green LED that can be controlled from sofware.
|
||||
* This LED is connected to PIN17. It is pulled high so a low value will
|
||||
* illuminate the LED.
|
||||
*
|
||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
||||
* NuTiny. The following definitions describe how NuttX controls the LEDs:
|
||||
*
|
||||
* SYMBOL Meaning LED state
|
||||
* Initially all LED is OFF
|
||||
* ------------------- ----------------------- ------------- ------------
|
||||
* LED_STARTED NuttX has been started LED ON
|
||||
* LED_HEAPALLOCATE Heap has been allocated LED ON
|
||||
* LED_IRQSENABLED Interrupts enabled LED ON
|
||||
* LED_STACKCREATED Idle stack created LED ON
|
||||
* LED_INIRQ In an interrupt LED should glow
|
||||
* LED_SIGNAL In a signal handler LED might glow
|
||||
* LED_ASSERTION An assertion failed LED ON while handling the assertion
|
||||
* LED_PANIC The system has crashed LED Blinking at 2Hz
|
||||
* LED_IDLE NUC1XX is is sleep mode (Optional, not used)
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "chip.h"
|
||||
#include "nuc_gpio.h"
|
||||
#include "nutiny-nuc120.h"
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Enables debug output from this file (needs CONFIG_DEBUG with
|
||||
* CONFIG_DEBUG_VERBOSE too)
|
||||
*/
|
||||
|
||||
#undef LED_DEBUG /* Define to enable debug */
|
||||
|
||||
#ifdef LED_DEBUG
|
||||
# define leddbg lldbg
|
||||
# define ledvdbg llvdbg
|
||||
#else
|
||||
# define leddbg(x...)
|
||||
# define ledvdbg(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_ledinit
|
||||
****************************************************************************/
|
||||
|
||||
void up_ledinit(void)
|
||||
{
|
||||
nuc_configgpio(GPIO_LED);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_ledon
|
||||
****************************************************************************/
|
||||
|
||||
void up_ledon(int led)
|
||||
{
|
||||
nuc_gpiowrite(GPIO_LED, false);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_ledoff
|
||||
****************************************************************************/
|
||||
|
||||
void up_ledoff(int led)
|
||||
{
|
||||
nuc_gpiowrite(GPIO_LED, true);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARCH_LEDS */
|
116
configs/nutiny-nuc120/src/nutiny-nuc120.h
Normal file
116
configs/nutiny-nuc120/src/nutiny-nuc120.h
Normal file
@ -0,0 +1,116 @@
|
||||
/****************************************************************************************************
|
||||
* configs/nutiny-nuc120/src/nutiny-nuc120.h
|
||||
* arch/arm/src/board/nutiny-nuc120.n
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
|
||||
#ifndef __CONFIGS_NUTINY_NUC120_SRC_NUTINY_NUC120_H
|
||||
#define __CONFIGS_NUTINY_NUC120_SRC_NUTINY_NUC120_H
|
||||
|
||||
/****************************************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/****************************************************************************************************
|
||||
* Definitions
|
||||
****************************************************************************************************/
|
||||
/* Configuration ************************************************************************************/
|
||||
|
||||
/* NuTiny-EVB-120 GPIOs *****************************************************************************/
|
||||
/* The NuTiny has a single green LED that can be controlled from sofware. This LED
|
||||
* is connected to PIN17. It is pulled high so a low value will illuminate the LED.
|
||||
*
|
||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
||||
* NuTiny. The following definitions describe how NuttX controls the LEDs:
|
||||
*
|
||||
* SYMBOL Meaning LED state
|
||||
* Initially all LED is OFF
|
||||
* ------------------- ----------------------- ------------- ------------
|
||||
* LED_STARTED NuttX has been started LED ON
|
||||
* LED_HEAPALLOCATE Heap has been allocated LED ON
|
||||
* LED_IRQSENABLED Interrupts enabled LED ON
|
||||
* LED_STACKCREATED Idle stack created LED ON
|
||||
* LED_INIRQ In an interrupt LED should glow
|
||||
* LED_SIGNAL In a signal handler LED might glow
|
||||
* LED_ASSERTION An assertion failed LED ON while handling the assertion
|
||||
* LED_PANIC The system has crashed LED Blinking at 2Hz
|
||||
* LED_IDLE NUC1XX is is sleep mode (Optional, not used)
|
||||
*/
|
||||
|
||||
/* Button definitions ***************************************************************/
|
||||
/* The NuTiny has no buttons */
|
||||
|
||||
/****************************************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************************************/
|
||||
|
||||
/****************************************************************************************************
|
||||
* Public data
|
||||
****************************************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************************************/
|
||||
|
||||
/****************************************************************************************************
|
||||
* Name: nuc_spiinitialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the NuTiny-EVB-120 board.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
|
||||
void weak_function nuc_spiinitialize(void);
|
||||
|
||||
/****************************************************************************************************
|
||||
* Name: nuc_usbinitialize
|
||||
*
|
||||
* Description:
|
||||
* Called from nuc_usbinitialize very early in inialization to setup USB-related
|
||||
* GPIO pins for the NuTiny-EVB-120 board.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32_USB
|
||||
void weak_function nuc_usbinitialize(void);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_NUTINY_NUC120_SRC_NUTINY_NUC120_H */
|
||||
|
@ -124,8 +124,8 @@
|
||||
|
||||
/* FLASH Configuration */
|
||||
|
||||
#undef CONFIG_LP17_FLASH
|
||||
#define CONFIG_LP17_FLASH 1
|
||||
#undef CONFIG_LPC17_FLASH
|
||||
#define CONFIG_LPC17_FLASH 1
|
||||
#define BOARD_FLASHCFG_VALUE 0x0000303a
|
||||
|
||||
/* Ethernet configuration */
|
||||
|
@ -71,6 +71,7 @@
|
||||
*/
|
||||
|
||||
#define LPC17_CCLK 120000000 /* 120Mhz */
|
||||
#define LPC17_PCLKDIV 2 /* Peripheral clock = LPC17_CCLK/2 */
|
||||
|
||||
/* Select the main oscillator as the frequency source. SYSCLK is then the frequency
|
||||
* of the main oscillator.
|
||||
@ -87,7 +88,7 @@
|
||||
#define BOARD_CCLKCFG_DIVIDER 6
|
||||
#define BOARD_CCLKCFG_VALUE ((BOARD_CCLKCFG_DIVIDER-1) << SYSCON_CCLKCFG_CCLKDIV_SHIFT)
|
||||
|
||||
/* PLL0. PLL0 is used to generate the CPU clock divider input (PLLCLK).
|
||||
/* PLL0. PLL0 is used to generate the CPU clock (PLLCLK).
|
||||
*
|
||||
* Source clock: Main oscillator
|
||||
* PLL0 Multiplier value (M): 10
|
||||
@ -106,7 +107,6 @@
|
||||
(((BOARD_PLL0CFG_MSEL-1) << SYSCON_PLLCFG_MSEL_SHIFT) | \
|
||||
((BOARD_PLL0CFG_PSEL-1) << SYSCON_PLLCFG_PSEL_SHIFT))
|
||||
|
||||
#ifdef (CONFIG_LPC17_USBHOST || CONFIG_LPC17_USBDEV)
|
||||
/* PLL1 : PLL1 is used to generate clock for the USB */
|
||||
|
||||
#undef CONFIG_LPC17_PLL1
|
||||
@ -115,7 +115,9 @@
|
||||
#define BOARD_PLL1CFG_PSEL 2
|
||||
#define BOARD_PLL1CFG_VALUE \
|
||||
(((BOARD_PLL1CFG_MSEL-1) << SYSCON_PLLCFG_MSEL_SHIFT) | \
|
||||
((BOARD_PLL1CFG_NSEL-1) << SYSCON_PLLCFG_PSEL_SHIFT))
|
||||
((BOARD_PLL1CFG_PSEL-1) << SYSCON_PLLCFG_PSEL_SHIFT))
|
||||
|
||||
#if defined(CONFIG_LPC17_USBHOST) || (CONFIG_LPC17_USBDEV)
|
||||
|
||||
/* USB divider. The output of the PLL is used as the USB clock
|
||||
*
|
||||
@ -128,8 +130,8 @@
|
||||
|
||||
/* FLASH Configuration */
|
||||
|
||||
#undef CONFIG_LP17_FLASH
|
||||
#define CONFIG_LP17_FLASH 1
|
||||
#undef CONFIG_LPC17_FLASH
|
||||
#define CONFIG_LPC17_FLASH 1
|
||||
|
||||
/* Flash access use 6 CPU clocks - Safe for any allowed conditions */
|
||||
|
||||
@ -137,7 +139,6 @@
|
||||
|
||||
/* Ethernet configuration */
|
||||
|
||||
//#define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV44
|
||||
#define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV20
|
||||
|
||||
/* Set EMC delay values:
|
||||
@ -256,6 +257,10 @@
|
||||
|
||||
/* Alternate pin selections *********************************************************/
|
||||
|
||||
#define GPIO_UART0_TXD GPIO_UART0_TXD_1
|
||||
#define GPIO_UART0_RXD GPIO_UART0_RXD_1
|
||||
|
||||
|
||||
/************************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
|
@ -39,8 +39,9 @@
|
||||
* 0x10000000 and 32Kb of Peripheral SRAM in two banks, 8Kb at addresses
|
||||
* 0x20000000 bank0 first and 8kb at 0x20020000 at bank0 second. And 16Kb
|
||||
* at 0x20040000 on bank1.
|
||||
* Here we assume that .data and .bss will all fit
|
||||
* into the 64Kb CPU SRAM address range.
|
||||
*
|
||||
* Here we assume that .data and .bss will all fit into the 64Kb CPU SRAM
|
||||
* address range.
|
||||
*/
|
||||
|
||||
MEMORY
|
||||
@ -104,7 +105,7 @@ SECTIONS
|
||||
*(COMMON)
|
||||
_ebss = ABSOLUTE(.);
|
||||
} > SRAM
|
||||
|
||||
/*
|
||||
.psram0 (NOLOAD) :
|
||||
{
|
||||
*(.psram0)
|
||||
@ -114,10 +115,10 @@ SECTIONS
|
||||
|
||||
.psram1 (NOLOAD) :
|
||||
{
|
||||
*(.psram0)
|
||||
*(.psram1)
|
||||
. = ALIGN(4)
|
||||
} > PSRAM1
|
||||
|
||||
*/
|
||||
/* Stabs debugging sections */
|
||||
|
||||
.stab 0 : { *(.stab) }
|
||||
|
Loading…
Reference in New Issue
Block a user