aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template')
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/board.c24
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/board.h36
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/clock_config.c376
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/clock_config.h168
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/peripherals.c28
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/peripherals.h31
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/pin_mux.c61
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/pin_mux.h52
8 files changed, 776 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/board.c b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/board.c
new file mode 100644
index 000000000..c6bff3bb6
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/board.c
@@ -0,0 +1,24 @@
1/*
2 * Copyright 2019 NXP.
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8/**
9 * @file board.c
10 * @brief Board initialization file.
11 */
12
13/* This is an empty template for board specific configuration.*/
14
15#include <stdint.h>
16#include "board.h"
17
18/**
19 * @brief Set up and initialize all required blocks and functions related to the board hardware.
20 */
21void BOARD_InitDebugConsole(void)
22{
23 /* The user initialization should be placed here */
24}
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/board.h b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/board.h
new file mode 100644
index 000000000..5dbaf35e2
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/board.h
@@ -0,0 +1,36 @@
1/*
2 * Copyright 2019 NXP.
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8/**
9 * @file board.h
10 * @brief Board initialization header file.
11 */
12
13/* This is an empty template for board specific configuration.*/
14
15#ifndef _BOARD_H_
16#define _BOARD_H_
17
18/**
19 * @brief The board name
20 */
21#define BOARD_NAME "board"
22
23#if defined(__cplusplus)
24extern "C" {
25#endif /* __cplusplus */
26
27/**
28 * @brief Initialize board specific settings.
29 */
30void BOARD_InitDebugConsole(void);
31
32#if defined(__cplusplus)
33}
34#endif /* __cplusplus */
35
36#endif /* _BOARD_H_ */
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/clock_config.c b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/clock_config.c
new file mode 100644
index 000000000..483a19af4
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/clock_config.c
@@ -0,0 +1,376 @@
1/*
2 * Copyright 2017-2018 NXP
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8/***********************************************************************************************************************
9 * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file
10 * will be overwritten if the respective MCUXpresso Config Tools is used to update this file.
11 **********************************************************************************************************************/
12/*
13 * How to set up clock using clock driver functions:
14 *
15 * 1. Setup clock sources.
16 *
17 * 2. Set up wait states of the flash.
18 *
19 * 3. Set up all dividers.
20 *
21 * 4. Set up all selectors to provide selected clocks.
22 */
23
24/* clang-format off */
25/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
26!!GlobalInfo
27product: Clocks v6.0
28processor: LPC55S26
29package_id: LPC55S26JBD100
30mcu_data: ksdk2_0
31processor_version: 0.2.11
32 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
33/* clang-format on */
34
35#include "fsl_power.h"
36#include "fsl_clock.h"
37#include "clock_config.h"
38
39/*******************************************************************************
40 * Definitions
41 ******************************************************************************/
42
43/*******************************************************************************
44 * Variables
45 ******************************************************************************/
46/* System clock frequency. */
47extern uint32_t SystemCoreClock;
48
49/*******************************************************************************
50 ************************ BOARD_InitBootClocks function ************************
51 ******************************************************************************/
52void BOARD_InitBootClocks(void)
53{
54 BOARD_BootClockPLL150M();
55}
56
57/*******************************************************************************
58 ******************** Configuration BOARD_BootClockFRO12M **********************
59 ******************************************************************************/
60/* clang-format off */
61/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
62!!Configuration
63name: BOARD_BootClockFRO12M
64outputs:
65- {id: System_clock.outFreq, value: 12 MHz}
66settings:
67- {id: ANALOG_CONTROL_FRO192M_CTRL_ENDI_FRO_96M_CFG, value: Enable}
68sources:
69- {id: ANACTRL.fro_hf.outFreq, value: 96 MHz}
70 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
71/* clang-format on */
72
73/*******************************************************************************
74 * Variables for BOARD_BootClockFRO12M configuration
75 ******************************************************************************/
76/*******************************************************************************
77 * Code for BOARD_BootClockFRO12M configuration
78 ******************************************************************************/
79void BOARD_BootClockFRO12M(void)
80{
81#ifndef SDK_SECONDARY_CORE
82 /*!< Set up the clock sources */
83 /*!< Configure FRO192M */
84 POWER_DisablePD(kPDRUNCFG_PD_FRO192M); /*!< Ensure FRO is on */
85 CLOCK_SetupFROClocking(12000000U); /*!< Set up FRO to the 12 MHz, just for sure */
86 CLOCK_AttachClk(kFRO12M_to_MAIN_CLK); /*!< Switch to FRO 12MHz first to ensure we can change the clock setting */
87
88 CLOCK_SetupFROClocking(96000000U); /* Enable FRO HF(96MHz) output */
89
90 POWER_SetVoltageForFreq(
91 12000000U); /*!< Set voltage for the one of the fastest clock outputs: System clock output */
92 CLOCK_SetFLASHAccessCyclesForFreq(12000000U); /*!< Set FLASH wait states for core */
93
94 /*!< Set up dividers */
95 CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 1U, false); /*!< Set AHBCLKDIV divider to value 1 */
96
97 /*!< Set up clock selectors - Attach clocks to the peripheries */
98 CLOCK_AttachClk(kFRO12M_to_MAIN_CLK); /*!< Switch MAIN_CLK to FRO12M */
99
100 /*< Set SystemCoreClock variable. */
101 SystemCoreClock = BOARD_BOOTCLOCKFRO12M_CORE_CLOCK;
102#endif
103}
104
105/*******************************************************************************
106 ******************* Configuration BOARD_BootClockFROHF96M *********************
107 ******************************************************************************/
108/* clang-format off */
109/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
110!!Configuration
111name: BOARD_BootClockFROHF96M
112outputs:
113- {id: System_clock.outFreq, value: 96 MHz}
114settings:
115- {id: ANALOG_CONTROL_FRO192M_CTRL_ENDI_FRO_96M_CFG, value: Enable}
116- {id: SYSCON.MAINCLKSELA.sel, value: ANACTRL.fro_hf_clk}
117sources:
118- {id: ANACTRL.fro_hf.outFreq, value: 96 MHz}
119 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
120/* clang-format on */
121
122/*******************************************************************************
123 * Variables for BOARD_BootClockFROHF96M configuration
124 ******************************************************************************/
125/*******************************************************************************
126 * Code for BOARD_BootClockFROHF96M configuration
127 ******************************************************************************/
128void BOARD_BootClockFROHF96M(void)
129{
130#ifndef SDK_SECONDARY_CORE
131 /*!< Set up the clock sources */
132 /*!< Configure FRO192M */
133 POWER_DisablePD(kPDRUNCFG_PD_FRO192M); /*!< Ensure FRO is on */
134 CLOCK_SetupFROClocking(12000000U); /*!< Set up FRO to the 12 MHz, just for sure */
135 CLOCK_AttachClk(kFRO12M_to_MAIN_CLK); /*!< Switch to FRO 12MHz first to ensure we can change the clock setting */
136
137 CLOCK_SetupFROClocking(96000000U); /* Enable FRO HF(96MHz) output */
138
139 POWER_SetVoltageForFreq(
140 96000000U); /*!< Set voltage for the one of the fastest clock outputs: System clock output */
141 CLOCK_SetFLASHAccessCyclesForFreq(96000000U); /*!< Set FLASH wait states for core */
142
143 /*!< Set up dividers */
144 CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 1U, false); /*!< Set AHBCLKDIV divider to value 1 */
145
146 /*!< Set up clock selectors - Attach clocks to the peripheries */
147 CLOCK_AttachClk(kFRO_HF_to_MAIN_CLK); /*!< Switch MAIN_CLK to FRO_HF */
148
149 /*< Set SystemCoreClock variable. */
150 SystemCoreClock = BOARD_BOOTCLOCKFROHF96M_CORE_CLOCK;
151#endif
152}
153
154/*******************************************************************************
155 ******************** Configuration BOARD_BootClockPLL100M *********************
156 ******************************************************************************/
157/* clang-format off */
158/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
159!!Configuration
160name: BOARD_BootClockPLL100M
161outputs:
162- {id: System_clock.outFreq, value: 100 MHz}
163settings:
164- {id: PLL0_Mode, value: Normal}
165- {id: ANALOG_CONTROL_FRO192M_CTRL_ENDI_FRO_96M_CFG, value: Enable}
166- {id: ENABLE_CLKIN_ENA, value: Enabled}
167- {id: ENABLE_SYSTEM_CLK_OUT, value: Enabled}
168- {id: SYSCON.MAINCLKSELB.sel, value: SYSCON.PLL0_BYPASS}
169- {id: SYSCON.PLL0CLKSEL.sel, value: SYSCON.CLK_IN_EN}
170- {id: SYSCON.PLL0M_MULT.scale, value: '100', locked: true}
171- {id: SYSCON.PLL0N_DIV.scale, value: '4', locked: true}
172- {id: SYSCON.PLL0_PDEC.scale, value: '4', locked: true}
173sources:
174- {id: ANACTRL.fro_hf.outFreq, value: 96 MHz}
175- {id: SYSCON.XTAL32M.outFreq, value: 16 MHz, enabled: true}
176 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
177/* clang-format on */
178
179/*******************************************************************************
180 * Variables for BOARD_BootClockPLL100M configuration
181 ******************************************************************************/
182/*******************************************************************************
183 * Code for BOARD_BootClockPLL100M configuration
184 ******************************************************************************/
185void BOARD_BootClockPLL100M(void)
186{
187#ifndef SDK_SECONDARY_CORE
188 /*!< Set up the clock sources */
189 /*!< Configure FRO192M */
190 POWER_DisablePD(kPDRUNCFG_PD_FRO192M); /*!< Ensure FRO is on */
191 CLOCK_SetupFROClocking(12000000U); /*!< Set up FRO to the 12 MHz, just for sure */
192 CLOCK_AttachClk(kFRO12M_to_MAIN_CLK); /*!< Switch to FRO 12MHz first to ensure we can change the clock setting */
193
194 CLOCK_SetupFROClocking(96000000U); /* Enable FRO HF(96MHz) output */
195
196 /*!< Configure XTAL32M */
197 POWER_DisablePD(kPDRUNCFG_PD_XTAL32M); /* Ensure XTAL32M is powered */
198 POWER_DisablePD(kPDRUNCFG_PD_LDOXO32M); /* Ensure XTAL32M is powered */
199 CLOCK_SetupExtClocking(16000000U); /* Enable clk_in clock */
200 SYSCON->CLOCK_CTRL |= SYSCON_CLOCK_CTRL_CLKIN_ENA_MASK; /* Enable clk_in from XTAL32M clock */
201 ANACTRL->XO32M_CTRL |= ANACTRL_XO32M_CTRL_ENABLE_SYSTEM_CLK_OUT_MASK; /* Enable clk_in to system */
202
203 POWER_SetVoltageForFreq(
204 100000000U); /*!< Set voltage for the one of the fastest clock outputs: System clock output */
205 CLOCK_SetFLASHAccessCyclesForFreq(100000000U); /*!< Set FLASH wait states for core */
206
207 /*!< Set up PLL */
208 CLOCK_AttachClk(kEXT_CLK_to_PLL0); /*!< Switch PLL0CLKSEL to EXT_CLK */
209 POWER_DisablePD(kPDRUNCFG_PD_PLL0); /* Ensure PLL is on */
210 POWER_DisablePD(kPDRUNCFG_PD_PLL0_SSCG);
211 const pll_setup_t pll0Setup = {
212 .pllctrl = SYSCON_PLL0CTRL_CLKEN_MASK | SYSCON_PLL0CTRL_SELI(53U) | SYSCON_PLL0CTRL_SELP(26U),
213 .pllndec = SYSCON_PLL0NDEC_NDIV(4U),
214 .pllpdec = SYSCON_PLL0PDEC_PDIV(2U),
215 .pllsscg = {0x0U, (SYSCON_PLL0SSCG1_MDIV_EXT(100U) | SYSCON_PLL0SSCG1_SEL_EXT_MASK)},
216 .pllRate = 100000000U,
217 .flags = PLL_SETUPFLAG_WAITLOCK};
218 CLOCK_SetPLL0Freq(&pll0Setup); /*!< Configure PLL0 to the desired values */
219
220 /*!< Set up dividers */
221 CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 1U, false); /*!< Set AHBCLKDIV divider to value 1 */
222
223 /*!< Set up clock selectors - Attach clocks to the peripheries */
224 CLOCK_AttachClk(kPLL0_to_MAIN_CLK); /*!< Switch MAIN_CLK to PLL0 */
225
226 /*< Set SystemCoreClock variable. */
227 SystemCoreClock = BOARD_BOOTCLOCKPLL100M_CORE_CLOCK;
228#endif
229}
230
231/*******************************************************************************
232 ******************** Configuration BOARD_BootClockPLL150M *********************
233 ******************************************************************************/
234/* clang-format off */
235/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
236!!Configuration
237name: BOARD_BootClockPLL150M
238called_from_default_init: true
239outputs:
240- {id: System_clock.outFreq, value: 150 MHz}
241settings:
242- {id: PLL0_Mode, value: Normal}
243- {id: ENABLE_CLKIN_ENA, value: Enabled}
244- {id: ENABLE_SYSTEM_CLK_OUT, value: Enabled}
245- {id: SYSCON.MAINCLKSELB.sel, value: SYSCON.PLL0_BYPASS}
246- {id: SYSCON.PLL0CLKSEL.sel, value: SYSCON.CLK_IN_EN}
247- {id: SYSCON.PLL0M_MULT.scale, value: '150', locked: true}
248- {id: SYSCON.PLL0N_DIV.scale, value: '8', locked: true}
249- {id: SYSCON.PLL0_PDEC.scale, value: '2', locked: true}
250sources:
251- {id: SYSCON.XTAL32M.outFreq, value: 16 MHz, enabled: true}
252 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
253/* clang-format on */
254
255/*******************************************************************************
256 * Variables for BOARD_BootClockPLL150M configuration
257 ******************************************************************************/
258/*******************************************************************************
259 * Code for BOARD_BootClockPLL150M configuration
260 ******************************************************************************/
261void BOARD_BootClockPLL150M(void)
262{
263#ifndef SDK_SECONDARY_CORE
264 /*!< Set up the clock sources */
265 /*!< Configure FRO192M */
266 POWER_DisablePD(kPDRUNCFG_PD_FRO192M); /*!< Ensure FRO is on */
267 CLOCK_SetupFROClocking(12000000U); /*!< Set up FRO to the 12 MHz, just for sure */
268 CLOCK_AttachClk(kFRO12M_to_MAIN_CLK); /*!< Switch to FRO 12MHz first to ensure we can change the clock setting */
269
270 /*!< Configure XTAL32M */
271 POWER_DisablePD(kPDRUNCFG_PD_XTAL32M); /* Ensure XTAL32M is powered */
272 POWER_DisablePD(kPDRUNCFG_PD_LDOXO32M); /* Ensure XTAL32M is powered */
273 CLOCK_SetupExtClocking(16000000U); /* Enable clk_in clock */
274 SYSCON->CLOCK_CTRL |= SYSCON_CLOCK_CTRL_CLKIN_ENA_MASK; /* Enable clk_in from XTAL32M clock */
275 ANACTRL->XO32M_CTRL |= ANACTRL_XO32M_CTRL_ENABLE_SYSTEM_CLK_OUT_MASK; /* Enable clk_in to system */
276
277 POWER_SetVoltageForFreq(
278 150000000U); /*!< Set voltage for the one of the fastest clock outputs: System clock output */
279 CLOCK_SetFLASHAccessCyclesForFreq(150000000U); /*!< Set FLASH wait states for core */
280
281 /*!< Set up PLL */
282 CLOCK_AttachClk(kEXT_CLK_to_PLL0); /*!< Switch PLL0CLKSEL to EXT_CLK */
283 POWER_DisablePD(kPDRUNCFG_PD_PLL0); /* Ensure PLL is on */
284 POWER_DisablePD(kPDRUNCFG_PD_PLL0_SSCG);
285 const pll_setup_t pll0Setup = {
286 .pllctrl = SYSCON_PLL0CTRL_CLKEN_MASK | SYSCON_PLL0CTRL_SELI(53U) | SYSCON_PLL0CTRL_SELP(31U),
287 .pllndec = SYSCON_PLL0NDEC_NDIV(8U),
288 .pllpdec = SYSCON_PLL0PDEC_PDIV(1U),
289 .pllsscg = {0x0U, (SYSCON_PLL0SSCG1_MDIV_EXT(150U) | SYSCON_PLL0SSCG1_SEL_EXT_MASK)},
290 .pllRate = 150000000U,
291 .flags = PLL_SETUPFLAG_WAITLOCK};
292 CLOCK_SetPLL0Freq(&pll0Setup); /*!< Configure PLL0 to the desired values */
293
294 /*!< Set up dividers */
295 CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 1U, false); /*!< Set AHBCLKDIV divider to value 1 */
296
297 /*!< Set up clock selectors - Attach clocks to the peripheries */
298 CLOCK_AttachClk(kPLL0_to_MAIN_CLK); /*!< Switch MAIN_CLK to PLL0 */
299
300 /*< Set SystemCoreClock variable. */
301 SystemCoreClock = BOARD_BOOTCLOCKPLL150M_CORE_CLOCK;
302#endif
303}
304
305/*******************************************************************************
306 ******************* Configuration BOARD_BootClockPLL1_150M ********************
307 ******************************************************************************/
308/* clang-format off */
309/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
310!!Configuration
311name: BOARD_BootClockPLL1_150M
312outputs:
313- {id: System_clock.outFreq, value: 150 MHz}
314settings:
315- {id: PLL1_Mode, value: Normal}
316- {id: ENABLE_CLKIN_ENA, value: Enabled}
317- {id: ENABLE_SYSTEM_CLK_OUT, value: Enabled}
318- {id: SYSCON.MAINCLKSELB.sel, value: SYSCON.PLL1_BYPASS}
319- {id: SYSCON.PLL1CLKSEL.sel, value: SYSCON.CLK_IN_EN}
320- {id: SYSCON.PLL1M_MULT.scale, value: '150', locked: true}
321- {id: SYSCON.PLL1N_DIV.scale, value: '8', locked: true}
322- {id: SYSCON.PLL1_PDEC.scale, value: '2', locked: true}
323sources:
324- {id: SYSCON.XTAL32M.outFreq, value: 16 MHz, enabled: true}
325 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
326/* clang-format on */
327
328/*******************************************************************************
329 * Variables for BOARD_BootClockPLL1_150M configuration
330 ******************************************************************************/
331/*******************************************************************************
332 * Code for BOARD_BootClockPLL1_150M configuration
333 ******************************************************************************/
334void BOARD_BootClockPLL1_150M(void)
335{
336#ifndef SDK_SECONDARY_CORE
337 /*!< Set up the clock sources */
338 /*!< Configure FRO192M */
339 POWER_DisablePD(kPDRUNCFG_PD_FRO192M); /*!< Ensure FRO is on */
340 CLOCK_SetupFROClocking(12000000U); /*!< Set up FRO to the 12 MHz, just for sure */
341 CLOCK_AttachClk(kFRO12M_to_MAIN_CLK); /*!< Switch to FRO 12MHz first to ensure we can change the clock setting */
342
343 /*!< Configure XTAL32M */
344 POWER_DisablePD(kPDRUNCFG_PD_XTAL32M); /* Ensure XTAL32M is powered */
345 POWER_DisablePD(kPDRUNCFG_PD_LDOXO32M); /* Ensure XTAL32M is powered */
346 CLOCK_SetupExtClocking(16000000U); /* Enable clk_in clock */
347 SYSCON->CLOCK_CTRL |= SYSCON_CLOCK_CTRL_CLKIN_ENA_MASK; /* Enable clk_in from XTAL32M clock */
348 ANACTRL->XO32M_CTRL |= ANACTRL_XO32M_CTRL_ENABLE_SYSTEM_CLK_OUT_MASK; /* Enable clk_in to system */
349
350 POWER_SetVoltageForFreq(150000000U); /*!< Set voltage for the one of the fastest clock outputs: System clock output */
351 CLOCK_SetFLASHAccessCyclesForFreq(150000000U); /*!< Set FLASH wait states for core */
352
353 /*!< Set up PLL1 */
354 CLOCK_AttachClk(kEXT_CLK_to_PLL1); /*!< Switch PLL1CLKSEL to EXT_CLK */
355 POWER_DisablePD(kPDRUNCFG_PD_PLL1); /* Ensure PLL is on */
356 const pll_setup_t pll1Setup = {
357 .pllctrl = SYSCON_PLL1CTRL_CLKEN_MASK | SYSCON_PLL1CTRL_SELI(53U) | SYSCON_PLL1CTRL_SELP(31U),
358 .pllndec = SYSCON_PLL1NDEC_NDIV(8U),
359 .pllpdec = SYSCON_PLL1PDEC_PDIV(1U),
360 .pllmdec = SYSCON_PLL1MDEC_MDIV(150U),
361 .pllRate = 150000000U,
362 .flags = PLL_SETUPFLAG_WAITLOCK
363 };
364 CLOCK_SetPLL1Freq(&pll1Setup); /*!< Configure PLL1 to the desired values */
365
366 /*!< Set up dividers */
367 CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 1U, false); /*!< Set AHBCLKDIV divider to value 1 */
368
369 /*!< Set up clock selectors - Attach clocks to the peripheries */
370 CLOCK_AttachClk(kPLL1_to_MAIN_CLK); /*!< Switch MAIN_CLK to PLL1 */
371
372 /*< Set SystemCoreClock variable. */
373 SystemCoreClock = BOARD_BOOTCLOCKPLL1_150M_CORE_CLOCK;
374#endif
375}
376
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/clock_config.h b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/clock_config.h
new file mode 100644
index 000000000..0ccead1ce
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/clock_config.h
@@ -0,0 +1,168 @@
1/*
2 * Copyright 2017-2018 NXP
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8/***********************************************************************************************************************
9 * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file
10 * will be overwritten if the respective MCUXpresso Config Tools is used to update this file.
11 **********************************************************************************************************************/
12
13#ifndef _CLOCK_CONFIG_H_
14#define _CLOCK_CONFIG_H_
15
16#include "fsl_common.h"
17
18/*******************************************************************************
19 * Definitions
20 ******************************************************************************/
21#define BOARD_XTAL0_CLK_HZ 16000000U /*!< Board xtal frequency in Hz */
22#define BOARD_XTAL32K_CLK_HZ 32768U /*!< Board xtal32K frequency in Hz */
23
24/*******************************************************************************
25 ************************ BOARD_InitBootClocks function ************************
26 ******************************************************************************/
27
28#if defined(__cplusplus)
29extern "C" {
30#endif /* __cplusplus*/
31
32/*!
33 * @brief This function executes default configuration of clocks.
34 *
35 */
36void BOARD_InitBootClocks(void);
37
38#if defined(__cplusplus)
39}
40#endif /* __cplusplus*/
41
42/*******************************************************************************
43 ******************** Configuration BOARD_BootClockFRO12M **********************
44 ******************************************************************************/
45/*******************************************************************************
46 * Definitions for BOARD_BootClockFRO12M configuration
47 ******************************************************************************/
48#define BOARD_BOOTCLOCKFRO12M_CORE_CLOCK 12000000U /*!< Core clock frequency: 12000000Hz */
49
50/*******************************************************************************
51 * API for BOARD_BootClockFRO12M configuration
52 ******************************************************************************/
53#if defined(__cplusplus)
54extern "C" {
55#endif /* __cplusplus*/
56
57/*!
58 * @brief This function executes configuration of clocks.
59 *
60 */
61void BOARD_BootClockFRO12M(void);
62
63#if defined(__cplusplus)
64}
65#endif /* __cplusplus*/
66
67/*******************************************************************************
68 ******************* Configuration BOARD_BootClockFROHF96M *********************
69 ******************************************************************************/
70/*******************************************************************************
71 * Definitions for BOARD_BootClockFROHF96M configuration
72 ******************************************************************************/
73#define BOARD_BOOTCLOCKFROHF96M_CORE_CLOCK 96000000U /*!< Core clock frequency: 96000000Hz */
74
75/*******************************************************************************
76 * API for BOARD_BootClockFROHF96M configuration
77 ******************************************************************************/
78#if defined(__cplusplus)
79extern "C" {
80#endif /* __cplusplus*/
81
82/*!
83 * @brief This function executes configuration of clocks.
84 *
85 */
86void BOARD_BootClockFROHF96M(void);
87
88#if defined(__cplusplus)
89}
90#endif /* __cplusplus*/
91
92/*******************************************************************************
93 ******************** Configuration BOARD_BootClockPLL100M *********************
94 ******************************************************************************/
95/*******************************************************************************
96 * Definitions for BOARD_BootClockPLL100M configuration
97 ******************************************************************************/
98#define BOARD_BOOTCLOCKPLL100M_CORE_CLOCK 100000000U /*!< Core clock frequency: 100000000Hz */
99
100/*******************************************************************************
101 * API for BOARD_BootClockPLL100M configuration
102 ******************************************************************************/
103#if defined(__cplusplus)
104extern "C" {
105#endif /* __cplusplus*/
106
107/*!
108 * @brief This function executes configuration of clocks.
109 *
110 */
111void BOARD_BootClockPLL100M(void);
112
113#if defined(__cplusplus)
114}
115#endif /* __cplusplus*/
116
117/*******************************************************************************
118 ******************** Configuration BOARD_BootClockPLL150M *********************
119 ******************************************************************************/
120/*******************************************************************************
121 * Definitions for BOARD_BootClockPLL150M configuration
122 ******************************************************************************/
123#define BOARD_BOOTCLOCKPLL150M_CORE_CLOCK 150000000U /*!< Core clock frequency: 150000000Hz */
124
125/*******************************************************************************
126 * API for BOARD_BootClockPLL150M configuration
127 ******************************************************************************/
128#if defined(__cplusplus)
129extern "C" {
130#endif /* __cplusplus*/
131
132/*!
133 * @brief This function executes configuration of clocks.
134 *
135 */
136void BOARD_BootClockPLL150M(void);
137
138#if defined(__cplusplus)
139}
140#endif /* __cplusplus*/
141
142/*******************************************************************************
143 ******************* Configuration BOARD_BootClockPLL1_150M ********************
144 ******************************************************************************/
145/*******************************************************************************
146 * Definitions for BOARD_BootClockPLL1_150M configuration
147 ******************************************************************************/
148#define BOARD_BOOTCLOCKPLL1_150M_CORE_CLOCK 150000000U /*!< Core clock frequency: 150000000Hz */
149
150
151/*******************************************************************************
152 * API for BOARD_BootClockPLL1_150M configuration
153 ******************************************************************************/
154#if defined(__cplusplus)
155extern "C" {
156#endif /* __cplusplus*/
157
158/*!
159 * @brief This function executes configuration of clocks.
160 *
161 */
162void BOARD_BootClockPLL1_150M(void);
163
164#if defined(__cplusplus)
165}
166#endif /* __cplusplus*/
167
168#endif /* _CLOCK_CONFIG_H_ */
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/peripherals.c b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/peripherals.c
new file mode 100644
index 000000000..a60e8de6a
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/peripherals.c
@@ -0,0 +1,28 @@
1/*
2 * Copyright 2019 NXP.
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
9!!GlobalInfo
10product: Peripherals v1.0
11* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
12
13/**
14 * @file peripherals.c
15 * @brief Peripherals initialization file.
16 */
17
18/* This is an empty template for board specific configuration.*/
19
20#include "peripherals.h"
21
22/**
23 * @brief Set up and initialize all required blocks and functions related to the peripherals hardware.
24 */
25void BOARD_InitBootPeripherals(void)
26{
27 /* The user initialization should be placed here */
28}
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/peripherals.h b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/peripherals.h
new file mode 100644
index 000000000..46c12a2dc
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/peripherals.h
@@ -0,0 +1,31 @@
1/*
2 * Copyright 2019 NXP.
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8/**
9 * @file peripherals.h
10 * @brief Peripherals initialization header file.
11 */
12
13/* This is an empty template for board specific configuration.*/
14
15#ifndef _PERIPHERALS_H_
16#define _PERIPHERALS_H_
17
18#if defined(__cplusplus)
19extern "C" {
20#endif /* __cplusplus */
21
22/**
23 * @brief Initialize peripherals specific settings.
24 */
25void BOARD_InitBootPeripherals(void);
26
27#if defined(__cplusplus)
28}
29#endif /* __cplusplus */
30
31#endif /* _PERIPHERALS_H_ */
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/pin_mux.c b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/pin_mux.c
new file mode 100644
index 000000000..e6376104e
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/pin_mux.c
@@ -0,0 +1,61 @@
1/*
2 * Copyright 2019 NXP.
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8/***********************************************************************************************************************
9 * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file
10 * will be overwritten if the respective MCUXpresso Config Tools is used to update this file.
11 **********************************************************************************************************************/
12
13/* clang-format off */
14/*
15 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
16!!GlobalInfo
17product: Pins v6.0
18processor: LPC55S26
19mcu_data: ksdk2_0
20processor_version: 0.1.11
21 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
22 */
23/* clang-format on */
24
25#include "fsl_common.h"
26#include "pin_mux.h"
27
28/* FUNCTION ************************************************************************************************************
29 *
30 * Function Name : BOARD_InitBootPins
31 * Description : Calls initialization functions.
32 *
33 * END ****************************************************************************************************************/
34void BOARD_InitBootPins(void)
35{
36 BOARD_InitPins();
37}
38
39/* clang-format off */
40/*
41 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
42BOARD_InitPins:
43- options: {callFromInitBoot: 'true', enableClock: 'true'}
44- pin_list: []
45 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
46 */
47/* clang-format on */
48
49/* FUNCTION ************************************************************************************************************
50 *
51 * Function Name : BOARD_InitPins
52 * Description : Configures pin routing and optionally pin electrical features.
53 *
54 * END ****************************************************************************************************************/
55/* Function assigned for the Cortex-M33 (Core #0) */
56void BOARD_InitPins(void)
57{
58}
59/***********************************************************************************************************************
60 * EOF
61 **********************************************************************************************************************/
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/pin_mux.h b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/pin_mux.h
new file mode 100644
index 000000000..28df85265
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC55S26/project_template/pin_mux.h
@@ -0,0 +1,52 @@
1/*
2 * Copyright 2019 NXP.
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8/***********************************************************************************************************************
9 * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file
10 * will be overwritten if the respective MCUXpresso Config Tools is used to update this file.
11 **********************************************************************************************************************/
12
13#ifndef _PIN_MUX_H_
14#define _PIN_MUX_H_
15
16/*!
17 * @addtogroup pin_mux
18 * @{
19 */
20
21/***********************************************************************************************************************
22 * API
23 **********************************************************************************************************************/
24
25#if defined(__cplusplus)
26extern "C" {
27#endif
28
29/*!
30 * @brief Calls initialization functions.
31 *
32 */
33void BOARD_InitBootPins(void);
34
35/*!
36 * @brief Configures pin routing and optionally pin electrical features.
37 *
38 */
39void BOARD_InitPins(void);
40
41#if defined(__cplusplus)
42}
43#endif
44
45/*!
46 * @}
47 */
48#endif /* _PIN_MUX_H_ */
49
50/***********************************************************************************************************************
51 * EOF
52 **********************************************************************************************************************/