diff options
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/boards/evkmimxrt1015/board.h')
-rw-r--r-- | lib/chibios-contrib/ext/mcux-sdk/boards/evkmimxrt1015/board.h | 147 |
1 files changed, 147 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/boards/evkmimxrt1015/board.h b/lib/chibios-contrib/ext/mcux-sdk/boards/evkmimxrt1015/board.h new file mode 100644 index 000000000..92fb755d7 --- /dev/null +++ b/lib/chibios-contrib/ext/mcux-sdk/boards/evkmimxrt1015/board.h | |||
@@ -0,0 +1,147 @@ | |||
1 | /* | ||
2 | * Copyright 2018-2019 NXP | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * SPDX-License-Identifier: BSD-3-Clause | ||
6 | */ | ||
7 | |||
8 | #ifndef _BOARD_H_ | ||
9 | #define _BOARD_H_ | ||
10 | |||
11 | #include "clock_config.h" | ||
12 | #include "fsl_common.h" | ||
13 | #include "fsl_gpio.h" | ||
14 | |||
15 | /******************************************************************************* | ||
16 | * Definitions | ||
17 | ******************************************************************************/ | ||
18 | /*! @brief The board name */ | ||
19 | #define BOARD_NAME "MIMXRT1015-EVK" | ||
20 | |||
21 | /* The UART to use for debug messages. */ | ||
22 | #define BOARD_DEBUG_UART_TYPE kSerialPort_Uart | ||
23 | #define BOARD_DEBUG_UART_BASEADDR (uint32_t) LPUART1 | ||
24 | #define BOARD_DEBUG_UART_INSTANCE 1U | ||
25 | |||
26 | #define BOARD_DEBUG_UART_CLK_FREQ BOARD_DebugConsoleSrcFreq() | ||
27 | |||
28 | #define BOARD_UART_IRQ LPUART1_IRQn | ||
29 | #define BOARD_UART_IRQ_HANDLER LPUART1_IRQHandler | ||
30 | |||
31 | #ifndef BOARD_DEBUG_UART_BAUDRATE | ||
32 | #define BOARD_DEBUG_UART_BAUDRATE (115200U) | ||
33 | #endif /* BOARD_DEBUG_UART_BAUDRATE */ | ||
34 | |||
35 | /* @Brief Board accelerator sensor configuration */ | ||
36 | #define BOARD_ACCEL_I2C_BASEADDR LPI2C1 | ||
37 | #define BOARD_ACCEL_I2C_CLOCK_SOURCE_SELECT (0U) | ||
38 | #define BOARD_ACCEL_I2C_CLOCK_SOURCE_DIVIDER (5U) | ||
39 | #define BOARD_ACCEL_I2C_CLOCK_FREQ (CLOCK_GetFreq(kCLOCK_Usb1PllClk) / 8 / (BOARD_ACCEL_I2C_CLOCK_SOURCE_DIVIDER + 1U)) | ||
40 | |||
41 | #define BOARD_CODEC_I2C_BASEADDR LPI2C1 | ||
42 | #define BOARD_CODEC_I2C_INSTANCE 1U | ||
43 | #define BOARD_CODEC_I2C_CLOCK_SOURCE_SELECT (0U) | ||
44 | #define BOARD_CODEC_I2C_CLOCK_SOURCE_DIVIDER (5U) | ||
45 | #define BOARD_CODEC_I2C_CLOCK_FREQ (10000000U) | ||
46 | |||
47 | /*! @brief The USER_LED used for board */ | ||
48 | #define LOGIC_LED_ON (0U) | ||
49 | #define LOGIC_LED_OFF (1U) | ||
50 | #ifndef BOARD_USER_LED_GPIO | ||
51 | #define BOARD_USER_LED_GPIO GPIO3 | ||
52 | #endif | ||
53 | #ifndef BOARD_USER_LED_GPIO_PIN | ||
54 | #define BOARD_USER_LED_GPIO_PIN (21U) | ||
55 | #endif | ||
56 | |||
57 | #define USER_LED_INIT(output) \ | ||
58 | GPIO_PinWrite(BOARD_USER_LED_GPIO, BOARD_USER_LED_GPIO_PIN, output); \ | ||
59 | BOARD_USER_LED_GPIO->GDIR |= (1U << BOARD_USER_LED_GPIO_PIN) /*!< Enable target USER_LED */ | ||
60 | #define USER_LED_ON() \ | ||
61 | GPIO_PortClear(BOARD_USER_LED_GPIO, 1U << BOARD_USER_LED_GPIO_PIN) /*!< Turn off target USER_LED */ | ||
62 | #define USER_LED_OFF() GPIO_PortSet(BOARD_USER_LED_GPIO, 1U << BOARD_USER_LED_GPIO_PIN) /*!<Turn on target USER_LED*/ | ||
63 | #define USER_LED_TOGGLE() \ | ||
64 | GPIO_PinWrite(BOARD_USER_LED_GPIO, BOARD_USER_LED_GPIO_PIN, \ | ||
65 | 0x1 ^ GPIO_PinRead(BOARD_USER_LED_GPIO, BOARD_USER_LED_GPIO_PIN)) /*!< Toggle target USER_LED */ | ||
66 | |||
67 | /*! @brief Define the port interrupt number for the board switches */ | ||
68 | #ifndef BOARD_USER_BUTTON_GPIO | ||
69 | #define BOARD_USER_BUTTON_GPIO GPIO2 | ||
70 | #endif | ||
71 | #ifndef BOARD_USER_BUTTON_GPIO_PIN | ||
72 | #define BOARD_USER_BUTTON_GPIO_PIN (9U) | ||
73 | #endif | ||
74 | #define BOARD_USER_BUTTON_IRQ GPIO2_Combined_0_15_IRQn | ||
75 | #define BOARD_USER_BUTTON_IRQ_HANDLER GPIO2_Combined_0_15_IRQHandler | ||
76 | #define BOARD_USER_BUTTON_NAME "SW4" | ||
77 | |||
78 | /*! @brief The flash size */ | ||
79 | #define BOARD_FLASH_SIZE (0x1000000U) | ||
80 | |||
81 | /* USB PHY condfiguration */ | ||
82 | #define BOARD_USB_PHY_D_CAL (0x0CU) | ||
83 | #define BOARD_USB_PHY_TXCAL45DP (0x06U) | ||
84 | #define BOARD_USB_PHY_TXCAL45DM (0x06U) | ||
85 | |||
86 | #define BOARD_ARDUINO_INT_IRQ (GPIO1_Combined_16_31_IRQn) | ||
87 | #define BOARD_ARDUINO_I2C_IRQ (LPI2C1_IRQn) | ||
88 | #define BOARD_ARDUINO_I2C_INDEX (1) | ||
89 | |||
90 | /*! @brief The WIFI-QCA shield pin. */ | ||
91 | #define BOARD_INITSILEX2401SHIELD_PWRON_GPIO GPIO2 /*!< GPIO device name: GPIO */ | ||
92 | #define BOARD_INITSILEX2401SHIELD_PWRON_PORT 2U /*!< PORT device index: 2 */ | ||
93 | #define BOARD_INITSILEX2401SHIELD_PWRON_PIN 7U /*!< PIO3 pin index: 7 */ | ||
94 | #define BOARD_INITSILEX2401SHIELD_PWRON_PIN_NAME GPIO2_07 /*!< Pin name */ | ||
95 | #define BOARD_INITSILEX2401SHIELD_PWRON_LABEL "PWRON" /*!< Label */ | ||
96 | #define BOARD_INITSILEX2401SHIELD_PWRON_NAME "PWRON" /*!< Identifier name */ | ||
97 | #define BOARD_INITSILEX2401SHIELD_PWRON_DIRECTION kGPIO_DigitalOutput /*!< Direction */ | ||
98 | |||
99 | #define BOARD_INITSILEX2401SHIELD_IRQ_GPIO GPIO2 /*!< GPIO device name: GPIO */ | ||
100 | #define BOARD_INITSILEX2401SHIELD_IRQ_PORT 2U /*!< PORT device index: 2 */ | ||
101 | #define BOARD_INITSILEX2401SHIELD_IRQ_PIN 6U /*!< PIO2 pin index: 6 */ | ||
102 | #define BOARD_INITSILEX2401SHIELD_IRQ_PIN_NAME GPIO2_06 /*!< Pin name */ | ||
103 | #define BOARD_INITSILEX2401SHIELD_IRQ_LABEL "IRQ" /*!< Label */ | ||
104 | #define BOARD_INITSILEX2401SHIELD_IRQ_NAME "IRQ" /*!< Identifier name */ | ||
105 | #define BOARD_INITSILEX2401SHIELD_IRQ_DIRECTION kGPIO_DigitalInput /*!< Direction */ | ||
106 | |||
107 | #if defined(__cplusplus) | ||
108 | extern "C" { | ||
109 | #endif /* __cplusplus */ | ||
110 | |||
111 | /******************************************************************************* | ||
112 | * API | ||
113 | ******************************************************************************/ | ||
114 | uint32_t BOARD_DebugConsoleSrcFreq(void); | ||
115 | |||
116 | void BOARD_InitDebugConsole(void); | ||
117 | void BOARD_ConfigMPU(void); | ||
118 | #if defined(SDK_I2C_BASED_COMPONENT_USED) && SDK_I2C_BASED_COMPONENT_USED | ||
119 | void BOARD_InitDebugConsole(void); | ||
120 | void BOARD_LPI2C_Init(LPI2C_Type *base, uint32_t clkSrc_Hz); | ||
121 | status_t BOARD_LPI2C_Send(LPI2C_Type *base, | ||
122 | uint8_t deviceAddress, | ||
123 | uint32_t subAddress, | ||
124 | uint8_t subaddressSize, | ||
125 | uint8_t *txBuff, | ||
126 | uint8_t txBuffSize); | ||
127 | status_t BOARD_LPI2C_Receive(LPI2C_Type *base, | ||
128 | uint8_t deviceAddress, | ||
129 | uint32_t subAddress, | ||
130 | uint8_t subaddressSize, | ||
131 | uint8_t *rxBuff, | ||
132 | uint8_t rxBuffSize); | ||
133 | void BOARD_Accel_I2C_Init(void); | ||
134 | status_t BOARD_Accel_I2C_Send(uint8_t deviceAddress, uint32_t subAddress, uint8_t subaddressSize, uint32_t txBuff); | ||
135 | status_t BOARD_Accel_I2C_Receive( | ||
136 | uint8_t deviceAddress, uint32_t subAddress, uint8_t subaddressSize, uint8_t *rxBuff, uint8_t rxBuffSize); | ||
137 | void BOARD_Codec_I2C_Init(void); | ||
138 | status_t BOARD_Codec_I2C_Send( | ||
139 | uint8_t deviceAddress, uint32_t subAddress, uint8_t subAddressSize, const uint8_t *txBuff, uint8_t txBuffSize); | ||
140 | status_t BOARD_Codec_I2C_Receive( | ||
141 | uint8_t deviceAddress, uint32_t subAddress, uint8_t subAddressSize, uint8_t *rxBuff, uint8_t rxBuffSize); | ||
142 | #endif /* SDK_I2C_BASED_COMPONENT_USED */ | ||
143 | #if defined(__cplusplus) | ||
144 | } | ||
145 | #endif /* __cplusplus */ | ||
146 | |||
147 | #endif /* _BOARD_H_ */ | ||