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:
Alin Jerpelea
2019-08-13 16:08:49 +00:00
committed by Gregory Nutt
parent 248a2966c6
commit 907d6b085b
242 changed files with 2600 additions and 2235 deletions
+56 -45
View File
@@ -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 -1
View File
@@ -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>
+40 -35
View File
@@ -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 */
+11 -6
View File
@@ -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 -1
View File
@@ -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
+5 -3
View File
@@ -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
+16 -14
View File
@@ -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)
{
+4 -3
View File
@@ -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
*
+9 -7
View File
@@ -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));
+50 -40
View File
@@ -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 -1
View File
@@ -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>
+40 -34
View File
@@ -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 -1
View File
@@ -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)
+4 -3
View File
@@ -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
+14 -12
View File
@@ -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)
{
+2 -2
View File
@@ -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 */
+9 -7
View File
@@ -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));
+27 -20
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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 -1
View File
@@ -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>
+14 -12
View File
@@ -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)
{
+2 -2
View File
@@ -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 */
+7 -6
View File
@@ -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>

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