mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
boards: nxstyle fixes
nxstyle fixes to pass the CI check Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
committed by
Xiang Xiao
parent
40cd67eee6
commit
6f14299dd0
@@ -86,7 +86,7 @@
|
|||||||
#define LED_ASSERTION 3 /* An assertion failed N/C N/C Soft glow */
|
#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 */
|
#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
|
* 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
|
* used for other purposes by the application (Of course, all LEDs are
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
* Name: a1x_boardinitialize
|
* Name: a1x_boardinitialize
|
||||||
*
|
*
|
||||||
* Description:
|
* 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
|
* point is called early in the initialization -- after all memory has been
|
||||||
* configured and mapped but before any devices have been initialized.
|
* configured and mapped but before any devices have been initialized.
|
||||||
*
|
*
|
||||||
@@ -57,7 +57,7 @@ void a1x_boardinitialize(void)
|
|||||||
* Description:
|
* Description:
|
||||||
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
||||||
* initialization call will be performed in the boot-up sequence to a
|
* 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
|
* called immediately after up_initialize() is called and just before the
|
||||||
* initial application is started. This additional initialization phase
|
* initial application is started. This additional initialization phase
|
||||||
* may be used, for example, to initialize board-specific device drivers.
|
* 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_PANIC 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
|
* After booting, LED1 and 3 are not longer used by the system and can be
|
||||||
* for other purposes by the application (Of course, all LEDs are available to
|
* used for other purposes by the application (Of course, all LEDs are
|
||||||
* the application if CONFIG_ARCH_LEDS is not defined.
|
* available to the application if CONFIG_ARCH_LEDS is not defined.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Buttons ******************************************************************/
|
/* Buttons ******************************************************************/
|
||||||
@@ -142,13 +142,13 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
# define TDA19988_I2CFREQUENCY 400000
|
# define TDA19988_I2CFREQUENCY 400000
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* LEDs *****************************************************************************/
|
/* LEDs *********************************************************************/
|
||||||
|
|
||||||
/* The beaglebone black has four user LEDs; all four can be controlled from
|
/* The beaglebone black has four user LEDs; all four can be controlled from
|
||||||
* software.
|
* software.
|
||||||
@@ -126,13 +126,13 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -29,11 +29,11 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Clocking *************************************************************/
|
/* Clocking *****************************************************************/
|
||||||
|
|
||||||
#define C5471_CLOCK 47500000 /* 47.5 MHz */
|
#define C5471_CLOCK 47500000 /* 47.5 MHz */
|
||||||
|
|
||||||
/* LED definitions ******************************************************/
|
/* LED definitions **********************************************************/
|
||||||
|
|
||||||
#define LED_STARTED 0
|
#define LED_STARTED 0
|
||||||
#define LED_HEAPALLOCATE 1
|
#define LED_HEAPALLOCATE 1
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
* Description:
|
* Description:
|
||||||
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
||||||
* initialization call will be performed in the boot-up sequence to a
|
* 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
|
* called immediately after up_initialize() is called and just before the
|
||||||
* initial application is started. This additional initialization phase
|
* initial application is started. This additional initialization phase
|
||||||
* may be used, for example, to initialize board-specific device drivers.
|
* may be used, for example, to initialize board-specific device drivers.
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* UART0
|
/* UART0
|
||||||
*
|
*
|
||||||
* The control MCU acts as a board controller (BC). There is a UART
|
* The control MCU acts as a board controller (BC). There is a UART
|
||||||
|
|||||||
@@ -113,28 +113,28 @@
|
|||||||
static const uint16_t g_ledbits[8] =
|
static const uint16_t g_ledbits[8] =
|
||||||
{
|
{
|
||||||
(LED_STARTED_ON_SETBITS | LED_STARTED_ON_CLRBITS |
|
(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_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_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_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_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_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_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_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
|
#ifdef CONFIG_EFM32_UART0
|
||||||
/* The control MCU acts as a board controller (BC). There is a UART
|
/* 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
|
* 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
|
* setting the EFM_BC_EN (PD13) line high. The EFM can then use the BSP
|
||||||
* send commands to the BC. When EFM_BC_EN is low, EFM_BC_TX and EFM_BC_RX
|
* to send commands to the BC. When EFM_BC_EN is low, EFM_BC_TX and
|
||||||
* can be used by other applications.
|
* EFM_BC_RX can be used by other applications.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
efm32_configgpio(GPIO_BC_EN);
|
efm32_configgpio(GPIO_BC_EN);
|
||||||
@@ -70,7 +70,7 @@ void efm32_boardinitialize(void)
|
|||||||
* Description:
|
* Description:
|
||||||
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
||||||
* initialization call will be performed in the boot-up sequence to a
|
* 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
|
* called immediately after up_initialize() is called and just before the
|
||||||
* initial application is started. This additional initialization phase
|
* initial application is started. This additional initialization phase
|
||||||
* may be used, for example, to initialize board-specific device drivers.
|
* may be used, for example, to initialize board-specific device drivers.
|
||||||
|
|||||||
@@ -233,9 +233,10 @@
|
|||||||
/* UART0:
|
/* UART0:
|
||||||
*
|
*
|
||||||
* The kit contains a board controller that is responsible for performing
|
* The kit contains a board controller that is responsible for performing
|
||||||
* various board level tasks, such as handling the debugger and the Advanced
|
* various board level tasks, such as handling the debugger and the
|
||||||
* Energy Monitor. An interface is provided between the EFM32 and the board
|
* Advanced Energy Monitor.
|
||||||
* controller in the form of a UART connection. The connection is enabled by
|
* 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
|
* setting the EFM_BC_EN (PF7) line high, and using the lines EFM_BC_TX
|
||||||
* (PE0) and EFM_BC_RX (PE1) for communicating.
|
* (PE0) and EFM_BC_RX (PE1) for communicating.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* The EFM32 Giant Gecko Start Kit has two yellow LEDs marked LED0 and LED1.
|
/* 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
|
* These LEDs are controlled by GPIO pins on the EFM32. The LEDs are
|
||||||
* connected to pins PE2 and PE3 in an active high configuration:
|
* 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)
|
void board_autoled_on(int led)
|
||||||
{
|
{
|
||||||
bool led0on = false; /* High illuminates */
|
bool led0on = false; /* High illuminates */
|
||||||
bool led1on = false; /* High illuminates */
|
bool led1on = false; /* High illuminates */
|
||||||
|
|
||||||
switch (led)
|
switch (led)
|
||||||
|
|||||||
@@ -47,9 +47,10 @@ void efm32_boardinitialize(void)
|
|||||||
{
|
{
|
||||||
#ifdef CONFIG_EFM32_UART0
|
#ifdef CONFIG_EFM32_UART0
|
||||||
/* The kit contains a board controller that is responsible for performing
|
/* The kit contains a board controller that is responsible for performing
|
||||||
* various board level tasks, such as handling the debugger and the Advanced
|
* various board level tasks, such as handling the debugger and the
|
||||||
* Energy Monitor. An interface is provided between the EFM32 and the board
|
* Advanced Energy Monitor.
|
||||||
* controller in the form of a UART connection. The connection is enabled by
|
* 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
|
* setting the EFM_BC_EN (PF7) line high, and using the lines EFM_BC_TX
|
||||||
* (PE0) and EFM_BC_RX (PE1) for communicating.
|
* (PE0) and EFM_BC_RX (PE1) for communicating.
|
||||||
*/
|
*/
|
||||||
@@ -70,7 +71,7 @@ void efm32_boardinitialize(void)
|
|||||||
* Description:
|
* Description:
|
||||||
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
||||||
* initialization call will be performed in the boot-up sequence to a
|
* 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
|
* called immediately after up_initialize() is called and just before the
|
||||||
* initial application is started. This additional initialization phase
|
* initial application is started. This additional initialization phase
|
||||||
* may be used, for example, to initialize board-specific device drivers.
|
* may be used, for example, to initialize board-specific device drivers.
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* UART0
|
/* UART0
|
||||||
*
|
*
|
||||||
* The kit contains a board controller that is responsible for performing
|
* The kit contains a board controller that is responsible for performing
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ void efm32_boardinitialize(void)
|
|||||||
* Description:
|
* Description:
|
||||||
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
||||||
* initialization call will be performed in the boot-up sequence to a
|
* 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
|
* called immediately after up_initialize() is called and just before the
|
||||||
* initial application is started. This additional initialization phase
|
* initial application is started. This additional initialization phase
|
||||||
* may be used, for example, to initialize board-specific device drivers.
|
* may be used, for example, to initialize board-specific device drivers.
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ extern "C"
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ void imx_board_initialize(void)
|
|||||||
* Description:
|
* Description:
|
||||||
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
||||||
* initialization call will be performed in the boot-up sequence to a
|
* 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
|
* called immediately after up_intitialize() is called and just before the
|
||||||
* initial application is started. This additional initialization phase
|
* initial application is started. This additional initialization phase
|
||||||
* may be used, for example, to initialize board-specific device drivers.
|
* may be used, for example, to initialize board-specific device drivers.
|
||||||
|
|||||||
@@ -60,13 +60,13 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* boards/arm/imxrt/imxrt1020-evk/include/board.h
|
* boards/arm/imxrt/imxrt1020-evk/include/board.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018-2019 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018-2019 Gregory Nutt. All rights reserved.
|
||||||
@@ -56,8 +56,10 @@
|
|||||||
|
|
||||||
#define IMXRT_VDD_SOC (0x12)
|
#define IMXRT_VDD_SOC (0x12)
|
||||||
|
|
||||||
/* Set Sys PLL (PLL2) to fOut = (24Mhz * SYS_PLL_DIV_SELECT) / ARM_PODF_DIVISOR
|
/* Set Sys PLL (PLL2) to fOut = (24Mhz * SYS_PLL_DIV_SELECT) /
|
||||||
* 528Mhz = (24Mhz * SYS_PLL_DIV_SELECT) / ARM_PODF_DIVISOR
|
* ARM_PODF_DIVISOR
|
||||||
|
* 528Mhz = (24Mhz * SYS_PLL_DIV_SELECT) /
|
||||||
|
* ARM_PODF_DIVISOR
|
||||||
* SYS_PLL_DIV_SELECT = 22
|
* SYS_PLL_DIV_SELECT = 22
|
||||||
* SYS_PODF_DIVISOR = 1
|
* SYS_PODF_DIVISOR = 1
|
||||||
* 528Mhz = (24Mhz * 22) / 1
|
* 528Mhz = (24Mhz * 22) / 1
|
||||||
@@ -74,7 +76,8 @@
|
|||||||
* IMXRT_IPG_PODF_DIVIDER = 4
|
* IMXRT_IPG_PODF_DIVIDER = 4
|
||||||
* 125Mhz = 500Mhz / 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
|
* IMXRT_PERCLK_PODF_DIVIDER = 2
|
||||||
* 62.5Mhz = 125Mhz / 2
|
* 62.5Mhz = 125Mhz / 2
|
||||||
*
|
*
|
||||||
@@ -134,7 +137,7 @@
|
|||||||
# define IMXRT_TRACE_CLK_SELECT CCM_CBCMR_TRACE_CLK_SEL_PLL2_PFD0
|
# define IMXRT_TRACE_CLK_SELECT CCM_CBCMR_TRACE_CLK_SEL_PLL2_PFD0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* LED definitions ***********************************************************/
|
/* LED definitions **********************************************************/
|
||||||
|
|
||||||
/* There is one user accessible LED status indicator located on the 1020-EVK.
|
/* There is one user accessible LED status indicator located on the 1020-EVK.
|
||||||
* The function of the LEDs include:
|
* The function of the LEDs include:
|
||||||
@@ -182,7 +185,7 @@
|
|||||||
|
|
||||||
#define BOARD_USDHC_SD_ID (0)
|
#define BOARD_USDHC_SD_ID (0)
|
||||||
|
|
||||||
/* Button definitions ********************************************************/
|
/* Button definitions *******************************************************/
|
||||||
|
|
||||||
/* The IMXRT board has three external buttons
|
/* The IMXRT board has three external buttons
|
||||||
*
|
*
|
||||||
@@ -271,13 +274,13 @@
|
|||||||
#define PIN_USDHC1_CD_GPIO (IOMUX_VSD_DEFAULT | \
|
#define PIN_USDHC1_CD_GPIO (IOMUX_VSD_DEFAULT | \
|
||||||
GPIO_PORT3 | GPIO_PIN19 ) /* SD_B0_06 */
|
GPIO_PORT3 | GPIO_PIN19 ) /* SD_B0_06 */
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
@@ -290,9 +293,9 @@ extern "C"
|
|||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|||||||
@@ -80,12 +80,10 @@
|
|||||||
* 2. SW4 (IRQ88, USER) Wakeup, GPIO5-0
|
* 2. SW4 (IRQ88, USER) Wakeup, GPIO5-0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define GPIO_SWWAKE (GPIO_INTERRUPT | GPIO_INT_FALLINGEDGE | \
|
#define GPIO_SWWAKE (GPIO_INTERRUPT | GPIO_INT_FALLINGEDGE | \
|
||||||
IOMUX_SWWAKE_DEFAULT | GPIO_PORT5 | GPIO_PIN0) /* WAKE */
|
IOMUX_SWWAKE_DEFAULT | GPIO_PORT5 | GPIO_PIN0) /* WAKE */
|
||||||
|
|
||||||
|
/* ETH Disambiguation *******************************************************/
|
||||||
/* ETH Disambiguation ********************************************************/
|
|
||||||
|
|
||||||
#define GPIO_ENET_INT (IOMUX_ENET_INT_DEFAULT | GPIO_INTERRUPT | \
|
#define GPIO_ENET_INT (IOMUX_ENET_INT_DEFAULT | GPIO_INTERRUPT | \
|
||||||
GPIO_INT_FALLINGEDGE | GPIO_PORT1 | GPIO_PIN22) /* AD_B1_06 */
|
GPIO_INT_FALLINGEDGE | GPIO_PORT1 | GPIO_PIN22) /* AD_B1_06 */
|
||||||
@@ -93,13 +91,13 @@
|
|||||||
#define GPIO_ENET_RST (GPIO_OUTPUT | IOMUX_ENET_RST_DEFAULT | \
|
#define GPIO_ENET_RST (GPIO_OUTPUT | IOMUX_ENET_RST_DEFAULT | \
|
||||||
GPIO_OUTPUT_ZERO | GPIO_PORT1 | GPIO_PIN4 ) /* AD_B0_04, Inverted logic */
|
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_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_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 */
|
#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 | \
|
#define PIN_USDHC1_CD (IOMUX_VSD_DEFAULT | \
|
||||||
GPIO_PORT3 | GPIO_PIN19 ) /* SD_B0_06 */
|
GPIO_PORT3 | GPIO_PIN19 ) /* SD_B0_06 */
|
||||||
@@ -113,13 +111,13 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -144,7 +142,7 @@ int imxrt_bringup(void);
|
|||||||
|
|
||||||
void imxrt_spidev_initialize(void);
|
void imxrt_spidev_initialize(void);
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: imxrt_mmcsd_spi_initialize
|
* Name: imxrt_mmcsd_spi_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ void imxrt_boardinitialize(void)
|
|||||||
* Description:
|
* Description:
|
||||||
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
||||||
* initialization call will be performed in the boot-up sequence to a
|
* 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
|
* called immediately after up_intitialize() is called and just before the
|
||||||
* initial application is started. This additional initialization phase
|
* initial application is started. This additional initialization phase
|
||||||
* may be used, for example, to initialize board-specific device drivers.
|
* may be used, for example, to initialize board-specific device drivers.
|
||||||
|
|||||||
@@ -34,26 +34,27 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*******************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
******************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "imxrt_flexspi_nor_flash.h"
|
#include "imxrt_flexspi_nor_flash.h"
|
||||||
|
|
||||||
/*******************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
******************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* This configuration is for an IS25LP064A. There will be slight differences for
|
/* This configuration is for an IS25LP064A.
|
||||||
* other chips but it's not as painful or scary as it looks. Just get the flash
|
* There will be slight differences for other chips but it's not as painful
|
||||||
* data sheet and work through it slowly to make sure the codes match. You will
|
* or scary as it looks. Just get the flash data sheet and work through it
|
||||||
* get something minimal up just using an 0x03 read opcode, and you can optimize
|
* slowly to make sure the codes match. You will get something minimal up
|
||||||
* for the actual flash you've got from there.
|
* 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
|
* It's best to not use the QPI because then you lose the ability to
|
||||||
* directly with the chip *except* in QPI mode until you power cycle, and the
|
* communicate directly with the chip *except* in QPI mode until you power
|
||||||
* overhead for block reads is minimal (reduces 32784 clock ticks to 32778 for
|
* cycle, and the overhead for block reads is minimal (reduces 32784 clock
|
||||||
* a 4K block read)
|
* ticks to 32778 for a 4K block read)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined (CONFIG_IMXRT1020_EVK_HYPER_FLASH)
|
#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,
|
.tag = FLEXSPI_CFG_BLK_TAG,
|
||||||
.version = FLEXSPI_CFG_BLK_VERSION,
|
.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_hold_time = 3u,
|
||||||
.cs_setup_time = 3u,
|
.cs_setup_time = 3u,
|
||||||
.column_address_width = 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) |
|
.controller_misc_option = (1u << FLEXSPIMISC_OFFSET_DDR_MODE_EN) |
|
||||||
(1u << FLEXSPIMISC_OFFSET_WORD_ADDRESSABLE_EN) |
|
(1u << FLEXSPIMISC_OFFSET_WORD_ADDRESSABLE_EN) |
|
||||||
(1u << FLEXSPIMISC_OFFSET_SAFECONFIG_FREQ_EN) |
|
(1u << FLEXSPIMISC_OFFSET_SAFECONFIG_FREQ_EN) |
|
||||||
(1u << FLEXSPIMISC_OFFSET_DIFFCLKEN),
|
(1u << FLEXSPIMISC_OFFSET_DIFFCLKEN),
|
||||||
.sflash_pad_type = SERIAL_FLASH_8PADS,
|
.sflash_pad_type = SERIAL_FLASH_8PADS,
|
||||||
.serial_clk_freq = FLEXSPI_SERIAL_CLKFREQ_133MHz,
|
.serial_clk_freq = FLEXSPI_SERIAL_CLKFREQ_133MHz,
|
||||||
.sflash_a1size = 64u * 1024u * 1024u,
|
.sflash_a1size = 64u * 1024u * 1024u,
|
||||||
@@ -86,9 +90,24 @@ const struct flexspi_nor_config_s g_flash_config =
|
|||||||
{
|
{
|
||||||
/* Read LUTs */
|
/* Read LUTs */
|
||||||
|
|
||||||
FLEXSPI_LUT_SEQ(CMD_DDR, FLEXSPI_8PAD, 0xa0, RADDR_DDR, FLEXSPI_8PAD, 0x18),
|
FLEXSPI_LUT_SEQ(CMD_DDR,
|
||||||
FLEXSPI_LUT_SEQ(CADDR_DDR, FLEXSPI_8PAD, 0x10, DUMMY_DDR, FLEXSPI_8PAD, 0x06),
|
FLEXSPI_8PAD,
|
||||||
FLEXSPI_LUT_SEQ(READ_DDR, FLEXSPI_8PAD, 0x04, STOP, FLEXSPI_1PAD, 0x0),
|
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,
|
.page_size = 512u,
|
||||||
@@ -170,3 +189,7 @@ const struct flexspi_nor_config_s g_flash_config =
|
|||||||
#else
|
#else
|
||||||
# error Boot Flash type not chosen!
|
# error Boot Flash type not chosen!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* boards/arm/imxrt/imxrt1020-evk/src/imxrt_spi.c
|
* boards/arm/imxrt/imxrt1020-evk/src/imxrt_spi.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* 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
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
@@ -57,17 +57,17 @@
|
|||||||
#if defined(CONFIG_IMXRT_LPSPI1) || defined(CONFIG_IMXRT_LPSPI2) || \
|
#if defined(CONFIG_IMXRT_LPSPI1) || defined(CONFIG_IMXRT_LPSPI2) || \
|
||||||
defined(CONFIG_IMXRT_LPSPI3) || defined(CONFIG_IMXRT_LPSPI4)
|
defined(CONFIG_IMXRT_LPSPI3) || defined(CONFIG_IMXRT_LPSPI4)
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: imxrt_spidev_initialize
|
* Name: imxrt_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to configure SPI chip select GPIO pins for the versiboard2.
|
* Called to configure SPI chip select GPIO pins for the versiboard2.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void weak_function imxrt_spidev_initialize(void)
|
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
|
* Name: imxrt_lpspi1/2/3select and imxrt_lpspi1/2/3status
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The external functions, imxrt_lpspi1/2/3select and imxrt_lpspi1/2/3status
|
* The external functions, imxrt_lpspi1/2/3select and
|
||||||
* must be provided by board-specific logic. They are implementations of
|
* imxrt_lpspi1/2/3status must be provided by board-specific logic.
|
||||||
* the select and status methods of the SPI interface defined by
|
* They are implementations of the select and status methods of the SPI
|
||||||
* struct spi_ops_s (see include/nuttx/spi/spi.h). All other methods
|
* interface defined bystruct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||||
* (including imxrt_lpspibus_initialize()) are provided by common
|
* All other methods (including imxrt_lpspibus_initialize()) are
|
||||||
* logic. To use this common SPI logic on your board:
|
* provided by common logic.
|
||||||
|
* To use this common SPI logic on your board:
|
||||||
*
|
*
|
||||||
* 1. Provide logic in imxrt_boardinitialize() to configure SPI chip select
|
* 1. Provide logic in imxrt_boardinitialize() to configure SPI chip select
|
||||||
* pins.
|
* pins.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c
|
* boards/arm/imxrt/imxrt1020-evk/src/imxrt_usbhost.c
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
@@ -16,11 +16,11 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
@@ -50,9 +50,9 @@
|
|||||||
|
|
||||||
#if defined(CONFIG_IMXRT_USBOTG) || defined(CONFIG_USBHOST)
|
#if defined(CONFIG_IMXRT_USBOTG) || defined(CONFIG_USBHOST)
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef CONFIG_USBHOST_DEFPRIO
|
#ifndef CONFIG_USBHOST_DEFPRIO
|
||||||
# define CONFIG_USBHOST_DEFPRIO 50
|
# define CONFIG_USBHOST_DEFPRIO 50
|
||||||
@@ -66,25 +66,25 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Retained device driver handle */
|
/* Retained device driver handle */
|
||||||
|
|
||||||
static struct usbhost_connection_s *g_ehciconn;
|
static struct usbhost_connection_s *g_ehciconn;
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ehci_waiter
|
* Name: ehci_waiter
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Wait for USB devices to be connected to the EHCI root hub.
|
* Wait for USB devices to be connected to the EHCI root hub.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int ehci_waiter(int argc, char *argv[])
|
static int ehci_waiter(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@@ -114,11 +114,11 @@ static int ehci_waiter(int argc, char *argv[])
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: imxrt_usbhost_initialize
|
* Name: imxrt_usbhost_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -127,7 +127,7 @@ static int ehci_waiter(int argc, char *argv[])
|
|||||||
* This function will start a thread that will monitor for device
|
* This function will start a thread that will monitor for device
|
||||||
* connection/disconnection events.
|
* connection/disconnection events.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int imxrt_usbhost_initialize(void)
|
int imxrt_usbhost_initialize(void)
|
||||||
{
|
{
|
||||||
@@ -217,7 +217,7 @@ int imxrt_usbhost_initialize(void)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: imxrt_usbhost_vbusdrive
|
* Name: imxrt_usbhost_vbusdrive
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -234,7 +234,7 @@ int imxrt_usbhost_initialize(void)
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define HCOR ((volatile struct ehci_hcor_s *)IMXRT_USBOTG_HCOR_BASE)
|
#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
|
* Name: imxrt_setup_overcurrent
|
||||||
*
|
*
|
||||||
* Description:
|
* 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
|
* Zero (OK) returned on success; a negated errno value is returned on
|
||||||
* failure.
|
* failure.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if 0 /* Not ready yet */
|
#if 0 /* Not ready yet */
|
||||||
int imxrt_setup_overcurrent(xcpt_t handler, void *arg)
|
int imxrt_setup_overcurrent(xcpt_t handler, void *arg)
|
||||||
|
|||||||
@@ -45,13 +45,13 @@
|
|||||||
#define GPIO_LED (GPIO_OUTPUT | IOMUX_LED_DEFAULT | \
|
#define GPIO_LED (GPIO_OUTPUT | IOMUX_LED_DEFAULT | \
|
||||||
GPIO_OUTPUT_ZERO | GPIO_PORT1 | GPIO_PIN9) /* AD_BO_09 */
|
GPIO_OUTPUT_ZERO | GPIO_PORT1 | GPIO_PIN9) /* AD_BO_09 */
|
||||||
|
|
||||||
/* Buttons ****************************************************************/
|
/* Buttons ******************************************************************/
|
||||||
|
|
||||||
#define GPIO_SW8 (GPIO_INTERRUPT | GPIO_INT_FALLINGEDGE | \
|
#define GPIO_SW8 (GPIO_INTERRUPT | GPIO_INT_FALLINGEDGE | \
|
||||||
IOMUX_SW_DEFAULT | \
|
IOMUX_SW_DEFAULT | \
|
||||||
GPIO_PORT5 | GPIO_PIN0 | ) /* WAKEUP */
|
GPIO_PORT5 | GPIO_PIN0 | ) /* WAKEUP */
|
||||||
|
|
||||||
/* Test Pins **************************************************************/
|
/* Test Pins ****************************************************************/
|
||||||
|
|
||||||
#define BOARD_NGPIOIN 0 /* Amount of GPIO Input pins */
|
#define BOARD_NGPIOIN 0 /* Amount of GPIO Input pins */
|
||||||
#define BOARD_NGPIOOUT 4 /* Amount of GPIO Output pins */
|
#define BOARD_NGPIOOUT 4 /* Amount of GPIO Output pins */
|
||||||
@@ -115,13 +115,13 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -146,7 +146,7 @@ int imxrt_bringup(void);
|
|||||||
|
|
||||||
void imxrt_spidev_initialize(void);
|
void imxrt_spidev_initialize(void);
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: imxrt_mmcsd_spi_initialize
|
* Name: imxrt_mmcsd_spi_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ void imxrt_boardinitialize(void)
|
|||||||
* Description:
|
* Description:
|
||||||
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
||||||
* initialization call will be performed in the boot-up sequence to a
|
* 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
|
* called immediately after up_intitialize() is called and just before the
|
||||||
* initial application is started. This additional initialization phase
|
* initial application is started. This additional initialization phase
|
||||||
* may be used, for example, to initialize board-specific device drivers.
|
* 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
|
* boards/arm/imxrt/imxrt1050-evk/src/imxrt_mmcsd_spi.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Greg Nutt. All rights reserved.
|
* Copyright (C) 2018 Greg Nutt. All rights reserved.
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_MMCSD_SPI
|
#ifdef CONFIG_MMCSD_SPI
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -63,14 +63,15 @@
|
|||||||
# error "SD driver requires CONFIG_DISABLE_MOUNTPOINT to be disabled"
|
# error "SD driver requires CONFIG_DISABLE_MOUNTPOINT to be disabled"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Private Definitions
|
* Private Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static const int SD_SPI_PORT = CONFIG_NSH_MMCSDSPIPORTNO; /* SD is connected to SPI1 port */
|
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 */
|
static const int SD_SLOT_NO = 0; /* There is only one SD slot */
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* 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.
|
* Then we don't need to Card Detect callback here.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: imxrt_spi1register
|
* Name: imxrt_spi1register
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -98,7 +99,7 @@ int imxrt_lpspi1register(struct spi_dev_s *dev, spi_mediachange_t callback,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: imxrt_mmcsd_spi_initialize
|
* Name: imxrt_mmcsd_spi_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -208,7 +208,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* boards/arm/imxrt/imxrt1060-evk/src/imxrt_mmcsd_spi.c
|
* boards/arm/imxrt/imxrt1060-evk/src/imxrt_mmcsd_spi.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Greg Nutt. All rights reserved.
|
* Copyright (C) 2018 Greg Nutt. All rights reserved.
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_MMCSD_SPI
|
#ifdef CONFIG_MMCSD_SPI
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -63,14 +63,15 @@
|
|||||||
# error "SD driver requires CONFIG_DISABLE_MOUNTPOINT to be disabled"
|
# error "SD driver requires CONFIG_DISABLE_MOUNTPOINT to be disabled"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Private Definitions
|
* Private Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static const int SD_SPI_PORT = CONFIG_NSH_MMCSDSPIPORTNO; /* SD is connected to SPI1 port */
|
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 */
|
static const int SD_SLOT_NO = 0; /* There is only one SD slot */
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* 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.
|
* Then we don't need to Card Detect callback here.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: imxrt_spi1register
|
* Name: imxrt_spi1register
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -98,7 +99,7 @@ int imxrt_lpspi1register(struct spi_dev_s *dev, spi_mediachange_t callback,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: imxrt_mmcsd_spi_initialize
|
* Name: imxrt_mmcsd_spi_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* boards/arm/imxrt/imxrt1060-evk/src/imxrt_usbhost.c
|
* boards/arm/imxrt/imxrt1060-evk/src/imxrt_usbhost.c
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
@@ -16,11 +16,11 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
@@ -50,9 +50,9 @@
|
|||||||
|
|
||||||
#if defined(CONFIG_IMXRT_USBOTG) || defined(CONFIG_USBHOST)
|
#if defined(CONFIG_IMXRT_USBOTG) || defined(CONFIG_USBHOST)
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef CONFIG_USBHOST_DEFPRIO
|
#ifndef CONFIG_USBHOST_DEFPRIO
|
||||||
# define CONFIG_USBHOST_DEFPRIO 50
|
# define CONFIG_USBHOST_DEFPRIO 50
|
||||||
@@ -66,25 +66,25 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Retained device driver handle */
|
/* Retained device driver handle */
|
||||||
|
|
||||||
static struct usbhost_connection_s *g_ehciconn;
|
static struct usbhost_connection_s *g_ehciconn;
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ehci_waiter
|
* Name: ehci_waiter
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Wait for USB devices to be connected to the EHCI root hub.
|
* Wait for USB devices to be connected to the EHCI root hub.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int ehci_waiter(int argc, char *argv[])
|
static int ehci_waiter(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@@ -114,11 +114,11 @@ static int ehci_waiter(int argc, char *argv[])
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: imxrt_usbhost_initialize
|
* Name: imxrt_usbhost_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -127,7 +127,7 @@ static int ehci_waiter(int argc, char *argv[])
|
|||||||
* This function will start a thread that will monitor for device
|
* This function will start a thread that will monitor for device
|
||||||
* connection/disconnection events.
|
* connection/disconnection events.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int imxrt_usbhost_initialize(void)
|
int imxrt_usbhost_initialize(void)
|
||||||
{
|
{
|
||||||
@@ -215,7 +215,7 @@ int imxrt_usbhost_initialize(void)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: imxrt_usbhost_vbusdrive
|
* Name: imxrt_usbhost_vbusdrive
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -232,7 +232,7 @@ int imxrt_usbhost_initialize(void)
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define HCOR ((volatile struct ehci_hcor_s *)IMXRT_USBOTG_HCOR_BASE)
|
#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
|
* Name: imxrt_setup_overcurrent
|
||||||
*
|
*
|
||||||
* Description:
|
* 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
|
* Zero (OK) returned on success; a negated errno value is returned on
|
||||||
* failure.
|
* failure.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if 0 /* Not ready yet */
|
#if 0 /* Not ready yet */
|
||||||
int imxrt_setup_overcurrent(xcpt_t handler, void *arg)
|
int imxrt_setup_overcurrent(xcpt_t handler, void *arg)
|
||||||
|
|||||||
@@ -116,7 +116,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
# ifndef __ASSEMBLY__
|
# ifndef __ASSEMBLY__
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/********************************************************************************
|
/****************************************************************************
|
||||||
* boards/arm/kinetis/freedom-k28f/include/board.h
|
* boards/arm/kinetis/freedom-k28f/include/board.h
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
@@ -16,14 +16,14 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
********************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __BOARDS_ARM_KINETIS_FREEDOM_K28F_INCLUDE_BOARD_H
|
#ifndef __BOARDS_ARM_KINETIS_FREEDOM_K28F_INCLUDE_BOARD_H
|
||||||
#define __BOARDS_ARM_KINETIS_FREEDOM_K28F_INCLUDE_BOARD_H
|
#define __BOARDS_ARM_KINETIS_FREEDOM_K28F_INCLUDE_BOARD_H
|
||||||
|
|
||||||
/********************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
********************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
@@ -34,11 +34,11 @@
|
|||||||
# include <arch/chip/kinetis_mcg.h>
|
# include <arch/chip/kinetis_mcg.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/********************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
********************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Clocking *********************************************************************/
|
/* Clocking *****************************************************************/
|
||||||
|
|
||||||
/* The Freedom K28F uses a 12MHz external Oscillator.
|
/* The Freedom K28F uses a 12MHz external Oscillator.
|
||||||
* The Kinetis MCU startup from an internal digitally-controlled oscillator
|
* The Kinetis MCU startup from an internal digitally-controlled oscillator
|
||||||
@@ -114,7 +114,8 @@
|
|||||||
BOARD_SIM_CLKDIV2_USBFRAC)
|
BOARD_SIM_CLKDIV2_USBFRAC)
|
||||||
#endif
|
#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 * ((PLLFLLFRAC+1) / (PLLFLLDIV+1))
|
||||||
* SIM_CLKDIV3_FREQ = BOARD_SOPT2_FREQ / (PLLFLLDIV+1) * (PLLFLLFRAC+1)
|
* SIM_CLKDIV3_FREQ = BOARD_SOPT2_FREQ / (PLLFLLDIV+1) * (PLLFLLFRAC+1)
|
||||||
* 72MHz = 144MHz / (1 + 1) * (1 + 0)
|
* 72MHz = 144MHz / (1 + 1) * (1 + 0)
|
||||||
@@ -132,7 +133,7 @@
|
|||||||
#define BOARD_TPM_CLKSRC SIM_SOPT2_TPMSRC_MCGCLK
|
#define BOARD_TPM_CLKSRC SIM_SOPT2_TPMSRC_MCGCLK
|
||||||
#define BOARD_TPM_FREQ BOARD_SIM_CLKDIV3_FREQ
|
#define BOARD_TPM_FREQ BOARD_SIM_CLKDIV3_FREQ
|
||||||
|
|
||||||
/* SDHC clocking ****************************************************************/
|
/* SDHC clocking ************************************************************/
|
||||||
|
|
||||||
/* SDCLK configurations corresponding to various modes of operation.
|
/* SDCLK configurations corresponding to various modes of operation.
|
||||||
* Formula is:
|
* Formula is:
|
||||||
@@ -214,7 +215,7 @@
|
|||||||
#define GPIO_FTM2_CH0OUT PIN_FTM2_CH0 /* Pin 25: PTB18 */
|
#define GPIO_FTM2_CH0OUT PIN_FTM2_CH0 /* Pin 25: PTB18 */
|
||||||
#define GPIO_FTM2_CH1OUT PIN_FTM2_CH1 /* Pin 32: PTB19 */
|
#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
|
/* A single LED is available driven by PTC5. The LED is grounded so bringing
|
||||||
* PTC5 high will illuminate the LED.
|
* PTC5 high will illuminate the LED.
|
||||||
@@ -246,11 +247,11 @@
|
|||||||
#define LED_ASSERTION 3 /* STATUS LED=no change */
|
#define LED_ASSERTION 3 /* STATUS LED=no change */
|
||||||
#define LED_PANIC 3 /* STATUS LED=flashing */
|
#define LED_PANIC 3 /* STATUS LED=flashing */
|
||||||
|
|
||||||
/* Button definitions ***********************************************************/
|
/* Button definitions *******************************************************/
|
||||||
|
|
||||||
/* The freedom-k28f board has no standard GPIO contact buttons */
|
/* 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:
|
/* The Freedom K28F has five LPUARTs with pin availability as follows:
|
||||||
*
|
*
|
||||||
@@ -411,7 +412,7 @@
|
|||||||
# define PIN_SDHC0_DCLK PIN_SDHC0_DCLK_1
|
# define PIN_SDHC0_DCLK PIN_SDHC0_DCLK_1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* LED definitions **************************************************************/
|
/* LED definitions **********************************************************/
|
||||||
|
|
||||||
/* The Freedom K28F has a single RGB LED driven by the K28F as follows:
|
/* 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 */
|
#define LED_PANIC 4 /* The system has crashed FLASH OFF OFF */
|
||||||
#undef LED_IDLE /* K28 is in sleep mode (Not used) */
|
#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,
|
/* Two push buttons, SW2 and SW3, are available on FRDM-K28F board,
|
||||||
* where SW2 is connected to PTA4 and SW3 is connected to PTD0.
|
* where SW2 is connected to PTA4 and SW3 is connected to PTD0.
|
||||||
|
|||||||
@@ -197,7 +197,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ void kinetis_boardinitialize(void)
|
|||||||
* Description:
|
* Description:
|
||||||
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
||||||
* initialization call will be performed in the boot-up sequence to a
|
* 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
|
* called immediately after up_initialize() is called and just before the
|
||||||
* initial application is started. This additional initialization phase
|
* initial application is started. This additional initialization phase
|
||||||
* may be used, for example, to initialize board-specific device drivers.
|
* may be used, for example, to initialize board-specific device drivers.
|
||||||
|
|||||||
@@ -45,10 +45,10 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_KINETIS_I2C0
|
#ifdef CONFIG_KINETIS_I2C0
|
||||||
FAR struct i2c_master_s* g_i2c0_dev;
|
FAR struct i2c_master_s *g_i2c0_dev;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_KINETIS_I2C1
|
#ifdef CONFIG_KINETIS_I2C1
|
||||||
FAR struct i2c_master_s* g_i2c1_dev;
|
FAR struct i2c_master_s *g_i2c1_dev;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -48,7 +48,8 @@
|
|||||||
* Name: k28_spidev_initialize
|
* Name: k28_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* 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
|
* Name: kinetis_spi0/1/2select and kinetis_spi0/1/2status
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The external functions, kinetis_spi0/1/2select and kinetis_spi0/1/2status
|
* The external functions, kinetis_spi0/1/2select and
|
||||||
* must be provided by board-specific logic.
|
* kinetis_spi0/1/2status must be provided by board-specific logic.
|
||||||
* They are implementations of the select and status methods of the SPI
|
* 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).
|
* interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||||
* All other methods (including kinetis_spibus_initialize())
|
* All other methods (including kinetis_spibus_initialize())
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ void k28_usbdev_initialize(void)
|
|||||||
* Description:
|
* Description:
|
||||||
* If USB is supported and the board supports a pullup via GPIO (for USB
|
* If USB is supported and the board supports a pullup via GPIO (for USB
|
||||||
* software connect and disconnect), then the board software must provide
|
* software connect and disconnect), then the board software must provide
|
||||||
* kinetis_pullup. See include/nuttx/usb/usbdev.h for additional description
|
* kinetis_pullup. See include/nuttx/usb/usbdev.h for additional
|
||||||
* of this method.
|
* description of this method.
|
||||||
* Alternatively, if no pull-up GPIO the following EXTERN can be redefined
|
* Alternatively, if no pull-up GPIO the following EXTERN can be redefined
|
||||||
* to be NULL.
|
* to be NULL.
|
||||||
*
|
*
|
||||||
@@ -108,7 +108,7 @@ int kinetis_usbpullup(FAR struct usbdev_s *dev, bool enable)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: kinetis_usbsuspend
|
* Name: kinetis_usbsuspend
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* boards/arm/kinetis/freedom-k28f/src/k28_usbhshost.c
|
* boards/arm/kinetis/freedom-k28f/src/k28_usbhshost.c
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
@@ -16,11 +16,11 @@
|
|||||||
* License for the specific language governing permissions and limitations
|
* License for the specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
@@ -57,9 +57,9 @@
|
|||||||
|
|
||||||
#if defined(CONFIG_KINETIS_USBHS) && defined(CONFIG_USBHOST)
|
#if defined(CONFIG_KINETIS_USBHS) && defined(CONFIG_USBHOST)
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define BOARD_USB_PHY_D_CAL (0x0CU)
|
#define BOARD_USB_PHY_D_CAL (0x0CU)
|
||||||
#define BOARD_USB_PHY_TXCAL45DP (0x06U)
|
#define BOARD_USB_PHY_TXCAL45DP (0x06U)
|
||||||
@@ -77,9 +77,9 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Private Function Prototypes
|
* Private Function Prototypes
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int ehci_waiter(int argc, char *argv[]);
|
static int ehci_waiter(int argc, char *argv[]);
|
||||||
static void ehci_hwinit(void);
|
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);
|
static void usb_msc_disconnect(FAR void *arg);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Retained device driver handle */
|
/* 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];
|
static struct wdog_s g_umount_tmr[CONFIG_FRDMK28F_USB_AUTOMOUNT_NUM_BLKDEV];
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ehci_waiter
|
* Name: ehci_waiter
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Wait for USB devices to be connected to the EHCI root hub.
|
* Wait for USB devices to be connected to the EHCI root hub.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int ehci_waiter(int argc, char *argv[])
|
static int ehci_waiter(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@@ -144,13 +144,13 @@ static int ehci_waiter(int argc, char *argv[])
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: ehci_hw_init
|
* Name: ehci_hw_init
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Initialize PHY and clocks for EHCI
|
* Initialize PHY and clocks for EHCI
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void ehci_hwinit(void)
|
static void ehci_hwinit(void)
|
||||||
{
|
{
|
||||||
@@ -241,13 +241,13 @@ static void ehci_hwinit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ifdef HAVE_USB_AUTOMOUNTER
|
# ifdef HAVE_USB_AUTOMOUNTER
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: usb_msc_connect
|
* Name: usb_msc_connect
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Mount the USB mass storage device
|
* Mount the USB mass storage device
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void usb_msc_connect(FAR void *arg)
|
static void usb_msc_connect(FAR void *arg)
|
||||||
{
|
{
|
||||||
@@ -258,7 +258,8 @@ static void usb_msc_connect(FAR void *arg)
|
|||||||
char blkdev[32];
|
char blkdev[32];
|
||||||
char mntpnt[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]);
|
wd_cancel(&g_umount_tmr[index]);
|
||||||
|
|
||||||
@@ -282,7 +283,7 @@ static void usb_msc_connect(FAR void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: unmount_retry_timeout
|
* Name: unmount_retry_timeout
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -300,7 +301,7 @@ static void usb_msc_connect(FAR void *arg)
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void unmount_retry_timeout(wdparm_t arg)
|
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);
|
usbhost_msc_notifier_signal(WORK_USB_MSC_DISCONNECT, sdchar);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: usb_msc_disconnect
|
* Name: usb_msc_disconnect
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Unmount the USB mass storage device
|
* Unmount the USB mass storage device
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void usb_msc_disconnect(FAR void *arg)
|
static void usb_msc_disconnect(FAR void *arg)
|
||||||
{
|
{
|
||||||
@@ -332,7 +333,8 @@ static void usb_msc_disconnect(FAR void *arg)
|
|||||||
|
|
||||||
char mntpnt[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]);
|
wd_cancel(&g_umount_tmr[index]);
|
||||||
|
|
||||||
@@ -379,11 +381,11 @@ static void usb_msc_disconnect(FAR void *arg)
|
|||||||
}
|
}
|
||||||
# endif /* HAVE_USB_AUTOMOUNTER */
|
# endif /* HAVE_USB_AUTOMOUNTER */
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: k28_usbhost_initialize
|
* Name: k28_usbhost_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -392,7 +394,7 @@ static void usb_msc_disconnect(FAR void *arg)
|
|||||||
* This function will start a thread that will monitor for device
|
* This function will start a thread that will monitor for device
|
||||||
* connection/disconnection events.
|
* connection/disconnection events.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int k28_usbhost_initialize(void)
|
int k28_usbhost_initialize(void)
|
||||||
{
|
{
|
||||||
@@ -489,7 +491,7 @@ int k28_usbhost_initialize(void)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: kinetis_usbhost_vbusdrive
|
* Name: kinetis_usbhost_vbusdrive
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -506,7 +508,7 @@ int k28_usbhost_initialize(void)
|
|||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define HCOR ((volatile struct ehci_hcor_s *)KINETIS_USBHS_HCOR_BASE)
|
#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
|
* Name: kinetis_setup_overcurrent
|
||||||
*
|
*
|
||||||
* Description:
|
* 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
|
* Zero (OK) returned on success; a negated errno value is returned on
|
||||||
* failure.
|
* failure.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if 0 /* Not ready yet */
|
#if 0 /* Not ready yet */
|
||||||
int kinetis_setup_overcurrent(xcpt_t handler, void *arg)
|
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)
|
#define GPIO_LED_B (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTB | PIN21)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
* under the License.
|
* under the License.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* The Freedom K64F has a single RGB LED driven by the K64F as follows:
|
/* The Freedom K64F has a single RGB LED driven by the K64F as follows:
|
||||||
*
|
*
|
||||||
* LED K64
|
* LED K64
|
||||||
|
|||||||
@@ -259,7 +259,8 @@ void k64_automount_initialize(void)
|
|||||||
* Name: k64_automount_event
|
* Name: k64_automount_event
|
||||||
*
|
*
|
||||||
* Description:
|
* 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.
|
* It has already scheduled the MMC/SD block driver operations.
|
||||||
* Now we need to schedule the auto-mount event which will occur with a
|
* Now we need to schedule the auto-mount event which will occur with a
|
||||||
* substantial delay to make sure that everything has settle down.
|
* 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);
|
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;
|
g_sdhc.inserted = inserted;
|
||||||
sdhc_mediachange(g_sdhc.sdhc, inserted);
|
sdhc_mediachange(g_sdhc.sdhc, inserted);
|
||||||
@@ -180,7 +182,8 @@ int k64_sdhc_initialize(void)
|
|||||||
ret = mmcsd_slotinitialize(MMSCD_MINOR, g_sdhc.sdhc);
|
ret = mmcsd_slotinitialize(MMSCD_MINOR, g_sdhc.sdhc);
|
||||||
if (ret != OK)
|
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);
|
ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,8 @@
|
|||||||
* Name: k64_spidev_initialize
|
* Name: k64_spidev_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* 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.
|
* the way your board is configured.
|
||||||
* 3. Add a call to kinetis_spibus_initialize() in your low level
|
* 3. Add a call to kinetis_spibus_initialize() in your low level
|
||||||
* application initialization logic
|
* application initialization logic
|
||||||
* 4. The handle returned by kinetis_spibus_initialize() may then be used to
|
* 4. The handle returned by kinetis_spibus_initialize() may then be used
|
||||||
* bind the SPI driver to higher level logic (e.g., calling
|
* to bind the SPI driver to higher level logic (e.g., calling
|
||||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||||
* the SPI MMC/SD driver).
|
* the SPI MMC/SD driver).
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -210,9 +210,9 @@
|
|||||||
* low-power wake up signal. Also, only SW3 can be a non-maskable interrupt.
|
* low-power wake up signal. Also, only SW3 can be a non-maskable interrupt.
|
||||||
*
|
*
|
||||||
* Switch GPIO Function
|
* Switch GPIO Function
|
||||||
* --------- ---------------------------------------------------------------
|
* -------- ---------------------------------------------------------------
|
||||||
* SW2 PTD11/LLWU_P25/SPI2_PCS0/SDHC0_CLKIN/LPUART0_CTS/FB_A19
|
* 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
|
* 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)
|
#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)
|
#define PIN_SPI1_PCS0 (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTD | PIN4)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public data
|
* Public Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -359,7 +359,8 @@ void k66_automount_initialize(void);
|
|||||||
* Name: k66_automount_event
|
* Name: k66_automount_event
|
||||||
*
|
*
|
||||||
* Description:
|
* 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.
|
* It has already scheduled the MMC/SD block driver operations.
|
||||||
* Now we need to schedule the auto-mount event which will occur with a
|
* Now we need to schedule the auto-mount event which will occur with a
|
||||||
* substantial delay to make sure that everything has settle down.
|
* 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 const struct k66_automount_config_s *config;
|
||||||
FAR struct k66_automount_state_s *state;
|
FAR struct k66_automount_state_s *state;
|
||||||
@@ -270,11 +271,12 @@ void k66_automount_initialize(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/****************************************************************************
|
||||||
* Name: k66_automount_event
|
* Name: k66_automount_event
|
||||||
*
|
*
|
||||||
* Description:
|
* 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.
|
* It has already scheduled the MMC/SD block driver operations.
|
||||||
* Now we need to schedule the auto-mount event which will occur with a
|
* Now we need to schedule the auto-mount event which will occur with a
|
||||||
* substantial delay to make sure that everything has settle down.
|
* substantial delay to make sure that everything has settle down.
|
||||||
@@ -292,7 +294,7 @@ void k66_automount_initialize(void)
|
|||||||
* Assumptions:
|
* Assumptions:
|
||||||
* Interrupts are disabled.
|
* Interrupts are disabled.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void k66_automount_event(bool inserted)
|
void k66_automount_event(bool inserted)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
#ifdef CONFIG_BOARDCTL_RESET
|
#ifdef CONFIG_BOARDCTL_RESET
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -52,13 +52,13 @@
|
|||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Name: k66_rtc_initialize
|
* Name: k66_rtc_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called to initialize the RTC FREEDOM-K66F board.
|
* Called to initialize the RTC FREEDOM-K66F board.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int k66_rtc_initialize(void)
|
int k66_rtc_initialize(void)
|
||||||
{
|
{
|
||||||
@@ -88,5 +88,6 @@ int k66_rtc_initialize(void)
|
|||||||
ret);
|
ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,8 +103,11 @@
|
|||||||
# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
|
# define BOARD_SDHC_SD4MODE_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV2
|
||||||
# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(2)
|
# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(2)
|
||||||
#else
|
#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_PRESCALER SDHC_SYSCTL_SDCLKFS_DIV16
|
||||||
# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(15)
|
# define BOARD_SDHC_SD4MODE_DIVISOR SDHC_SYSCTL_DVS_DIV(15)
|
||||||
#endif
|
#endif
|
||||||
@@ -138,9 +141,9 @@
|
|||||||
|
|
||||||
/* On-Board Connections
|
/* On-Board Connections
|
||||||
*
|
*
|
||||||
* ------------------- -------------------------- -------- -------------------
|
* ------------------- -------------------------- -------- ------------------
|
||||||
* FEATURE CONNECTION PORT/PIN PIN FUNCTION
|
* FEATURE CONNECTION PORT/PIN PIN FUNCTION
|
||||||
* ------------------- -------------------------- -------- -------------------
|
* ------------------- -------------------------- -------- ------------------
|
||||||
* Audio Jack Output Audio Amp On PTE28 PTE28
|
* Audio Jack Output Audio Amp On PTE28 PTE28
|
||||||
* Audio Output DAC1_OUT DAC1_OUT
|
* Audio Output DAC1_OUT DAC1_OUT
|
||||||
* Volume Up PTD10 PTD10
|
* Volume Up PTD10 PTD10
|
||||||
@@ -168,9 +171,9 @@
|
|||||||
#define PIN_FTM1_CH0 PIN_FTM1_CH0_1
|
#define PIN_FTM1_CH0 PIN_FTM1_CH0_1
|
||||||
|
|
||||||
/* Connections via the General Purpose Tower Plug-in (TWRPI) Socket
|
/* Connections via the General Purpose Tower Plug-in (TWRPI) Socket
|
||||||
* ------------------- -------------------------- -------- -------------------
|
* ------------------- -------------------------- -------- ------------------
|
||||||
* FEATURE CONNECTION PORT/PIN PIN FUNCTION
|
* FEATURE CONNECTION PORT/PIN PIN FUNCTION
|
||||||
* ------------------- -------------------------- -------- -------------------
|
* ------------------- -------------------------- -------- ------------------
|
||||||
* General Purpose TWRPI AN0 (J8 Pin 8) ? ADC0_DP0/ADC1_DP3
|
* General Purpose TWRPI AN0 (J8 Pin 8) ? ADC0_DP0/ADC1_DP3
|
||||||
* TWRPI Socket TWRPI AN1 (J8 Pin 9) ? ADC0_DM0/ADC1_DM3
|
* TWRPI Socket TWRPI AN1 (J8 Pin 9) ? ADC0_DM0/ADC1_DM3
|
||||||
* TWRPI AN2 (J8 Pin 12) ? ADC1_DP0/ADC0_DP3
|
* TWRPI AN2 (J8 Pin 12) ? ADC1_DP0/ADC0_DP3
|
||||||
|
|||||||
@@ -140,7 +140,9 @@ static void kinetis_mediachange(void)
|
|||||||
|
|
||||||
if (inserted != g_nsh.inserted)
|
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;
|
g_nsh.inserted = inserted;
|
||||||
sdhc_mediachange(g_nsh.sdhc, 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);
|
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_nsh.sdhc);
|
||||||
if (ret != OK)
|
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);
|
ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user