mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 09:49:21 +08:00
Merged in alinjerpelea/nuttx (pull request #991)
arm: codestyle fixes 2 * arm: kl: codestyle fixes After the board restructuration is time for codestyle cleanup Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * arm: lc823450: codestyle fixes After the board restructuration is time for codestyle cleanup Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com> * arm: lpc17xx_40xx: 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:
parent
248a2966c6
commit
907d6b085b
242 changed files with 2600 additions and 2235 deletions
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/kwikstik-k40/include/board.h
|
||||
/****************************************************************************
|
||||
* boards/arm/kl/freedom-kl25z/include/board.h
|
||||
* include/arch/board/board.h
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
|
@ -32,30 +32,31 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_BOARD_BOARD_H
|
||||
#define __ARCH_BOARD_BOARD_H
|
||||
#ifndef __BOARDS_ARM_KL_FREEDOM_KL25Z_INCLUDE_BOARD_H
|
||||
#define __BOARDS_ARM_KL_FREEDOM_KL25Z_INCLUDE_BOARD_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#ifndef __ASSEMBLY__
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Clocking *****************************************************************/
|
||||
|
||||
/* Clocking *************************************************************************/
|
||||
/* The Kwikstik-K40 has a 4MHz crystal on board */
|
||||
|
||||
#undef BOARD_EXTCLOCK /* Crystal */
|
||||
#define BOARD_XTAL_FREQ 8000000 /* 8MHz crystal frequency (REFCLK) */
|
||||
#define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator */
|
||||
#undef BOARD_EXTCLOCK /* Crystal */
|
||||
#define BOARD_XTAL_FREQ 8000000 /* 8MHz crystal frequency (REFCLK) */
|
||||
#define BOARD_XTAL32_FREQ 32768 /* 32KHz RTC Oscillator */
|
||||
|
||||
/* PLL Configuration.
|
||||
*
|
||||
|
@ -64,15 +65,16 @@
|
|||
* MCGPLLCLK Frequency: MCGPLLCLK = 96MHz
|
||||
*/
|
||||
|
||||
#define BOARD_PRDIV0 2 /* PLL External Reference Divider */
|
||||
#define BOARD_VDIV0 24 /* PLL VCO Divider (frequency multiplier) */
|
||||
#define BOARD_PRDIV0 2 /* PLL External Reference Divider */
|
||||
#define BOARD_VDIV0 24 /* PLL VCO Divider (frequency multiplier) */
|
||||
|
||||
#define BOARD_PLLIN_FREQ (BOARD_XTAL_FREQ / BOARD_PRDIV0)
|
||||
#define BOARD_PLLOUT_FREQ (BOARD_PLLIN_FREQ * BOARD_VDIV0)
|
||||
#define BOARD_MCGPLLCLK_FREQ BOARD_PLLOUT_FREQ
|
||||
|
||||
/* MCGOUTCLK: MCG output of either IRC, MCGFLLCLK, MCGPLLCLK, or MCG's external
|
||||
* reference clock that sources the core, system, bus, and flash clock.
|
||||
/* MCGOUTCLK: MCG output of either IRC, MCGFLLCLK, MCGPLLCLK, or MCG's
|
||||
* external reference clock that sources the core, system, bus, and
|
||||
* flash clock.
|
||||
*
|
||||
* MCGOUTCLK = MCGPLLCLK = 96MHz
|
||||
*/
|
||||
|
@ -88,20 +90,21 @@
|
|||
* System clock divided by OUTDIV4, clocks the bus slaves and peripherals.
|
||||
*/
|
||||
|
||||
#define BOARD_OUTDIV1 2 /* Core/system = MCGOUTCLK / 2, 48MHz */
|
||||
#define BOARD_OUTDIV4 2 /* Bus clock = System clock / 2, 24MHz */
|
||||
#define BOARD_OUTDIV1 2 /* Core/system = MCGOUTCLK / 2, 48MHz */
|
||||
#define BOARD_OUTDIV4 2 /* Bus clock = System clock / 2, 24MHz */
|
||||
|
||||
#define BOARD_CORECLK_FREQ (BOARD_MCGOUTCLK_FREQ / BOARD_OUTDIV1)
|
||||
#define BOARD_BUSCLK_FREQ (BOARD_CORECLK_FREQ / BOARD_OUTDIV4)
|
||||
|
||||
/* SDHC clocking ********************************************************************/
|
||||
/* SDHC clocking ************************************************************/
|
||||
|
||||
/* SDCLK configurations corresponding to various modes of operation. Formula is:
|
||||
/* SDCLK configurations corresponding to various modes of operation.
|
||||
* Formula is:
|
||||
*
|
||||
* SDCLK frequency = (base clock) / (prescaler * divisor)
|
||||
*
|
||||
* The SDHC module is always configure configured so that the core clock is the base
|
||||
* clock.
|
||||
* The SDHC module is always configure configured so that the core clock is
|
||||
* the base clock.
|
||||
*/
|
||||
|
||||
/* Identification mode: 400KHz = 96MHz / ( 16 * 15) */
|
||||
|
@ -134,6 +137,7 @@
|
|||
#endif
|
||||
|
||||
/* PWM Configuration */
|
||||
|
||||
/* TPM0 Channels */
|
||||
|
||||
#define GPIO_TPM0_CH0OUT PIN_TPM0_CH0_3 //PIN_TPM0_CH0_1
|
||||
|
@ -153,7 +157,8 @@
|
|||
#define GPIO_TPM2_CH0OUT PIN_TPM2_CH0_1
|
||||
#define GPIO_TPM2_CH1OUT PIN_TPM2_CH1_1
|
||||
|
||||
/* LED definitions ******************************************************************/
|
||||
/* LED definitions **********************************************************/
|
||||
|
||||
/* The Freedom KL25Z has a single RGB LED driven by the KL25Z as follows:
|
||||
*
|
||||
* ------------- --------
|
||||
|
@ -163,10 +168,12 @@
|
|||
* Green Cathode PTB19
|
||||
* Blue Cathode PTD1
|
||||
*
|
||||
* NOTE: PTD1 is also connected to the I/O header on J2 pin 10 (also known as D13).
|
||||
* NOTE:
|
||||
* PTD1 is also connected to the I/O header on J2 pin 10 (also known as D13).
|
||||
*
|
||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
||||
* Freedom KL25Z. The following definitions describe how NuttX controls the LEDs:
|
||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board
|
||||
* the Freedom KL25Z.
|
||||
* The following definitions describe how NuttX controls the LEDs:
|
||||
*
|
||||
* SYMBOL Meaning LED state
|
||||
* Initially all LED is OFF
|
||||
|
@ -191,15 +198,17 @@
|
|||
#define LED_ASSERTION 6
|
||||
#define LED_PANIC 7
|
||||
|
||||
/* Button definitions ***************************************************************/
|
||||
/* Button definitions *******************************************************/
|
||||
|
||||
/* The Freedom KL25Z board has no standard GPIO contact buttons */
|
||||
|
||||
/* Alternative pin resolution *******************************************************/
|
||||
/* If there are alternative configurations for various pins in the k25z128_pinmux.h
|
||||
* header file, those alternative pins will be labeled with a suffix like _1, _2,
|
||||
* etc. The logic in this file must select the correct pin configuration for the
|
||||
* board by defining a pin configuration (with no suffix) that maps to the correct
|
||||
* alternative.
|
||||
/* Alternative pin resolution ***********************************************/
|
||||
|
||||
/* If there are alternative configurations for various pins in the
|
||||
* k25z128_pinmux.h header file, those alternative pins will be labeled with
|
||||
* a suffix like _1, _2, etc. The logic in this file must select the correct
|
||||
* pin configuration for the board by defining a pin configuration
|
||||
* (with no suffix) that maps to the correct alternative.
|
||||
*/
|
||||
|
||||
/* SPI0 Pinout
|
||||
|
@ -227,33 +236,35 @@
|
|||
#define GPIO_ADXL345_INT1 (GPIO_INPUT | PIN_PORTA | PIN_INT_RISING | PIN16)
|
||||
#define GPIO_ADXL345_CS (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTD | PIN0)
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
#define EXTERN extern "C"
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_tsi_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the TSI hardware and interface for the sliders on board the Freedom
|
||||
* KL25Z board. Register a character driver at /dev/tsi that may be used to read
|
||||
* from each sensor.
|
||||
* Initialize the TSI hardware and interface for the sliders on board the
|
||||
* Freedom KL25Z board.
|
||||
* Register a character driver at /dev/tsi that may be used to read from
|
||||
* each sensor.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_KL_TSI
|
||||
void kl_tsi_initialize(void);
|
||||
|
@ -265,4 +276,4 @@ void kl_tsi_initialize(void);
|
|||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ARCH_BOARD_BOARD_H */
|
||||
#endif /* __BOARDS_ARM_KL_FREEDOM_KL25Z_INCLUDE_BOARD_H */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
############################################################################
|
||||
# boards/freedom-kl25z/scripts/Make.defs
|
||||
# boards/arm/kl/freedom-kl25z/scripts/Make.defs
|
||||
#
|
||||
# Copyright (C) 2013m, 2017 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/kwikstik-k40/scripts/freedom-kl25z.ld
|
||||
* boards/arm/kl/freedom-kl25z/scripts/freedom-kl25z.ld
|
||||
*
|
||||
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
############################################################################
|
||||
# boards/freedom-kl25z/src/Makefile
|
||||
# boards/arm/kl/freedom-kl25z/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************************************
|
||||
* boards/freedom-kl25z/src/freedom-kl25z.h
|
||||
/****************************************************************************
|
||||
* boards/arm/kl/freedom-kl25z/src/freedom-kl25z.h
|
||||
*
|
||||
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -31,25 +31,27 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __BOARDS_ARM_FREEDOM_KL25Z_SRC_FREEDOM_KL25Z_H
|
||||
#define __BOARDS_ARM_FREEDOM_KL25Z_SRC_FREEDOM_KL25Z_H
|
||||
#ifndef __BOARDS_ARM_KL_FREEDOM_KL25Z_SRC_FREEDOM_KL25Z_H
|
||||
#define __BOARDS_ARM_KL_FREEDOM_KL25Z_SRC_FREEDOM_KL25Z_H
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************************************/
|
||||
/* Configuration ************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* Freedom KL25Z GPIOs ******************************************************/
|
||||
|
||||
/* Freedom KL25Z GPIOs ******************************************************************************/
|
||||
/* The Freedom KL25Z has a single RGB LED driven by the KL25Z as follows:
|
||||
*
|
||||
* ------------- --------
|
||||
|
@ -59,10 +61,12 @@
|
|||
* Green Cathode PTB19
|
||||
* Blue Cathode PTD1
|
||||
*
|
||||
* NOTE: PTD1 is also connected to the I/O header on J2 pin 10 (also known as D13).
|
||||
* NOTE:
|
||||
* PTD1 is also connected to the I/O header on J2 pin 10 (also known as D13).
|
||||
*
|
||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
||||
* Freedom KL25Z. The following definitions describe how NuttX controls the LEDs:
|
||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board
|
||||
* the Freedom KL25Z.
|
||||
* The following definitions describe how NuttX controls the LEDs:
|
||||
*
|
||||
* SYMBOL Meaning LED state
|
||||
* Initially all LED is OFF
|
||||
|
@ -82,72 +86,73 @@
|
|||
#define GPIO_LED_G (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTB | PIN19)
|
||||
#define GPIO_LED_B (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTD | PIN1)
|
||||
|
||||
/* Button definitions *******************************************************************************/
|
||||
/* Button definitions *******************************************************/
|
||||
|
||||
/* The Freedom KL25Z has no buttons */
|
||||
|
||||
/* Chip selects ************************************************************************************/
|
||||
/* Chip selects *************************************************************/
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the Freedom KL25Z board.
|
||||
* Called to configure SPI chip select GPIO pins for the Freedom KL25Z
|
||||
* board.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void weak_function kl_spidev_initialize(void);
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_usbinitialize
|
||||
*
|
||||
* Description:
|
||||
* Called from kl_usbinitialize very early in inialization to setup USB-related
|
||||
* GPIO pins for the Freedom KL25Z board.
|
||||
* Called from kl_usbinitialize very early in inialization to setup
|
||||
* USB-related GPIO pins for the Freedom KL25Z board.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32_USB
|
||||
void weak_function kl_usbinitialize(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_led_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the on-board LED
|
||||
*
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
void kl_led_initialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_pwm_setup
|
||||
*
|
||||
* Description:
|
||||
* Initialize PWM and register the PWM device.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PWM
|
||||
int kl_pwm_setup(void);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __BOARDS_ARM_FREEDOM_KL25Z_SRC_FREEDOM_KL25Z_H */
|
||||
|
||||
#endif /* __BOARDS_ARM_KL_FREEDOM_KL25Z_SRC_FREEDOM_KL25Z_H */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/freedom-kl25z/src/kl_adxl345.c
|
||||
/****************************************************************************
|
||||
* boards/arm/kl/freedom-kl25z/src/kl_adxl345.c
|
||||
*
|
||||
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -31,7 +31,7 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
|
@ -55,6 +55,7 @@
|
|||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#ifdef CONFIG_SENSORS_ADXL345
|
||||
|
@ -153,6 +154,7 @@ static struct kl_adxl345config_s g_adxl345config =
|
|||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/* This is the ADXL345 Interrupt handler */
|
||||
|
||||
int adxl345_interrupt(int irq, FAR void *context)
|
||||
|
@ -181,7 +183,8 @@ int adxl345_interrupt(int irq, FAR void *context)
|
|||
static int adxl345_attach(FAR struct adxl345_config_s *state,
|
||||
adxl345_handler_t handler, FAR void *arg)
|
||||
{
|
||||
FAR struct kl_adxl345config_s *priv = (FAR struct kl_adxl345config_s *)state;
|
||||
FAR struct kl_adxl345config_s *priv =
|
||||
(FAR struct kl_adxl345config_s *)state;
|
||||
|
||||
sninfo("Saving handler %p\n", handler);
|
||||
DEBUGASSERT(priv);
|
||||
|
@ -197,7 +200,8 @@ static int adxl345_attach(FAR struct adxl345_config_s *state,
|
|||
|
||||
static void adxl345_enable(FAR struct adxl345_config_s *state, bool enable)
|
||||
{
|
||||
FAR struct kl_adxl345config_s *priv = (FAR struct kl_adxl345config_s *)state;
|
||||
FAR struct kl_adxl345config_s *priv =
|
||||
(FAR struct kl_adxl345config_s *)state;
|
||||
irqstate_t flags;
|
||||
|
||||
/* Attach and enable, or detach and disable. Enabling and disabling GPIO
|
||||
|
@ -275,7 +279,8 @@ int adxl345_archinitialize(int minor)
|
|||
dev = kl_spibus_initialize(CONFIG_ADXL345_SPIDEV);
|
||||
if (!dev)
|
||||
{
|
||||
snerr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_ADXL345_SPIDEV);
|
||||
snerr("ERROR: Failed to initialize SPI bus %d\n",
|
||||
CONFIG_ADXL345_SPIDEV);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* config/stm32f4discovery/src/kl_appinit.c
|
||||
* boards/arm/kl/freedom-kl25z/src/kl_appinit.c
|
||||
*
|
||||
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/freedom-kl25z/src/kl_boardinitialize.c
|
||||
/****************************************************************************
|
||||
* boards/arm/kl/freedom-kl25z/src/kl_boardinitialize.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <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>
|
||||
|
||||
|
@ -47,32 +47,33 @@
|
|||
#include "up_arch.h"
|
||||
#include "freedom-kl25z.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All K25Z architectures must provide the following entry point. This entry point
|
||||
* is called early in the initialization -- after all memory has been configured
|
||||
* and mapped but before any devices have been initialized.
|
||||
* All K25Z architectures must provide the following entry point.
|
||||
* This entry point is called early in the initialization -- after all
|
||||
* memory has been configured and mapped but before any devices have been
|
||||
* initialized.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void kl_boardinitialize(void)
|
||||
{
|
||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function
|
||||
* kl_spidev_initialize() has been brought into the link.
|
||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak
|
||||
* function kl_spidev_initialize() has been brought into the link.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_KL_SPI0) || defined(CONFIG_KL_SPI1)
|
||||
|
@ -126,6 +127,5 @@ void board_late_initialize(void)
|
|||
#if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL)
|
||||
(void)board_app_initialize(0);
|
||||
#endif
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/freedom-kl25z/src/kl_led.c
|
||||
* boards/arm/kl/freedom-kl25z/src/kl_led.c
|
||||
*
|
||||
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -32,6 +32,7 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* The Freedom KL25Z has a single RGB LED driven by the KL25Z as follows:
|
||||
*
|
||||
* ------------- --------
|
||||
|
@ -41,8 +42,9 @@
|
|||
* Green Cathode PTB19
|
||||
* Blue Cathode PTD1
|
||||
*
|
||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
||||
* Freedom KL25Z. The following definitions describe how NuttX controls the LEDs:
|
||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board
|
||||
* the Freedom KL25Z.
|
||||
* The following definitions describe how NuttX controls the LEDs:
|
||||
*
|
||||
* SYMBOL Meaning LED state
|
||||
* Initially all LED is OFF
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/freedom-kl25z/src/kl_pwm.c
|
||||
/****************************************************************************
|
||||
* boards/arm/kl/freedom-kl25z/src/kl_pwm.c
|
||||
*
|
||||
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -32,11 +32,11 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
|
@ -53,10 +53,12 @@
|
|||
#include "up_arch.h"
|
||||
#include "kl_pwm.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
/* Configuration *******************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* PWM
|
||||
*
|
||||
* The Kinetis Freedom board provides a LED on GPIO.
|
||||
|
@ -66,21 +68,21 @@
|
|||
|
||||
extern struct pwm_lowerhalf_s *kl_pwminitialize(int timer);
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_pwm_setup
|
||||
*
|
||||
* Description:
|
||||
* Initialize PWM and register the PWM device.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
int kl_pwm_setup(void)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/freedom-kl25z/src/kl_spi.c
|
||||
* boards/arm/kl/freedom-kl25z/src/kl_spi.c
|
||||
*
|
||||
* Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -101,12 +101,13 @@ void weak_function kl_spidev_initialize(void)
|
|||
* the way your board is configured.
|
||||
* 3. Add a call to kl_spibus_initialize() in your low level application
|
||||
* initialization logic
|
||||
* 4. The handle returned by kl_spibus_initialize() may then be used to bind
|
||||
* the SPI driver to higher level logic (e.g., calling
|
||||
* 4. The handle returned by kl_spibus_initialize() may then be used to
|
||||
* bind the SPI driver to higher level logic (e.g., calling
|
||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||
* the SPI MMC/SD driver).
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: kl_spi[n]select
|
||||
*
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
/****************************************************************************
|
||||
* boards/freedom-kl25z/src/kl_tsi.c
|
||||
* boards/arm/kl/freedom-kl25z/src/kl_tsi.c
|
||||
*
|
||||
* Copyright (C) 2013 Alan Carvalho de Assis
|
||||
* Author: Alan Carvalho de Assis <acassis@gmail.com>
|
||||
* with adaptions from Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Reference: https://community.freescale.com/community/
|
||||
* the-embedded-beat/blog/2012/10/15/
|
||||
* using-the-touch-interface-on-the-freescale-freedom-development-platform
|
||||
* Reference:
|
||||
* https://community.freescale.com/community/
|
||||
* the-embedded-beat/blog/2012/10/15/
|
||||
* using-the-touch-interface-on-the-freescale-freedom-development-platform
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -75,7 +76,8 @@
|
|||
****************************************************************************/
|
||||
|
||||
static void tsi_calibrate(void);
|
||||
static ssize_t tsi_read(FAR struct file *filep, FAR char *buffer, size_t buflen);
|
||||
static ssize_t tsi_read(FAR struct file *filep,
|
||||
FAR char *buffer, size_t buflen);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
@ -135,7 +137,7 @@ static void tsi_calibrate(void)
|
|||
while (!(getreg32(KL_TSI_GENCS) & TSI_GENCS_EOSF));
|
||||
|
||||
g_defcap[i] = getreg32(KL_TSI_DATA) & TSI_DATA_TSICNT_MASK;
|
||||
iinfo("Sensor %d = %d\n", i+1, g_defcap[i]);
|
||||
iinfo("Sensor %d = %d\n", i + 1, g_defcap[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -171,7 +173,7 @@ static ssize_t tsi_read(FAR struct file *filep, FAR char *buf, size_t buflen)
|
|||
regval |= TSI_DATA_SWTS;
|
||||
putreg32(regval, KL_TSI_DATA);
|
||||
|
||||
/* Wait until the conversion is done*/
|
||||
/* Wait until the conversion is done */
|
||||
|
||||
while (!(getreg32(KL_TSI_GENCS) & TSI_GENCS_EOSF));
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/freedom-kl26z/include/board.h
|
||||
/****************************************************************************
|
||||
* boards/arm/kl/freedom-kl26z/include/board.h
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -31,25 +31,26 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __BOARDS_ARM_FREEDOME_KL26Z_BOARD_H
|
||||
#define __BOARDS_ARM_FREEDOME_KL26Z_BOARD_H
|
||||
#ifndef __BOARDS_ARM_KL_FREEDOM_KL26Z_INCLUDE_BOARD_H
|
||||
#define __BOARDS_ARM_KL_FREEDOM_KL26Z_INCLUDE_BOARD_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#ifndef __ASSEMBLY__
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Clocking *****************************************************************/
|
||||
|
||||
/* Clocking *************************************************************************/
|
||||
/* The KL26Z has an 8MHz crystal on board */
|
||||
|
||||
#undef BOARD_EXTCLOCK /* Crystal */
|
||||
|
@ -63,14 +64,15 @@
|
|||
* MCGPLLCLK Frequency: MCGPLLCLK = 96MHz
|
||||
*/
|
||||
|
||||
#define BOARD_PRDIV0 2 /* PLL External Reference Divider */
|
||||
#define BOARD_VDIV0 24 /* PLL VCO Divider (frequency multiplier) */
|
||||
#define BOARD_PRDIV0 2 /* PLL External Reference Divider */
|
||||
#define BOARD_VDIV0 24 /* PLL VCO Divider (frequency multiplier) */
|
||||
|
||||
#define BOARD_PLLIN_FREQ (BOARD_XTAL_FREQ / BOARD_PRDIV0)
|
||||
#define BOARD_PLLOUT_FREQ (BOARD_PLLIN_FREQ * BOARD_VDIV0)
|
||||
#define BOARD_MCGPLLCLK_FREQ BOARD_PLLOUT_FREQ
|
||||
|
||||
/* MCGOUTCLK: MCG output of either IRC, MCGFLLCLK, MCGPLLCLK, or MCG's external
|
||||
/* MCGOUTCLK:
|
||||
* MCG output of either IRC, MCGFLLCLK, MCGPLLCLK, or MCG's external
|
||||
* reference clock that sources the core, system, bus, and flash clock.
|
||||
*
|
||||
* MCGOUTCLK = MCGPLLCLK = 96MHz
|
||||
|
@ -87,20 +89,21 @@
|
|||
* System clock divided by OUTDIV4, clocks the bus slaves and peripherals.
|
||||
*/
|
||||
|
||||
#define BOARD_OUTDIV1 2 /* Core/system = MCGOUTCLK / 2, 48MHz */
|
||||
#define BOARD_OUTDIV4 2 /* Bus clock = System clock / 2, 24MHz */
|
||||
#define BOARD_OUTDIV1 2 /* Core/system = MCGOUTCLK / 2, 48MHz */
|
||||
#define BOARD_OUTDIV4 2 /* Bus clock = System clock / 2, 24MHz */
|
||||
|
||||
#define BOARD_CORECLK_FREQ (BOARD_MCGOUTCLK_FREQ / BOARD_OUTDIV1)
|
||||
#define BOARD_BUSCLK_FREQ (BOARD_CORECLK_FREQ / BOARD_OUTDIV4)
|
||||
|
||||
/* SDHC clocking ********************************************************************/
|
||||
/* SDHC clocking ************************************************************/
|
||||
|
||||
/* SDCLK configurations corresponding to various modes of operation. Formula is:
|
||||
/* SDCLK configurations corresponding to various modes of operation.
|
||||
* Formula is:
|
||||
*
|
||||
* SDCLK frequency = (base clock) / (prescaler * divisor)
|
||||
*
|
||||
* The SDHC module is always configure configured so that the core clock is the base
|
||||
* clock.
|
||||
* The SDHC module is always configure configured so that the core clock is
|
||||
* the base clock.
|
||||
*/
|
||||
|
||||
/* Identification mode: 400KHz = 96MHz / ( 16 * 15) */
|
||||
|
@ -133,6 +136,7 @@
|
|||
#endif
|
||||
|
||||
/* PWM Configuration */
|
||||
|
||||
/* TPM0 Channels */
|
||||
|
||||
#define GPIO_TPM0_CH0OUT PIN_TPM0_CH0_3 //PIN_TPM0_CH0_1
|
||||
|
@ -152,7 +156,8 @@
|
|||
#define GPIO_TPM2_CH0OUT PIN_TPM2_CH0_1
|
||||
#define GPIO_TPM2_CH1OUT PIN_TPM2_CH1_1
|
||||
|
||||
/* LED definitions ******************************************************************/
|
||||
/* LED definitions **********************************************************/
|
||||
|
||||
/* The Freedom KL26Z has a single RGB LED driven by the KL26Z as follows:
|
||||
*
|
||||
* ------------- --------
|
||||
|
@ -162,10 +167,12 @@
|
|||
* Green Cathode PTE31
|
||||
* Blue Cathode PTD5
|
||||
*
|
||||
* NOTE: PTD5 is also connected to the I/O header on J2 pin 12 (also known as D13).
|
||||
* NOTE:
|
||||
* PTD5 is also connected to the I/O header on J2 pin 12 (also known as D13).
|
||||
*
|
||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
||||
* Freedom KL26Z. The following definitions describe how NuttX controls the LEDs:
|
||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board
|
||||
* the Freedom KL26Z.
|
||||
* The following definitions describe how NuttX controls the LEDs:
|
||||
*
|
||||
* SYMBOL Meaning LED state
|
||||
* Initially all LED is OFF
|
||||
|
@ -190,15 +197,18 @@
|
|||
#define LED_ASSERTION 6
|
||||
#define LED_PANIC 7
|
||||
|
||||
/* Button definitions ***************************************************************/
|
||||
/* Button definitions *******************************************************/
|
||||
|
||||
/* The Freedom KL26Z board has no standard GPIO contact buttons */
|
||||
|
||||
/* Alternative pin resolution *******************************************************/
|
||||
/* If there are alternative configurations for various pins in the k26z128_pinmux.h
|
||||
* header file, those alternative pins will be labeled with a suffix like _1, _2,
|
||||
* etc. The logic in this file must select the correct pin configuration for the
|
||||
* board by defining a pin configuration (with no suffix) that maps to the correct
|
||||
* alternative.
|
||||
/* Alternative pin resolution ***********************************************/
|
||||
|
||||
/* If there are alternative configurations for various pins in the
|
||||
* k26z128_pinmux.h header file, those alternative pins will be labeled with
|
||||
* a suffix like _1, _2, etc.
|
||||
* The logic in this file must select the correct pin configuration for the
|
||||
* board by defining a pin configuration (with no suffix) that maps to the
|
||||
* correct alternative.
|
||||
*/
|
||||
|
||||
/* SPI0 Pinout
|
||||
|
@ -217,9 +227,9 @@
|
|||
#define PIN_SPI1_MISO (PIN_SPI1_MISO_3 | PIN_ALT2_PULLUP)
|
||||
#define PIN_SPI1_MOSI (PIN_SPI0_MOSI_7 | PIN_ALT2_PULLUP)
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
|
@ -232,19 +242,19 @@ extern "C"
|
|||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_tsi_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the TSI hardware and interface for the sliders on board the Freedom
|
||||
* KL26Z board. Register a character driver at /dev/tsi that may be used to read
|
||||
* from each sensor.
|
||||
* Initialize the TSI hardware and interface for the sliders on board the
|
||||
* Freedom KL26Z board. Register a character driver at /dev/tsi that may
|
||||
* be used to read from each sensor.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_KL_TSI
|
||||
void kl_tsi_initialize(void);
|
||||
|
@ -256,4 +266,4 @@ void kl_tsi_initialize(void);
|
|||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __BOARDS_ARM_FREEDOME_KL26Z_BOARD_H */
|
||||
#endif /* __BOARDS_ARM_KL_FREEDOM_KL26Z_INCLUDE_BOARD_H */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
############################################################################
|
||||
# boards/freedom-kl26z/scripts/Make.defs
|
||||
# boards/arm/kl/freedom-kl26z/scripts/Make.defs
|
||||
#
|
||||
# Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/freedom-kl26z/scripts/freedom-kl26z.ld
|
||||
* boards/arm/kl/freedom-kl26z/scripts/freedom-kl26z.ld
|
||||
*
|
||||
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
############################################################################
|
||||
# boards/freedom-kl26z/src/Makefile
|
||||
# boards/arm/kl/freedom-kl26z/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************************************
|
||||
* boards/freedom-kl26z/src/freedom-kl26z.h
|
||||
/****************************************************************************
|
||||
* boards/arm/kl/freedom-kl26z/src/freedom-kl26z.h
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -31,25 +31,27 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __BOARDS_ARM_FREEDOM_KL26Z_SRC_FREEDOM_KL26Z_H
|
||||
#define __BOARDS_ARM_FREEDOM_KL26Z_SRC_FREEDOM_KL26Z_H
|
||||
#ifndef __BOARDS_ARM_KL_FREEDOM_KL26Z_SRC_FREEDOM_KL26Z_H
|
||||
#define __BOARDS_ARM_KL_FREEDOM_KL26Z_SRC_FREEDOM_KL26Z_H
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************************************/
|
||||
/* Configuration ************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* Freedom KL26Z GPIOs ******************************************************/
|
||||
|
||||
/* Freedom KL26Z GPIOs ******************************************************************************/
|
||||
/* The Freedom KL26Z has a single RGB LED driven by the KL26Z as follows:
|
||||
*
|
||||
* ------------- --------
|
||||
|
@ -59,10 +61,12 @@
|
|||
* Green Cathode PTE31
|
||||
* Blue Cathode PTD5
|
||||
*
|
||||
* NOTE: PTD5 is also connected to the I/O header on J2 pin 12 (also known as D13).
|
||||
* NOTE:
|
||||
* PTD5 is also connected to the I/O header on J2 pin 12 (also known as D13).
|
||||
*
|
||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
||||
* Freedom KL26Z. The following definitions describe how NuttX controls the LEDs:
|
||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board
|
||||
* the Freedom KL26Z.
|
||||
* The following definitions describe how NuttX controls the LEDs:
|
||||
*
|
||||
* SYMBOL Meaning LED state
|
||||
* Initially all LED is OFF
|
||||
|
@ -82,71 +86,73 @@
|
|||
#define GPIO_LED_G (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTE | PIN31)
|
||||
#define GPIO_LED_B (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTD | PIN5)
|
||||
|
||||
/* Button definitions *******************************************************************************/
|
||||
/* Button definitions *******************************************************/
|
||||
|
||||
/* The Freedom KL26Z has no buttons */
|
||||
|
||||
/* Chip selects ************************************************************************************/
|
||||
/* Chip selects *************************************************************/
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the Freedom KL26Z board.
|
||||
* Called to configure SPI chip select GPIO pins for the Freedom KL26Z
|
||||
* board.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void weak_function kl_spidev_initialize(void);
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_usbinitialize
|
||||
*
|
||||
* Description:
|
||||
* Called from kl_usbinitialize very early in inialization to setup USB-related
|
||||
* GPIO pins for the Freedom KL26Z board.
|
||||
* Called from kl_usbinitialize very early in inialization to setup
|
||||
* USB-related GPIO pins for the Freedom KL26Z board.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32_USB
|
||||
void weak_function kl_usbinitialize(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_led_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the on-board LED
|
||||
*
|
||||
****************************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
void kl_led_initialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_pwm_setup
|
||||
*
|
||||
* Description:
|
||||
* Initialize PWM and register the PWM device.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PWM
|
||||
int kl_pwm_setup(void);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __BOARDS_ARM_FREEDOM_KL26Z_SRC_FREEDOM_KL26Z_H */
|
||||
#endif /* __BOARDS_ARM_KL_FREEDOM_KL26Z_SRC_FREEDOM_KL26Z_H */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* config/stm32f4discovery/src/kl_appinit.c
|
||||
* boards/arm/kl/freedom-kl26z/src/kl_appinit.c
|
||||
*
|
||||
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/freedom-kl26z/src/kl_boardinitialize.c
|
||||
/****************************************************************************
|
||||
* boards/arm/kl/freedom-kl26z/src/kl_boardinitialize.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <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>
|
||||
|
||||
|
@ -47,24 +47,25 @@
|
|||
#include "up_arch.h"
|
||||
#include "freedom-kl26z.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All K25Z architectures must provide the following entry point. This entry point
|
||||
* is called early in the initialization -- after all memory has been configured
|
||||
* and mapped but before any devices have been initialized.
|
||||
* All K25Z architectures must provide the following entry point.
|
||||
* This entry point is called early in the initialization -- after all
|
||||
* memory has been configured and mapped but before any devices have been
|
||||
* initialized.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void kl_boardinitialize(void)
|
||||
{
|
||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function
|
||||
* kl_spidev_initialize() has been brought into the link.
|
||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak
|
||||
* function kl_spidev_initialize() has been brought into the link.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_KL_SPI0) || defined(CONFIG_KL_SPI1)
|
||||
|
@ -100,9 +101,9 @@ void kl_boardinitialize(void)
|
|||
* Description:
|
||||
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
||||
* initialization call will be performed in the boot-up sequence to a
|
||||
* function called board_late_initialize(). board_late_initialize() will be
|
||||
* called immediately after up_intitialize() is called and just before the
|
||||
* initial application is started. This additional initialization phase
|
||||
* function called board_late_initialize(). board_late_initialize() will
|
||||
* be called immediately after up_intitialize() is called and just before
|
||||
* the initial application is started. This additional initialization phase
|
||||
* may be used, for example, to initialize board-specific device drivers.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -111,8 +112,8 @@ void kl_boardinitialize(void)
|
|||
void board_late_initialize(void)
|
||||
{
|
||||
/* Perform NSH initialization here instead of from the NSH. This
|
||||
* alternative NSH initialization is necessary when NSH is ran in user-space
|
||||
* but the initialization function must run in kernel space.
|
||||
* alternative NSH initialization is necessary when NSH is ran in
|
||||
* user-space but the initialization function must run in kernel space.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/freedom-kl26z/src/kl_led.c
|
||||
* boards/arm/kl/freedom-kl26z/src/kl_led.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -41,8 +41,9 @@
|
|||
* Green Cathode PTE31
|
||||
* Blue Cathode PTD5
|
||||
*
|
||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board the
|
||||
* Freedom KL26Z. The following definitions describe how NuttX controls the LEDs:
|
||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board
|
||||
* the Freedom KL26Z.
|
||||
* The following definitions describe how NuttX controls the LEDs:
|
||||
*
|
||||
* SYMBOL Meaning LED state
|
||||
* Initially all LED is OFF
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/freedom-kl26z/src/kl_pwm.c
|
||||
/****************************************************************************
|
||||
* boards/arm/kl/freedom-kl26z/src/kl_pwm.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -32,11 +32,11 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
|
@ -53,10 +53,12 @@
|
|||
#include "up_arch.h"
|
||||
#include "kl_pwm.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
/* Configuration *******************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* PWM
|
||||
*
|
||||
* The Kinetis Freedom board provides a LED on GPIO.
|
||||
|
@ -66,17 +68,17 @@
|
|||
|
||||
extern struct pwm_lowerhalf_s *kl_pwminitialize(int timer);
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_pwm_setup
|
||||
*
|
||||
* Description:
|
||||
* Initialize PWM and register the PWM device.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
int kl_pwm_setup(void)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/freedom-kl26z/src/kl_spi.c
|
||||
* boards/arm/kl/freedom-kl26z/src/kl_spi.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -104,6 +104,7 @@ void weak_function kl_spidev_initialize(void)
|
|||
* the SPI MMC/SD driver).
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: kl_spi[n]select
|
||||
*
|
||||
|
@ -207,5 +208,4 @@ int kl_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_KL_SPI */
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
/****************************************************************************
|
||||
* boards/freedom-kl26z/src/kl_tsi.c
|
||||
* boards/arm/kl/freedom-kl26z/src/kl_tsi.c
|
||||
*
|
||||
* Copyright (C) 2013 Alan Carvalho de Assis
|
||||
* Author: Alan Carvalho de Assis <acassis@gmail.com>
|
||||
* with adaptations from Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Reference: https://community.freescale.com/community/
|
||||
* the-embedded-beat/blog/2012/10/15/
|
||||
* using-the-touch-interface-on-the-freescale-freedom-development-platform
|
||||
* Reference:
|
||||
* https://community.freescale.com/community/
|
||||
* the-embedded-beat/blog/2012/10/15/
|
||||
* using-the-touch-interface-on-the-freescale-freedom-development-platform
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
@ -75,7 +76,8 @@
|
|||
****************************************************************************/
|
||||
|
||||
static void tsi_calibrate(void);
|
||||
static ssize_t tsi_read(FAR struct file *filep, FAR char *buffer, size_t buflen);
|
||||
static ssize_t tsi_read(FAR struct file *filep,
|
||||
FAR char *buffer, size_t buflen);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
|
@ -135,7 +137,7 @@ static void tsi_calibrate(void)
|
|||
while (!(getreg32(KL_TSI_GENCS) & TSI_GENCS_EOSF));
|
||||
|
||||
g_defcap[i] = getreg32(KL_TSI_DATA) & TSI_DATA_TSICNT_MASK;
|
||||
iinfo("Sensor %d = %d\n", i+1, g_defcap[i]);
|
||||
iinfo("Sensor %d = %d\n", i + 1, g_defcap[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -171,7 +173,7 @@ static ssize_t tsi_read(FAR struct file *filep, FAR char *buf, size_t buflen)
|
|||
regval |= TSI_DATA_SWTS;
|
||||
putreg32(regval, KL_TSI_DATA);
|
||||
|
||||
/* Wait until the conversion is done*/
|
||||
/* Wait until the conversion is done */
|
||||
|
||||
while (!(getreg32(KL_TSI_GENCS) & TSI_GENCS_EOSF));
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/teensy-lc/include/board.h
|
||||
/****************************************************************************
|
||||
* boards/arm/kl/teensy-lc/include/board.h
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -31,29 +31,30 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_BOARD_BOARD_H
|
||||
#define __ARCH_BOARD_BOARD_H
|
||||
#ifndef __BOARDS_ARM_KL_TEENSY_LC_INCLUDE_BOARD_H
|
||||
#define __BOARDS_ARM_KL_TEENSY_LC_INCLUDE_BOARD_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#ifndef __ASSEMBLY__
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Clocking *****************************************************************/
|
||||
|
||||
/* Clocking *************************************************************************/
|
||||
/* The board has a 16MHz crystal. */
|
||||
|
||||
#undef BOARD_EXTCLOCK /* Crystal */
|
||||
#define BOARD_XTAL_FREQ 16000000 /* 16 MHz crystal frequency (REFCLK) */
|
||||
#undef BOARD_EXTCLOCK /* Crystal */
|
||||
#define BOARD_XTAL_FREQ 16000000 /* 16 MHz crystal frequency (REFCLK) */
|
||||
|
||||
/* PLL Configuration.
|
||||
*
|
||||
|
@ -62,14 +63,15 @@
|
|||
* MCGPLLCLK Frequency: MCGPLLCLK = 96MHz
|
||||
*/
|
||||
|
||||
#define BOARD_PRDIV0 4 /* PLL External Reference Divider */
|
||||
#define BOARD_VDIV0 24 /* PLL VCO Divider (frequency multiplier) */
|
||||
#define BOARD_PRDIV0 4 /* PLL External Reference Divider */
|
||||
#define BOARD_VDIV0 24 /* PLL VCO Divider (frequency multiplier) */
|
||||
|
||||
#define BOARD_PLLIN_FREQ (BOARD_XTAL_FREQ / BOARD_PRDIV0)
|
||||
#define BOARD_PLLOUT_FREQ (BOARD_PLLIN_FREQ * BOARD_VDIV0)
|
||||
#define BOARD_MCGPLLCLK_FREQ BOARD_PLLOUT_FREQ
|
||||
|
||||
/* MCGOUTCLK: MCG output of either IRC, MCGFLLCLK, MCGPLLCLK, or MCG's external
|
||||
/* MCGOUTCLK:
|
||||
* MCG output of either IRC, MCGFLLCLK, MCGPLLCLK, or MCG's external
|
||||
* reference clock that sources the core, system, bus, and flash clock.
|
||||
*
|
||||
* MCGOUTCLK = MCGPLLCLK = 96MHz
|
||||
|
@ -86,13 +88,14 @@
|
|||
* System clock divided by OUTDIV4, clocks the bus slaves and peripherals.
|
||||
*/
|
||||
|
||||
#define BOARD_OUTDIV1 2 /* Core/system = MCGOUTCLK / 2 = 48 MHz */
|
||||
#define BOARD_OUTDIV4 2 /* Bus clock = System clock / 2 = 24 MHz */
|
||||
#define BOARD_OUTDIV1 2 /* Core/system = MCGOUTCLK / 2 = 48 MHz */
|
||||
#define BOARD_OUTDIV4 2 /* Bus clock = System clock / 2 = 24 MHz */
|
||||
|
||||
#define BOARD_CORECLK_FREQ (BOARD_MCGOUTCLK_FREQ / BOARD_OUTDIV1)
|
||||
#define BOARD_BUSCLK_FREQ (BOARD_CORECLK_FREQ / BOARD_OUTDIV4)
|
||||
|
||||
/* PWM Configuration */
|
||||
|
||||
/* TPM0 Channels */
|
||||
|
||||
#define GPIO_TPM0_CH0OUT PIN_TPM0_CH0_2 // Pin 22: PTC1
|
||||
|
@ -112,8 +115,10 @@
|
|||
#define GPIO_TPM2_CH0OUT PIN_TPM2_CH0_1 // Pin 3: PTA1
|
||||
#define GPIO_TPM2_CH1OUT PIN_TPM2_CH1_1 // Pin 4: PTA2
|
||||
|
||||
/* LED definitions ******************************************************************/
|
||||
/* LED definitions **********************************************************/
|
||||
|
||||
/* The Teensy LC has a single LED. */
|
||||
|
||||
#define LED_STARTED 0 /* LED off */
|
||||
#define LED_HEAPALLOCATE 0 /* LED off */
|
||||
#define LED_IRQSENABLED 0 /* LED off */
|
||||
|
@ -129,7 +134,9 @@
|
|||
*/
|
||||
|
||||
/* Note that the Teensy maps SCK0 to pin 13 which conflicts with the
|
||||
* LED. Use pin 14 instead. */
|
||||
* LED. Use pin 14 instead.
|
||||
*/
|
||||
|
||||
#define PIN_SPI0_SCK (PIN_SPI0_SCK_3 | PIN_ALT2_PULLUP) // Pin 14: PTD1
|
||||
#define PIN_SPI0_MISO (PIN_SPI0_MISO_4 | PIN_ALT2_PULLUP) // Pin 12: PTC7
|
||||
#define PIN_SPI0_MOSI (PIN_SPI0_MOSI_3 | PIN_ALT2_PULLUP) // Pin 11: PTC6
|
||||
|
@ -138,4 +145,4 @@
|
|||
#define PIN_SPI1_MISO (PIN_SPI1_MISO_2 | PIN_ALT2_PULLUP) // Pin 1: PTB17
|
||||
#define PIN_SPI1_MOSI (PIN_SPI0_MOSI_1 | PIN_ALT2_PULLUP) // Pin 0: PTB16
|
||||
|
||||
#endif /* __ARCH_BOARD_BOARD_H */
|
||||
#endif /* __BOARDS_ARM_KL_TEENSY_LC_INCLUDE_BOARD_H */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
############################################################################
|
||||
# boards/teensy-lc/scripts/Make.defs
|
||||
# boards/arm/kl/teensy-lc/scripts/Make.defs
|
||||
#
|
||||
# Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/teensy-lc/scripts/teensy-lc.ld
|
||||
* boards/arm/kl/teensy-lc/scripts/teensy-lc.ld
|
||||
*
|
||||
* Copyright (C) 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
############################################################################
|
||||
# boards/teensy-lc/src/Makefile
|
||||
# boards/arm/kl/teensy-lc/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* config/teensy-lc/src/kl_appinit.c
|
||||
* boards/arm/kl/teensy-lc/src/kl_appinit.c
|
||||
*
|
||||
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/teensy-lc/src/kl_boardinitialize.c
|
||||
/****************************************************************************
|
||||
* boards/arm/kl/teensy-lc/src/kl_boardinitialize.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <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 "up_arch.h"
|
||||
#include "teensy-lc.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All K25Z architectures must provide the following entry point. This entry point
|
||||
* is called early in the initialization -- after all memory has been configured
|
||||
* and mapped but before any devices have been initialized.
|
||||
* All K25Z architectures must provide the following entry point.
|
||||
* This entry point is called early in the initialization -- after all
|
||||
* memory has been configured and mapped but before any devices have been
|
||||
* initialized.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void kl_boardinitialize(void)
|
||||
{
|
||||
|
@ -83,8 +84,8 @@ void kl_boardinitialize(void)
|
|||
kl_configgpio(PIN_UART0_TX_3);
|
||||
#endif
|
||||
|
||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function
|
||||
* kl_spidev_initialize() has been brought into the link.
|
||||
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak
|
||||
* function kl_spidev_initialize() has been brought into the link.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_KL_SPI0) || defined(CONFIG_KL_SPI1)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/teensy-lc/src/kl_led.c
|
||||
* boards/arm/kl/teensy-lc/src/kl_led.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/teensy-lc/src/kl_pwm.c
|
||||
/****************************************************************************
|
||||
* boards/arm/kl/teensy-lc/src/kl_pwm.c
|
||||
*
|
||||
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -32,11 +32,11 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
|
@ -53,10 +53,12 @@
|
|||
#include "up_arch.h"
|
||||
#include "kl_pwm.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
/* Configuration *******************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* PWM
|
||||
*
|
||||
* The Kinetis Freedom board provides a LED on GPIO.
|
||||
|
@ -66,17 +68,17 @@
|
|||
|
||||
extern struct pwm_lowerhalf_s *kl_pwminitialize(int timer);
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_pwm_setup
|
||||
*
|
||||
* Description:
|
||||
* Initialize PWM and register the PWM device.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
int kl_pwm_setup(void)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/teensy-lc/src/kl_spi.c
|
||||
* boards/arm/kl/teensy-lc/src/kl_spi.c
|
||||
*
|
||||
* Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -104,6 +104,7 @@ void weak_function kl_spidev_initialize(void)
|
|||
* the SPI MMC/SD driver).
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: kl_spi[n]select
|
||||
*
|
||||
|
@ -207,5 +208,4 @@ int kl_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
|||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_KL_SPI */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/teensy-lc/src/teensy-lc.h
|
||||
* boards/arm/kl/teensy-lc/src/teensy-lc.h
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -33,8 +33,8 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __BOARDS_ARM_TEENSY_LC_SRC_TEENSY_LC_H
|
||||
#define __BOARDS_ARM_TEENSY_LC_SRC_TEENSY_LC_H
|
||||
#ifndef __BOARDS_ARM_KL_TEENSY_LC_SRC_TEENSY_LC_H
|
||||
#define __BOARDS_ARM_KL_TEENSY_LC_SRC_TEENSY_LC_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
|
@ -47,6 +47,7 @@
|
|||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#define GPIO_LED (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTC | PIN5)
|
||||
|
@ -79,13 +80,13 @@
|
|||
|
||||
void weak_function kl_spidev_initialize(void);
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kl_pwm_setup
|
||||
*
|
||||
* Description:
|
||||
* Initialize PWM and register the PWM device.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PWM
|
||||
int kl_pwm_setup(void);
|
||||
|
@ -104,5 +105,5 @@ void kl_led_initialize(void);
|
|||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __BOARDS_ARM_TEENSY_LC_SRC_TEENSY_LC_H */
|
||||
#endif /* __BOARDS_ARM_KL_TEENSY_LC_SRC_TEENSY_LC_H */
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/include/board.h
|
||||
* boards/arm/lc823450/lc823450-xgevk/include/board.h
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
@ -33,14 +33,14 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __BOARDS_ARM_LC823450_XGEVK_INCLUDE_BOARD_H
|
||||
#define __BOARDS_ARM_LC823450_XGEVK_INCLUDE_BOARD_H
|
||||
#ifndef __BOARDS_ARM_LC823450_LC823450_XGEVK_INCLUDE_BOARD_H
|
||||
#define __BOARDS_ARM_LC823450_LC823450_XGEVK_INCLUDE_BOARD_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#define LED_STARTED 0 /* N/A */
|
||||
#define LED_HEAPALLOCATE 1 /* N/A */
|
||||
|
@ -53,9 +53,10 @@
|
|||
#define LED_CPU0 8 /* LED0 (D9) */
|
||||
#define LED_CPU1 9 /* LED1 (D10) */
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
@ -68,9 +69,9 @@ extern "C"
|
|||
|
||||
extern unsigned int XT1OSC_CLK;
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void up_init_default_mux(void);
|
||||
|
||||
|
@ -80,4 +81,4 @@ void up_init_default_mux(void);
|
|||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __BOARDS_ARM_LC823450_XGEVK_INCLUDE_BOARD_H */
|
||||
#endif /* __BOARDS_ARM_LC823450_LC823450_XGEVK_INCLUDE_BOARD_H */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
############################################################################
|
||||
# boards/lc823450-xgevk/kernel/Makefile
|
||||
# boards/arm/lc823450/lc823450-xgevk/kernel/Makefile
|
||||
#
|
||||
# Copyright 2018 Sony Video & Sound Products Inc.
|
||||
# Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/kernel/lc823450_userspace.c
|
||||
* boards/arm/lc823450/lc823450-xgevk/kernel/lc823450_userspace.c
|
||||
*
|
||||
* Copyright 2018 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
@ -53,6 +53,7 @@
|
|||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#ifndef CONFIG_NUTTX_USERSPACE
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
############################################################################
|
||||
# boards/lc823450-xgevk/scripts/Make.defs
|
||||
# boards/arm/lc823450/lc823450-xgevk/scripts/Make.defs
|
||||
#
|
||||
# Copyright 2017,2018 Sony Video & Sound Products Inc.
|
||||
# Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/scripts/gnu-elf.ld
|
||||
* boards/arm/lc823450/lc823450-xgevk/scripts/gnu-elf.ld
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/scripts/ld-ipl2.script
|
||||
* boards/arm/lc823450/lc823450-xgevk/scripts/ld-ipl2.script
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/scripts/ld-spif-boot.script
|
||||
* boards/arm/lc823450/lc823450-xgevk/scripts/ld-spif-boot.script
|
||||
*
|
||||
* Copyright 2019 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/scripts/ld.script
|
||||
* boards/arm/lc823450/lc823450-xgevk/scripts/ld.script
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/scripts/memory.ld
|
||||
* boards/arm/lc823450/lc823450-xgevk/scripts/memory.ld
|
||||
*
|
||||
* Copyright 2018 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/scripts/user-space.ld
|
||||
* boards/arm/lc823450/lc823450-xgevk/scripts/user-space.ld
|
||||
*
|
||||
* Copyright 2018 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
############################################################################
|
||||
# boards/lc823450-xgevk/src/Makefile
|
||||
# boards/arm/lc823450/lc823450-xgevk/src/Makefile
|
||||
#
|
||||
# Copyright 2017 Sony Video & Sound Products Inc.
|
||||
# Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/src/lc823450-xgevk.h
|
||||
* boards/arm/lc823450/lc823450-xgevk/src/lc823450-xgevk.h
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
@ -33,8 +33,8 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __BOARDS_ARM_LC823450_XGEVK_SRC_LC823450_XGEVK_H
|
||||
#define __BOARDS_ARM_LC823450_XGEVK_SRC_LC823450_XGEVK_H
|
||||
#ifndef __BOARDS_ARM_LC823450_LC823450_XGEVK_SRC_LC823450_XGEVK_H
|
||||
#define __BOARDS_ARM_LC823450_LC823450_XGEVK_SRC_LC823450_XGEVK_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
|
@ -99,4 +99,4 @@ int lc823450_wm8776initialize(int minor);
|
|||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __BOARDS_ARM_LC823450_XGEVK_SRC_LC823450_XGEVK_H */
|
||||
#endif /* __BOARDS_ARM_LC823450_LC823450_XGEVK_SRC_LC823450_XGEVK_H */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/src/lc823450-xgevk_mux.h
|
||||
* boards/arm/lc823450/lc823450-xgevk/src/lc823450-xgevk_mux.h
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masatoshi Tateishi <Masatoshi.Tateishi@jp.sony.com>
|
||||
|
@ -34,8 +34,8 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __BOARDS_ARM_LC823450_XGEVK_SRC_LC823450_XGEVK_MUX_H
|
||||
#define __BOARDS_ARM_LC823450_XGEVK_SRC_LC823450_XGEVK_MUX_H
|
||||
#ifndef __BOARDS_ARM_LC823450_LC823450_XGEVK_SRC_LC823450_XGEVK_MUX_H
|
||||
#define __BOARDS_ARM_LC823450_LC823450_XGEVK_SRC_LC823450_XGEVK_MUX_H
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
@ -135,7 +135,6 @@
|
|||
0 << 14 | /* GPIO0E 0:0, 1:1 */ \
|
||||
0 << 15 /* GPIO0F 0:0, 1:1 */ \
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* PORT1
|
||||
****************************************************************************/
|
||||
|
@ -576,7 +575,6 @@
|
|||
0 << 8 | /* GPIO58 0:0, 1:1 */ \
|
||||
0 << 9 /* GPIO59 0:0, 1:1 */
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* PORT6
|
||||
****************************************************************************/
|
||||
|
@ -605,4 +603,4 @@
|
|||
0 << 22 | /* XTALI0 0:2mA, 1:---, 2:4mA, 3:8mA */ \
|
||||
0 << 24 /* XTALI1 0:2mA, 1:---, 2:4mA, 3:8mA */
|
||||
|
||||
#endif /* __BOARDS_ARM_LC823450_XGEVK_SRC_LC823450_XGEVK_MUX_H */
|
||||
#endif /* __BOARDS_ARM_LC823450_LC823450_XGEVK_SRC_LC823450_XGEVK_MUX_H */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/src/lc823450_adc.c
|
||||
* boards/arm/lc823450/lc823450-xgevk/src/lc823450_adc.c
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
@ -51,13 +51,13 @@
|
|||
#include "lc823450-xgevk.h"
|
||||
#include "lc823450_adc.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lc823450_adc_setup
|
||||
*
|
||||
* Description:
|
||||
* Initialize ADC and register the ADC driver.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
int lc823450_adc_setup(void)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/src/lc823450_appinit.c
|
||||
* boards/arm/lc823450/lc823450-xgevk/src/lc823450_appinit.c
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/src/lc823450_autoleds.c
|
||||
* boards/arm/lc823450/lc823450-xgevk/src/lc823450_autoleds.c
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/src/lc823450_boot.c
|
||||
* boards/arm/lc823450/lc823450-xgevk/src/lc823450_boot.c
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/src/lc823450_bringup.c
|
||||
* boards/arm/lc823450/lc823450-xgevk/src/lc823450_bringup.c
|
||||
*
|
||||
* Copyright 2017,2018 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/src/lc823450_bt.c
|
||||
* boards/arm/lc823450/lc823450-xgevk/src/lc823450_bt.c
|
||||
*
|
||||
* Copyright 2018 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/src/lc823450_mux.c
|
||||
* boards/arm/lc823450/lc823450-xgevk/src/lc823450_mux.c
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masatoshi Tateishi <Masatoshi.Tateishi@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/src/lc823450_netinit.c
|
||||
* boards/arm/lc823450/lc823450-xgevk/src/lc823450_netinit.c
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/src/lc823450_reset.c
|
||||
* boards/arm/lc823450/lc823450-xgevk/src/lc823450_reset.c
|
||||
*
|
||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/src/lc823450_sdif.c
|
||||
* boards/arm/lc823450/lc823450-xgevk/src/lc823450_sdif.c
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/src/lc823450_spi.c
|
||||
* boards/arm/lc823450/lc823450-xgevk/src/lc823450_spi.c
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
@ -56,7 +56,8 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void lc823450_spiselect(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
|
||||
void lc823450_spiselect(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
/* no need */
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/src/lc823450_st7565.c
|
||||
* boards/arm/lc823450/lc823450-xgevk/src/lc823450_st7565.c
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
@ -75,12 +75,13 @@
|
|||
static void lc823450_st7565_reset(FAR struct st7565_lcd_s *lcd, bool on);
|
||||
static void lc823450_st7565_select(FAR struct st7565_lcd_s *lcd);
|
||||
static void lc823450_st7565_deselect(FAR struct st7565_lcd_s *lcd);
|
||||
static void lc823450_st7565_cmddata(FAR struct st7565_lcd_s *lcd, const uint8_t cmd);
|
||||
static int lc823450_st7565_senddata(FAR struct st7565_lcd_s *lcd, FAR const uint8_t *data,
|
||||
static void lc823450_st7565_cmddata(FAR struct st7565_lcd_s *lcd,
|
||||
const uint8_t cmd);
|
||||
static int lc823450_st7565_senddata(FAR struct st7565_lcd_s *lcd,
|
||||
FAR const uint8_t *data,
|
||||
int size);
|
||||
static int lc823450_st7565_backlight(FAR struct st7565_lcd_s *lcd, int level);
|
||||
|
||||
|
||||
static FAR struct spi_dev_s *g_spidev;
|
||||
static FAR struct lcd_dev_s *g_lcddev;
|
||||
|
||||
|
@ -136,7 +137,8 @@ static void lc823450_st7565_deselect(FAR struct st7565_lcd_s *lcd)
|
|||
* Name: lc823450_st7565_cmddata
|
||||
****************************************************************************/
|
||||
|
||||
static void lc823450_st7565_cmddata(FAR struct st7565_lcd_s *lcd, const uint8_t cmd)
|
||||
static void lc823450_st7565_cmddata(FAR struct st7565_lcd_s *lcd,
|
||||
const uint8_t cmd)
|
||||
{
|
||||
lc823450_gpio_write(GPIO_LCD_A0, !cmd);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/src/lc823450_usbmsc.c
|
||||
* boards/arm/lc823450/lc823450-xgevk/src/lc823450_usbmsc.c
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lc823450-xgevk/src/lc823450_wm8776.c
|
||||
* boards/arm/lc823450/lc823450-xgevk/src/lc823450_wm8776.c
|
||||
*
|
||||
* Copyright 2017 Sony Video & Sound Products Inc.
|
||||
* Author: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
|
||||
|
@ -73,7 +73,6 @@ static struct wm8776_lower_s g_wm8776info =
|
|||
.frequency = 400000,
|
||||
};
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lc823450_wm8776initialize
|
||||
****************************************************************************/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lincoln60/include/board.h
|
||||
* boards/arm/lpc17xx_40xx/lincoln60/include/board.h
|
||||
* include/arch/board/board.h
|
||||
*
|
||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||
|
@ -34,8 +34,8 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __BOARDS_ARM_LINCOLN60_INCLUDE_BOARD_H
|
||||
#define __BOARDS_ARM_LINCOLN60_INCLUDE_BOARD_H
|
||||
#ifndef __BOARDS_ARM_LPC17XX_40XX_LINCOLN60_INCLUDE_BOARD_H
|
||||
#define __BOARDS_ARM_LPC17XX_40XX_LINCOLN60_INCLUDE_BOARD_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
|
@ -53,8 +53,10 @@
|
|||
****************************************************************************/
|
||||
|
||||
/* Clocking ****************************************************************/
|
||||
/* NOTE: The following definitions require lpc17_40_syscon.h. It is not included here
|
||||
* because the including C file may not have that file in its include path.
|
||||
|
||||
/* NOTE: The following definitions require lpc17_40_syscon.h.
|
||||
* It is not included here because the including C file may not have that
|
||||
* file in its include path.
|
||||
*/
|
||||
|
||||
#define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency */
|
||||
|
@ -133,6 +135,7 @@
|
|||
#define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV20
|
||||
|
||||
/* LED definitions *********************************************************/
|
||||
|
||||
/* The Lincoln 60 has 2 LEDs along the bottom of the board. Green or off.
|
||||
* If CONFIG_ARCH_LEDS is defined, the LEDs will be controlled as follows
|
||||
* for NuttX debug functionality (where NC means "No Change").
|
||||
|
@ -218,4 +221,4 @@ void lpc17_40_led(int lednum, int state);
|
|||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __BOARDS_ARM_LINCOLN60_INCLUDE_BOARD_H */
|
||||
#endif /* __BOARDS_ARM_LPC17XX_40XX_LINCOLN60_INCLUDE_BOARD_H */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
############################################################################
|
||||
# boards/lincoln60/scripts/Make.defs
|
||||
# boards/arm/lpc17xx_40xx/lincoln60/scripts/Make.defs
|
||||
#
|
||||
# Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lincoln60/scripts/ld.script
|
||||
* boards/arm/lpc17xx_40xx/lincoln60/scripts/ld.script
|
||||
*
|
||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
############################################################################
|
||||
# boards/lincoln60/src/Makefile
|
||||
# boards/arm/lpc17xx_40xx/lincoln60/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lincoln60/src/lincoln60.h
|
||||
* boards/arm/lpc17xx_40xx/lincoln60/src/lincoln60.h
|
||||
*
|
||||
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* config/lincoln60/src/lpc17_40_appinit.c
|
||||
* boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_appinit.c
|
||||
*
|
||||
* Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/lincoln60/src/lpc17_40_boot.c
|
||||
/****************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_boot.c
|
||||
*
|
||||
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <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,27 +49,28 @@
|
|||
|
||||
#include "lincoln60.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc17_40_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All LPC17xx/LPC40xx architectures must provide the following entry point. This entry point
|
||||
* is called early in the intitialization -- after all memory has been configured
|
||||
* and mapped but before any devices have been initialized.
|
||||
* All LPC17xx/LPC40xx architectures must provide the following entry point.
|
||||
* This entry point is called early in the intitialization -- after all
|
||||
* memory has been configured and mapped but before any devices have been
|
||||
* initialized.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void lpc17_40_boardinitialize(void)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lincoln60/src/lpc17_40_buttons.c
|
||||
* boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_buttons.c
|
||||
*
|
||||
* Copyright (C) 2012-2013, 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -92,10 +92,10 @@ static uint8_t g_buttonirq[NUM_BUTTONS] =
|
|||
* Name: board_button_initialize
|
||||
*
|
||||
* Description:
|
||||
* board_button_initialize() must be called to initialize button resources. After
|
||||
* that, board_buttons() may be called to collect the current state of all
|
||||
* buttons or board_button_irq() may be called to register button interrupt
|
||||
* handlers.
|
||||
* board_button_initialize() must be called to initialize button resources.
|
||||
* After that, board_buttons() may be called to collect the current state
|
||||
* of all buttons or board_button_irq() may be called to register button
|
||||
* interrupt handlers.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -115,9 +115,9 @@ void board_button_initialize(void)
|
|||
* Name: board_buttons
|
||||
*
|
||||
* Description:
|
||||
* board_button_initialize() must be called to initialize button resources. After
|
||||
* that, board_buttons() may be called to collect the current state of all
|
||||
* buttons.
|
||||
* board_button_initialize() must be called to initialize button resources.
|
||||
* After that, board_buttons() may be called to collect the current state
|
||||
* of all buttons.
|
||||
*
|
||||
* board_buttons() may be called at any time to harvest the state of every
|
||||
* button. The state of the buttons is returned as a bitset with one
|
||||
|
@ -136,16 +136,16 @@ uint32_t board_buttons(void)
|
|||
|
||||
for (i = 0; i < NUM_BUTTONS; i++)
|
||||
{
|
||||
/* A LOW value means that the key is pressed. */
|
||||
/* A LOW value means that the key is pressed. */
|
||||
|
||||
bool released = lpc17_40_gpioread(g_buttoncfg[i]);
|
||||
bool released = lpc17_40_gpioread(g_buttoncfg[i]);
|
||||
|
||||
/* Accumulate the set of depressed (not released) keys */
|
||||
/* Accumulate the set of depressed (not released) keys */
|
||||
|
||||
if (!released)
|
||||
{
|
||||
if (!released)
|
||||
{
|
||||
ret |= (1 << i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -155,19 +155,21 @@ uint32_t board_buttons(void)
|
|||
* Button support.
|
||||
*
|
||||
* Description:
|
||||
* board_button_initialize() must be called to initialize button resources. After
|
||||
* that, board_button_irq() may be called to register button interrupt handlers.
|
||||
* board_button_initialize() must be called to initialize button resources.
|
||||
* After that, board_button_irq() may be called to register button interrupt
|
||||
* handlers.
|
||||
*
|
||||
* board_button_irq() may be called to register an interrupt handler that will
|
||||
* be called when a button is depressed or released. The ID value is a
|
||||
* button enumeration value that uniquely identifies a button resource. See the
|
||||
* BOARD_BUTTON_* and BOARD_JOYSTICK_* definitions in board.h for the meaning
|
||||
* of enumeration values.
|
||||
* board_button_irq() may be called to register an interrupt handler that
|
||||
* will be called when a button is depressed or released. The ID value is
|
||||
* a button enumeration value that uniquely identifies a button resource.
|
||||
* See the BOARD_BUTTON_* and BOARD_JOYSTICK_* definitions in board.h for
|
||||
* the meaning of enumeration values.
|
||||
*
|
||||
* Note that board_button_irq() also enables button interrupts. Button
|
||||
* interrupts will remain enabled after the interrupt handler is attached.
|
||||
* Interrupts may be disabled (and detached) by calling board_button_irq with
|
||||
* irqhandler equal to NULL.
|
||||
* Note that board_button_irq() also enables button interrupts.
|
||||
* Button interrupts will remain enabled after the interrupt handler is
|
||||
* attached.
|
||||
* Interrupts may be disabled (and detached) by calling board_button_irq
|
||||
* with irqhandler equal to NULL.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -211,5 +213,4 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg)
|
|||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_ARCH_BUTTONS */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lincoln60/src/lpc17_40_leds.c
|
||||
* boards/arm/lpc17xx_40xx/lincoln60/src/lpc17_40_leds.c
|
||||
*
|
||||
* Copyright (C) 2012-2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -72,23 +72,22 @@
|
|||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/* LED definitions ******************************************************************
|
||||
/* LED definitions **********************************************************/
|
||||
|
||||
The Lincoln 60 has 2 LEDs along the bottom of the board. Green or off.
|
||||
If CONFIG_ARCH_LEDS is defined, the LEDs will be controlled as follows for NuttX
|
||||
debug functionality (where NC means "No Change").
|
||||
|
||||
During the boot phases. LED1 and LED2 will show boot status.
|
||||
|
||||
LED1 LED2
|
||||
STARTED OFF OFF
|
||||
HEAPALLOCATE BLUE OFF
|
||||
IRQSENABLED OFF BLUE
|
||||
STACKCREATED OFF OFF
|
||||
|
||||
After the system is booted, this logic will no longer use LEDs 1 & 2. They
|
||||
are available for use by applications using lpc17_40_led (prototyped below)
|
||||
*/
|
||||
/* The Lincoln 60 has 2 LEDs along the bottom of the board. Green or off.
|
||||
* If CONFIG_ARCH_LEDS is defined, the LEDs will be controlled as follows for
|
||||
* NuttXdebug functionality (where NC means "No Change").
|
||||
* During the boot phases. LED1 and LED2 will show boot status.
|
||||
*
|
||||
* LED1 LED2
|
||||
* STARTED OFF OFF
|
||||
* HEAPALLOCATE BLUE OFF
|
||||
* IRQSENABLED OFF BLUE
|
||||
* STACKCREATED OFF OFF
|
||||
*
|
||||
* After the system is booted, this logic will no longer use LEDs 1 & 2. They
|
||||
* are available for use by applications using lpc17_40_led (prototyped below)
|
||||
*/
|
||||
|
||||
static bool g_initialized;
|
||||
static int g_nestcount;
|
||||
|
@ -144,8 +143,8 @@ void board_autoled_on(int led)
|
|||
case LED_IRQSENABLED:
|
||||
led2 = 1;
|
||||
}
|
||||
lpc17_40_led(LINCOLN60_LED1,led1);
|
||||
lpc17_40_led(LINCOLN60_LED2,led2);
|
||||
lpc17_40_led(LINCOLN60_LED1, led1);
|
||||
lpc17_40_led(LINCOLN60_LED2, led2);
|
||||
}
|
||||
|
||||
/* We will always control the HB LED */
|
||||
|
@ -183,13 +182,14 @@ void board_autoled_off(int led)
|
|||
}
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc17_40_led
|
||||
*
|
||||
* Description:
|
||||
* Once the system has booted, these functions can be used to control the LEDs
|
||||
* Once the system has booted, these functions can be used to control the
|
||||
* LEDs
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void lpc17_40_led(int lednum, int state)
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ Using OpenOCD with the Olimex ARM-USB-OCD
|
|||
I have been using the Olimex ARM-USB-OCD debugger. OpenOCD
|
||||
requires a configuration file. I keep the one I used last here:
|
||||
|
||||
boards/lpc4088-devkit/tools/lpc4088-devkit.cfg
|
||||
boards/arm/lpc17xx_40xx/lpc4088-devkit/tools/lpc4088-devkit.cfg
|
||||
|
||||
However, the "correct" configuration script to use with OpenOCD may
|
||||
change as the features of OpenOCD evolve. So you should at least
|
||||
|
@ -136,7 +136,7 @@ Using OpenOCD with the Olimex ARM-USB-OCD
|
|||
installations. They could be most anywhwere if you are using a
|
||||
windows version of OpenOCD.
|
||||
|
||||
boards/lpc4088-devkit/tools/lpc4088-devkit.cfg
|
||||
boards/arm/lpc17xx_40xx/lpc4088-devkit/tools/lpc4088-devkit.cfg
|
||||
This is simply openocd-usb.cfg, lpc40xx.cfg, and lpc1xxx.cfg
|
||||
concatenated into one file for convenience. Don't use it
|
||||
unless you have to.
|
||||
|
@ -147,20 +147,21 @@ Using OpenOCD with the Olimex ARM-USB-OCD
|
|||
|
||||
- Possibly the value of OPENOCD_PATH and TARGET_PATH
|
||||
- It assumes that the correct script to use is the one at
|
||||
boards/lpc4088-devkit/tools/lpc4088-devkit.cfg
|
||||
boards/arm/lpc17xx_40xx/lpc4088-devkit/tools/lpc4088-devkit.cfg
|
||||
|
||||
Starting OpenOCD
|
||||
|
||||
Then you should be able to start the OpenOCD daemon as follows. This
|
||||
assumes that you have already CD'ed to the NuttX build directory and
|
||||
that you have set the full path to the boards/lpc4088-devkit/tools in your
|
||||
PATH environment variable:
|
||||
that you have set the full path to the
|
||||
boards/arm/lpc17xx_40xx/lpc4088-devkit/tools in your PATH environment
|
||||
variable:
|
||||
|
||||
oocd.sh $PWD
|
||||
|
||||
or, if the PATH variable is not so configured:
|
||||
|
||||
boards/lpc4088-devkit/tools/oocd.sh $PWD
|
||||
boards/arm/lpc17xx_40xx/lpc4088-devkit/tools/oocd.sh $PWD
|
||||
|
||||
Connecting GDB
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/lpc4088-devkit/include/board.h
|
||||
/****************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/include/board.h
|
||||
* include/arch/board/board.h
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
|
@ -32,14 +32,14 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __BOARDS_ARM_LPC4088_DEVKIT_INCLUDE_BOARD_H
|
||||
#define __BOARDS_ARM_LPC4088_DEVKIT_INCLUDE_BOARD_H
|
||||
#ifndef __BOARDS_ARM_LPC17XX_40XX_LPC4088_DEVKIT_INCLUDE_BOARD_H
|
||||
#define __BOARDS_ARM_LPC17XX_40XX_LPC4088_DEVKIT_INCLUDE_BOARD_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
|
@ -49,12 +49,16 @@
|
|||
# include <nuttx/irq.h>
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
/* Clocking *************************************************************************/
|
||||
/* NOTE: The following definitions require lpc17_40_syscon.h. It is not included here
|
||||
* because the including C file may not have that file in its include path.
|
||||
****************************************************************************/
|
||||
|
||||
/* Clocking *****************************************************************/
|
||||
|
||||
/* NOTE:
|
||||
* The following definitions require lpc17_40_syscon.h.
|
||||
* It is not included here because the including C file may not have that
|
||||
* file in its include path.
|
||||
*/
|
||||
|
||||
#define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency */
|
||||
|
@ -65,27 +69,28 @@
|
|||
|
||||
/* This is the clock setup we configure for:
|
||||
*
|
||||
* SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source
|
||||
* PLL0CLK = (10 * SYSCLK) / 1 = 120MHz -> PLL0 multipler=10, pre-divider=1
|
||||
* CCLCK = 120MHz -> CCLK divider = 1
|
||||
* SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source
|
||||
* PLL0CLK = (10 * SYSCLK) / 1 = 120MHz -> PLL0 multipler=10, pre-divider=1
|
||||
* CCLCK = 120MHz -> CCLK divider = 1
|
||||
*/
|
||||
|
||||
#define LPC17_40_CCLK 120000000 /* 120Mhz */
|
||||
#define BOARD_PCLKDIV 2 /* Peripheral clock = LPC17_40_CCLK/2 */
|
||||
#define LPC17_40_CCLK 120000000 /* 120Mhz */
|
||||
#define BOARD_PCLKDIV 2 /* Peripheral clock = LPC17_40_CCLK/2 */
|
||||
#define BOARD_PCLK_FREQUENCY (LPC17_40_CCLK / BOARD_PCLKDIV)
|
||||
|
||||
/* Select the main oscillator as the frequency source. SYSCLK is then the frequency
|
||||
* of the main oscillator.
|
||||
/* Select the main oscillator as the frequency source.
|
||||
* SYSCLK is then the frequency of the main oscillator.
|
||||
*
|
||||
* If BOARD_XTAL_FREQUENCY > 15000000, then the SCS OSCRS bit (bit 4) should also
|
||||
* be set in the BOARD_SCS_VALUE.
|
||||
* If BOARD_XTAL_FREQUENCY > 15000000, then the SCS OSCRS bit (bit 4)
|
||||
* should also be set in the BOARD_SCS_VALUE.
|
||||
*/
|
||||
|
||||
#undef CONFIG_LPC17_40_MAINOSC
|
||||
#define CONFIG_LPC17_40_MAINOSC 1
|
||||
#define BOARD_SCS_VALUE SYSCON_SCS_OSCEN
|
||||
|
||||
/* Select the main oscillator and CCLK divider. The output of the divider is CCLK.
|
||||
/* Select the main oscillator and CCLK divider.
|
||||
* The output of the divider is CCLK.
|
||||
* The input to the divider (PLLCLK) will be determined by the PLL output.
|
||||
*/
|
||||
|
||||
|
@ -121,10 +126,11 @@
|
|||
((BOARD_PLL1CFG_PSEL-1) << SYSCON_PLLCFG_PSEL_SHIFT))
|
||||
|
||||
#ifdef CONFIG_LPC17_40_EMC
|
||||
|
||||
/* EMC clock selection.
|
||||
*
|
||||
* The EMC clock should not be driven above 80MHz. As a result the EMC
|
||||
* uses the CPU clock divided by two.
|
||||
* The EMC clock should not be driven above 80MHz.
|
||||
* As a result the EMC uses the CPU clock divided by two.
|
||||
*/
|
||||
|
||||
# define BOARD_EMCCLKSEL_DIVIDER 2
|
||||
|
@ -133,7 +139,9 @@
|
|||
#endif
|
||||
|
||||
#if defined(CONFIG_LPC17_40_USBHOST) || (CONFIG_LPC17_40_USBDEV)
|
||||
/* USB divider. The output of the PLL is used as the USB clock
|
||||
|
||||
/* USB divider.
|
||||
* The output of the PLL is used as the USB clock
|
||||
*
|
||||
* USBCLK = PLL1CLK = (SYSCLK * 4) = 48MHz
|
||||
*/
|
||||
|
@ -157,9 +165,11 @@
|
|||
#define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV48
|
||||
|
||||
#ifdef CONFIG_LPC17_40_SDCARD
|
||||
/* SDIO dividers. Note that slower clocking is required when DMA is disabled
|
||||
* in order to avoid RX overrun/TX underrun errors due to delayed responses
|
||||
* to service FIFOs in interrupt driven mode.
|
||||
|
||||
/* SDIO dividers.
|
||||
* Note that slower clocking is required when DMA is disabled in order to
|
||||
* avoid RX overrun/TX underrun errors due to delayed responses to
|
||||
* service FIFOs in interrupt driven mode.
|
||||
* SDCARD_CLOCK=PCLK/(2*(SDCARD_CLKDIV+1))
|
||||
*/
|
||||
|
||||
|
@ -214,14 +224,16 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
/* LED definitions ******************************************************************/
|
||||
/* LED definitions **********************************************************/
|
||||
|
||||
/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in
|
||||
* any way. The following definitions are used to access individual LEDs.
|
||||
*
|
||||
* LED1 : Connected to P2[26]
|
||||
* LED2 : Connected to P2[27]
|
||||
*
|
||||
* These LEDs are connected to ground so a high output value will illuminate them.
|
||||
* These LEDs are connected to ground so a high output value will illuminate
|
||||
* them.
|
||||
*/
|
||||
|
||||
/* LED index values for use with board_userled() */
|
||||
|
@ -236,25 +248,29 @@
|
|||
#define BOARD_LED2_BIT (1 << BOARD_LED2)
|
||||
|
||||
/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the two LEDs
|
||||
* on the LPC4088 OEM Board. The following definitions describe how NuttX
|
||||
* controls the LEDs:
|
||||
* on the LPC4088 OEM Board.
|
||||
* The following definitions describe how NuttX controls the LEDs:
|
||||
*/
|
||||
/* LED1 LED2 LED3 LED4 */
|
||||
#define LED_STARTED 0 /* OFF OFF OFF OFF */
|
||||
#define LED_HEAPALLOCATE 1 /* ON OFF OFF OFF */
|
||||
#define LED_IRQSENABLED 2 /* OFF ON OFF OFF */
|
||||
#define LED_STACKCREATED 3 /* ON ON OFF OFF */
|
||||
#define LED_INIRQ 4 /* LED3 glows, on while in interrupt */
|
||||
#define LED_INIRQ 4 /* LED3 glows, on while in interrupt */
|
||||
#define LED_SIGNAL 4 /* LED3 glows, on while in signal handler */
|
||||
#define LED_ASSERTION 4 /* LED3 glows, on while in assertion */
|
||||
#define LED_PANIC 4 /* LED3 Flashes at 2Hz */
|
||||
#define LED_IDLE 5 /* LED4 glows: ON while active *
|
||||
* OFF while sleeping */
|
||||
#define LED_IDLE 5 /* LED4 glows: ON while active
|
||||
* OFF while sleeping
|
||||
*/
|
||||
|
||||
/* Button definitions ***************************************************************/
|
||||
/* The LPC4088 Developer's Kit supports several buttons. All have external
|
||||
* pullup resistors. When closed, the pins will be pulled to ground. So the buttons
|
||||
* will read "1" when open and "0" when closed. All are capable of generating interrupts.
|
||||
|
||||
/* The LPC4088 Developer's Kit supports several buttons.
|
||||
* All have external pullup resistors.
|
||||
* When closed, the pins will be pulled to ground.
|
||||
* So the buttons will read "1" when open and "0" when closed.
|
||||
* All are capable of generating interrupts.
|
||||
*
|
||||
* USER1 -- Connected to P2[10]
|
||||
*
|
||||
|
@ -266,11 +282,10 @@
|
|||
* JOY_D -- Connected to P2[27]
|
||||
* JOY_CTR -- Connected to P2[22]
|
||||
*
|
||||
* For the interrupting buttons, interrupts are generated on both edges (press and
|
||||
* release).
|
||||
* For the interrupting buttons, interrupts are generated on both edges
|
||||
* (press and release).
|
||||
*/
|
||||
|
||||
|
||||
#define BOARD_BUTTON_USER1 0
|
||||
|
||||
#define BOARD_JOYSTICK_A 1
|
||||
|
@ -289,7 +304,7 @@
|
|||
#define BOARD_JOYSTICK_D_BIT (1 << BOARD_JOYSTICK_D)
|
||||
#define BOARD_JOYSTICK_CTR_BIT (1 << BOARD_JOYSTICK_CTR)
|
||||
|
||||
/* Alternate pin selections *********************************************************/
|
||||
/* Alternate pin selections *************************************************/
|
||||
|
||||
/* UART0:
|
||||
*
|
||||
|
@ -303,7 +318,8 @@
|
|||
/* UART1:
|
||||
*
|
||||
* All pin options are controlled by jumpers on the board.
|
||||
* RXD is set with JP12, TXD is set with JP13, modem control lines are set with JP11.
|
||||
* RXD is set with JP12, TXD is set with JP13, modem control lines are set
|
||||
* with JP11.
|
||||
*
|
||||
* RTS --- Connected to P3[30]
|
||||
* RI --- Connected to P3[22]
|
||||
|
@ -349,9 +365,9 @@
|
|||
#define GPIO_ENET_MDC GPIO_ENET_MDC_1
|
||||
#define GPIO_ENET_MDIO GPIO_ENET_MDIO_1
|
||||
|
||||
|
||||
/* External LCD is currently untested.
|
||||
* These pins will probably need to be updated before using the LCD. */
|
||||
* These pins will probably need to be updated before using the LCD.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
/* LCD R:
|
||||
|
@ -416,24 +432,22 @@
|
|||
|
||||
/* XPT2046 Touchscreen:
|
||||
*
|
||||
/* -------------- -------------------- ------------ --------------------------------
|
||||
* -------------- -------------------- ------------ -------------------------
|
||||
* XTPT2046 Module Module
|
||||
* Signal Connector Connector
|
||||
* -------------- -------------------- ------------ ---------------------------------
|
||||
* -------------- -------------------- ------------ -------------------------
|
||||
* Pin 11 PENIRQ\ PENIRQ (pulled high) PORT3 Pin 1 P2.15 PENIRQ
|
||||
* Pin 12 DOUT MISO PORT3 Pin 4 P1.18 MISO1 (Also USB HOST UP LED)
|
||||
* Pin 13 BUSY BUSY (pulled high) PORT3 Pin 9 P2.14 BUSY
|
||||
* Pin 14 DIN MOSI PORT3 Pin 3 P0.13 MOSI1 (Also USB Device up LED and SD CD pin)
|
||||
* Pin 15 CS\ SSEL (pulled high) PORT3 Pin 6 P1.8 GPIO (Also RMII_CRS_DV)
|
||||
* Pin 16 DCLK SCK PORT3 Pin 5 P1.19 SCK1
|
||||
* -------------- -------------------- ------------ ---------------------------------
|
||||
* -------------- -------------------- ------------ -------------------------
|
||||
*/
|
||||
|
||||
|
||||
#define GPIO_SSP1_MISO GPIO_SSP1_MISO_3
|
||||
#define GPIO_SSP1_MOSI GPIO_SSP1_MOSI_2
|
||||
#define GPIO_SSP1_SCK GPIO_SSP1_SCK_2
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __BOARDS_ARM_LPC4088_DEVKIT_INCLUDE_BOARD_H */
|
||||
#endif /* __BOARDS_ARM_LPC17XX_40XX_LPC4088_DEVKIT_INCLUDE_BOARD_H */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
############################################################################
|
||||
# boards/lpc4088-devkit/kernel/Makefile
|
||||
# boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/Makefile
|
||||
#
|
||||
# Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lpc4088-devkit/kernel/lpc17_40_userspace.c
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/kernel/lpc17_40_userspace.c
|
||||
*
|
||||
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -50,6 +50,7 @@
|
|||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#ifndef CONFIG_NUTTX_USERSPACE
|
||||
|
@ -64,14 +65,14 @@
|
|||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* These 'addresses' of these values are setup by the linker script. They are
|
||||
* not actual uint32_t storage locations! They are only used meaningfully in the
|
||||
* following way:
|
||||
/* These 'addresses' of these values are setup by the linker script.
|
||||
* They are not actual uint32_t storage locations!
|
||||
* They are only used meaningfully in the following way:
|
||||
*
|
||||
* - The linker script defines, for example, the symbol_sdata.
|
||||
* - The declareion extern uint32_t _sdata; makes C happy. C will believe
|
||||
* that the value _sdata is the address of a uint32_t variable _data (it is
|
||||
* not!).
|
||||
* that the value _sdata is the address of a uint32_t variable _data
|
||||
* (it is not!).
|
||||
* - We can recoved the linker value then by simply taking the address of
|
||||
* of _data. like: uint32_t *pdata = &_sdata;
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
############################################################################
|
||||
# boards/lpc4088-devkit/scripts/Make.defs
|
||||
# boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/Make.defs
|
||||
#
|
||||
# Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lpc4088-devkit/scripts/kernel-space.ld
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/kernel-space.ld
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lpc4088-devkit/scripts/ld.script
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/ld.script
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Rommel Marcelo
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lpc4088-devkit/scripts/memory.ld
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/memory.ld
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -41,9 +41,10 @@
|
|||
*
|
||||
* For MPU support, the kernel-mode NuttX section is assumed to be 256KB of
|
||||
* FLASH and 4KB of SRAM. That, of course, can be optimized as needed (See
|
||||
* also boards/lpc4088-devkit/scripts/kernel-space.ld); 256KB is probably much
|
||||
* more than is needed by the RTOS! That size is selected only because it
|
||||
* is available due to alignment issues for the user space FLASH memory.
|
||||
* also boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/kernel-space.ld);
|
||||
* 256KB is probably much more than is needed by the RTOS!
|
||||
* That size is selected only because it is available due to alignment
|
||||
* issues for the user space FLASH memory.
|
||||
*
|
||||
* Alignment of the user space FLASH partition is a critical factor: The
|
||||
* user space FLASH partition will be spanned with a single region of size
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lpc4088-devkit/scripts/user-space.ld
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/scripts/user-space.ld
|
||||
*
|
||||
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
############################################################################
|
||||
# boards/lpc4088-devkit/src/Makefile
|
||||
# boards/arm/lpc17xx_40xx/lpc4088-devkit/src/Makefile
|
||||
#
|
||||
# Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* config/lpc4088-devkit/src/lpc17_40_appinit.c
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_appinit.c
|
||||
*
|
||||
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lpc4088-devkit/src/lpc17_40_autoleds.c
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_autoleds.c
|
||||
*
|
||||
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -65,11 +65,12 @@
|
|||
* LED3 -- Connected to P1[13]
|
||||
* LED4 -- Connected to P4[27]
|
||||
*
|
||||
* These LEDs are connected to ground so a high output value will illuminate them.
|
||||
* These LEDs are connected to ground so a high output value will illuminate
|
||||
* them.
|
||||
*
|
||||
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the two LEDs
|
||||
* on the LPC4088 Developer's Kit. The following definitions describe how NuttX
|
||||
* controls the LEDs:
|
||||
* on the LPC4088 Developer's Kit. The following definitions describe how
|
||||
* NuttX controls the LEDs:
|
||||
*
|
||||
* LED1 LED2 LED3 LED4
|
||||
* LED_STARTED 0 OFF OFF OFF OFF
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/lpc4088-devkit/src/lpc17_40_boardinitialize.c
|
||||
/****************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_boardinitialize.c
|
||||
*
|
||||
* Copyright (C) 2013, 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <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>
|
||||
|
||||
|
@ -51,27 +51,28 @@
|
|||
|
||||
#include "lpc4088-devkit.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc17_40_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All LPC17xx/LPC40xx architectures must provide the following entry point. This entry point
|
||||
* is called early in the intitialization -- after all memory has been configured
|
||||
* and mapped but before any devices have been initialized.
|
||||
* All LPC17xx/LPC40xx architectures must provide the following entry point.
|
||||
* This entry point is called early in the intitialization -- after all
|
||||
* memory has been configured and mapped but before any devices have been
|
||||
* initialized.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void lpc17_40_boardinitialize(void)
|
||||
{
|
||||
|
@ -96,8 +97,8 @@ void lpc17_40_boardinitialize(void)
|
|||
#if defined(CONFIG_LPC17_40_SSP0) || defined(CONFIG_LPC17_40_SSP1) || \
|
||||
defined(CONFIG_LPC17_40_SSP2)
|
||||
/* Configure SSP chip selects if 1) at least one SSP is enabled, and 2)
|
||||
* the weak function lpc4088_devkit_sspdev_initialize() has been brought into
|
||||
* the link.
|
||||
* the weak function lpc4088_devkit_sspdev_initialize() has been brought
|
||||
* into the link.
|
||||
*/
|
||||
|
||||
if (lpc4088_devkit_sspdev_initialize)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* config/lpc4088-devkit/src/lpc17_40_bringup.c
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_bringup.c
|
||||
*
|
||||
* Copyright (C) 2013, 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -62,6 +62,7 @@
|
|||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#define NSH_HAVE_MMCSD 1
|
||||
|
@ -83,7 +84,9 @@
|
|||
# undef NSH_HAVE_MMCSD
|
||||
#endif
|
||||
|
||||
/* MMC/SD support requires that an SPI support is enabled and an SPI port is selected */
|
||||
/* MMC/SD support requires that an SPI support is enabled
|
||||
* and an SPI port is selected
|
||||
*/
|
||||
|
||||
#ifdef NSH_HAVE_MMCSD
|
||||
# if !defined(CONFIG_NSH_MMCSDSLOTNO)
|
||||
|
@ -176,7 +179,7 @@ static int nsh_waiter(int argc, char *argv[])
|
|||
struct usbhost_hubport_s *hport;
|
||||
|
||||
syslog(LOG_INFO, "nsh_waiter: Running\n");
|
||||
for (;;)
|
||||
for (; ; )
|
||||
{
|
||||
/* Wait for the device to change state */
|
||||
|
||||
|
@ -287,7 +290,8 @@ static int nsh_usbhostinitialize(void)
|
|||
ret = usbhost_msc_initialize();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to register the mass storage class: %d\n", ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to register the mass storage class: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -297,7 +301,8 @@ static int nsh_usbhostinitialize(void)
|
|||
ret = usbhost_cdcacm_initialize();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to register the CDC/ACM serial class: %d\n", ret);
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to register the CDC/ACM serial class: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -355,7 +360,7 @@ int lpc4088_devkit_bringup(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
/* Initialize SD Card*/
|
||||
/* Initialize SD Card */
|
||||
|
||||
ret = nsh_sdinitialize();
|
||||
if (ret == OK)
|
||||
|
@ -371,7 +376,8 @@ int lpc4088_devkit_bringup(void)
|
|||
ret = fb_register(0, 0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: fb_register() failed: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: fb_register() failed: %d\n",
|
||||
ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -381,7 +387,8 @@ int lpc4088_devkit_bringup(void)
|
|||
ret = lpc4088_devkit_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: lpc4088_devkit_tsc_setup failed: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: lpc4088_devkit_tsc_setup failed: %d\n",
|
||||
ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -391,7 +398,8 @@ int lpc4088_devkit_bringup(void)
|
|||
ret = lpc17_40_djoy_initialization();
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to register the joystick driver: %d\n", ret);
|
||||
syslog(LOG_ERR, "ERROR: Failed to register the joystick driver: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lpc4088-devkit/src/lpc17_40_buttons.c
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_buttons.c
|
||||
*
|
||||
* Copyright (C) 2013, 2015, 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -106,10 +106,10 @@ static const uint8_t g_buttonirq[NUM_BUTTONS] =
|
|||
* Name: board_button_initialize
|
||||
*
|
||||
* Description:
|
||||
* board_button_initialize() must be called to initialize button resources. After
|
||||
* that, board_buttons() may be called to collect the current state of all
|
||||
* buttons or board_button_irq() may be called to register button interrupt
|
||||
* handlers.
|
||||
* board_button_initialize() must be called to initialize button resources.
|
||||
* After that, board_buttons() may be called to collect the current state
|
||||
* of all buttons or board_button_irq() may be called to register button
|
||||
* interrupt handlers.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -150,16 +150,16 @@ uint32_t board_buttons(void)
|
|||
|
||||
for (i = 0; i < NUM_BUTTONS; i++)
|
||||
{
|
||||
/* A LOW value means that the key is pressed. */
|
||||
/* A LOW value means that the key is pressed. */
|
||||
|
||||
bool released = lpc17_40_gpioread(g_buttoncfg[i]);
|
||||
bool released = lpc17_40_gpioread(g_buttoncfg[i]);
|
||||
|
||||
/* Accumulate the set of depressed (not released) keys */
|
||||
/* Accumulate the set of depressed (not released) keys */
|
||||
|
||||
if (!released)
|
||||
{
|
||||
if (!released)
|
||||
{
|
||||
ret |= (1 << i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -181,8 +181,8 @@ uint32_t board_buttons(void)
|
|||
*
|
||||
* Note that board_button_irq() also enables button interrupts. Button
|
||||
* interrupts will remain enabled after the interrupt handler is attached.
|
||||
* Interrupts may be disabled (and detached) by calling board_button_irq with
|
||||
* irqhandler equal to NULL.
|
||||
* Interrupts may be disabled (and detached) by calling board_button_irq
|
||||
* with irqhandler equal to NULL.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lpc4088-devkit/src/lpc17_40_djoystick.c
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_djoystick.c
|
||||
*
|
||||
* Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -53,7 +53,8 @@
|
|||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* The LPC4088 Developer's Kit supports several buttons. All will read "1"
|
||||
|
||||
/* The LPC4088 Developer's Kit supports several buttons. All will read "1"
|
||||
* when open and "0" when closed
|
||||
*
|
||||
* USER1 -- Connected to P2[10]
|
||||
|
@ -93,13 +94,13 @@ static void djoy_enable(FAR const struct djoy_lowerhalf_s *lower,
|
|||
djoy_buttonset_t press, djoy_buttonset_t release,
|
||||
djoy_interrupt_t handler, FAR void *arg);
|
||||
|
||||
|
||||
static void djoy_disable(void);
|
||||
static int djoy_interrupt(int irq, FAR void *context, FAR void *arg);
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/* Pin configuration for each LPC4088 Developer's Kit joystick "button."
|
||||
* Indexed using DJOY_* definitions in include/nuttx/input/djoystick.h.
|
||||
*/
|
||||
|
@ -172,16 +173,16 @@ static djoy_buttonset_t djoy_sample(FAR const struct djoy_lowerhalf_s *lower)
|
|||
|
||||
for (i = 0; i < DJOY_NGPIOS; i++)
|
||||
{
|
||||
/* A LOW value means that the key is pressed. */
|
||||
/* A LOW value means that the key is pressed. */
|
||||
|
||||
bool released = lpc17_40_gpioread(g_joygpio[i]);
|
||||
bool released = lpc17_40_gpioread(g_joygpio[i]);
|
||||
|
||||
/* Accumulate the set of depressed (not released) keys */
|
||||
/* Accumulate the set of depressed (not released) keys */
|
||||
|
||||
if (!released)
|
||||
{
|
||||
if (!released)
|
||||
{
|
||||
ret |= (1 << i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
iinfo("Returning: %02x\n", DJOY_ALLBITS);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/lpc4088-devkit/src/lpc17_40_lcd.c
|
||||
/****************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_lcd.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <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,34 +49,35 @@
|
|||
|
||||
#ifdef CONFIG_LPC17_40_LCD
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc4088_devkit_lcd_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the LCD. Setup backlight (initially off)
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void lpc4088_devkit_lcd_initialize(void)
|
||||
{
|
||||
/* Configure the LCD backlight (and turn the backlight off) */
|
||||
|
||||
#ifdef CONFIG_LPC17_40_LCD_BACKLIGHT
|
||||
lpc17_40_configgpio(GPIO_LCD_BL);
|
||||
#endif
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc17_40_backlight
|
||||
*
|
||||
* Description:
|
||||
* If CONFIG_LPC17_40_LCD_BACKLIGHT is defined, then the board-specific logic must
|
||||
* provide this interface to turn the backlight on and off.
|
||||
* If CONFIG_LPC17_40_LCD_BACKLIGHT is defined, then the board-specific
|
||||
* logic must provide this interface to turn the backlight on and off.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_LPC17_40_LCD_BACKLIGHT
|
||||
void lpc17_40_backlight(bool blon)
|
||||
|
@ -84,5 +85,4 @@ void lpc17_40_backlight(bool blon)
|
|||
lpc17_40_gpiowrite(GPIO_LCD_BL, blon);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_LPC17_40_LCD */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/lpc4088-devkit/src/lpc17_40_nandinitialize.c
|
||||
/****************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_nandinitialize.c
|
||||
* arch/arm/src/board/lpc17_40_nandinitialize.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
|
@ -32,11 +32,11 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
|
@ -51,17 +51,17 @@
|
|||
|
||||
#if defined(CONFIG_LPC17_40_EMC) && defined(CONFIG_LPC17_40_EXTNAND)
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc4088_devkit_nand_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize NAND FLASH
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void lpc4088_devkit_nand_initialize(void)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/lpc4088-devkit/src/lpc17_40_norinitialize.c
|
||||
/****************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_norinitialize.c
|
||||
* arch/arm/src/board/lpc17_40_norinitialize.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
|
@ -32,11 +32,11 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
|
@ -51,17 +51,17 @@
|
|||
|
||||
#if defined(CONFIG_LPC17_40_EMC) && defined(CONFIG_LPC17_40_EXTNOR)
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc4088_devkit_nor_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize NOR FLASH
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void lpc4088_devkit_nor_initialize(void)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/lpc4088-devkit/src/lpc17_40_sdraminitialize.c
|
||||
/****************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_sdraminitialize.c
|
||||
* arch/arm/src/board/lpc17_40_sdraminitialize.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
|
@ -32,11 +32,11 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
|
@ -54,12 +54,13 @@
|
|||
|
||||
#if defined(CONFIG_LPC17_40_EMC) && defined(CONFIG_LPC17_40_EXTDRAM)
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* The core clock is LPC17_40_EMCCLK which may be either LPC17_40_CCLK* (undivided), or
|
||||
* LPC17_40_CCLK / 2 as determined by settings in the board.h header file.
|
||||
/* The core clock is LPC17_40_EMCCLK which may be either LPC17_40_CCLK*
|
||||
* (undivided), or LPC17_40_CCLK / 2 as determined by settings in the board.h
|
||||
* header file.
|
||||
*
|
||||
* For example:
|
||||
* LPC17_40_CCLCK = 120,000,000
|
||||
|
@ -97,17 +98,17 @@
|
|||
|
||||
#define SDRAM_BASE 0xa0000000 /* CS0 */
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc4088_devkit_sdram_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize SDRAM
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void lpc4088_devkit_sdram_initialize(void)
|
||||
{
|
||||
|
@ -143,7 +144,7 @@ void lpc4088_devkit_sdram_initialize(void)
|
|||
putreg32( 1, LPC17_40_EMC_DYNAMICAPR); /* TAPR = 2 clocks? */
|
||||
putreg32(EMC_NS2CLK(20) + 2, LPC17_40_EMC_DYNAMICDAL); /* TDAL = TRP + TDPL = 20ns + 2clk */
|
||||
putreg32( 1, LPC17_40_EMC_DYNAMICWR); /* TWR = 2 clocks */
|
||||
putreg32( EMC_NS2CLK(63), LPC17_40_EMC_DYNAMICRC); /* H57V2562GTR-75C TRC = 63ns(min)*/
|
||||
putreg32( EMC_NS2CLK(63), LPC17_40_EMC_DYNAMICRC); /* H57V2562GTR-75C TRC = 63ns(min) */
|
||||
putreg32( EMC_NS2CLK(63), LPC17_40_EMC_DYNAMICRFC); /* H57V2562GTR-75C TRFC = TRC */
|
||||
putreg32( 15, LPC17_40_EMC_DYNAMICXSR); /* Exit self-refresh to active */
|
||||
putreg32( EMC_NS2CLK(63), LPC17_40_EMC_DYNAMICRRD); /* 3 clock, TRRD = 15ns (min) */
|
||||
|
@ -158,27 +159,29 @@ void lpc4088_devkit_sdram_initialize(void)
|
|||
putreg32(MDKCFG_RASCAS0VAL, LPC17_40_EMC_DYNAMICRASCAS0);
|
||||
|
||||
#ifdef CONFIG_LPC17_40_SDRAM_16BIT
|
||||
/* For Manley lpc1778 SDRAM: H57V2562GTR-75C, 256Mb, 16Mx16, 4 banks, row=13, column=9:
|
||||
*
|
||||
* 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC
|
||||
*/
|
||||
|
||||
/* For Manley lpc1778 SDRAM:
|
||||
* H57V2562GTR-75C, 256Mb, 16Mx16, 4 banks, row=13, column=9:
|
||||
*
|
||||
* 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC
|
||||
*/
|
||||
|
||||
putreg32(EMC_DYNAMICCONFIG_MD_SDRAM | EMC_DYNAMICCONFIG_AM0(13),
|
||||
LPC17_40_EMC_DYNAMICCONFIG0);
|
||||
|
||||
#elif defined CONFIG_LPC17_40_SDRAM_32BIT
|
||||
/* 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC */
|
||||
/* 256Mb, 16Mx16, 4 banks, row=13, column=9, RBC */
|
||||
|
||||
putreg32(EMC_DYNAMICCONFIG_MD_SDRAM | EMC_DYNAMICCONFIG_AM0(13) | EMC_DYNAMICCONFIG_AM1,
|
||||
LPC17_40_EMC_DYNAMICCONFIG0);
|
||||
putreg32(EMC_DYNAMICCONFIG_MD_SDRAM | EMC_DYNAMICCONFIG_AM0(13) |
|
||||
EMC_DYNAMICCONFIG_AM1, LPC17_40_EMC_DYNAMICCONFIG0);
|
||||
#endif
|
||||
|
||||
up_mdelay(100);
|
||||
|
||||
/* Issue NOP command */
|
||||
|
||||
putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | EMC_DYNAMICCONTROL_I_NOP,
|
||||
LPC17_40_EMC_DYNAMICCONTROL);
|
||||
putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS |
|
||||
EMC_DYNAMICCONTROL_I_NOP, LPC17_40_EMC_DYNAMICCONTROL);
|
||||
|
||||
/* Wait 200 Msec */
|
||||
|
||||
|
@ -186,8 +189,8 @@ void lpc4088_devkit_sdram_initialize(void)
|
|||
|
||||
/* Issue PALL command */
|
||||
|
||||
putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | EMC_DYNAMICCONTROL_I_PALL,
|
||||
LPC17_40_EMC_DYNAMICCONTROL);
|
||||
putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS |
|
||||
EMC_DYNAMICCONTROL_I_PALL, LPC17_40_EMC_DYNAMICCONTROL);
|
||||
|
||||
putreg32(2, LPC17_40_EMC_DYNAMICREFRESH); /* ( n * 16 ) -> 32 clock cycles */
|
||||
|
||||
|
@ -195,7 +198,7 @@ void lpc4088_devkit_sdram_initialize(void)
|
|||
|
||||
for (i = 0; i < 128; i++);
|
||||
|
||||
/* 64ms/8192 = 7.8125us, nx16x8.33ns < 7.8125us, n < 58.6*/
|
||||
/* 64ms/8192 = 7.8125us, nx16x8.33ns < 7.8125us, n < 58.6 */
|
||||
|
||||
regval = 64000000 / (1 << 13);
|
||||
regval -= 16;
|
||||
|
@ -205,8 +208,8 @@ void lpc4088_devkit_sdram_initialize(void)
|
|||
|
||||
/* Issue MODE command */
|
||||
|
||||
putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS | EMC_DYNAMICCONTROL_I_MODE,
|
||||
LPC17_40_EMC_DYNAMICCONTROL);
|
||||
putreg32(EMC_DYNAMICCONTROL_CE | EMC_DYNAMICCONTROL_CS |
|
||||
EMC_DYNAMICCONTROL_I_MODE, LPC17_40_EMC_DYNAMICCONTROL);
|
||||
|
||||
#ifdef CONFIG_LPC17_40_SDRAM_16BIT
|
||||
(void)getreg16(SDRAM_BASE | (0x33 << 12)); /* 8 burst, 3 CAS latency */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lpc4088-devkit/src/lpc17_40_ssp.c
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_ssp.c
|
||||
* arch/arm/src/board/lpc17_40_ssp.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
|
@ -104,35 +104,39 @@ void weak_function lpc4088_devkit_sspdev_initialize(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc17_40_ssp0/1/2select and lpc17_40_ssp0/1/2status
|
||||
*
|
||||
* Description:
|
||||
* The external functions, lpc17_40_ssp0/1/2select and lpc17_40_ssp0/1/2status
|
||||
* must be provided by board-specific logic. They are implementations of the select
|
||||
* and status methods of the SPI interface defined by struct spi_ops_s (see
|
||||
* include/nuttx/spi/spi.h). All other methods (including lpc17_40_sspbus_initialize())
|
||||
* are provided by common LPC17xx/LPC40xx logic. To use this common SPI logic on your
|
||||
* board:
|
||||
* The external functions, lpc17_40_ssp0/1/2select and
|
||||
* lpc17_40_ssp0/1/2status must be provided by board-specific logic.
|
||||
* They are implementations of the select and status methods of the SPI
|
||||
* interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||
* All other methods (including lpc17_40_sspbus_initialize())
|
||||
* are provided by common LPC17xx/LPC40xx logic.
|
||||
* To use this common SPI logic on your board:
|
||||
*
|
||||
* 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip select
|
||||
* pins.
|
||||
* 2. Provide lpc17_40_ssp0/1/2select() and lpc17_40_ssp0/1/2status() functions
|
||||
* in your board-specific logic. These functions will perform chip selection
|
||||
* and status operations using GPIOs in the way your board is configured.
|
||||
* 3. Add a calls to lpc17_40_sspbus_initialize() in your low level application
|
||||
* initialization logic
|
||||
* 4. The handle returned by lpc17_40_sspbus_initialize() may then be used to bind the
|
||||
* SPI driver to higher level logic (e.g., calling
|
||||
* 1. Provide logic in lpc17_40_boardinitialize() to configure SPI/SSP chip
|
||||
* select pins.
|
||||
* 2. Provide lpc17_40_ssp0/1/2select() and lpc17_40_ssp0/1/2status()
|
||||
* functions in your board-specific logic. These functions will perform
|
||||
* chip selection and status operations using GPIOs in the way your
|
||||
* board is configured.
|
||||
* 3. Add a calls to lpc17_40_sspbus_initialize() in your low level
|
||||
* application initialization logic
|
||||
* 4. The handle returned by lpc17_40_sspbus_initialize() may then be used
|
||||
* to bind the SPI driver to higher level logic (e.g., calling
|
||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||
* the SPI MMC/SD driver).
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_LPC17_40_SSP0
|
||||
void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
|
||||
void lpc17_40_ssp0select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
selected ? "assert" : "de-assert");
|
||||
}
|
||||
|
||||
uint8_t lpc17_40_ssp0status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
|
@ -143,9 +147,11 @@ uint8_t lpc17_40_ssp0status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_LPC17_40_SSP1
|
||||
void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
|
||||
void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
selected ? "assert" : "de-assert");
|
||||
if (devid == SPIDEV_TOUCHSCREEN(0))
|
||||
{
|
||||
/* Assert/de-assert the CS pin to the touchscreen */
|
||||
|
@ -164,9 +170,11 @@ uint8_t lpc17_40_ssp1status(FAR struct spi_dev_s *dev, uint32_t devid)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_LPC17_40_SSP2
|
||||
void lpc17_40_ssp2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
|
||||
void lpc17_40_ssp2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
|
||||
spiinfo("devid: %d CS: %s\n", (int)devid,
|
||||
selected ? "assert" : "de-assert");
|
||||
}
|
||||
|
||||
uint8_t lpc17_40_ssp2status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/lpc4088-devkit/src/lpc17_40_touchscreen.c
|
||||
/****************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_touchscreen.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -31,7 +31,7 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
|
@ -178,7 +178,8 @@ static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable)
|
|||
iinfo("enable:%d\n", enable);
|
||||
if (enable)
|
||||
{
|
||||
/* Enable PENIRQ interrupts. NOTE: The pin interrupt is enabled from worker thread
|
||||
/* Enable PENIRQ interrupts.
|
||||
* NOTE: The pin interrupt is enabled from worker thread
|
||||
* logic after completion of processing of the touchscreen interrupt.
|
||||
*/
|
||||
|
||||
|
@ -186,7 +187,8 @@ static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable)
|
|||
}
|
||||
else
|
||||
{
|
||||
/* Disable PENIRQ interrupts. NOTE: The PENIRQ interrupt will be disabled from
|
||||
/* Disable PENIRQ interrupts.
|
||||
* NOTE: The PENIRQ interrupt will be disabled from
|
||||
* interrupt handling logic.
|
||||
*/
|
||||
|
||||
|
@ -196,7 +198,8 @@ static void tsc_enable(FAR struct ads7843e_config_s *state, bool enable)
|
|||
|
||||
static void tsc_clear(FAR struct ads7843e_config_s *state)
|
||||
{
|
||||
/* Does nothing. The interrupt is cleared automatically in the GPIO
|
||||
/* Does nothing.
|
||||
* The interrupt is cleared automatically in the GPIO
|
||||
* logic for the LPC17xx/LPC40xx family.
|
||||
*/
|
||||
}
|
||||
|
@ -293,7 +296,8 @@ int lpc4088_devkit_tsc_setup(int minor)
|
|||
dev = lpc17_40_sspbus_initialize(CONFIG_ADS7843E_SPIDEV);
|
||||
if (!dev)
|
||||
{
|
||||
ierr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV);
|
||||
ierr("ERROR: Failed to initialize SPI bus %d\n",
|
||||
CONFIG_ADS7843E_SPIDEV);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
@ -304,7 +308,9 @@ int lpc4088_devkit_tsc_setup(int minor)
|
|||
{
|
||||
ierr("ERROR: Failed to register touchscreen device minor=%d\n",
|
||||
CONFIG_ADS7843E_DEVMINOR);
|
||||
|
||||
/* up_spiuninitialize(dev); */
|
||||
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lpc4088-devkit/src/lpc17_40_userleds.c
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc17_40_userleds.c
|
||||
* arch/arm/src/board/lpc17_40_userleds.c
|
||||
*
|
||||
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/lpc4088-devkit/src/lpc4088-devkit.h
|
||||
/****************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-devkit/src/lpc4088-devkit.h
|
||||
* arch/arm/src/board/lpc4088-devkit.h
|
||||
*
|
||||
* Copyright (C) 2013, 2017-2018 Gregory Nutt. All rights reserved.
|
||||
|
@ -32,23 +32,24 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _CONFIGS_LPC4088_DEVKIT_SRC_LPC4088_DEVKIT_H
|
||||
#define _CONFIGS_LPC4088_DEVKIT_SRC_LPC4088_DEVKIT_H
|
||||
#ifndef __BOARDS_ARM_LPC17XX_40XX_LPC4088_DEVKIT_SRC_LPC4088_DEVKIT_H
|
||||
#define __BOARDS_ARM_LPC17XX_40XX_LPC4088_DEVKIT_SRC_LPC4088_DEVKIT_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* LPC4088 Developer's Kit GPIO Pin Definitions *****************************/
|
||||
|
||||
/* LPC4088 Developer's Kit GPIO Pin Definitions *************************************/
|
||||
/* GPIO P2[21] connects to the Ready/Busy pin of the NAND part. We need to
|
||||
* reconfigure this pin as normal GPIO input if NAND is used.
|
||||
*/
|
||||
|
@ -63,7 +64,8 @@
|
|||
* LED3 -- Connected to P1[13]
|
||||
* LED4 -- Connected to P4[27]
|
||||
*
|
||||
* These LEDs are connecte to ground so a high output value will illuminate them.
|
||||
* These LEDs are connecte to ground so a high output value will illuminate
|
||||
* them.
|
||||
*/
|
||||
|
||||
#define GPIO_LED1 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT1 | GPIO_PIN14)
|
||||
|
@ -71,11 +73,13 @@
|
|||
#define GPIO_LED3 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT1 | GPIO_PIN13)
|
||||
#define GPIO_LED4 (GPIO_OUTPUT | GPIO_VALUE_ONE | GPIO_PORT4 | GPIO_PIN27)
|
||||
|
||||
/* Button definitions ***************************************************************/
|
||||
/* The LPC4088 Developer's Kit supports several buttons. All are pulled up externally.
|
||||
* When closed, the pins will be pulled to ground. So the buttons will read "1"
|
||||
* when open and "0" when closed. All are capable of generating
|
||||
* interrupts.
|
||||
/* Button definitions *******************************************************/
|
||||
|
||||
/* The LPC4088 Developer's Kit supports several buttons.
|
||||
* All are pulled up externally.
|
||||
* When closed, the pins will be pulled to ground.
|
||||
* So the buttons will read "1" when open and "0" when closed.
|
||||
* All are capable of generating interrupts.
|
||||
*
|
||||
* USER1 -- Connected to P2[10]
|
||||
*
|
||||
|
@ -87,8 +91,8 @@
|
|||
* JOY_D -- Connected to P2[27]
|
||||
* JOY_CTR -- Connected to P2[22]
|
||||
*
|
||||
* For the interrupting buttons, interrupts are generated on both edges (press and
|
||||
* release).
|
||||
* For the interrupting buttons, interrupts are generated on both edges
|
||||
* (press and release).
|
||||
*/
|
||||
|
||||
#define GPIO_USER1 (GPIO_INPUT | GPIO_PULLUP | GPIO_PORT4 | GPIO_PIN26)
|
||||
|
@ -108,37 +112,43 @@
|
|||
#define GPIO_JOY_D_IRQ LPC17_40_IRQ_P2p27
|
||||
#define GPIO_JOY_CTR_IRQ LPC17_40_IRQ_P2p22
|
||||
|
||||
/* SD Card **************************************************************************/
|
||||
/* The SD card detect (CD) signal is on bit 4 of the PCA9532 port expander U8.
|
||||
* Support for this is not currently set up.
|
||||
* The SD card's power is controlled through a P-channel MOSFET connected to P1[5].
|
||||
* This pin must be driven LOW in order to enable the SD card.*/
|
||||
/* SD Card ******************************************************************/
|
||||
|
||||
/* The SD card detect (CD) signal is on bit 4 of the PCA9532 port expander
|
||||
* U8. Support for this is not currently set up.
|
||||
* The SD card's power is controlled through a P-channel MOSFET connected
|
||||
* to P1[5]. This pin must be driven LOW in order to enable the SD card.
|
||||
*/
|
||||
|
||||
#define GPIO_SD_PWR (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT1 | GPIO_PIN5)
|
||||
|
||||
/* More work is required to complete implementation of LCD support on this board. */
|
||||
/* More work is required to complete implementation of LCD support
|
||||
* on this board.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
/* LCD ******************************************************************************/
|
||||
/* LCD **********************************************************************/
|
||||
|
||||
/* Backlight enable, P2[1]. Initial state is OFF (zero) */
|
||||
|
||||
#define GPIO_LCD_BL (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT2 | GPIO_PIN1)
|
||||
|
||||
/* XPT2046 Touchscreen **************************************************************/
|
||||
/* -------------- -------------------- ------------ --------------------------------
|
||||
/* XPT2046 Touchscreen ******************************************************/
|
||||
|
||||
/* -------------- -------------------- ------------ -------------------------
|
||||
* XTPT2046 Module Module LPC4088 Developer's Kit LED
|
||||
* Signal Connector Connector
|
||||
* -------------- -------------------- ------------ ---------------------------------
|
||||
* -------------- -------------------- ------------ -------------------------
|
||||
* Pin 11 PENIRQ\ PENIRQ (pulled high) PORT3 Pin 1 P2.15 PENIRQ
|
||||
* Pin 12 DOUT MISO PORT3 Pin 4 P1.18 MISO1 (Also USB HOST UP LED)
|
||||
* Pin 13 BUSY BUSY (pulled high) PORT3 Pin 9 P2.14 BUSY
|
||||
* Pin 14 DIN MOSI PORT3 Pin 3 P0.13 MOSI1 (Also USB Device up LED and SD CD pin)
|
||||
* Pin 15 CS\ SSEL (pulled high) PORT3 Pin 6 P1.8 GPIO (Also RMII_CRS_DV)
|
||||
* Pin 16 DCLK SCK PORT3 Pin 5 P1.19 SCK1
|
||||
* -------------- -------------------- ------------ ---------------------------------
|
||||
* -------------- -------------------- ------------ -------------------------
|
||||
*
|
||||
* Pins should not need to be configured as pull-ups because, according to the LCD
|
||||
* schematic, the are pulled-up on board the LCD module.
|
||||
* Pins should not need to be configured as pull-ups because, according to
|
||||
* the LCD schematic, the are pulled-up on board the LCD module.
|
||||
*/
|
||||
|
||||
#define GPIO_TC_PENIRQ (GPIO_INTBOTH | GPIO_FLOAT | GPIO_PORT2 | GPIO_PIN15)
|
||||
|
@ -149,17 +159,17 @@
|
|||
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc4088_devkit_bringup
|
||||
*
|
||||
* Description:
|
||||
|
@ -171,102 +181,103 @@
|
|||
* CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y :
|
||||
* Called from the NSH library via boardctl()
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
int lpc4088_devkit_bringup(void);
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc4088_devkit_sspdev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the LPC4088 Developer's Kit board.
|
||||
* Called to configure SPI chip select GPIO pins for the LPC4088 Developer's
|
||||
* Kit board.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void weak_function lpc4088_devkit_sspdev_initialize(void);
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc4088_devkit_sdram_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize SDRAM
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_LPC17_40_EMC
|
||||
#ifdef CONFIG_LPC17_40_EXTDRAM
|
||||
void lpc4088_devkit_sdram_initialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc4088_devkit_nor_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize NOR FLASH
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_LPC17_40_EXTNOR
|
||||
void lpc4088_devkit_nor_initialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc4088_devkit_nand_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize NAND FLASH
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_LPC17_40_EXTNAND
|
||||
void lpc4088_devkit_nand_initialize(void);
|
||||
#endif
|
||||
#endif /* CONFIG_LPC17_40_EMC */
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc4088_devkit_lcd_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the LCD. Setup backlight (initially off)
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_LPC17_40_LCD
|
||||
void lpc4088_devkit_lcd_initialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc4088_devkit_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup logic to configure the touchscreen
|
||||
* device. This function will register the driver as /dev/inputN where N is the
|
||||
* minor device number.
|
||||
* This function is called by board-bringup logic to configure the
|
||||
* touchscreen device. This function will register the driver as
|
||||
* /dev/inputN where N is the minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is returned to
|
||||
* indicate the nature of the failure.
|
||||
* Zero is returned on success. Otherwise, a negated errno value is
|
||||
* returned to indicate the nature of the failure.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT_ADS7843E
|
||||
int lpc4088_devkit_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: lpc17_40_djoy_initialization
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the discrete joystick driver
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_LPC4088_DEVKIT_DJOYSTICK
|
||||
int lpc17_40_djoy_initialization(void);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _CONFIGS_LPC4088_DEVKIT_SRC_LPC4088_DEVKIT_H */
|
||||
#endif /* __BOARDS_ARM_LPC17XX_40XX_LPC4088_DEVKIT_SRC_LPC4088_DEVKIT_H */
|
||||
|
|
|
@ -93,7 +93,7 @@ Using OpenOCD with the Olimex ARM-USB-OCD
|
|||
I have been using the Olimex ARM-USB-OCD debugger. OpenOCD
|
||||
requires a configuration file. I keep the one I used last here:
|
||||
|
||||
boards/lpc4088-quickstart/tools/lpc4088-quickstart.cfg
|
||||
boards/arm/lpc17xx_40xx/lpc4088-quickstart/tools/lpc4088-quickstart.cfg
|
||||
|
||||
However, the "correct" configuration script to use with OpenOCD may
|
||||
change as the features of OpenOCD evolve. So you should at least
|
||||
|
@ -121,7 +121,7 @@ Using OpenOCD with the Olimex ARM-USB-OCD
|
|||
installations. They could be most anywhwere if you are using a
|
||||
windows version of OpenOCD.
|
||||
|
||||
boards/lpc4088-quickstart/tools/lpc4088-quickstart.cfg
|
||||
boards/arm/lpc17xx_40xx/lpc4088-quickstart/tools/lpc4088-quickstart.cfg
|
||||
This is simply openocd-usb.cfg, lpc40xx.cfg, and lpc1xxx.cfg
|
||||
concatenated into one file for convenience. Don't use it
|
||||
unless you have to.
|
||||
|
@ -132,20 +132,21 @@ Using OpenOCD with the Olimex ARM-USB-OCD
|
|||
|
||||
- Possibly the value of OPENOCD_PATH and TARGET_PATH
|
||||
- It assumes that the correct script to use is the one at
|
||||
boards/lpc4088-quickstart/tools/lpc4088-quickstart.cfg
|
||||
boards/arm/lpc17xx_40xx/lpc4088-quickstart/tools/lpc4088-quickstart.cfg
|
||||
|
||||
Starting OpenOCD
|
||||
|
||||
Then you should be able to start the OpenOCD daemon as follows. This
|
||||
assumes that you have already CD'ed to the NuttX build directory and
|
||||
that you have set the full path to the boards/lpc4088-quickstart/tools
|
||||
that you have set the full path to the
|
||||
boards/arm/lpc17xx_40xx/lpc4088-quickstart/tools
|
||||
in your PATH environment variable:
|
||||
|
||||
oocd.sh $PWD
|
||||
|
||||
or, if the PATH variable is not so configured:
|
||||
|
||||
boards/lpc4088-quickstart/tools/oocd.sh $PWD
|
||||
boards/arm/lpc17xx_40xx/lpc4088-quickstart/tools/oocd.sh $PWD
|
||||
|
||||
Connecting GDB
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/************************************************************************************
|
||||
* boards/lpc4088-quickstart/include/board.h
|
||||
/****************************************************************************
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-quickstart/include/board.h
|
||||
* include/arch/board/board.h
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
|
@ -32,14 +32,14 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __BOARDS_ARM_LPC4088_QUICKSTART_INCLUDE_BOARD_H
|
||||
#define __BOARDS_ARM_LPC4088_QUICKSTART_INCLUDE_BOARD_H
|
||||
#ifndef __BOARDS_ARM_LPC17XX_40XX_LPC4088_QUICKSTART_INCLUDE_BOARD_H
|
||||
#define __BOARDS_ARM_LPC17XX_40XX_LPC4088_QUICKSTART_INCLUDE_BOARD_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
|
@ -49,12 +49,15 @@
|
|||
# include <nuttx/irq.h>
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
/* Clocking *************************************************************************/
|
||||
/* NOTE: The following definitions require lpc17_40_syscon.h. It is not included here
|
||||
* because the including C file may not have that file in its include path.
|
||||
****************************************************************************/
|
||||
|
||||
/* Clocking *****************************************************************/
|
||||
|
||||
/* NOTE: The following definitions require lpc17_40_syscon.h.
|
||||
* It is not included here because the including C file may not have that
|
||||
* file in its include path.
|
||||
*/
|
||||
|
||||
#define BOARD_XTAL_FREQUENCY (12000000) /* XTAL oscillator frequency */
|
||||
|
@ -65,27 +68,28 @@
|
|||
|
||||
/* This is the clock setup we configure for:
|
||||
*
|
||||
* SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source
|
||||
* PLL0CLK = (10 * SYSCLK) / 1 = 120MHz -> PLL0 multipler=10, pre-divider=1
|
||||
* CCLCK = 120MHz -> CCLK divider = 1
|
||||
* SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source
|
||||
* PLL0CLK = (10 * SYSCLK) / 1 = 120MHz -> PLL0 multipler=10, pre-divider=1
|
||||
* CCLCK = 120MHz -> CCLK divider = 1
|
||||
*/
|
||||
|
||||
#define LPC17_40_CCLK 120000000 /* 120Mhz */
|
||||
#define LPC17_40_CCLK 120000000 /* 120Mhz */
|
||||
#define BOARD_PCLKDIV 2 /* Peripheral clock = LPC17_40_CCLK/2 */
|
||||
#define BOARD_PCLK_FREQUENCY (LPC17_40_CCLK / BOARD_PCLKDIV)
|
||||
|
||||
/* Select the main oscillator as the frequency source. SYSCLK is then the frequency
|
||||
* of the main oscillator.
|
||||
/* Select the main oscillator as the frequency source.
|
||||
* SYSCLK is then the frequency of the main oscillator.
|
||||
*
|
||||
* If BOARD_XTAL_FREQUENCY > 15000000, then the SCS OSCRS bit (bit 4) should also
|
||||
* be set in the BOARD_SCS_VALUE.
|
||||
* If BOARD_XTAL_FREQUENCY > 15000000, then the SCS OSCRS bit (bit 4) should
|
||||
* also be set in the BOARD_SCS_VALUE.
|
||||
*/
|
||||
|
||||
#undef CONFIG_LPC17_40_MAINOSC
|
||||
#define CONFIG_LPC17_40_MAINOSC 1
|
||||
#define BOARD_SCS_VALUE SYSCON_SCS_OSCEN
|
||||
|
||||
/* Select the main oscillator and CCLK divider. The output of the divider is CCLK.
|
||||
/* Select the main oscillator and CCLK divider.
|
||||
* The output of the divider is CCLK.
|
||||
* The input to the divider (PLLCLK) will be determined by the PLL output.
|
||||
*/
|
||||
|
||||
|
@ -188,16 +192,19 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
/* LED definitions ******************************************************************/
|
||||
/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in
|
||||
* any way. The following definitions are used to access individual LEDs.
|
||||
/* LED definitions **********************************************************/
|
||||
|
||||
/* If CONFIG_ARCH_LEDS is not defined, then the user can control
|
||||
* the LEDs in any way.
|
||||
* The following definitions are used to access individual LEDs.
|
||||
*
|
||||
* LED1 : Connected to P1[18]
|
||||
* LED2 : Connected to P0[13]
|
||||
* LED3 : Connected to P1[13]
|
||||
* LED4 : Connected to P2[19]
|
||||
*
|
||||
* These LEDs are connecte to ground so a high output value will illuminate them.
|
||||
* These LEDs are connecte to ground so a high output value will illuminate
|
||||
* them.
|
||||
*/
|
||||
|
||||
/* LED index values for use with board_userled() */
|
||||
|
@ -216,8 +223,8 @@
|
|||
#define BOARD_LED4_BIT (1 << BOARD_LED4)
|
||||
|
||||
/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the four LEDs
|
||||
* on the LPC4088 QuickStart board. The following definitions describe how NuttX
|
||||
* controls the LEDs:
|
||||
* on the LPC4088 QuickStart board.
|
||||
* The following definitions describe how NuttX controls the LEDs:
|
||||
*/
|
||||
/* LED1 LED2 LED3 LED4 */
|
||||
#define LED_STARTED 0 /* OFF OFF OFF OFF */
|
||||
|
@ -228,29 +235,31 @@
|
|||
#define LED_SIGNAL 4 /* LED3 glows, on while in signal handler */
|
||||
#define LED_ASSERTION 4 /* LED3 glows, on while in assertion */
|
||||
#define LED_PANIC 4 /* LED3 Flashes at 2Hz */
|
||||
#define LED_IDLE 5 /* LED4 glows: ON while active *
|
||||
* OFF while sleeping */
|
||||
#define LED_IDLE 5 /* LED4 glows: ON while active
|
||||
* OFF while sleeping
|
||||
*/
|
||||
|
||||
/* Button definitions ***************************************************************/
|
||||
/* The LPC4088 QuickStart supports a single button. It must be pulled up by the MCU.
|
||||
* When closed, the pin will be pulled to ground. So the button will read "1"
|
||||
* when open and "0" when closed. The button is capable of generating an
|
||||
* interrupt.
|
||||
/* Button definitions *******************************************************/
|
||||
|
||||
/* The LPC4088 QuickStart supports a single button.
|
||||
* It must be pulled up by the MCU.
|
||||
* When closed, the pin will be pulled to ground.
|
||||
* So the button will read "1" when open and "0" when closed.
|
||||
* The button is capable of generating an interrupt.
|
||||
*
|
||||
* USER1 -- Connected to P2[10]
|
||||
*
|
||||
* For the interrupting buttons, interrupts are generated on both edges (press and
|
||||
* release).
|
||||
* For the interrupting buttons, interrupts are generated on both edges
|
||||
* (press and release).
|
||||
*/
|
||||
|
||||
|
||||
#define BOARD_BUTTON_USER1 0
|
||||
|
||||
#define NUM_BUTTONS 1
|
||||
|
||||
#define BOARD_BUTTON_USER1_BIT (1 << BOARD_BUTTON_USER1)
|
||||
|
||||
/* Alternate pin selections *********************************************************/
|
||||
/* Alternate pin selections *************************************************/
|
||||
|
||||
/* UART0:
|
||||
*
|
||||
|
@ -290,9 +299,9 @@
|
|||
#define GPIO_ENET_MDC GPIO_ENET_MDC_1
|
||||
#define GPIO_ENET_MDIO GPIO_ENET_MDIO_1
|
||||
|
||||
|
||||
/* External LCD is currently untested.
|
||||
* These pins will probably need to be updated before using the LCD. */
|
||||
* These pins will probably need to be updated before using the LCD.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
/* LCD R:
|
||||
|
@ -357,24 +366,22 @@
|
|||
|
||||
/* XPT2046 Touchscreen:
|
||||
*
|
||||
/* -------------- -------------------- ------------ --------------------------------
|
||||
* -------------- -------------------- ------------ -------------------------
|
||||
* XTPT2046 Module Module
|
||||
* Signal Connector Connector
|
||||
* -------------- -------------------- ------------ ---------------------------------
|
||||
* -------------- -------------------- ------------ -------------------------
|
||||
* Pin 11 PENIRQ\ PENIRQ (pulled high) PORT3 Pin 1 P2.15 PENIRQ
|
||||
* Pin 12 DOUT MISO PORT3 Pin 4 P1.18 MISO1 (Also USB HOST UP LED)
|
||||
* Pin 13 BUSY BUSY (pulled high) PORT3 Pin 9 P2.14 BUSY
|
||||
* Pin 14 DIN MOSI PORT3 Pin 3 P0.13 MOSI1 (Also USB Device up LED and SD CD pin)
|
||||
* Pin 15 CS\ SSEL (pulled high) PORT3 Pin 6 P1.8 GPIO (Also RMII_CRS_DV)
|
||||
* Pin 16 DCLK SCK PORT3 Pin 5 P1.19 SCK1
|
||||
* -------------- -------------------- ------------ ---------------------------------
|
||||
* -------------- -------------------- ------------ -------------------------
|
||||
*/
|
||||
|
||||
|
||||
#define GPIO_SSP1_MISO GPIO_SSP1_MISO_3
|
||||
#define GPIO_SSP1_MOSI GPIO_SSP1_MOSI_2
|
||||
#define GPIO_SSP1_SCK GPIO_SSP1_SCK_2
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __BOARDS_ARM_LPC4088_QUICKSTART_INCLUDE_BOARD_H */
|
||||
#endif /* __BOARDS_ARM_LPC17XX_40XX_LPC4088_QUICKSTART_INCLUDE_BOARD_H */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
############################################################################
|
||||
# boards/lpc4088-quickstart/kernel/Makefile
|
||||
# boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/Makefile
|
||||
#
|
||||
# Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lpc4088-quickstart/kernel/lpc17_40_userspace.c
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-quickstart/kernel/lpc17_40_userspace.c
|
||||
*
|
||||
* Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
@ -50,6 +50,7 @@
|
|||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#ifndef CONFIG_NUTTX_USERSPACE
|
||||
|
@ -64,14 +65,14 @@
|
|||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* These 'addresses' of these values are setup by the linker script. They are
|
||||
* not actual uint32_t storage locations! They are only used meaningfully in the
|
||||
* following way:
|
||||
/* These 'addresses' of these values are setup by the linker script.
|
||||
* They are not actual uint32_t storage locations!
|
||||
* They are only used meaningfully in the following way:
|
||||
*
|
||||
* - The linker script defines, for example, the symbol_sdata.
|
||||
* - The declareion extern uint32_t _sdata; makes C happy. C will believe
|
||||
* that the value _sdata is the address of a uint32_t variable _data (it is
|
||||
* not!).
|
||||
* that the value _sdata is the address of a uint32_t variable _data
|
||||
* (it is not!).
|
||||
* - We can recoved the linker value then by simply taking the address of
|
||||
* of _data. like: uint32_t *pdata = &_sdata;
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
############################################################################
|
||||
# boards/lpc4088-quickstart/scripts/Make.defs
|
||||
# boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/Make.defs
|
||||
#
|
||||
# Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||
# Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lpc4088-quickstart/scripts/kernel-space.ld
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/kernel-space.ld
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/****************************************************************************
|
||||
* boards/lpc4088-quickstart/scripts/ld.script
|
||||
* boards/arm/lpc17xx_40xx/lpc4088-quickstart/scripts/ld.script
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Rommel Marcelo
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue