forked from nuttx/nuttx-update
boards: nxstyle fixes
nxstyle fixes to pass the CI check Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
parent
40cd67eee6
commit
6f14299dd0
430 changed files with 3616 additions and 2516 deletions
|
@ -86,7 +86,7 @@
|
|||
#define LED_ASSERTION 3 /* An assertion failed N/C N/C Soft glow */
|
||||
#define LED_PANIC 3 /* The system has crashed N/C N/C 2Hz Flashing */
|
||||
|
||||
/* LED_IDLE --- /* MCU is is sleep mode Not used
|
||||
/* LED_IDLE --- MCU is is sleep mode Not used
|
||||
*
|
||||
* After booting, LED1 and 3 are not longer used by the system and can be
|
||||
* used for other purposes by the application (Of course, all LEDs are
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
* Name: a1x_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All A1x architectures must provide the following entry point. This entry
|
||||
* All A1x 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.
|
||||
*
|
||||
|
@ -57,7 +57,7 @@ void a1x_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
|
||||
* function called board_late_initialize(). board_late_initialize() will be
|
||||
* called immediately after up_initialize() is called and just before the
|
||||
* initial application is started. This additional initialization phase
|
||||
* may be used, for example, to initialize board-specific device drivers.
|
||||
|
|
|
@ -102,9 +102,9 @@
|
|||
* LED_PANIC The system has crashed N/C N/C 2Hz Flashing
|
||||
* LED_IDLE MCU is is sleep mode Not used
|
||||
*
|
||||
* After booting, LED1 and 3 are not longer used by the system and can be used
|
||||
* for other purposes by the application (Of course, all LEDs are available to
|
||||
* the application if CONFIG_ARCH_LEDS is not defined.
|
||||
* After booting, LED1 and 3 are not longer used by the system and can be
|
||||
* used for other purposes by the application (Of course, all LEDs are
|
||||
* available to the application if CONFIG_ARCH_LEDS is not defined.
|
||||
*/
|
||||
|
||||
/* Buttons ******************************************************************/
|
||||
|
@ -142,13 +142,13 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
# define TDA19988_I2CFREQUENCY 400000
|
||||
#endif
|
||||
|
||||
/* LEDs *****************************************************************************/
|
||||
/* LEDs *********************************************************************/
|
||||
|
||||
/* The beaglebone black has four user LEDs; all four can be controlled from
|
||||
* software.
|
||||
|
@ -126,13 +126,13 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Clocking *************************************************************/
|
||||
/* Clocking *****************************************************************/
|
||||
|
||||
#define C5471_CLOCK 47500000 /* 47.5 MHz */
|
||||
|
||||
/* LED definitions ******************************************************/
|
||||
/* LED definitions **********************************************************/
|
||||
|
||||
#define LED_STARTED 0
|
||||
#define LED_HEAPALLOCATE 1
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
* 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
|
||||
* function called board_late_initialize(). board_late_initialize() will be
|
||||
* called immediately after up_initialize() is called and just before the
|
||||
* initial application is started. This additional initialization phase
|
||||
* may be used, for example, to initialize board-specific device drivers.
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* UART0
|
||||
*
|
||||
* The control MCU acts as a board controller (BC). There is a UART
|
||||
|
|
|
@ -113,28 +113,28 @@
|
|||
static const uint16_t g_ledbits[8] =
|
||||
{
|
||||
(LED_STARTED_ON_SETBITS | LED_STARTED_ON_CLRBITS |
|
||||
LED_STARTED_OFF_SETBITS | LED_STARTED_OFF_CLRBITS),
|
||||
LED_STARTED_OFF_SETBITS | LED_STARTED_OFF_CLRBITS),
|
||||
|
||||
(LED_HEAPALLOCATE_ON_SETBITS | LED_HEAPALLOCATE_ON_CLRBITS |
|
||||
LED_HEAPALLOCATE_OFF_SETBITS | LED_HEAPALLOCATE_OFF_CLRBITS),
|
||||
LED_HEAPALLOCATE_OFF_SETBITS | LED_HEAPALLOCATE_OFF_CLRBITS),
|
||||
|
||||
(LED_IRQSENABLED_ON_SETBITS | LED_IRQSENABLED_ON_CLRBITS |
|
||||
LED_IRQSENABLED_OFF_SETBITS | LED_IRQSENABLED_OFF_CLRBITS),
|
||||
LED_IRQSENABLED_OFF_SETBITS | LED_IRQSENABLED_OFF_CLRBITS),
|
||||
|
||||
(LED_STACKCREATED_ON_SETBITS | LED_STACKCREATED_ON_CLRBITS |
|
||||
LED_STACKCREATED_OFF_SETBITS | LED_STACKCREATED_OFF_CLRBITS),
|
||||
LED_STACKCREATED_OFF_SETBITS | LED_STACKCREATED_OFF_CLRBITS),
|
||||
|
||||
(LED_INIRQ_ON_SETBITS | LED_INIRQ_ON_CLRBITS |
|
||||
LED_INIRQ_OFF_SETBITS | LED_INIRQ_OFF_CLRBITS),
|
||||
LED_INIRQ_OFF_SETBITS | LED_INIRQ_OFF_CLRBITS),
|
||||
|
||||
(LED_SIGNAL_ON_SETBITS | LED_SIGNAL_ON_CLRBITS |
|
||||
LED_SIGNAL_OFF_SETBITS | LED_SIGNAL_OFF_CLRBITS),
|
||||
LED_SIGNAL_OFF_SETBITS | LED_SIGNAL_OFF_CLRBITS),
|
||||
|
||||
(LED_ASSERTION_ON_SETBITS | LED_ASSERTION_ON_CLRBITS |
|
||||
LED_ASSERTION_OFF_SETBITS | LED_ASSERTION_OFF_CLRBITS),
|
||||
LED_ASSERTION_OFF_SETBITS | LED_ASSERTION_OFF_CLRBITS),
|
||||
|
||||
(LED_PANIC_ON_SETBITS | LED_PANIC_ON_CLRBITS |
|
||||
LED_PANIC_OFF_SETBITS | LED_PANIC_OFF_CLRBITS)
|
||||
LED_PANIC_OFF_SETBITS | LED_PANIC_OFF_CLRBITS)
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -49,9 +49,9 @@ void efm32_boardinitialize(void)
|
|||
#ifdef CONFIG_EFM32_UART0
|
||||
/* The control MCU acts as a board controller (BC). There is a UART
|
||||
* connection between the EFM and the BC. The connection is made by
|
||||
* setting the EFM_BC_EN (PD13) line high. The EFM can then use the BSP to
|
||||
* send commands to the BC. When EFM_BC_EN is low, EFM_BC_TX and EFM_BC_RX
|
||||
* can be used by other applications.
|
||||
* setting the EFM_BC_EN (PD13) line high. The EFM can then use the BSP
|
||||
* to send commands to the BC. When EFM_BC_EN is low, EFM_BC_TX and
|
||||
* EFM_BC_RX can be used by other applications.
|
||||
*/
|
||||
|
||||
efm32_configgpio(GPIO_BC_EN);
|
||||
|
@ -70,7 +70,7 @@ void efm32_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
|
||||
* function called board_late_initialize(). board_late_initialize() will be
|
||||
* called immediately after up_initialize() is called and just before the
|
||||
* initial application is started. This additional initialization phase
|
||||
* may be used, for example, to initialize board-specific device drivers.
|
||||
|
|
|
@ -233,9 +233,10 @@
|
|||
/* UART0:
|
||||
*
|
||||
* The kit contains a board controller that is responsible for performing
|
||||
* various board level tasks, such as handling the debugger and the Advanced
|
||||
* Energy Monitor. An interface is provided between the EFM32 and the board
|
||||
* controller in the form of a UART connection. The connection is enabled by
|
||||
* various board level tasks, such as handling the debugger and the
|
||||
* Advanced Energy Monitor.
|
||||
* An interface is provided between the EFM32 and the board controller in
|
||||
* the form of a UART connection. The connection is enabled by
|
||||
* setting the EFM_BC_EN (PF7) line high, and using the lines EFM_BC_TX
|
||||
* (PE0) and EFM_BC_RX (PE1) for communicating.
|
||||
*
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* The EFM32 Giant Gecko Start Kit has two yellow LEDs marked LED0 and LED1.
|
||||
* These LEDs are controlled by GPIO pins on the EFM32. The LEDs are
|
||||
* connected to pins PE2 and PE3 in an active high configuration:
|
||||
|
@ -96,7 +97,7 @@ void board_autoled_initialize(void)
|
|||
|
||||
void board_autoled_on(int led)
|
||||
{
|
||||
bool led0on = false; /* High illuminates */
|
||||
bool led0on = false; /* High illuminates */
|
||||
bool led1on = false; /* High illuminates */
|
||||
|
||||
switch (led)
|
||||
|
|
|
@ -47,9 +47,10 @@ void efm32_boardinitialize(void)
|
|||
{
|
||||
#ifdef CONFIG_EFM32_UART0
|
||||
/* The kit contains a board controller that is responsible for performing
|
||||
* various board level tasks, such as handling the debugger and the Advanced
|
||||
* Energy Monitor. An interface is provided between the EFM32 and the board
|
||||
* controller in the form of a UART connection. The connection is enabled by
|
||||
* various board level tasks, such as handling the debugger and the
|
||||
* Advanced Energy Monitor.
|
||||
* An interface is provided between the EFM32 and the board controller in
|
||||
* the form of a UART connection. The connection is enabled by
|
||||
* setting the EFM_BC_EN (PF7) line high, and using the lines EFM_BC_TX
|
||||
* (PE0) and EFM_BC_RX (PE1) for communicating.
|
||||
*/
|
||||
|
@ -70,7 +71,7 @@ void efm32_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
|
||||
* function called board_late_initialize(). board_late_initialize() will be
|
||||
* called immediately after up_initialize() is called and just before the
|
||||
* initial application is started. This additional initialization phase
|
||||
* may be used, for example, to initialize board-specific device drivers.
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* UART0
|
||||
*
|
||||
* The kit contains a board controller that is responsible for performing
|
||||
|
|
|
@ -54,7 +54,7 @@ void efm32_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
|
||||
* function called board_late_initialize(). board_late_initialize() will be
|
||||
* called immediately after up_initialize() is called and just before the
|
||||
* initial application is started. This additional initialization phase
|
||||
* may be used, for example, to initialize board-specific device drivers.
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
|
|
@ -147,7 +147,7 @@ extern "C"
|
|||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#undef EXTERN
|
||||
|
|
|
@ -105,7 +105,7 @@ void imx_board_initialize(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
|
||||
* 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.
|
||||
|
|
|
@ -60,13 +60,13 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* boards/arm/imxrt/imxrt1020-evk/include/board.h
|
||||
*
|
||||
* Copyright (C) 2018-2019 Gregory Nutt. All rights reserved.
|
||||
|
@ -56,8 +56,10 @@
|
|||
|
||||
#define IMXRT_VDD_SOC (0x12)
|
||||
|
||||
/* Set Sys PLL (PLL2) to fOut = (24Mhz * SYS_PLL_DIV_SELECT) / ARM_PODF_DIVISOR
|
||||
* 528Mhz = (24Mhz * SYS_PLL_DIV_SELECT) / ARM_PODF_DIVISOR
|
||||
/* Set Sys PLL (PLL2) to fOut = (24Mhz * SYS_PLL_DIV_SELECT) /
|
||||
* ARM_PODF_DIVISOR
|
||||
* 528Mhz = (24Mhz * SYS_PLL_DIV_SELECT) /
|
||||
* ARM_PODF_DIVISOR
|
||||
* SYS_PLL_DIV_SELECT = 22
|
||||
* SYS_PODF_DIVISOR = 1
|
||||
* 528Mhz = (24Mhz * 22) / 1
|
||||
|
@ -74,7 +76,8 @@
|
|||
* IMXRT_IPG_PODF_DIVIDER = 4
|
||||
* 125Mhz = 500Mhz / 4
|
||||
*
|
||||
* PERCLK_CLOCK_ROOT = IPG_CLOCK_ROOT / IMXRT_PERCLK_PODF_DIVIDER
|
||||
* PERCLK_CLOCK_ROOT = IPG_CLOCK_ROOT /
|
||||
* IMXRT_PERCLK_PODF_DIVIDER
|
||||
* IMXRT_PERCLK_PODF_DIVIDER = 2
|
||||
* 62.5Mhz = 125Mhz / 2
|
||||
*
|
||||
|
@ -134,7 +137,7 @@
|
|||
# define IMXRT_TRACE_CLK_SELECT CCM_CBCMR_TRACE_CLK_SEL_PLL2_PFD0
|
||||
#endif
|
||||
|
||||
/* LED definitions ***********************************************************/
|
||||
/* LED definitions **********************************************************/
|
||||
|
||||
/* There is one user accessible LED status indicator located on the 1020-EVK.
|
||||
* The function of the LEDs include:
|
||||
|
@ -182,7 +185,7 @@
|
|||
|
||||
#define BOARD_USDHC_SD_ID (0)
|
||||
|
||||
/* Button definitions ********************************************************/
|
||||
/* Button definitions *******************************************************/
|
||||
|
||||
/* The IMXRT board has three external buttons
|
||||
*
|
||||
|
@ -271,13 +274,13 @@
|
|||
#define PIN_USDHC1_CD_GPIO (IOMUX_VSD_DEFAULT | \
|
||||
GPIO_PORT3 | GPIO_PIN19 ) /* SD_B0_06 */
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
|
@ -290,9 +293,9 @@ extern "C"
|
|||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
@ -80,12 +80,10 @@
|
|||
* 2. SW4 (IRQ88, USER) Wakeup, GPIO5-0
|
||||
*/
|
||||
|
||||
|
||||
#define GPIO_SWWAKE (GPIO_INTERRUPT | GPIO_INT_FALLINGEDGE | \
|
||||
IOMUX_SWWAKE_DEFAULT | GPIO_PORT5 | GPIO_PIN0) /* WAKE */
|
||||
|
||||
|
||||
/* ETH Disambiguation ********************************************************/
|
||||
/* ETH Disambiguation *******************************************************/
|
||||
|
||||
#define GPIO_ENET_INT (IOMUX_ENET_INT_DEFAULT | GPIO_INTERRUPT | \
|
||||
GPIO_INT_FALLINGEDGE | GPIO_PORT1 | GPIO_PIN22) /* AD_B1_06 */
|
||||
|
@ -93,13 +91,13 @@
|
|||
#define GPIO_ENET_RST (GPIO_OUTPUT | IOMUX_ENET_RST_DEFAULT | \
|
||||
GPIO_OUTPUT_ZERO | GPIO_PORT1 | GPIO_PIN4 ) /* AD_B0_04, Inverted logic */
|
||||
|
||||
/* USBOTG *********************************************************************/
|
||||
/* USBOTG *******************************************************************/
|
||||
|
||||
#define GPIO_USBOTG_ID (GPIO_USB_OTG_ID_1 | IOMUX_USBOTG_ID_DEFAULT) /* AD_B1_11 */
|
||||
#define GPIO_USBOTG_PWR (GPIO_USB_OTG_PWR_1 | IOMUX_USBOTG_PWR_DEFAULT) /* AD_B1_10 */
|
||||
#define GPIO_USBOTG_OC (GPIO_USB_OTG_OC_1 | IOMUX_USBOTG_OC_DEFAULT) /* AD_B1_12 */
|
||||
|
||||
/* USDHC **********************************************************************/
|
||||
/* USDHC ********************************************************************/
|
||||
|
||||
#define PIN_USDHC1_CD (IOMUX_VSD_DEFAULT | \
|
||||
GPIO_PORT3 | GPIO_PIN19 ) /* SD_B0_06 */
|
||||
|
@ -113,13 +111,13 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -144,7 +142,7 @@ int imxrt_bringup(void);
|
|||
|
||||
void imxrt_spidev_initialize(void);
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: imxrt_mmcsd_spi_initialize
|
||||
*
|
||||
* Description:
|
||||
|
|
|
@ -60,7 +60,7 @@ void imxrt_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
|
||||
* 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.
|
||||
|
|
|
@ -34,26 +34,27 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
******************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include "imxrt_flexspi_nor_flash.h"
|
||||
|
||||
/*******************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
******************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* This configuration is for an IS25LP064A. There will be slight differences for
|
||||
* other chips but it's not as painful or scary as it looks. Just get the flash
|
||||
* data sheet and work through it slowly to make sure the codes match. You will
|
||||
* get something minimal up just using an 0x03 read opcode, and you can optimize
|
||||
* for the actual flash you've got from there.
|
||||
/* This configuration is for an IS25LP064A.
|
||||
* There will be slight differences for other chips but it's not as painful
|
||||
* or scary as it looks. Just get the flash data sheet and work through it
|
||||
* slowly to make sure the codes match. You will get something minimal up
|
||||
* just using an 0x03 read opcode, and you can optimize for the actual flash
|
||||
* you've got from there.
|
||||
*
|
||||
* It's best to not use the QPI because then you lose the ability to communicate
|
||||
* directly with the chip *except* in QPI mode until you power cycle, and the
|
||||
* overhead for block reads is minimal (reduces 32784 clock ticks to 32778 for
|
||||
* a 4K block read)
|
||||
* It's best to not use the QPI because then you lose the ability to
|
||||
* communicate directly with the chip *except* in QPI mode until you power
|
||||
* cycle, and the overhead for block reads is minimal (reduces 32784 clock
|
||||
* ticks to 32778 for a 4K block read)
|
||||
*/
|
||||
|
||||
#if defined (CONFIG_IMXRT1020_EVK_HYPER_FLASH)
|
||||
|
@ -64,17 +65,20 @@ const struct flexspi_nor_config_s g_flash_config =
|
|||
{
|
||||
.tag = FLEXSPI_CFG_BLK_TAG,
|
||||
.version = FLEXSPI_CFG_BLK_VERSION,
|
||||
.read_sample_clksrc = FLASH_READ_SAMPLE_CLK_EXTERNALINPUT_FROM_DQSPAD,
|
||||
.read_sample_clksrc =
|
||||
FLASH_READ_SAMPLE_CLK_EXTERNALINPUT_FROM_DQSPAD,
|
||||
.cs_hold_time = 3u,
|
||||
.cs_setup_time = 3u,
|
||||
.column_address_width = 3u,
|
||||
|
||||
/* Enable DDR mode, Word addassable, Safe configuration, Differential clock */
|
||||
/* Enable DDR mode, Word addassable,
|
||||
* Safe configuration, Differential clock
|
||||
*/
|
||||
|
||||
.controller_misc_option = (1u << FLEXSPIMISC_OFFSET_DDR_MODE_EN) |
|
||||
(1u << FLEXSPIMISC_OFFSET_WORD_ADDRESSABLE_EN) |
|
||||
(1u << FLEXSPIMISC_OFFSET_SAFECONFIG_FREQ_EN) |
|
||||
(1u << FLEXSPIMISC_OFFSET_DIFFCLKEN),
|
||||
(1u << FLEXSPIMISC_OFFSET_WORD_ADDRESSABLE_EN) |
|
||||
(1u << FLEXSPIMISC_OFFSET_SAFECONFIG_FREQ_EN) |
|
||||
(1u << FLEXSPIMISC_OFFSET_DIFFCLKEN),
|
||||
.sflash_pad_type = SERIAL_FLASH_8PADS,
|
||||
.serial_clk_freq = FLEXSPI_SERIAL_CLKFREQ_133MHz,
|
||||
.sflash_a1size = 64u * 1024u * 1024u,
|
||||
|
@ -86,9 +90,24 @@ const struct flexspi_nor_config_s g_flash_config =
|
|||
{
|
||||
/* Read LUTs */
|
||||
|
||||
FLEXSPI_LUT_SEQ(CMD_DDR, FLEXSPI_8PAD, 0xa0, RADDR_DDR, FLEXSPI_8PAD, 0x18),
|
||||
FLEXSPI_LUT_SEQ(CADDR_DDR, FLEXSPI_8PAD, 0x10, DUMMY_DDR, FLEXSPI_8PAD, 0x06),
|
||||
FLEXSPI_LUT_SEQ(READ_DDR, FLEXSPI_8PAD, 0x04, STOP, FLEXSPI_1PAD, 0x0),
|
||||
FLEXSPI_LUT_SEQ(CMD_DDR,
|
||||
FLEXSPI_8PAD,
|
||||
0xa0,
|
||||
RADDR_DDR,
|
||||
FLEXSPI_8PAD,
|
||||
0x18),
|
||||
FLEXSPI_LUT_SEQ(CADDR_DDR,
|
||||
FLEXSPI_8PAD,
|
||||
0x10,
|
||||
DUMMY_DDR,
|
||||
FLEXSPI_8PAD,
|
||||
0x06),
|
||||
FLEXSPI_LUT_SEQ(READ_DDR,
|
||||
FLEXSPI_8PAD,
|
||||
0x04,
|
||||
STOP,
|
||||
FLEXSPI_1PAD,
|
||||
0x0),
|
||||
},
|
||||
},
|
||||
.page_size = 512u,
|
||||
|
@ -170,3 +189,7 @@ const struct flexspi_nor_config_s g_flash_config =
|
|||
#else
|
||||
# error Boot Flash type not chosen!
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* boards/arm/imxrt/imxrt1020-evk/src/imxrt_spi.c
|
||||
*
|
||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
||||
|
@ -31,11 +31,11 @@
|
|||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
|
@ -57,17 +57,17 @@
|
|||
#if defined(CONFIG_IMXRT_LPSPI1) || defined(CONFIG_IMXRT_LPSPI2) || \
|
||||
defined(CONFIG_IMXRT_LPSPI3) || defined(CONFIG_IMXRT_LPSPI4)
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: imxrt_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the versiboard2.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void weak_function imxrt_spidev_initialize(void)
|
||||
{
|
||||
|
@ -84,12 +84,13 @@ void weak_function imxrt_spidev_initialize(void)
|
|||
* Name: imxrt_lpspi1/2/3select and imxrt_lpspi1/2/3status
|
||||
*
|
||||
* Description:
|
||||
* The external functions, imxrt_lpspi1/2/3select and imxrt_lpspi1/2/3status
|
||||
* 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 imxrt_lpspibus_initialize()) are provided by common
|
||||
* logic. To use this common SPI logic on your board:
|
||||
* The external functions, imxrt_lpspi1/2/3select and
|
||||
* imxrt_lpspi1/2/3status must be provided by board-specific logic.
|
||||
* They are implementations of the select and status methods of the SPI
|
||||
* interface defined bystruct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||
* All other methods (including imxrt_lpspibus_initialize()) are
|
||||
* provided by common logic.
|
||||
* To use this common SPI logic on your board:
|
||||
*
|
||||
* 1. Provide logic in imxrt_boardinitialize() to configure SPI chip select
|
||||
* pins.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -16,11 +16,11 @@
|
|||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
|
@ -50,9 +50,9 @@
|
|||
|
||||
#if defined(CONFIG_IMXRT_USBOTG) || defined(CONFIG_USBHOST)
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_USBHOST_DEFPRIO
|
||||
# define CONFIG_USBHOST_DEFPRIO 50
|
||||
|
@ -66,25 +66,25 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Retained device driver handle */
|
||||
|
||||
static struct usbhost_connection_s *g_ehciconn;
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: ehci_waiter
|
||||
*
|
||||
* Description:
|
||||
* Wait for USB devices to be connected to the EHCI root hub.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
static int ehci_waiter(int argc, char *argv[])
|
||||
{
|
||||
|
@ -114,11 +114,11 @@ static int ehci_waiter(int argc, char *argv[])
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: imxrt_usbhost_initialize
|
||||
*
|
||||
* Description:
|
||||
|
@ -127,7 +127,7 @@ static int ehci_waiter(int argc, char *argv[])
|
|||
* This function will start a thread that will monitor for device
|
||||
* connection/disconnection events.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
int imxrt_usbhost_initialize(void)
|
||||
{
|
||||
|
@ -217,7 +217,7 @@ int imxrt_usbhost_initialize(void)
|
|||
return OK;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: imxrt_usbhost_vbusdrive
|
||||
*
|
||||
* Description:
|
||||
|
@ -234,7 +234,7 @@ int imxrt_usbhost_initialize(void)
|
|||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#define HCOR ((volatile struct ehci_hcor_s *)IMXRT_USBOTG_HCOR_BASE)
|
||||
|
||||
|
@ -261,7 +261,7 @@ void imxrt_usbhost_vbusdrive(int rhport, bool enable)
|
|||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: imxrt_setup_overcurrent
|
||||
*
|
||||
* Description:
|
||||
|
@ -276,7 +276,7 @@ void imxrt_usbhost_vbusdrive(int rhport, bool enable)
|
|||
* Zero (OK) returned on success; a negated errno value is returned on
|
||||
* failure.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#if 0 /* Not ready yet */
|
||||
int imxrt_setup_overcurrent(xcpt_t handler, void *arg)
|
||||
|
|
|
@ -45,13 +45,13 @@
|
|||
#define GPIO_LED (GPIO_OUTPUT | IOMUX_LED_DEFAULT | \
|
||||
GPIO_OUTPUT_ZERO | GPIO_PORT1 | GPIO_PIN9) /* AD_BO_09 */
|
||||
|
||||
/* Buttons ****************************************************************/
|
||||
/* Buttons ******************************************************************/
|
||||
|
||||
#define GPIO_SW8 (GPIO_INTERRUPT | GPIO_INT_FALLINGEDGE | \
|
||||
IOMUX_SW_DEFAULT | \
|
||||
GPIO_PORT5 | GPIO_PIN0 | ) /* WAKEUP */
|
||||
|
||||
/* Test Pins **************************************************************/
|
||||
/* Test Pins ****************************************************************/
|
||||
|
||||
#define BOARD_NGPIOIN 0 /* Amount of GPIO Input pins */
|
||||
#define BOARD_NGPIOOUT 4 /* Amount of GPIO Output pins */
|
||||
|
@ -115,13 +115,13 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -146,7 +146,7 @@ int imxrt_bringup(void);
|
|||
|
||||
void imxrt_spidev_initialize(void);
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: imxrt_mmcsd_spi_initialize
|
||||
*
|
||||
* Description:
|
||||
|
|
|
@ -60,7 +60,7 @@ void imxrt_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
|
||||
* 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.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* boards/arm/imxrt/imxrt1050-evk/src/imxrt_mmcsd_spi.c
|
||||
*
|
||||
* Copyright (C) 2018 Greg Nutt. All rights reserved.
|
||||
|
@ -32,7 +32,7 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -51,7 +51,7 @@
|
|||
|
||||
#ifdef CONFIG_MMCSD_SPI
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -63,14 +63,15 @@
|
|||
# error "SD driver requires CONFIG_DISABLE_MOUNTPOINT to be disabled"
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Definitions
|
||||
****************************************************************************/
|
||||
|
||||
static const int SD_SPI_PORT = CONFIG_NSH_MMCSDSPIPORTNO; /* SD is connected to SPI1 port */
|
||||
|
||||
static const int SD_SLOT_NO = 0; /* There is only one SD slot */
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -78,11 +79,11 @@ static const int SD_SLOT_NO = 0; /* There is only one SD slot */
|
|||
* Then we don't need to Card Detect callback here.
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: imxrt_spi1register
|
||||
*
|
||||
* Description:
|
||||
|
@ -98,7 +99,7 @@ int imxrt_lpspi1register(struct spi_dev_s *dev, spi_mediachange_t callback,
|
|||
}
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: imxrt_mmcsd_spi_initialize
|
||||
*
|
||||
* Description:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* boards/arm/imxrt/imxrt1050-evk/src/imxrt_sdram_ini_dcd.c
|
||||
*
|
||||
* Copyright (C) 2017, NXP Semiconductors, Inc.
|
||||
|
@ -31,6 +31,10 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include "imxrt_flexspi_nor_boot.h"
|
||||
|
||||
__attribute__((section(".boot_hdr.dcd_data")))
|
||||
|
@ -42,6 +46,7 @@ __attribute__((section(".boot_hdr.dcd_data")))
|
|||
const uint8_t g_dcd_data[] =
|
||||
{
|
||||
/* 0000 */ DCD_TAG_HEADER,
|
||||
|
||||
0x04,
|
||||
0x30,
|
||||
0x41,
|
||||
|
@ -57,7 +62,9 @@ const uint8_t g_dcd_data[] =
|
|||
0xff,
|
||||
0xff,
|
||||
0xff,
|
||||
|
||||
/* 0010 */ 0x40,
|
||||
|
||||
0x0f,
|
||||
0xc0,
|
||||
0x6c,
|
||||
|
@ -73,7 +80,9 @@ const uint8_t g_dcd_data[] =
|
|||
0xff,
|
||||
0xff,
|
||||
0xff,
|
||||
|
||||
/* 0020 */ 0x40,
|
||||
|
||||
0x0f,
|
||||
0xc0,
|
||||
0x74,
|
||||
|
@ -89,7 +98,9 @@ const uint8_t g_dcd_data[] =
|
|||
0xff,
|
||||
0xff,
|
||||
0xff,
|
||||
|
||||
/* 0030 */ 0x40,
|
||||
|
||||
0x0f,
|
||||
0xc0,
|
||||
0x7c,
|
||||
|
@ -105,7 +116,9 @@ const uint8_t g_dcd_data[] =
|
|||
0xff,
|
||||
0xff,
|
||||
0xff,
|
||||
|
||||
/* 0040 */ 0x40,
|
||||
|
||||
0x0d,
|
||||
0x80,
|
||||
0x30,
|
||||
|
@ -121,7 +134,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x1d,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 0050 */ 0x40,
|
||||
|
||||
0x0f,
|
||||
0xc0,
|
||||
0x14,
|
||||
|
@ -137,7 +152,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 0060 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x18,
|
||||
|
@ -153,7 +170,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 0070 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x20,
|
||||
|
@ -169,7 +188,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 0080 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x28,
|
||||
|
@ -185,7 +206,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 0090 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x30,
|
||||
|
@ -201,7 +224,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 00a0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x38,
|
||||
|
@ -217,7 +242,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 00b0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x40,
|
||||
|
@ -233,7 +260,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 00c0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x48,
|
||||
|
@ -249,7 +278,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 00d0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x50,
|
||||
|
@ -265,7 +296,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 00e0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x58,
|
||||
|
@ -281,7 +314,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 00f0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x60,
|
||||
|
@ -297,7 +332,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 0100 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x68,
|
||||
|
@ -313,7 +350,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 0110 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x70,
|
||||
|
@ -329,7 +368,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 0120 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x78,
|
||||
|
@ -345,7 +386,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 0130 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x80,
|
||||
|
@ -361,7 +404,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 0140 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x88,
|
||||
|
@ -377,7 +422,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 0150 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x90,
|
||||
|
@ -393,7 +440,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 0160 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0x98,
|
||||
|
@ -409,7 +458,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 0170 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0xa0,
|
||||
|
@ -425,7 +476,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 0180 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0xa8,
|
||||
|
@ -441,7 +494,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 0190 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0xb0,
|
||||
|
@ -457,7 +512,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 01a0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x80,
|
||||
0xb8,
|
||||
|
@ -473,7 +530,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 01b0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x08,
|
||||
|
@ -489,7 +548,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 01c0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x10,
|
||||
|
@ -505,7 +566,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 01d0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x18,
|
||||
|
@ -521,7 +584,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 01e0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x20,
|
||||
|
@ -537,7 +602,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 01f0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x28,
|
||||
|
@ -553,7 +620,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 0200 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x30,
|
||||
|
@ -569,7 +638,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 0210 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x38,
|
||||
|
@ -585,7 +656,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 0220 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x40,
|
||||
|
@ -601,7 +674,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 0230 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x48,
|
||||
|
@ -617,7 +692,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 0240 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x50,
|
||||
|
@ -633,7 +710,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 0250 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x58,
|
||||
|
@ -649,7 +728,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 0260 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x60,
|
||||
|
@ -665,7 +746,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 0270 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x68,
|
||||
|
@ -681,7 +764,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 0280 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x70,
|
||||
|
@ -697,7 +782,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 0290 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x78,
|
||||
|
@ -713,7 +800,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 02a0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x80,
|
||||
|
@ -729,7 +818,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 02b0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x88,
|
||||
|
@ -745,7 +836,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 02c0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x90,
|
||||
|
@ -761,7 +854,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 02d0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0x98,
|
||||
|
@ -777,7 +872,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 02e0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0xa0,
|
||||
|
@ -793,7 +890,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x01,
|
||||
0x10,
|
||||
0xf9,
|
||||
|
||||
/* 02f0 */ 0x40,
|
||||
|
||||
0x1f,
|
||||
0x82,
|
||||
0xa8,
|
||||
|
@ -809,7 +908,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x04,
|
||||
|
||||
/* 0300 */ 0x40,
|
||||
|
||||
0x2f,
|
||||
0x00,
|
||||
0x08,
|
||||
|
@ -825,7 +926,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x03,
|
||||
0x05,
|
||||
0x24,
|
||||
|
||||
/* 0310 */ 0x40,
|
||||
|
||||
0x2f,
|
||||
0x00,
|
||||
0x10,
|
||||
|
@ -841,7 +944,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x1b,
|
||||
|
||||
/* 0320 */ 0x40,
|
||||
|
||||
0x2f,
|
||||
0x00,
|
||||
0x18,
|
||||
|
@ -857,7 +962,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x1b,
|
||||
|
||||
/* 0330 */ 0x40,
|
||||
|
||||
0x2f,
|
||||
0x00,
|
||||
0x20,
|
||||
|
@ -873,7 +980,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x19,
|
||||
|
||||
/* 0340 */ 0x40,
|
||||
|
||||
0x2f,
|
||||
0x00,
|
||||
0x28,
|
||||
|
@ -889,7 +998,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x1b,
|
||||
|
||||
/* 0350 */ 0x40,
|
||||
|
||||
0x2f,
|
||||
0x00,
|
||||
0x30,
|
||||
|
@ -905,7 +1016,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x79,
|
||||
0xa8,
|
||||
|
||||
/* 0360 */ 0x40,
|
||||
|
||||
0x2f,
|
||||
0x00,
|
||||
0x40,
|
||||
|
@ -921,7 +1034,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x65,
|
||||
0x29,
|
||||
0x22,
|
||||
|
||||
/* 0370 */ 0x40,
|
||||
|
||||
0x2f,
|
||||
0x00,
|
||||
0x48,
|
||||
|
@ -937,7 +1052,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x21,
|
||||
0x0a,
|
||||
0x08,
|
||||
|
||||
/* 0380 */ 0x40,
|
||||
|
||||
0x2f,
|
||||
0x00,
|
||||
0x80,
|
||||
|
@ -953,7 +1070,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x88,
|
||||
0x88,
|
||||
0x88,
|
||||
|
||||
/* 0390 */ 0x40,
|
||||
|
||||
0x2f,
|
||||
0x00,
|
||||
0x94,
|
||||
|
@ -969,7 +1088,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 03a0 */ 0x40,
|
||||
|
||||
0x2f,
|
||||
0x00,
|
||||
0x90,
|
||||
|
@ -985,7 +1106,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x5a,
|
||||
0x00,
|
||||
0x0f,
|
||||
|
||||
/* 03b0 */ 0xcf,
|
||||
|
||||
0x00,
|
||||
0x0c,
|
||||
0x1c,
|
||||
|
@ -1001,7 +1124,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x14,
|
||||
0x04,
|
||||
|
||||
/* 03c0 */ 0x40,
|
||||
|
||||
0x2f,
|
||||
0x00,
|
||||
0x90,
|
||||
|
@ -1017,7 +1142,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x5a,
|
||||
0x00,
|
||||
0x0c,
|
||||
|
||||
/* 03d0 */ 0xcf,
|
||||
|
||||
0x00,
|
||||
0x0c,
|
||||
0x1c,
|
||||
|
@ -1033,7 +1160,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x14,
|
||||
0x04,
|
||||
|
||||
/* 03e0 */ 0x40,
|
||||
|
||||
0x2f,
|
||||
0x00,
|
||||
0x90,
|
||||
|
@ -1049,7 +1178,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x5a,
|
||||
0x00,
|
||||
0x0c,
|
||||
|
||||
/* 03f0 */ 0xcf,
|
||||
|
||||
0x00,
|
||||
0x0c,
|
||||
0x1c,
|
||||
|
@ -1065,7 +1196,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x1c,
|
||||
0x04,
|
||||
|
||||
/* 0400 */ 0x40,
|
||||
|
||||
0x2f,
|
||||
0x00,
|
||||
0xa0,
|
||||
|
@ -1081,7 +1214,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
/* 0410 */ 0x40,
|
||||
|
||||
0x2f,
|
||||
0x00,
|
||||
0x9c,
|
||||
|
@ -1097,7 +1232,9 @@ const uint8_t g_dcd_data[] =
|
|||
0x2f,
|
||||
0x00,
|
||||
0x3c,
|
||||
|
||||
/* 0420 */ 0x00,
|
||||
|
||||
0x00,
|
||||
0x00,
|
||||
0x01,
|
||||
|
@ -1114,3 +1251,7 @@ const uint8_t g_dcd_data[] =
|
|||
0x0a,
|
||||
0x09,
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
|
|
@ -208,7 +208,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* boards/arm/imxrt/imxrt1060-evk/src/imxrt_mmcsd_spi.c
|
||||
*
|
||||
* Copyright (C) 2018 Greg Nutt. All rights reserved.
|
||||
|
@ -32,7 +32,7 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -51,7 +51,7 @@
|
|||
|
||||
#ifdef CONFIG_MMCSD_SPI
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -63,14 +63,15 @@
|
|||
# error "SD driver requires CONFIG_DISABLE_MOUNTPOINT to be disabled"
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Definitions
|
||||
****************************************************************************/
|
||||
|
||||
static const int SD_SPI_PORT = CONFIG_NSH_MMCSDSPIPORTNO; /* SD is connected to SPI1 port */
|
||||
|
||||
static const int SD_SLOT_NO = 0; /* There is only one SD slot */
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -78,11 +79,11 @@ static const int SD_SLOT_NO = 0; /* There is only one SD slot */
|
|||
* Then we don't need to Card Detect callback here.
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: imxrt_spi1register
|
||||
*
|
||||
* Description:
|
||||
|
@ -98,7 +99,7 @@ int imxrt_lpspi1register(struct spi_dev_s *dev, spi_mediachange_t callback,
|
|||
}
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: imxrt_mmcsd_spi_initialize
|
||||
*
|
||||
* Description:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* boards/arm/imxrt/imxrt1060-evk/src/imxrt_usbhost.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -16,11 +16,11 @@
|
|||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
|
@ -50,9 +50,9 @@
|
|||
|
||||
#if defined(CONFIG_IMXRT_USBOTG) || defined(CONFIG_USBHOST)
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_USBHOST_DEFPRIO
|
||||
# define CONFIG_USBHOST_DEFPRIO 50
|
||||
|
@ -66,25 +66,25 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Retained device driver handle */
|
||||
|
||||
static struct usbhost_connection_s *g_ehciconn;
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: ehci_waiter
|
||||
*
|
||||
* Description:
|
||||
* Wait for USB devices to be connected to the EHCI root hub.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
static int ehci_waiter(int argc, char *argv[])
|
||||
{
|
||||
|
@ -114,11 +114,11 @@ static int ehci_waiter(int argc, char *argv[])
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: imxrt_usbhost_initialize
|
||||
*
|
||||
* Description:
|
||||
|
@ -127,7 +127,7 @@ static int ehci_waiter(int argc, char *argv[])
|
|||
* This function will start a thread that will monitor for device
|
||||
* connection/disconnection events.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
int imxrt_usbhost_initialize(void)
|
||||
{
|
||||
|
@ -215,7 +215,7 @@ int imxrt_usbhost_initialize(void)
|
|||
return OK;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: imxrt_usbhost_vbusdrive
|
||||
*
|
||||
* Description:
|
||||
|
@ -232,7 +232,7 @@ int imxrt_usbhost_initialize(void)
|
|||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#define HCOR ((volatile struct ehci_hcor_s *)IMXRT_USBOTG_HCOR_BASE)
|
||||
|
||||
|
@ -259,7 +259,7 @@ void imxrt_usbhost_vbusdrive(int rhport, bool enable)
|
|||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: imxrt_setup_overcurrent
|
||||
*
|
||||
* Description:
|
||||
|
@ -274,7 +274,7 @@ void imxrt_usbhost_vbusdrive(int rhport, bool enable)
|
|||
* Zero (OK) returned on success; a negated errno value is returned on
|
||||
* failure.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#if 0 /* Not ready yet */
|
||||
int imxrt_setup_overcurrent(xcpt_t handler, void *arg)
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
# ifndef __ASSEMBLY__
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* boards/arm/kinetis/freedom-k28f/include/board.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -16,14 +16,14 @@
|
|||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __BOARDS_ARM_KINETIS_FREEDOM_K28F_INCLUDE_BOARD_H
|
||||
#define __BOARDS_ARM_KINETIS_FREEDOM_K28F_INCLUDE_BOARD_H
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
|
@ -34,11 +34,11 @@
|
|||
# include <arch/chip/kinetis_mcg.h>
|
||||
#endif
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Clocking *********************************************************************/
|
||||
/* Clocking *****************************************************************/
|
||||
|
||||
/* The Freedom K28F uses a 12MHz external Oscillator.
|
||||
* The Kinetis MCU startup from an internal digitally-controlled oscillator
|
||||
|
@ -114,7 +114,8 @@
|
|||
BOARD_SIM_CLKDIV2_USBFRAC)
|
||||
#endif
|
||||
|
||||
/* Divider output clock = Divider input clock * ((PLLFLLFRAC+1)/(PLLFLLDIV+1))
|
||||
/* Divider output
|
||||
* clock = Divider input clock * ((PLLFLLFRAC+1)/(PLLFLLDIV+1))
|
||||
* SIM_CLKDIV3_FREQ = BOARD_SOPT2_FREQ * ((PLLFLLFRAC+1) / (PLLFLLDIV+1))
|
||||
* SIM_CLKDIV3_FREQ = BOARD_SOPT2_FREQ / (PLLFLLDIV+1) * (PLLFLLFRAC+1)
|
||||
* 72MHz = 144MHz / (1 + 1) * (1 + 0)
|
||||
|
@ -132,7 +133,7 @@
|
|||
#define BOARD_TPM_CLKSRC SIM_SOPT2_TPMSRC_MCGCLK
|
||||
#define BOARD_TPM_FREQ BOARD_SIM_CLKDIV3_FREQ
|
||||
|
||||
/* SDHC clocking ****************************************************************/
|
||||
/* SDHC clocking ************************************************************/
|
||||
|
||||
/* SDCLK configurations corresponding to various modes of operation.
|
||||
* Formula is:
|
||||
|
@ -214,7 +215,7 @@
|
|||
#define GPIO_FTM2_CH0OUT PIN_FTM2_CH0 /* Pin 25: PTB18 */
|
||||
#define GPIO_FTM2_CH1OUT PIN_FTM2_CH1 /* Pin 32: PTB19 */
|
||||
|
||||
/* LED definitions **************************************************************/
|
||||
/* LED definitions **********************************************************/
|
||||
|
||||
/* A single LED is available driven by PTC5. The LED is grounded so bringing
|
||||
* PTC5 high will illuminate the LED.
|
||||
|
@ -246,11 +247,11 @@
|
|||
#define LED_ASSERTION 3 /* STATUS LED=no change */
|
||||
#define LED_PANIC 3 /* STATUS LED=flashing */
|
||||
|
||||
/* Button definitions ***********************************************************/
|
||||
/* Button definitions *******************************************************/
|
||||
|
||||
/* The freedom-k28f board has no standard GPIO contact buttons */
|
||||
|
||||
/* Alternative pin resolution ***************************************************/
|
||||
/* Alternative pin resolution ***********************************************/
|
||||
|
||||
/* The Freedom K28F has five LPUARTs with pin availability as follows:
|
||||
*
|
||||
|
@ -411,7 +412,7 @@
|
|||
# define PIN_SDHC0_DCLK PIN_SDHC0_DCLK_1
|
||||
#endif
|
||||
|
||||
/* LED definitions **************************************************************/
|
||||
/* LED definitions **********************************************************/
|
||||
|
||||
/* The Freedom K28F has a single RGB LED driven by the K28F as follows:
|
||||
*
|
||||
|
@ -457,7 +458,7 @@
|
|||
#define LED_PANIC 4 /* The system has crashed FLASH OFF OFF */
|
||||
#undef LED_IDLE /* K28 is in sleep mode (Not used) */
|
||||
|
||||
/* Button definitions ***********************************************************/
|
||||
/* Button definitions *******************************************************/
|
||||
|
||||
/* Two push buttons, SW2 and SW3, are available on FRDM-K28F board,
|
||||
* where SW2 is connected to PTA4 and SW3 is connected to PTD0.
|
||||
|
|
|
@ -197,7 +197,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
|
|
@ -72,7 +72,7 @@ void kinetis_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
|
||||
* function called board_late_initialize(). board_late_initialize() will be
|
||||
* called immediately after up_initialize() is called and just before the
|
||||
* initial application is started. This additional initialization phase
|
||||
* may be used, for example, to initialize board-specific device drivers.
|
||||
|
|
|
@ -45,10 +45,10 @@
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_KINETIS_I2C0
|
||||
FAR struct i2c_master_s* g_i2c0_dev;
|
||||
FAR struct i2c_master_s *g_i2c0_dev;
|
||||
#endif
|
||||
#ifdef CONFIG_KINETIS_I2C1
|
||||
FAR struct i2c_master_s* g_i2c1_dev;
|
||||
FAR struct i2c_master_s *g_i2c1_dev;
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -48,7 +48,8 @@
|
|||
* Name: k28_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the KwikStik-K40 board.
|
||||
* Called to configure SPI chip select GPIO pins for the KwikStik-K40
|
||||
* board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -61,8 +62,8 @@ void weak_function k28_spidev_initialize(void)
|
|||
* Name: kinetis_spi0/1/2select and kinetis_spi0/1/2status
|
||||
*
|
||||
* Description:
|
||||
* The external functions, kinetis_spi0/1/2select and kinetis_spi0/1/2status
|
||||
* must be provided by board-specific logic.
|
||||
* The external functions, kinetis_spi0/1/2select and
|
||||
* kinetis_spi0/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 kinetis_spibus_initialize())
|
||||
|
|
|
@ -67,8 +67,8 @@ void k28_usbdev_initialize(void)
|
|||
* Description:
|
||||
* If USB is supported and the board supports a pullup via GPIO (for USB
|
||||
* software connect and disconnect), then the board software must provide
|
||||
* kinetis_pullup. See include/nuttx/usb/usbdev.h for additional description
|
||||
* of this method.
|
||||
* kinetis_pullup. See include/nuttx/usb/usbdev.h for additional
|
||||
* description of this method.
|
||||
* Alternatively, if no pull-up GPIO the following EXTERN can be redefined
|
||||
* to be NULL.
|
||||
*
|
||||
|
@ -108,7 +108,7 @@ int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable)
|
|||
return OK;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kinetis_usbsuspend
|
||||
*
|
||||
* Description:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* boards/arm/kinetis/freedom-k28f/src/k28_usbhshost.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
|
@ -16,11 +16,11 @@
|
|||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
|
@ -57,9 +57,9 @@
|
|||
|
||||
#if defined(CONFIG_KINETIS_USBHS) && defined(CONFIG_USBHOST)
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#define BOARD_USB_PHY_D_CAL (0x0CU)
|
||||
#define BOARD_USB_PHY_TXCAL45DP (0x06U)
|
||||
|
@ -77,9 +77,9 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
static int ehci_waiter(int argc, char *argv[]);
|
||||
static void ehci_hwinit(void);
|
||||
|
@ -90,9 +90,9 @@ static void unmount_retry_timeout(wdparm_t arg);
|
|||
static void usb_msc_disconnect(FAR void *arg);
|
||||
# endif
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Retained device driver handle */
|
||||
|
||||
|
@ -104,17 +104,17 @@ static struct usbhost_connection_s *g_ehciconn;
|
|||
static struct wdog_s g_umount_tmr[CONFIG_FRDMK28F_USB_AUTOMOUNT_NUM_BLKDEV];
|
||||
# endif
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: ehci_waiter
|
||||
*
|
||||
* Description:
|
||||
* Wait for USB devices to be connected to the EHCI root hub.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
static int ehci_waiter(int argc, char *argv[])
|
||||
{
|
||||
|
@ -144,13 +144,13 @@ static int ehci_waiter(int argc, char *argv[])
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: ehci_hw_init
|
||||
*
|
||||
* Description:
|
||||
* Initialize PHY and clocks for EHCI
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
static void ehci_hwinit(void)
|
||||
{
|
||||
|
@ -241,13 +241,13 @@ static void ehci_hwinit(void)
|
|||
}
|
||||
|
||||
# ifdef HAVE_USB_AUTOMOUNTER
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: usb_msc_connect
|
||||
*
|
||||
* Description:
|
||||
* Mount the USB mass storage device
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
static void usb_msc_connect(FAR void *arg)
|
||||
{
|
||||
|
@ -258,7 +258,8 @@ static void usb_msc_connect(FAR void *arg)
|
|||
char blkdev[32];
|
||||
char mntpnt[32];
|
||||
|
||||
DEBUGASSERT(index >= 0 && index < CONFIG_FRDMK28F_USB_AUTOMOUNT_NUM_BLKDEV);
|
||||
DEBUGASSERT(index >= 0 &&
|
||||
index < CONFIG_FRDMK28F_USB_AUTOMOUNT_NUM_BLKDEV);
|
||||
|
||||
wd_cancel(&g_umount_tmr[index]);
|
||||
|
||||
|
@ -282,7 +283,7 @@ static void usb_msc_connect(FAR void *arg)
|
|||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: unmount_retry_timeout
|
||||
*
|
||||
* Description:
|
||||
|
@ -300,7 +301,7 @@ static void usb_msc_connect(FAR void *arg)
|
|||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
static void unmount_retry_timeout(wdparm_t arg)
|
||||
{
|
||||
|
@ -316,13 +317,13 @@ static void unmount_retry_timeout(wdparm_t arg)
|
|||
usbhost_msc_notifier_signal(WORK_USB_MSC_DISCONNECT, sdchar);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: usb_msc_disconnect
|
||||
*
|
||||
* Description:
|
||||
* Unmount the USB mass storage device
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
static void usb_msc_disconnect(FAR void *arg)
|
||||
{
|
||||
|
@ -332,7 +333,8 @@ static void usb_msc_disconnect(FAR void *arg)
|
|||
|
||||
char mntpnt[32];
|
||||
|
||||
DEBUGASSERT(index >= 0 && index < CONFIG_FRDMK28F_USB_AUTOMOUNT_NUM_BLKDEV);
|
||||
DEBUGASSERT(index >= 0 &&
|
||||
index < CONFIG_FRDMK28F_USB_AUTOMOUNT_NUM_BLKDEV);
|
||||
|
||||
wd_cancel(&g_umount_tmr[index]);
|
||||
|
||||
|
@ -379,11 +381,11 @@ static void usb_msc_disconnect(FAR void *arg)
|
|||
}
|
||||
# endif /* HAVE_USB_AUTOMOUNTER */
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: k28_usbhost_initialize
|
||||
*
|
||||
* Description:
|
||||
|
@ -392,7 +394,7 @@ static void usb_msc_disconnect(FAR void *arg)
|
|||
* This function will start a thread that will monitor for device
|
||||
* connection/disconnection events.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
int k28_usbhost_initialize(void)
|
||||
{
|
||||
|
@ -489,7 +491,7 @@ int k28_usbhost_initialize(void)
|
|||
return OK;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kinetis_usbhost_vbusdrive
|
||||
*
|
||||
* Description:
|
||||
|
@ -506,7 +508,7 @@ int k28_usbhost_initialize(void)
|
|||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#define HCOR ((volatile struct ehci_hcor_s *)KINETIS_USBHS_HCOR_BASE)
|
||||
|
||||
|
@ -533,7 +535,7 @@ void kinetis_usbhost_vbusdrive(int rhport, bool enable)
|
|||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: kinetis_setup_overcurrent
|
||||
*
|
||||
* Description:
|
||||
|
@ -548,7 +550,7 @@ void kinetis_usbhost_vbusdrive(int rhport, bool enable)
|
|||
* Zero (OK) returned on success; a negated errno value is returned on
|
||||
* failure.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#if 0 /* Not ready yet */
|
||||
int kinetis_setup_overcurrent(xcpt_t handler, void *arg)
|
||||
|
|
|
@ -223,7 +223,7 @@
|
|||
#define GPIO_LED_B (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTB | PIN21)
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* The Freedom K64F has a single RGB LED driven by the K64F as follows:
|
||||
*
|
||||
* LED K64
|
||||
|
|
|
@ -259,7 +259,8 @@ void k64_automount_initialize(void)
|
|||
* Name: k64_automount_event
|
||||
*
|
||||
* Description:
|
||||
* The SDHC card detection logic has detected an insertion or removal event.
|
||||
* The SDHC card detection logic has detected an insertion or removal
|
||||
* event.
|
||||
* It has already scheduled the MMC/SD block driver operations.
|
||||
* Now we need to schedule the auto-mount event which will occur with a
|
||||
* substantial delay to make sure that everything has settle down.
|
||||
|
|
|
@ -109,7 +109,9 @@ static void k64_mediachange(void)
|
|||
{
|
||||
mcinfo("Media change: %d->%d\n", g_sdhc.inserted, inserted);
|
||||
|
||||
/* Yes.. perform the appropriate action (this might need some debounce). */
|
||||
/* Yes..
|
||||
* perform the appropriate action (this might need some debounce).
|
||||
*/
|
||||
|
||||
g_sdhc.inserted = inserted;
|
||||
sdhc_mediachange(g_sdhc.sdhc, inserted);
|
||||
|
@ -180,7 +182,8 @@ int k64_sdhc_initialize(void)
|
|||
ret = mmcsd_slotinitialize(MMSCD_MINOR, g_sdhc.sdhc);
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n",
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,8 @@
|
|||
* Name: k64_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the FREEDOM-K64F board.
|
||||
* Called to configure SPI chip select GPIO pins for the FREEDOM-K64F
|
||||
* board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -81,8 +82,8 @@ void weak_function k64_spidev_initialize(void)
|
|||
* the way your board is configured.
|
||||
* 3. Add a call to kinetis_spibus_initialize() in your low level
|
||||
* application initialization logic
|
||||
* 4. The handle returned by kinetis_spibus_initialize() may then be used to
|
||||
* bind the SPI driver to higher level logic (e.g., calling
|
||||
* 4. The handle returned by kinetis_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).
|
||||
*
|
||||
|
|
|
@ -210,9 +210,9 @@
|
|||
* low-power wake up signal. Also, only SW3 can be a non-maskable interrupt.
|
||||
*
|
||||
* Switch GPIO Function
|
||||
* --------- ---------------------------------------------------------------
|
||||
* SW2 PTD11/LLWU_P25/SPI2_PCS0/SDHC0_CLKIN/LPUART0_CTS/FB_A19
|
||||
* SW3 PTA10/LLWU_P22/FTM2_CH0/MII0_RXD2/FTM2_QD_PHA/TPM2_CH0/TRACE_D0
|
||||
* -------- ---------------------------------------------------------------
|
||||
* SW2 PTD11/LLWU_P25/SPI2_PCS0/SDHC0_CLKIN/LPUART0_CTS/FB_A19
|
||||
* SW3 PTA10/LLWU_P22/FTM2_CH0/MII0_RXD2/FTM2_QD_PHA/TPM2_CH0/TRACE_D0
|
||||
*/
|
||||
|
||||
#define GPIO_SW2 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTD | PIN11)
|
||||
|
@ -240,13 +240,13 @@
|
|||
#define PIN_SPI1_PCS0 (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTD | PIN4)
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -359,7 +359,8 @@ void k66_automount_initialize(void);
|
|||
* Name: k66_automount_event
|
||||
*
|
||||
* Description:
|
||||
* The SDHC card detection logic has detected an insertion or removal event.
|
||||
* The SDHC card detection logic has detected an insertion or removal
|
||||
* event.
|
||||
* It has already scheduled the MMC/SD block driver operations.
|
||||
* Now we need to schedule the auto-mount event which will occur with a
|
||||
* substantial delay to make sure that everything has settle down.
|
||||
|
|
|
@ -182,7 +182,8 @@ static int k66_attach(FAR const struct automount_lower_s *lower,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void k66_enable(FAR const struct automount_lower_s *lower, bool enable)
|
||||
static void k66_enable(FAR const struct automount_lower_s *lower,
|
||||
bool enable)
|
||||
{
|
||||
FAR const struct k66_automount_config_s *config;
|
||||
FAR struct k66_automount_state_s *state;
|
||||
|
@ -270,11 +271,12 @@ void k66_automount_initialize(void)
|
|||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: k66_automount_event
|
||||
*
|
||||
* Description:
|
||||
* The SDHC card detection logic has detected an insertion or removal event.
|
||||
* The SDHC card detection logic has detected an insertion or removal
|
||||
* event.
|
||||
* It has already scheduled the MMC/SD block driver operations.
|
||||
* Now we need to schedule the auto-mount event which will occur with a
|
||||
* substantial delay to make sure that everything has settle down.
|
||||
|
@ -292,7 +294,7 @@ void k66_automount_initialize(void)
|
|||
* Assumptions:
|
||||
* Interrupts are disabled.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void k66_automount_event(bool inserted)
|
||||
{
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#ifdef CONFIG_BOARDCTL_RESET
|
||||
|
||||
/****************************************************************************
|
||||
* Public functions
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -52,13 +52,13 @@
|
|||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: k66_rtc_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to initialize the RTC FREEDOM-K66F board.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
int k66_rtc_initialize(void)
|
||||
{
|
||||
|
@ -88,5 +88,6 @@ int k66_rtc_initialize(void)
|
|||
ret);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -103,8 +103,11 @@
|
|||
# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
|
||||
# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(2)
|
||||
#else
|
||||
//# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
|
||||
//# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(3)
|
||||
|
||||
/* # define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 */
|
||||
|
||||
/* # define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(3) */
|
||||
|
||||
# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV16
|
||||
# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(15)
|
||||
#endif
|
||||
|
@ -138,9 +141,9 @@
|
|||
|
||||
/* On-Board Connections
|
||||
*
|
||||
* ------------------- -------------------------- -------- -------------------
|
||||
* ------------------- -------------------------- -------- ------------------
|
||||
* FEATURE CONNECTION PORT/PIN PIN FUNCTION
|
||||
* ------------------- -------------------------- -------- -------------------
|
||||
* ------------------- -------------------------- -------- ------------------
|
||||
* Audio Jack Output Audio Amp On PTE28 PTE28
|
||||
* Audio Output DAC1_OUT DAC1_OUT
|
||||
* Volume Up PTD10 PTD10
|
||||
|
@ -168,9 +171,9 @@
|
|||
#define PIN_FTM1_CH0 PIN_FTM1_CH0_1
|
||||
|
||||
/* Connections via the General Purpose Tower Plug-in (TWRPI) Socket
|
||||
* ------------------- -------------------------- -------- -------------------
|
||||
* ------------------- -------------------------- -------- ------------------
|
||||
* FEATURE CONNECTION PORT/PIN PIN FUNCTION
|
||||
* ------------------- -------------------------- -------- -------------------
|
||||
* ------------------- -------------------------- -------- ------------------
|
||||
* General Purpose TWRPI AN0 (J8 Pin 8) ? ADC0_DP0/ADC1_DP3
|
||||
* TWRPI Socket TWRPI AN1 (J8 Pin 9) ? ADC0_DM0/ADC1_DM3
|
||||
* TWRPI AN2 (J8 Pin 12) ? ADC1_DP0/ADC0_DP3
|
||||
|
|
|
@ -140,7 +140,9 @@ static void kinetis_mediachange(void)
|
|||
|
||||
if (inserted != g_nsh.inserted)
|
||||
{
|
||||
/* Yes.. perform the appropriate action (this might need some debounce). */
|
||||
/* Yes..
|
||||
* perform the appropriate action (this might need some debounce).
|
||||
*/
|
||||
|
||||
g_nsh.inserted = inserted;
|
||||
sdhc_mediachange(g_nsh.sdhc, inserted);
|
||||
|
@ -229,7 +231,8 @@ int board_app_initialize(uintptr_t arg)
|
|||
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_nsh.sdhc);
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n",
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,8 @@
|
|||
* Name: kinetis_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the KwikStik-K40 board.
|
||||
* Called to configure SPI chip select GPIO pins for the KwikStik-K40
|
||||
* board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
|
|
@ -68,7 +68,8 @@ void kinetis_usbinitialize(void)
|
|||
* If USB is supported and the board supports a pullup via GPIO (for USB
|
||||
* software connect and disconnect), then the board software must provide
|
||||
* kinetis_pullup.
|
||||
* See include/nuttx/usb/usbdev.h for additional description of this method.
|
||||
* See include/nuttx/usb/usbdev.h for additional description of this
|
||||
* method.
|
||||
* Alternatively, if no pull-up GPIO the following EXTERN can be redefined
|
||||
* to be NULL.
|
||||
*
|
||||
|
|
|
@ -50,9 +50,9 @@
|
|||
|
||||
/* On-Board Connections
|
||||
*
|
||||
* ------------------- -------------------------- -------- -------------------
|
||||
* ------------------- -------------------------- -------- ------------------
|
||||
* FEATURE CONNECTION PORT/PIN PIN FUNCTION
|
||||
* ------------------- -------------------------- -------- -------------------
|
||||
* ------------------- -------------------------- -------- ------------------
|
||||
* Audio Jack Output Audio Amp On PTE28 PTE28
|
||||
* Audio Output DAC1_OUT DAC1_OUT
|
||||
* Volume Up PTD10 PTD10
|
||||
|
@ -81,9 +81,9 @@
|
|||
#define GPIO_SD_CARDON (GPIO_HIGHDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTE | PIN6)
|
||||
|
||||
/* Connections via the General Purpose Tower Plug-in (TWRPI) Socket
|
||||
* ------------------- -------------------------- -------- -------------------
|
||||
* ------------------- -------------------------- -------- ------------------
|
||||
* FEATURE CONNECTION PORT/PIN PIN FUNCTION
|
||||
* ------------------- -------------------------- -------- -------------------
|
||||
* ------------------- -------------------------- -------- ------------------
|
||||
* General Purpose TWRPI AN0 (J8 Pin 8) ? ADC0_DP0/ADC1_DP3
|
||||
* TWRPI Socket TWRPI AN1 (J8 Pin 9) ? ADC0_DM0/ADC1_DM3
|
||||
* TWRPI AN2 (J8 Pin 12) ? ADC1_DP0/ADC0_DP3
|
||||
|
@ -135,20 +135,21 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: kinetis_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the KwikStik-K40 board.
|
||||
* Called to configure SPI chip select GPIO pins for the KwikStik-K40
|
||||
* board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
|
|
@ -137,8 +137,10 @@
|
|||
#define BOARD_SOPT2_PLLFLLSEL SIM_SOPT2_PLLFLLSEL_MCGPLLCLK
|
||||
#define BOARD_SOPT2_FREQ BOARD_MCG_FREQ
|
||||
|
||||
/* Divider output clock = Divider input clock × [ (USBFRAC+1) / (USBDIV+1) ]
|
||||
* SIM_CLKDIV2_FREQ = BOARD_SOPT2_FREQ × [ (USBFRAC+1) / (USBDIV+1) ]
|
||||
/* Divider output clock = Divider input clock ×
|
||||
* [ (USBFRAC+1) / (USBDIV+1) ]
|
||||
* SIM_CLKDIV2_FREQ = BOARD_SOPT2_FREQ ×
|
||||
* [ (USBFRAC+1) / (USBDIV+1) ]
|
||||
*/
|
||||
|
||||
#if BOARD_SOPT2_FREQ == 96000000
|
||||
|
|
|
@ -47,7 +47,8 @@
|
|||
* Name: kinetis_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the KwikStik-K40 board.
|
||||
* Called to configure SPI chip select GPIO pins for the KwikStik-K40
|
||||
* board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -60,12 +61,12 @@ void weak_function kinetis_spidev_initialize(void)
|
|||
* Name: kinetis_spi0/1/2select and kinetis_spi0/1/2status
|
||||
*
|
||||
* Description:
|
||||
* The external functions, kinetis_spi0/1/2select and kinetis_spi0/1/2status
|
||||
* must be provided by board-specific logic.
|
||||
* The external functions, kinetis_spi0/1/2select and
|
||||
* kinetis_spi0/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 kinetis_spibus_initialize()) are provided by
|
||||
* common Kinetis logic.
|
||||
* All other methods (including kinetis_spibus_initialize()) are provided
|
||||
* by common Kinetis logic.
|
||||
* To use this common SPI logic on your board:
|
||||
*
|
||||
* 1. Provide logic in kinetis_boardinitialize() to configure SPI chip
|
||||
|
@ -76,8 +77,8 @@ void weak_function kinetis_spidev_initialize(void)
|
|||
* using GPIOs in the way your board is configured.
|
||||
* 3. Add a calls to kinetis_spibus_initialize() in your low level
|
||||
* application initialization logic
|
||||
* 4. The handle returned by kinetis_spibus_initialize() may then be used to
|
||||
* bind the SPI driver to higher level logic (e.g., calling
|
||||
* 4. The handle returned by kinetis_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).
|
||||
*
|
||||
|
|
|
@ -68,7 +68,8 @@ void kinetis_usbinitialize(void)
|
|||
* If USB is supported and the board supports a pullup via GPIO (for USB
|
||||
* software connect and disconnect), then the board software must provide
|
||||
* kinetis_pullup.
|
||||
* See include/nuttx/usb/usbdev.h for additional description of this method.
|
||||
* See include/nuttx/usb/usbdev.h for additional description of this
|
||||
* method.
|
||||
* Alternatively, if no pull-up GPIO the following EXTERN can be redefined
|
||||
* to be NULL.
|
||||
*
|
||||
|
|
|
@ -75,22 +75,23 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct i2c_master_s* i2c_dev;
|
||||
FAR struct i2c_master_s *i2c_dev;
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: kinetis_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the KwikStik-K40 board.
|
||||
* Called to configure SPI chip select GPIO pins for the KwikStik-K40
|
||||
* board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
|
|
@ -105,8 +105,11 @@
|
|||
# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
|
||||
# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(2)
|
||||
#else
|
||||
//# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
|
||||
//# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(3)
|
||||
|
||||
/* # define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 */
|
||||
|
||||
/* # define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(3) */
|
||||
|
||||
# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV16
|
||||
# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(15)
|
||||
#endif
|
||||
|
@ -156,9 +159,9 @@
|
|||
*/
|
||||
|
||||
/* On-Board Connections
|
||||
* -------------------- ------------------------- -------- -------------------
|
||||
* -------------------- ------------------------- -------- ------------------
|
||||
* FEATURE CONNECTION PORT/PIN PIN FUNCTION
|
||||
* -------------------- ------------------------- -------- -------------------
|
||||
* -------------------- ------------------------- -------- ------------------
|
||||
* OSJTAG USB-to-serial OSJTAG Bridge RX Data PTE9 UART5_RX
|
||||
* Bridge OSJTAG Bridge TX Data PTE8 UART5_TX
|
||||
* SD Card Slot SD Clock PTE2 SDHC0_DCLK
|
||||
|
@ -208,9 +211,9 @@
|
|||
#define PIN_I2C0_SCL PIN_I2C0_SCL_3
|
||||
|
||||
/* Connections via the General Purpose Tower Plug-in (TWRPI) Socket
|
||||
* -------------------- ------------------------- -------- -------------------
|
||||
* -------------------- ------------------------- -------- ------------------
|
||||
* FEATURE CONNECTION PORT/PIN PIN FUNCTION
|
||||
* -------------------- ------------------------- -------- -------------------
|
||||
* -------------------- ------------------------- -------- ------------------
|
||||
* General Purpose TWRPI AN0 (J4 Pin 8) ? ADC0_DP0/ADC1_DP3
|
||||
* TWRPI Socket TWRPI AN1 (J4 Pin 9) ? ADC0_DM0/ADC1_DM3
|
||||
* TWRPI AN2 (J4 Pin 12) ? ADC1_DP0/ADC0_DP3
|
||||
|
|
|
@ -142,7 +142,9 @@ static void kinetis_mediachange(void)
|
|||
|
||||
if (inserted != g_nsh.inserted)
|
||||
{
|
||||
/* Yes.. perform the appropriate action (this might need some debounce). */
|
||||
/* Yes..
|
||||
* perform the appropriate action (this might need some debounce).
|
||||
*/
|
||||
|
||||
g_nsh.inserted = inserted;
|
||||
sdhc_mediachange(g_nsh.sdhc, inserted);
|
||||
|
@ -242,7 +244,8 @@ int board_app_initialize(uintptr_t arg)
|
|||
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_nsh.sdhc);
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n",
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* The TWR-K60N512 has four LEDs:
|
||||
*
|
||||
* 1. E1 / Orange LED PTA11
|
||||
|
@ -111,28 +112,28 @@
|
|||
static const uint16_t g_ledbits[8] =
|
||||
{
|
||||
(LED_STARTED_ON_SETBITS | LED_STARTED_ON_CLRBITS |
|
||||
LED_STARTED_OFF_SETBITS | LED_STARTED_OFF_CLRBITS),
|
||||
LED_STARTED_OFF_SETBITS | LED_STARTED_OFF_CLRBITS),
|
||||
|
||||
(LED_HEAPALLOCATE_ON_SETBITS | LED_HEAPALLOCATE_ON_CLRBITS |
|
||||
LED_HEAPALLOCATE_OFF_SETBITS | LED_HEAPALLOCATE_OFF_CLRBITS),
|
||||
LED_HEAPALLOCATE_OFF_SETBITS | LED_HEAPALLOCATE_OFF_CLRBITS),
|
||||
|
||||
(LED_IRQSENABLED_ON_SETBITS | LED_IRQSENABLED_ON_CLRBITS |
|
||||
LED_IRQSENABLED_OFF_SETBITS | LED_IRQSENABLED_OFF_CLRBITS),
|
||||
LED_IRQSENABLED_OFF_SETBITS | LED_IRQSENABLED_OFF_CLRBITS),
|
||||
|
||||
(LED_STACKCREATED_ON_SETBITS | LED_STACKCREATED_ON_CLRBITS |
|
||||
LED_STACKCREATED_OFF_SETBITS | LED_STACKCREATED_OFF_CLRBITS),
|
||||
LED_STACKCREATED_OFF_SETBITS | LED_STACKCREATED_OFF_CLRBITS),
|
||||
|
||||
(LED_INIRQ_ON_SETBITS | LED_INIRQ_ON_CLRBITS |
|
||||
LED_INIRQ_OFF_SETBITS | LED_INIRQ_OFF_CLRBITS),
|
||||
LED_INIRQ_OFF_SETBITS | LED_INIRQ_OFF_CLRBITS),
|
||||
|
||||
(LED_SIGNAL_ON_SETBITS | LED_SIGNAL_ON_CLRBITS |
|
||||
LED_SIGNAL_OFF_SETBITS | LED_SIGNAL_OFF_CLRBITS),
|
||||
LED_SIGNAL_OFF_SETBITS | LED_SIGNAL_OFF_CLRBITS),
|
||||
|
||||
(LED_ASSERTION_ON_SETBITS | LED_ASSERTION_ON_CLRBITS |
|
||||
LED_ASSERTION_OFF_SETBITS | LED_ASSERTION_OFF_CLRBITS),
|
||||
LED_ASSERTION_OFF_SETBITS | LED_ASSERTION_OFF_CLRBITS),
|
||||
|
||||
(LED_PANIC_ON_SETBITS | LED_PANIC_ON_CLRBITS |
|
||||
LED_PANIC_OFF_SETBITS | LED_PANIC_OFF_CLRBITS)
|
||||
LED_PANIC_OFF_SETBITS | LED_PANIC_OFF_CLRBITS)
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -60,8 +60,8 @@ void weak_function kinetis_spidev_initialize(void)
|
|||
* Name: kinetis_spi0/1/2select and kinetis_spi0/1/2status
|
||||
*
|
||||
* Description:
|
||||
* The external functions, kinetis_spi0/1/2select and kinetis_spi0/1/2status
|
||||
* must be provided by board-specific logic.
|
||||
* The external functions, kinetis_spi0/1/2select and
|
||||
* kinetis_spi0/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 kinetis_spibus_initialize()) are provided
|
||||
|
|
|
@ -68,7 +68,8 @@ void kinetis_usbinitialize(void)
|
|||
* If USB is supported and the board supports a pullup via GPIO
|
||||
* (for USB software connect and disconnect), then the board software must
|
||||
* provide kinetis_pullup.
|
||||
* See include/nuttx/usb/usbdev.h for additional description of this method.
|
||||
* See include/nuttx/usb/usbdev.h for additional description of this
|
||||
* method.
|
||||
* Alternatively, if no pull-up GPIO the following EXTERN can be redefined
|
||||
* to be NULL.
|
||||
*
|
||||
|
|
|
@ -64,9 +64,9 @@
|
|||
/* TWR-K60N512 GPIOs ********************************************************/
|
||||
|
||||
/* On-Board Connections
|
||||
* -------------------- ------------------------- -------- -------------------
|
||||
* -------------------- ------------------------- -------- -----------------
|
||||
* FEATURE CONNECTION PORT/PIN PIN FUNCTION
|
||||
* -------------------- ------------------------- -------- -------------------
|
||||
* -------------------- ------------------------- -------- -----------------
|
||||
* OSJTAG USB-to-serial OSJTAG Bridge RX Data PTE9 UART5_RX
|
||||
* Bridge OSJTAG Bridge TX Data PTE8 UART5_TX
|
||||
* SD Card Slot SD Clock PTE2 SDHC0_DCLK
|
||||
|
@ -122,9 +122,9 @@
|
|||
#define GPIO_LED4 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN10)
|
||||
|
||||
/* Connections via the General Purpose Tower Plug-in (TWRPI) Socket
|
||||
* -------------------- ------------------------- -------- -------------------
|
||||
* -------------------- ------------------------- -------- ------------------
|
||||
* FEATURE CONNECTION PORT/PIN PIN FUNCTION
|
||||
* -------------------- ------------------------- -------- -------------------
|
||||
* -------------------- ------------------------- -------- ------------------
|
||||
* General Purpose TWRPI AN0 (J4 Pin 8) ? ADC0_DP0/ADC1_DP3
|
||||
* TWRPI Socket TWRPI AN1 (J4 Pin 9) ? ADC0_DM0/ADC1_DM3
|
||||
* TWRPI AN2 (J4 Pin 12) ? ADC1_DP0/ADC0_DP3
|
||||
|
@ -264,13 +264,13 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -154,7 +154,8 @@ static int k64_attach(FAR const struct automount_lower_s *lower,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static void k64_enable(FAR const struct automount_lower_s *lower, bool enable)
|
||||
static void k64_enable(FAR const struct automount_lower_s *lower,
|
||||
bool enable)
|
||||
{
|
||||
FAR const struct k64_automount_config_s *config;
|
||||
FAR struct k64_automount_state_s *state;
|
||||
|
@ -246,7 +247,8 @@ void k64_automount_initialize(void)
|
|||
* Name: k64_automount_event
|
||||
*
|
||||
* Description:
|
||||
* The SDHC card detection logic has detected an insertion or removal event.
|
||||
* The SDHC card detection logic has detected an insertion or removal
|
||||
* event.
|
||||
* It has already scheduled the MMC/SD block driver operations.
|
||||
* Now we need to schedule the auto-mount event which will occur with a
|
||||
* substantial delay to make sure that everything has settle down.
|
||||
|
|
|
@ -50,7 +50,8 @@
|
|||
#define K64_LED1 (1 << 0)
|
||||
#define K64_LED2 (1 << 1)
|
||||
#define K64_LED3 (1 << 2)
|
||||
// #define K64_LED4 (1 << 3)
|
||||
|
||||
/* #define K64_LED4 (1 << 3) */
|
||||
|
||||
#define ON_SETBITS_SHIFT (0)
|
||||
#define ON_CLRBITS_SHIFT (4)
|
||||
|
@ -114,28 +115,28 @@
|
|||
static const uint16_t g_ledbits[8] =
|
||||
{
|
||||
(LED_STARTED_ON_SETBITS | LED_STARTED_ON_CLRBITS |
|
||||
LED_STARTED_OFF_SETBITS | LED_STARTED_OFF_CLRBITS),
|
||||
LED_STARTED_OFF_SETBITS | LED_STARTED_OFF_CLRBITS),
|
||||
|
||||
(LED_HEAPALLOCATE_ON_SETBITS | LED_HEAPALLOCATE_ON_CLRBITS |
|
||||
LED_HEAPALLOCATE_OFF_SETBITS | LED_HEAPALLOCATE_OFF_CLRBITS),
|
||||
LED_HEAPALLOCATE_OFF_SETBITS | LED_HEAPALLOCATE_OFF_CLRBITS),
|
||||
|
||||
(LED_IRQSENABLED_ON_SETBITS | LED_IRQSENABLED_ON_CLRBITS |
|
||||
LED_IRQSENABLED_OFF_SETBITS | LED_IRQSENABLED_OFF_CLRBITS),
|
||||
LED_IRQSENABLED_OFF_SETBITS | LED_IRQSENABLED_OFF_CLRBITS),
|
||||
|
||||
(LED_STACKCREATED_ON_SETBITS | LED_STACKCREATED_ON_CLRBITS |
|
||||
LED_STACKCREATED_OFF_SETBITS | LED_STACKCREATED_OFF_CLRBITS),
|
||||
LED_STACKCREATED_OFF_SETBITS | LED_STACKCREATED_OFF_CLRBITS),
|
||||
|
||||
(LED_INIRQ_ON_SETBITS | LED_INIRQ_ON_CLRBITS |
|
||||
LED_INIRQ_OFF_SETBITS | LED_INIRQ_OFF_CLRBITS),
|
||||
LED_INIRQ_OFF_SETBITS | LED_INIRQ_OFF_CLRBITS),
|
||||
|
||||
(LED_SIGNAL_ON_SETBITS | LED_SIGNAL_ON_CLRBITS |
|
||||
LED_SIGNAL_OFF_SETBITS | LED_SIGNAL_OFF_CLRBITS),
|
||||
LED_SIGNAL_OFF_SETBITS | LED_SIGNAL_OFF_CLRBITS),
|
||||
|
||||
(LED_ASSERTION_ON_SETBITS | LED_ASSERTION_ON_CLRBITS |
|
||||
LED_ASSERTION_OFF_SETBITS | LED_ASSERTION_OFF_CLRBITS),
|
||||
LED_ASSERTION_OFF_SETBITS | LED_ASSERTION_OFF_CLRBITS),
|
||||
|
||||
(LED_PANIC_ON_SETBITS | LED_PANIC_ON_CLRBITS |
|
||||
LED_PANIC_OFF_SETBITS | LED_PANIC_OFF_CLRBITS)
|
||||
LED_PANIC_OFF_SETBITS | LED_PANIC_OFF_CLRBITS)
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -105,7 +105,9 @@ static void k64_mediachange(void)
|
|||
{
|
||||
mcinfo("Media change: %d->%d\n", g_sdhc.inserted, inserted);
|
||||
|
||||
/* Yes.. perform the appropriate action (this might need some debounce). */
|
||||
/* Yes..
|
||||
* perform the appropriate action (this might need some debounce).
|
||||
*/
|
||||
|
||||
g_sdhc.inserted = inserted;
|
||||
sdhc_mediachange(g_sdhc.sdhc, inserted);
|
||||
|
@ -176,7 +178,8 @@ int k64_sdhc_initialize(void)
|
|||
ret = mmcsd_slotinitialize(MMSCD_MINOR, g_sdhc.sdhc);
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n",
|
||||
syslog(LOG_ERR,
|
||||
"ERROR: Failed to bind SDHC to the MMC/SD driver: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -239,7 +239,9 @@
|
|||
#define GPIO_SW1 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTC | PIN6)
|
||||
#define GPIO_SW3 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTA | PIN4)
|
||||
|
||||
/* LEDs. Note that LED1-3 are used by system, LED4 is for user defined apps. */
|
||||
/* LEDs.
|
||||
* Note that LED1-3 are used by system, LED4 is for user defined apps.
|
||||
*/
|
||||
|
||||
#define GPIO_LED1 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTE | PIN6)
|
||||
#define GPIO_LED2 (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTE | PIN7)
|
||||
|
@ -251,20 +253,21 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: k64_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the TWR-K64F120M board.
|
||||
* Called to configure SPI chip select GPIO pins for the TWR-K64F120M
|
||||
* board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -356,7 +359,8 @@ void k64_automount_initialize(void);
|
|||
* Name: k64_automount_event
|
||||
*
|
||||
* Description:
|
||||
* The SDHC card detection logic has detected an insertion or removal event.
|
||||
* The SDHC card detection logic has detected an insertion or removal
|
||||
* event.
|
||||
* It has already scheduled the MMC/SD block driver operations. Now we need
|
||||
* to schedule the auto-mount event which will occur with a substantial
|
||||
* delay to make sure that everything has settle down.
|
||||
|
|
|
@ -114,8 +114,11 @@
|
|||
# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
|
||||
# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(2)
|
||||
#else
|
||||
//# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
|
||||
//# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(3)
|
||||
|
||||
/* # define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 */
|
||||
|
||||
/* # define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(3) */
|
||||
|
||||
# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV16
|
||||
# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(15)
|
||||
#endif
|
||||
|
@ -124,7 +127,7 @@
|
|||
|
||||
/* TPM0 Channels */
|
||||
|
||||
#define GPIO_TPM0_CH0OUT PIN_TPM0_CH0_3 //PIN_TPM0_CH0_1
|
||||
#define GPIO_TPM0_CH0OUT PIN_TPM0_CH0_3 /* PIN_TPM0_CH0_1 */
|
||||
#define GPIO_TPM0_CH1OUT PIN_TPM0_CH1_1
|
||||
#define GPIO_TPM0_CH2OUT PIN_TPM0_CH2_1
|
||||
#define GPIO_TPM0_CH3OUT PIN_TPM0_CH3_1
|
||||
|
@ -153,7 +156,8 @@
|
|||
* Blue Cathode PTD1
|
||||
*
|
||||
* NOTE:
|
||||
* PTD1 is also connected to the I/O header on J2 pin 10 (also known as D13).
|
||||
* 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.
|
||||
|
|
|
@ -82,13 +82,13 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -272,7 +272,8 @@ int adxl345_archinitialize(int minor)
|
|||
/* Instantiate the ADXL345 driver */
|
||||
|
||||
g_adxl345config.handle =
|
||||
adxl345_instantiate(dev, (FAR struct adxl345_config_s *)&g_adxl345config);
|
||||
adxl345_instantiate(dev,
|
||||
(FAR struct adxl345_config_s *)&g_adxl345config);
|
||||
if (!g_adxl345config.handle)
|
||||
{
|
||||
snerr("ERROR: Failed to instantiate the ADXL345 driver\n");
|
||||
|
@ -281,7 +282,8 @@ int adxl345_archinitialize(int minor)
|
|||
|
||||
/* Initialize and register the ADXL345 driver */
|
||||
|
||||
ret = adxl345_register(g_adxl345config.handle, CONFIG_ADXL345_DEVMINOR);
|
||||
ret = adxl345_register(g_adxl345config.handle,
|
||||
CONFIG_ADXL345_DEVMINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
snerr("ERROR: Failed to register ADXL345 driver: %d\n", ret);
|
||||
|
|
|
@ -94,7 +94,7 @@ 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
|
||||
* 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.
|
||||
|
@ -105,8 +105,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)
|
||||
|
|
|
@ -69,10 +69,10 @@ void weak_function kl_spidev_initialize(void)
|
|||
*
|
||||
* Description:
|
||||
* These external functions must be provided by board-specific logic. They
|
||||
* are implementations of the select, status, and cmddata methods of the SPI
|
||||
* interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). All
|
||||
* other methods including kl_spibus_initialize()) are provided by common
|
||||
* Kinetis logic. To use this common SPI logic on your board:
|
||||
* are implementations of the select, status, and cmddata methods of the
|
||||
* SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||
* All other methods including kl_spibus_initialize()) are provided by
|
||||
* common Kinetis logic. To use this common SPI logic on your board:
|
||||
*
|
||||
* 1. Provide logic in kl_boardinitialize() to configure SPI chip select
|
||||
* pins.
|
||||
|
|
|
@ -114,8 +114,11 @@
|
|||
# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
|
||||
# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(2)
|
||||
#else
|
||||
//# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
|
||||
//# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(3)
|
||||
|
||||
/* # define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2 */
|
||||
|
||||
/* # define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(3) */
|
||||
|
||||
# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV16
|
||||
# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(15)
|
||||
#endif
|
||||
|
|
|
@ -82,13 +82,13 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -88,8 +88,9 @@ void kl_boardinitialize(void)
|
|||
* 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
|
||||
* may be used, for example, to initialize board-specific device drivers.
|
||||
* the initial application is started. This additional initialization
|
||||
* phase may be used, for example, to initialize board-specific device
|
||||
* drivers.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* The Freedom KL26Z has a single RGB LED driven by the KL26Z as follows:
|
||||
*
|
||||
* ------------- --------
|
||||
|
|
|
@ -44,7 +44,8 @@
|
|||
* Name: kl_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the FRDM-KL26Z board.
|
||||
* Called to configure SPI chip select GPIO pins for the FRDM-KL26Z
|
||||
* board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -66,10 +67,10 @@ void weak_function kl_spidev_initialize(void)
|
|||
*
|
||||
* Description:
|
||||
* These external functions must be provided by board-specific logic. They
|
||||
* are implementations of the select, status, and cmddata methods of the SPI
|
||||
* interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). All
|
||||
* other methods including kl_spibus_initialize()) are provided by common
|
||||
* Kinetis logic. To use this common SPI logic on your board:
|
||||
* are implementations of the select, status, and cmddata methods of the
|
||||
* SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||
* All other methods including kl_spibus_initialize()) are provided by
|
||||
* common Kinetis logic. To use this common SPI logic on your board:
|
||||
*
|
||||
* 1. Provide logic in kl_boardinitialize() to configure SPI chip select
|
||||
* pins.
|
||||
|
@ -83,8 +84,8 @@ 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).
|
||||
*
|
||||
|
|
|
@ -106,19 +106,20 @@ 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
|
||||
* may be used, for example, to initialize board-specific device drivers.
|
||||
* function called board_late_initialize(). board_late_initialize() will
|
||||
* be called immediately after up_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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_BOARD_LATE_INITIALIZE
|
||||
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.
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL)
|
||||
|
|
|
@ -44,7 +44,8 @@
|
|||
* Name: kl_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the FRDM-KL25Z board.
|
||||
* Called to configure SPI chip select GPIO pins for the FRDM-KL25Z
|
||||
* board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -66,10 +67,10 @@ void weak_function kl_spidev_initialize(void)
|
|||
*
|
||||
* Description:
|
||||
* These external functions must be provided by board-specific logic. They
|
||||
* are implementations of the select, status, and cmddata methods of the SPI
|
||||
* interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h). All
|
||||
* other methods including kl_spibus_initialize()) are provided by common
|
||||
* Kinetis logic. To use this common SPI logic on your board:
|
||||
* are implementations of the select, status, and cmddata methods of the
|
||||
* SPI interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||
* All other methods including kl_spibus_initialize()) are provided by
|
||||
* common Kinetis logic. To use this common SPI logic on your board:
|
||||
*
|
||||
* 1. Provide logic in kl_boardinitialize() to configure SPI chip select
|
||||
* pins.
|
||||
|
@ -83,8 +84,8 @@ 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).
|
||||
*
|
||||
|
|
|
@ -46,20 +46,21 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
|
|
@ -78,13 +78,13 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -50,7 +50,8 @@
|
|||
* Name: lpc17_40_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All LPC17xx/LPC40xx architectures must provide the following entry point.
|
||||
* All LPC17xx/LPC40xx 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.
|
||||
|
|
|
@ -70,8 +70,9 @@
|
|||
* 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)
|
||||
* 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;
|
||||
|
@ -128,6 +129,7 @@ void board_autoled_on(int led)
|
|||
case LED_IRQSENABLED:
|
||||
led2 = 1;
|
||||
}
|
||||
|
||||
lpc17_40_led(LINCOLN60_LED1, led1);
|
||||
lpc17_40_led(LINCOLN60_LED2, led2);
|
||||
}
|
||||
|
@ -177,7 +179,6 @@ void board_autoled_off(int led)
|
|||
****************************************************************************/
|
||||
|
||||
void lpc17_40_led(int lednum, int state)
|
||||
|
||||
{
|
||||
lpc17_40_gpiowrite(lednum, state);
|
||||
}
|
||||
|
|
|
@ -53,14 +53,15 @@
|
|||
|
||||
/* This is the clock setup we configure for:
|
||||
*
|
||||
* SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source
|
||||
* 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 BOARD_PCLK_FREQUENCY (LPC17_40_CCLK / BOARD_PCLKDIV)
|
||||
#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.
|
||||
|
@ -235,20 +236,21 @@
|
|||
* 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_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
|
||||
*/
|
||||
|
||||
/* Button definitions ***************************************************************/
|
||||
/* 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_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
|
||||
*/
|
||||
|
||||
/* Button definitions *******************************************************/
|
||||
|
||||
/* The LPC4088 Developer's Kit supports several buttons.
|
||||
* All have external pullup resistors.
|
||||
|
@ -421,10 +423,14 @@
|
|||
* 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 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 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
|
||||
* -------------- -------------------- ------------ -------------------------
|
||||
*/
|
||||
|
|
|
@ -140,22 +140,22 @@
|
|||
static const uint16_t g_ledbits[8] =
|
||||
{
|
||||
(LED_STARTED_ON_SETBITS | LED_STARTED_ON_CLRBITS |
|
||||
LED_STARTED_OFF_SETBITS | LED_STARTED_OFF_CLRBITS),
|
||||
LED_STARTED_OFF_SETBITS | LED_STARTED_OFF_CLRBITS),
|
||||
|
||||
(LED_HEAPALLOCATE_ON_SETBITS | LED_HEAPALLOCATE_ON_CLRBITS |
|
||||
LED_HEAPALLOCATE_OFF_SETBITS | LED_HEAPALLOCATE_OFF_CLRBITS),
|
||||
LED_HEAPALLOCATE_OFF_SETBITS | LED_HEAPALLOCATE_OFF_CLRBITS),
|
||||
|
||||
(LED_IRQSENABLED_ON_SETBITS | LED_IRQSENABLED_ON_CLRBITS |
|
||||
LED_IRQSENABLED_OFF_SETBITS | LED_IRQSENABLED_OFF_CLRBITS),
|
||||
LED_IRQSENABLED_OFF_SETBITS | LED_IRQSENABLED_OFF_CLRBITS),
|
||||
|
||||
(LED_STACKCREATED_ON_SETBITS | LED_STACKCREATED_ON_CLRBITS |
|
||||
LED_STACKCREATED_OFF_SETBITS | LED_STACKCREATED_OFF_CLRBITS),
|
||||
LED_STACKCREATED_OFF_SETBITS | LED_STACKCREATED_OFF_CLRBITS),
|
||||
|
||||
(LED_EVENT_ON_SETBITS | LED_EVENT_ON_CLRBITS |
|
||||
LED_EVENT_OFF_SETBITS | LED_EVENT_OFF_CLRBITS),
|
||||
LED_EVENT_OFF_SETBITS | LED_EVENT_OFF_CLRBITS),
|
||||
|
||||
(LED_IDLE_ON_SETBITS | LED_IDLE_ON_CLRBITS |
|
||||
LED_IDLE_OFF_SETBITS | LED_IDLE_OFF_CLRBITS)
|
||||
LED_IDLE_OFF_SETBITS | LED_IDLE_OFF_CLRBITS)
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -52,7 +52,8 @@
|
|||
* Name: lpc17_40_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All LPC17xx/LPC40xx architectures must provide the following entry point.
|
||||
* All LPC17xx/LPC40xx 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.
|
||||
|
@ -111,7 +112,7 @@ void lpc17_40_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
|
||||
* function called board_late_initialize(). board_late_initialize() will be
|
||||
* called immediately after up_initialize() is called and just before the
|
||||
* initial application is started. This additional initialization phase
|
||||
* may be used, for example, to initialize board-specific device drivers.
|
||||
|
|
|
@ -52,8 +52,8 @@
|
|||
* JOY_D -- Connected to P2[27]
|
||||
* JOY_CTR -- Connected to P2[22]
|
||||
*
|
||||
* The switches are all connected to ground and should be pulled up and sensed
|
||||
* with a value of '0' when closed.
|
||||
* The switches are all connected to ground and should be pulled up and
|
||||
* sensed with a value of '0' when closed.
|
||||
*
|
||||
* Mapping to DJOYSTICK buttons:
|
||||
*
|
||||
|
@ -73,11 +73,13 @@
|
|||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static djoy_buttonset_t djoy_supported(FAR const struct djoy_lowerhalf_s *lower);
|
||||
static djoy_buttonset_t djoy_sample(FAR const struct djoy_lowerhalf_s *lower);
|
||||
static djoy_buttonset_t djoy_supported(
|
||||
FAR const struct djoy_lowerhalf_s *lower);
|
||||
static djoy_buttonset_t djoy_sample(
|
||||
FAR const struct djoy_lowerhalf_s *lower);
|
||||
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);
|
||||
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);
|
||||
|
@ -135,7 +137,8 @@ static const struct djoy_lowerhalf_s g_djoylower =
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static djoy_buttonset_t djoy_supported(FAR const struct djoy_lowerhalf_s *lower)
|
||||
static djoy_buttonset_t djoy_supported(
|
||||
FAR const struct djoy_lowerhalf_s *lower)
|
||||
{
|
||||
iinfo("Supported: %02x\n", DJOY_ALLBITS);
|
||||
return (djoy_buttonset_t)DJOY_ALLBITS;
|
||||
|
|
|
@ -122,17 +122,19 @@ void lpc4088_devkit_sdram_initialize(void)
|
|||
|
||||
/* Configure the SDRAM */
|
||||
|
||||
putreg32( EMC_NS2CLK(20), LPC17_40_EMC_DYNAMICRP); /* TRP = 20 nS */
|
||||
putreg32( 15, LPC17_40_EMC_DYNAMICRAS); /* RAS = 42ns to 100K ns, */
|
||||
putreg32( 0, LPC17_40_EMC_DYNAMICSREX); /* TSREX = 1 clock */
|
||||
putreg32( 1, LPC17_40_EMC_DYNAMICAPR); /* TAPR = 2 clocks? */
|
||||
putreg32(EMC_NS2CLK(20), LPC17_40_EMC_DYNAMICRP); /* TRP = 20 nS */
|
||||
putreg32(15, LPC17_40_EMC_DYNAMICRAS); /* RAS = 42ns to 100K ns, */
|
||||
putreg32(0, LPC17_40_EMC_DYNAMICSREX); /* TSREX = 1 clock */
|
||||
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_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) */
|
||||
putreg32( 1, LPC17_40_EMC_DYNAMICMRD); /* 2 clock, TMRD = 2 clocks (min) */
|
||||
|
||||
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_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) */
|
||||
putreg32(1, LPC17_40_EMC_DYNAMICMRD); /* 2 clock, TMRD = 2 clocks (min) */
|
||||
|
||||
/* Command delayed strategy, using EMCCLKDELAY */
|
||||
|
||||
|
|
|
@ -120,14 +120,18 @@
|
|||
/* XPT2046 Touchscreen ******************************************************/
|
||||
|
||||
/* -------------- -------------------- ------------ -------------------------
|
||||
* XTPT2046 Module Module LPC4088 Developer's Kit LED
|
||||
* Signal Connector Connector
|
||||
* XTPT2046 Module Module LPC4088 Developer's Kit
|
||||
* Signal Connector LED 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 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 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
|
||||
* -------------- -------------------- ------------ -------------------------
|
||||
*
|
||||
|
@ -144,13 +148,13 @@
|
|||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -173,8 +177,8 @@ 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
|
|
@ -52,7 +52,8 @@
|
|||
|
||||
/* This is the clock setup we configure for:
|
||||
*
|
||||
* SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source
|
||||
* 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
|
||||
*/
|
||||
|
@ -210,18 +211,19 @@
|
|||
* 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 */
|
||||
#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_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
|
||||
*/
|
||||
|
||||
/* 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_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
|
||||
*/
|
||||
|
||||
/* Button definitions *******************************************************/
|
||||
|
||||
|
@ -355,10 +357,14 @@
|
|||
* 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 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 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
|
||||
* -------------- -------------------- ------------ -------------------------
|
||||
*/
|
||||
|
|
|
@ -146,22 +146,22 @@
|
|||
static const uint16_t g_ledbits[8] =
|
||||
{
|
||||
(LED_STARTED_ON_SETBITS | LED_STARTED_ON_CLRBITS |
|
||||
LED_STARTED_OFF_SETBITS | LED_STARTED_OFF_CLRBITS),
|
||||
LED_STARTED_OFF_SETBITS | LED_STARTED_OFF_CLRBITS),
|
||||
|
||||
(LED_HEAPALLOCATE_ON_SETBITS | LED_HEAPALLOCATE_ON_CLRBITS |
|
||||
LED_HEAPALLOCATE_OFF_SETBITS | LED_HEAPALLOCATE_OFF_CLRBITS),
|
||||
LED_HEAPALLOCATE_OFF_SETBITS | LED_HEAPALLOCATE_OFF_CLRBITS),
|
||||
|
||||
(LED_IRQSENABLED_ON_SETBITS | LED_IRQSENABLED_ON_CLRBITS |
|
||||
LED_IRQSENABLED_OFF_SETBITS | LED_IRQSENABLED_OFF_CLRBITS),
|
||||
LED_IRQSENABLED_OFF_SETBITS | LED_IRQSENABLED_OFF_CLRBITS),
|
||||
|
||||
(LED_STACKCREATED_ON_SETBITS | LED_STACKCREATED_ON_CLRBITS |
|
||||
LED_STACKCREATED_OFF_SETBITS | LED_STACKCREATED_OFF_CLRBITS),
|
||||
LED_STACKCREATED_OFF_SETBITS | LED_STACKCREATED_OFF_CLRBITS),
|
||||
|
||||
(LED_EVENT_ON_SETBITS | LED_EVENT_ON_CLRBITS |
|
||||
LED_EVENT_OFF_SETBITS | LED_EVENT_OFF_CLRBITS),
|
||||
LED_EVENT_OFF_SETBITS | LED_EVENT_OFF_CLRBITS),
|
||||
|
||||
(LED_IDLE_ON_SETBITS | LED_IDLE_ON_CLRBITS |
|
||||
LED_IDLE_OFF_SETBITS | LED_IDLE_OFF_CLRBITS)
|
||||
LED_IDLE_OFF_SETBITS | LED_IDLE_OFF_CLRBITS)
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -52,7 +52,8 @@
|
|||
* Name: lpc17_40_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All LPC17xx/LPC40xx architectures must provide the following entry point.
|
||||
* All LPC17xx/LPC40xx 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.
|
||||
|
@ -101,7 +102,7 @@ void lpc17_40_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
|
||||
* function called board_late_initialize(). board_late_initialize() will be
|
||||
* called immediately after up_initialize() is called and just before the
|
||||
* initial application is started. This additional initialization phase
|
||||
* may be used, for example, to initialize board-specific device drivers.
|
||||
|
|
|
@ -122,17 +122,19 @@ void lpc4088_quickstart_sdram_initialize(void)
|
|||
|
||||
/* Configure the SDRAM */
|
||||
|
||||
putreg32( EMC_NS2CLK(20), LPC17_40_EMC_DYNAMICRP); /* TRP = 20 nS */
|
||||
putreg32( 15, LPC17_40_EMC_DYNAMICRAS); /* RAS = 42ns to 100K ns, */
|
||||
putreg32( 0, LPC17_40_EMC_DYNAMICSREX); /* TSREX = 1 clock */
|
||||
putreg32( 1, LPC17_40_EMC_DYNAMICAPR); /* TAPR = 2 clocks? */
|
||||
putreg32(EMC_NS2CLK(20), LPC17_40_EMC_DYNAMICRP); /* TRP = 20 nS */
|
||||
putreg32(15, LPC17_40_EMC_DYNAMICRAS); /* RAS = 42ns to 100K ns, */
|
||||
putreg32(0, LPC17_40_EMC_DYNAMICSREX); /* TSREX = 1 clock */
|
||||
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_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) */
|
||||
putreg32( 1, LPC17_40_EMC_DYNAMICMRD); /* 2 clock, TMRD = 2 clocks (min) */
|
||||
|
||||
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_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) */
|
||||
putreg32(1, LPC17_40_EMC_DYNAMICMRD); /* 2 clock, TMRD = 2 clocks (min) */
|
||||
|
||||
/* Command delayed strategy, using EMCCLKDELAY */
|
||||
|
||||
|
|
|
@ -76,13 +76,13 @@
|
|||
#define GPIO_USER2_IRQ LPC17_40_IRQ_P2p10
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
|
||||
/* 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.
|
||||
* 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 */
|
||||
|
@ -46,8 +46,10 @@
|
|||
|
||||
/* This is the clock setup we configure for:
|
||||
*
|
||||
* SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for source
|
||||
* PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20, pre-divider=1
|
||||
* SYSCLK = BOARD_OSCCLK_FREQUENCY = 12MHz -> Select Main oscillator for
|
||||
* source
|
||||
* PLL0CLK = (2 * 20 * SYSCLK) / 1 = 480MHz -> PLL0 multipler=20,
|
||||
* pre-divider=1
|
||||
* CCLCK = 480MHz / 6 = 80MHz -> CCLK divider = 6
|
||||
*/
|
||||
|
||||
|
@ -108,13 +110,14 @@
|
|||
|
||||
/* FLASH Configuration */
|
||||
|
||||
#undef CONFIG_LPC17_40_FLASH
|
||||
#undef CONFIG_LPC17_40_FLASHOB
|
||||
#define CONFIG_LPC17_40_FLASH 1
|
||||
#define BOARD_FLASHCFG_VALUE 0x0000303a
|
||||
|
||||
/* Ethernet configuration */
|
||||
|
||||
//#define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV44
|
||||
/* #define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV44 */
|
||||
|
||||
#define ETH_MCFG_CLKSEL_DIV ETH_MCFG_CLKSEL_DIV20
|
||||
|
||||
/* LED definitions **********************************************************/
|
||||
|
@ -122,6 +125,7 @@
|
|||
/* The LPCXpresso LPC1768 board has a single red LED
|
||||
* (there are additional LEDs on the base board not considered here).
|
||||
*/
|
||||
|
||||
/* ON OFF */
|
||||
#define LED_STARTED 0 /* OFF ON (never happens) */
|
||||
#define LED_HEAPALLOCATE 0 /* OFF ON (never happens) */
|
||||
|
@ -145,7 +149,8 @@
|
|||
* P0[6]/I2SRX_SDA/SSEL1/MAT2[0] J6-8 SSEL1, OLED CS
|
||||
* P0[7]/I2STX_CLK/SCK1/MAT2[1] J6-7 SCK1, OLED SCK
|
||||
* P0[8]/I2STX_WS/MISO1/MAT2[2] J6-6 MISO1
|
||||
* P0[9]/I2STX_SDA/MOSI1/MAT2[3] J6-5 MOSI1, OLED data in
|
||||
* P0[9]/I2STX_SDA/MOSI1/MAT2[3] J6-5 MOSI1,
|
||||
* OLED data in
|
||||
* P0[10] J6-40 TXD2/SDA2
|
||||
* P0[11] J6-41 RXD2/SCL2
|
||||
* P0[15]/TXD1/SCK0/SCK J6-13 TXD1/SCK0
|
||||
|
@ -159,7 +164,8 @@
|
|||
* P0[23]/AD0[0]/I2SRX_CLK/CAP3[0] J6-15 AD0.0
|
||||
* P0[24]/AD0[1]/I2SRX_WS/CAP3[1] J6-16 AD0.1
|
||||
* P0[25]/AD0[2]/I2SRX_SDA/TXD3 J6-17 AD0.2
|
||||
* P0[26]/AD0[3]/AOUT/RXD3 J6-18 AD0.3/AOUT / RGB LED
|
||||
* P0[26]/AD0[3]/AOUT/RXD3 J6-18 AD0.3/AOUT /
|
||||
* RGB LED
|
||||
* P0[27]/SDA0/USB_SDA J6-25
|
||||
* P0[28]/SCL0 J6-26
|
||||
* P0[29]/USB_D+ J6-37 USB_D+
|
||||
|
@ -180,12 +186,16 @@
|
|||
#define GPIO_SSP0_MISO GPIO_SSP0_MISO_1
|
||||
#define GPIO_SSP0_MOSI GPIO_SSP0_MOSI_1
|
||||
|
||||
/* P1[0]/ENET-TXD0 J6-34? TXD0 TX-(Ethernet PHY)
|
||||
* P1[1]/ENET_TXD1 J6-35? TXD1 TX+(Ethernet PHY)
|
||||
/* P1[0]/ENET-TXD0 J6-34? TXD0 TX-
|
||||
* (Ethernet PHY)
|
||||
* P1[1]/ENET_TXD1 J6-35? TXD1 TX+
|
||||
* (Ethernet PHY)
|
||||
* P1[4]/ENET_TX_EN TXEN N/A
|
||||
* P1[8]/ENET_CRS CRS_DV/MODE2 N/A
|
||||
* P1[9]/ENET_RXD0 J6-32? RXD0/MODE0 RD-(Ethernet PHY)
|
||||
* P1[10]/ENET_RXD1 J6-33? RXD1/MODE1 RD+(Ethernet PHY)
|
||||
* P1[9]/ENET_RXD0 J6-32? RXD0/MODE0 RD-
|
||||
* (Ethernet PHY)
|
||||
* P1[10]/ENET_RXD1 J6-33? RXD1/MODE1 RD+
|
||||
* (Ethernet PHY)
|
||||
* P1[14]/ENET_RX_ER RXER/PHYAD0 N/A
|
||||
* P1[15]/ENET_REF_CLK REFCLK N/A
|
||||
* P1[16]/ENET_MDC MDC N/A
|
||||
|
@ -209,14 +219,19 @@
|
|||
#define GPIO_ENET_MDC GPIO_ENET_MDC_1
|
||||
#define GPIO_ENET_MDIO GPIO_ENET_MDIO_1
|
||||
|
||||
/* P2[0]/PWM1.1/TXD1 J6-42 PWM1.1 / RGB LED / RS422 RX
|
||||
* P2[1]/PWM1.2/RXD1 J6-43 PWM1.2 / OLED voltage / RGB LED / RS422 RX
|
||||
/* P2[0]/PWM1.1/TXD1 J6-42 PWM1.1 /
|
||||
* RGB LED /
|
||||
* RS422 RX
|
||||
* P2[1]/PWM1.2/RXD1 J6-43 PWM1.2 /
|
||||
* OLED voltage /
|
||||
* RGB LED /
|
||||
* RS422 RX
|
||||
* P2[2]/PWM1.3/CTS1/TRACEDATA[3] J6-44 PWM1.3
|
||||
* P2[3]/PWM1.4/DCD1/TRACEDATA[2] J6-45 PWM1.4
|
||||
* P2[4]/PWM1.5/DSR1/TRACEDATA[1] J6-46 PWM1.5
|
||||
* P2[5]/PWM1[6]/DTR1/TRACEDATA[0] J6-47 PWM1.6
|
||||
* P2[6]/PCAP1[0]/RI1/TRACECLK J6-48
|
||||
* P2[7]/RD2/RTS1 J6-49 OLED command/data
|
||||
* P2[7]/RD2/RTS1 J6-49 OLED cmd/data
|
||||
* P2[8]/TD2/TXD2 J6-50
|
||||
* P2[9]/USB_CONNECT/RXD2 PAD19 USB Pullup N/A
|
||||
* P2[10]/EINT0/NMI J6-51
|
||||
|
|
|
@ -51,7 +51,8 @@
|
|||
* Name: lpc17_40_boardinitialize
|
||||
*
|
||||
* Description:
|
||||
* All LPC17xx/LPC40xx architectures must provide the following entry point.
|
||||
* All LPC17xx/LPC40xx 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.
|
||||
|
|
|
@ -96,7 +96,8 @@ int lpcexpresso_pwm_setup(void)
|
|||
mcpwm = lpc17_40_mcpwminitialize(0);
|
||||
if (!mcpwm)
|
||||
{
|
||||
aerr("ERROR: Failed to get the LPC17XX_40XX MOTOR PWM lower half\n");
|
||||
aerr(
|
||||
"ERROR: Failed to get the LPC17XX_40XX MOTOR PWM lower half\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
|
|
@ -158,6 +158,7 @@ void lpc17_40_ssp1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
|||
|
||||
lpc17_40_gpiowrite(LPCXPRESSO_OLED_CS, !selected);
|
||||
}
|
||||
|
||||
#endif
|
||||
ssp_dumpgpio("lpc17_40_ssp1select() Exit");
|
||||
}
|
||||
|
|
|
@ -76,7 +76,8 @@ int board_usbmsc_initialize(int port)
|
|||
|
||||
/* Get the SPI port */
|
||||
|
||||
syslog(LOG_INFO, "Initializing SPI port %d\n", LPC17XX_40XX_MMCSDSPIPORTNO);
|
||||
syslog(LOG_INFO, "Initializing SPI port %d\n",
|
||||
LPC17XX_40XX_MMCSDSPIPORTNO);
|
||||
|
||||
spi = lpc17_40_sspbus_initialize(LPC17XX_40XX_MMCSDSPIPORTNO);
|
||||
if (!spi)
|
||||
|
|
|
@ -70,12 +70,16 @@
|
|||
#define LPCXPRESSO_I2C1_EPROM_SDL GPIO_I2C1_SCL_2
|
||||
#define LPCXPRESSO_LED (GPIO_OUTPUT | GPIO_VALUE_ZERO | GPIO_PORT0 | GPIO_PIN22)
|
||||
|
||||
/* P1[0]/ENET-TXD0 J6-34? TXD0 TX-(Ethernet PHY)
|
||||
* P1[1]/ENET_TXD1 J6-35? TXD1 TX+(Ethernet PHY)
|
||||
/* P1[0]/ENET-TXD0 J6-34? TXD0 TX-
|
||||
* (Ethernet PHY)
|
||||
* P1[1]/ENET_TXD1 J6-35? TXD1 TX+
|
||||
* (Ethernet PHY)
|
||||
* P1[4]/ENET_TX_EN TXEN N/A
|
||||
* P1[8]/ENET_CRS CRS_DV/MODE2 N/A
|
||||
* P1[9]/ENET_RXD0 J6-32? RXD0/MODE0 RD-(Ethernet PHY)
|
||||
* P1[10]/ENET_RXD1 J6-33? RXD1/MODE1 RD+(Ethernet PHY)
|
||||
* P1[9]/ENET_RXD0 J6-32? RXD0/MODE0 RD-
|
||||
* (Ethernet PHY)
|
||||
* P1[10]/ENET_RXD1 J6-33? RXD1/MODE1 RD+
|
||||
* (Ethernet PHY)
|
||||
* P1[14]/ENET_RX_ER RXER/PHYAD0 N/A
|
||||
* P1[15]/ENET_REF_CLK REFCLK N/A
|
||||
* P1[16]/ENET_MDC MDC N/A
|
||||
|
@ -126,8 +130,10 @@
|
|||
* SD Signal Pin Pin
|
||||
* --- ----------- ----- --------
|
||||
* CS PIO1_11* 55 P2.2 (See LPCXPRESSO_SD_CS)
|
||||
* DIN PIO0_9-MOSI 5 P0.9 MOSI1 (See GPIO_SSP1_MOSI in chip/lpcxpresso_ssp.h)
|
||||
* DOUT PIO0_8-MISO 6 P0.8 MISO1 (See GPIO_SSP1_MISO in chip/lpcxpresso_ssp.h)
|
||||
* DIN PIO0_9-MOSI 5 P0.9 MOSI1 (See GPIO_SSP1_MOSI in chip/
|
||||
* lpcxpresso_ssp.h)
|
||||
* DOUT PIO0_8-MISO 6 P0.8 MISO1 (See GPIO_SSP1_MISO in chip/
|
||||
* lpcxpresso_ssp.h)
|
||||
* CLK PIO2_11-SCK 7 P0.9 SCK1 (See GPIO_SSP1_SCK in board.h)
|
||||
* CD PIO2_10 52 P2.11 (See LPCXPRESSO_SD_CD)
|
||||
*/
|
||||
|
@ -180,9 +186,12 @@
|
|||
* ----------------------------+-------+-------------- ---------------------
|
||||
* LPC1758 Pin | J4/6 | Base Board Description
|
||||
* ----------------------------+-------+-------------- ---------------------
|
||||
* P2.1/PWM1.2/RXD1 | 43 | PIO1_10 FAN5331 Power Control (SHDN#)
|
||||
* P0.6/I2SRX-SDA/SSEL1/MAT2.0 | 8 | PIO0_2 OLED chip select (CS#)
|
||||
* P2.7/RD2/RTS1 | 49 | PIO2_7 OLED command/data (D/C#)
|
||||
* P2.1/PWM1.2/RXD1 | 43 | PIO1_10 FAN5331 Power Control
|
||||
* (SHDN#)
|
||||
* P0.6/I2SRX-SDA/SSEL1/MAT2.0 | 8 | PIO0_2 OLED chip select
|
||||
* (CS#)
|
||||
* P2.7/RD2/RTS1 | 49 | PIO2_7 OLED command/data
|
||||
* (D/C#)
|
||||
* P0.7/I2STX-CLK/SCK1/MAT2.1 | 7 | PIO2_11-SCK OLED clock (D0)
|
||||
* P0.9/I2STX-SDA/MOSI1/MAT2.3 | 5 | PIO0_9-MOSI OLED data in (D1)
|
||||
* ----------------------------+-------+-------------- ---------------------
|
||||
|
@ -197,13 +206,13 @@
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public data
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Public Functions Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue