diff options
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template')
8 files changed, 385 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/board.c b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/board.c new file mode 100644 index 000000000..30bda70e0 --- /dev/null +++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/board.c | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * Copyright 201, 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 | */ | ||
21 | void BOARD_InitDebugConsole(void) | ||
22 | { | ||
23 | /* The user initialization should be placed here */ | ||
24 | } | ||
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/board.h b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/board.h new file mode 100644 index 000000000..b3b5ef0f5 --- /dev/null +++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/board.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * Copyright 2017, 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) | ||
24 | extern "C" { | ||
25 | #endif /* __cplusplus */ | ||
26 | |||
27 | /** | ||
28 | * @brief Initialize board specific settings. | ||
29 | */ | ||
30 | void 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/LPC832/project_template/clock_config.c b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/clock_config.c new file mode 100644 index 000000000..d6d9d9f63 --- /dev/null +++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/clock_config.c | |||
@@ -0,0 +1,90 @@ | |||
1 | /* | ||
2 | * Copyright 2018 NXP. | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * SPDX-License-Identifier: BSD-3-Clause | ||
6 | */ | ||
7 | |||
8 | /* | ||
9 | * How to set up clock using clock driver functions: | ||
10 | * | ||
11 | * 1. Setup clock sources. | ||
12 | * | ||
13 | * 2. Set up all dividers. | ||
14 | * | ||
15 | * 3. Set up all selectors to provide selected clocks. | ||
16 | */ | ||
17 | |||
18 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* | ||
19 | !!GlobalInfo | ||
20 | product: Clocks v5.0 | ||
21 | processor: LPC832 | ||
22 | mcu_data: ksdk2_0 | ||
23 | processor_version: 0.0.5 | ||
24 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ | ||
25 | |||
26 | #include "fsl_power.h" | ||
27 | #include "fsl_clock.h" | ||
28 | #include "clock_config.h" | ||
29 | |||
30 | /******************************************************************************* | ||
31 | * Definitions | ||
32 | ******************************************************************************/ | ||
33 | |||
34 | /******************************************************************************* | ||
35 | * Variables | ||
36 | ******************************************************************************/ | ||
37 | /* System clock frequency. */ | ||
38 | extern uint32_t SystemCoreClock; | ||
39 | |||
40 | /******************************************************************************* | ||
41 | ************************ BOARD_InitBootClocks function ************************ | ||
42 | ******************************************************************************/ | ||
43 | void BOARD_InitBootClocks(void) | ||
44 | { | ||
45 | BOARD_BootClockRUN(); | ||
46 | } | ||
47 | |||
48 | /******************************************************************************* | ||
49 | ********************** Configuration BOARD_BootClockRUN *********************** | ||
50 | ******************************************************************************/ | ||
51 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* | ||
52 | !!Configuration | ||
53 | name: BOARD_BootClockRUN | ||
54 | called_from_default_init: true | ||
55 | outputs: | ||
56 | - {id: ADC_clock.outFreq, value: 12 MHz} | ||
57 | - {id: I2C0_clock.outFreq, value: 12 MHz} | ||
58 | - {id: LowPower_clock.outFreq, value: 10 kHz} | ||
59 | - {id: SPI0_clock.outFreq, value: 12 MHz} | ||
60 | - {id: SPI1_clock.outFreq, value: 12 MHz} | ||
61 | - {id: SYSPLL_clock.outFreq, value: 12 MHz} | ||
62 | - {id: System_clock.outFreq, value: 12 MHz} | ||
63 | - {id: divto750k_clock.outFreq, value: 750 kHz} | ||
64 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ | ||
65 | |||
66 | /******************************************************************************* | ||
67 | * Variables for BOARD_BootClockRUN configuration | ||
68 | ******************************************************************************/ | ||
69 | /******************************************************************************* | ||
70 | * Code for BOARD_BootClockRUN configuration | ||
71 | ******************************************************************************/ | ||
72 | void BOARD_BootClockRUN(void) | ||
73 | { | ||
74 | /*!< Set up the clock sources */ | ||
75 | /*!< Set up IRC */ | ||
76 | POWER_DisablePD(kPDRUNCFG_PD_IRC_OUT); /*!< Ensure IRC OUT is on */ | ||
77 | POWER_DisablePD(kPDRUNCFG_PD_IRC); /*!< Ensure IRC is on */ | ||
78 | POWER_DisablePD(kPDRUNCFG_PD_SYSOSC); /*!< Ensure SYSOSC is on */ | ||
79 | CLOCK_Select(kSYSPLL_From_Irc); /*!< set IRC to pll select */ | ||
80 | clock_sys_pll_t config; | ||
81 | config.src = kCLOCK_SysPllSrcIrc; /*!< set pll src */ | ||
82 | config.targetFreq = 12000000U; /*!< set pll target freq */ | ||
83 | CLOCK_InitSystemPll(&config); /*!< set parameters */ | ||
84 | CLOCK_SetMainClkSrc(kCLOCK_MainClkSrcIrc); /*!< select irc for main clock */ | ||
85 | CLOCK_Select(kCLKOUT_From_Irc); /*!< select IRC for CLKOUT */ | ||
86 | CLOCK_SetCoreSysClkDiv(1U); | ||
87 | /*!< Set SystemCoreClock variable. */ | ||
88 | SystemCoreClock = BOARD_BOOTCLOCKRUN_CORE_CLOCK; | ||
89 | } | ||
90 | |||
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/clock_config.h b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/clock_config.h new file mode 100644 index 000000000..1e477ec2e --- /dev/null +++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/clock_config.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * Copyright 2018 NXP. | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * SPDX-License-Identifier: BSD-3-Clause | ||
6 | */ | ||
7 | |||
8 | #ifndef _CLOCK_CONFIG_H_ | ||
9 | #define _CLOCK_CONFIG_H_ | ||
10 | |||
11 | #include "fsl_common.h" | ||
12 | |||
13 | /******************************************************************************* | ||
14 | * Definitions | ||
15 | ******************************************************************************/ | ||
16 | #define BOARD_XTAL0_CLK_HZ 12000000U /*!< Board xtal0 frequency in Hz */ | ||
17 | #define BOARD_XTAL32K_CLK_HZ 32768U /*!< Board xtal32K frequency in Hz */ | ||
18 | |||
19 | /******************************************************************************* | ||
20 | ************************ BOARD_InitBootClocks function ************************ | ||
21 | ******************************************************************************/ | ||
22 | |||
23 | #if defined(__cplusplus) | ||
24 | extern "C" { | ||
25 | #endif /* __cplusplus*/ | ||
26 | |||
27 | /*! | ||
28 | * @brief This function executes default configuration of clocks. | ||
29 | * | ||
30 | */ | ||
31 | void BOARD_InitBootClocks(void); | ||
32 | |||
33 | #if defined(__cplusplus) | ||
34 | } | ||
35 | #endif /* __cplusplus*/ | ||
36 | |||
37 | /******************************************************************************* | ||
38 | ********************** Configuration BOARD_BootClockRUN *********************** | ||
39 | ******************************************************************************/ | ||
40 | /******************************************************************************* | ||
41 | * Definitions for BOARD_BootClockRUN configuration | ||
42 | ******************************************************************************/ | ||
43 | #define BOARD_BOOTCLOCKRUN_CORE_CLOCK 12000000U /*!< Core clock frequency: 12000000Hz */ | ||
44 | |||
45 | |||
46 | /******************************************************************************* | ||
47 | * API for BOARD_BootClockRUN configuration | ||
48 | ******************************************************************************/ | ||
49 | #if defined(__cplusplus) | ||
50 | extern "C" { | ||
51 | #endif /* __cplusplus*/ | ||
52 | |||
53 | /*! | ||
54 | * @brief This function executes configuration of clocks. | ||
55 | * | ||
56 | */ | ||
57 | void BOARD_BootClockRUN(void); | ||
58 | |||
59 | #if defined(__cplusplus) | ||
60 | } | ||
61 | #endif /* __cplusplus*/ | ||
62 | |||
63 | #endif /* _CLOCK_CONFIG_H_ */ | ||
64 | |||
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/peripherals.c b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/peripherals.c new file mode 100644 index 000000000..e0c5222bc --- /dev/null +++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/peripherals.c | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * Copyright 2017-2018 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 | ||
10 | product: Peripherals v1.0 | ||
11 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ | ||
12 | |||
13 | /******************************************************************************* | ||
14 | * Included files | ||
15 | ******************************************************************************/ | ||
16 | #include "peripherals.h" | ||
17 | |||
18 | /******************************************************************************* | ||
19 | * BOARD_InitBootPeripherals function | ||
20 | ******************************************************************************/ | ||
21 | void BOARD_InitBootPeripherals(void) | ||
22 | { | ||
23 | } | ||
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/peripherals.h b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/peripherals.h new file mode 100644 index 000000000..99b6c0b3b --- /dev/null +++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/peripherals.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * Copyright 2017-2018 NXP | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * SPDX-License-Identifier: BSD-3-Clause | ||
6 | */ | ||
7 | |||
8 | #ifndef _PERIPHERALS_H_ | ||
9 | #define _PERIPHERALS_H_ | ||
10 | |||
11 | #if defined(__cplusplus) | ||
12 | extern "C" { | ||
13 | #endif /*_cplusplus. */ | ||
14 | /******************************************************************************* | ||
15 | * BOARD_InitBootPeripherals function | ||
16 | ******************************************************************************/ | ||
17 | void BOARD_InitBootPeripherals(void); | ||
18 | |||
19 | #if defined(__cplusplus) | ||
20 | } | ||
21 | #endif /*_cplusplus. */ | ||
22 | |||
23 | #endif /* _PERIPHERALS_H_ */ | ||
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/pin_mux.c b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/pin_mux.c new file mode 100644 index 000000000..d5ae9dfba --- /dev/null +++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/pin_mux.c | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * Copyright 2018-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 | ||
17 | product: Pins v6.0 | ||
18 | processor: LPC832 | ||
19 | mcu_data: ksdk2_0 | ||
20 | processor_version: 0.0.10 | ||
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 ****************************************************************************************************************/ | ||
34 | void BOARD_InitBootPins(void) | ||
35 | { | ||
36 | BOARD_InitPins(); | ||
37 | } | ||
38 | |||
39 | /* clang-format off */ | ||
40 | /* | ||
41 | * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* | ||
42 | BOARD_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-M0P */ | ||
56 | void BOARD_InitPins(void) | ||
57 | { | ||
58 | } | ||
59 | /*********************************************************************************************************************** | ||
60 | * EOF | ||
61 | **********************************************************************************************************************/ | ||
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/pin_mux.h b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/pin_mux.h new file mode 100644 index 000000000..87d9da960 --- /dev/null +++ b/lib/chibios-contrib/ext/mcux-sdk/devices/LPC832/project_template/pin_mux.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * Copyright 2018-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 | * Definitions | ||
18 | **********************************************************************************************************************/ | ||
19 | |||
20 | /*! @brief Direction type */ | ||
21 | typedef enum _pin_mux_direction | ||
22 | { | ||
23 | kPIN_MUX_DirectionInput = 0U, /* Input direction */ | ||
24 | kPIN_MUX_DirectionOutput = 1U, /* Output direction */ | ||
25 | kPIN_MUX_DirectionInputOrOutput = 2U /* Input or output direction */ | ||
26 | } pin_mux_direction_t; | ||
27 | |||
28 | /*! | ||
29 | * @addtogroup pin_mux | ||
30 | * @{ | ||
31 | */ | ||
32 | |||
33 | /*********************************************************************************************************************** | ||
34 | * API | ||
35 | **********************************************************************************************************************/ | ||
36 | |||
37 | #if defined(__cplusplus) | ||
38 | extern "C" { | ||
39 | #endif | ||
40 | |||
41 | /*! | ||
42 | * @brief Calls initialization functions. | ||
43 | * | ||
44 | */ | ||
45 | void BOARD_InitBootPins(void); | ||
46 | |||
47 | /*! | ||
48 | * @brief Configures pin routing and optionally pin electrical features. | ||
49 | * | ||
50 | */ | ||
51 | void BOARD_InitPins(void); /* Function assigned for the Cortex-M0P */ | ||
52 | |||
53 | #if defined(__cplusplus) | ||
54 | } | ||
55 | #endif | ||
56 | |||
57 | /*! | ||
58 | * @} | ||
59 | */ | ||
60 | #endif /* _PIN_MUX_H_ */ | ||
61 | |||
62 | /*********************************************************************************************************************** | ||
63 | * EOF | ||
64 | **********************************************************************************************************************/ | ||