1 | /*********************************************************************************************************************** |
2 | * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file |
3 | * will be overwritten if the respective MCUXpresso Config Tools is used to update this file. |
4 | **********************************************************************************************************************/ |
5 | |
6 | /* clang-format off */ |
7 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
8 | !!GlobalInfo |
9 | product: Peripherals v11.0 |
10 | processor: MIMXRT1062xxxxA |
11 | package_id: MIMXRT1062DVL6A |
12 | mcu_data: ksdk2_0 |
13 | processor_version: 11.0.1 |
14 | board: MIMXRT1060-EVK |
15 | functionalGroups: |
16 | - name: BOARD_InitPeripherals |
17 | UUID: 8938164a-fc00-4024-85f1-e6a10239b6ba |
18 | called_from_default_init: true |
19 | selectedCore: core0 |
20 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
21 | |
22 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
23 | component: |
24 | - type: 'system' |
25 | - type_id: 'system_54b53072540eeeb8f8e9343e71f28176' |
26 | - global_system_definitions: |
27 | - user_definitions: '' |
28 | - user_includes: '' |
29 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
30 | |
31 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
32 | component: |
33 | - type: 'uart_cmsis_common' |
34 | - type_id: 'uart_cmsis_common_9cb8e302497aa696fdbb5a4fd622c2a8' |
35 | - global_USART_CMSIS_common: |
36 | - quick_selection: 'default' |
37 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
38 | |
39 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
40 | component: |
41 | - type: 'gpio_adapter_common' |
42 | - type_id: 'gpio_adapter_common_57579b9ac814fe26bf95df0a384c36b6' |
43 | - global_gpio_adapter_common: |
44 | - quick_selection: 'default' |
45 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
46 | /* clang-format on */ |
47 | |
48 | /*********************************************************************************************************************** |
49 | * Included files |
50 | **********************************************************************************************************************/ |
51 | #include "peripherals.h" |
52 | |
53 | /*********************************************************************************************************************** |
54 | * BOARD_InitPeripherals functional group |
55 | **********************************************************************************************************************/ |
56 | /*********************************************************************************************************************** |
57 | * DMA0 initialization code |
58 | **********************************************************************************************************************/ |
59 | /* clang-format off */ |
60 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
61 | instance: |
62 | - name: 'DMA0' |
63 | - type: 'edma' |
64 | - mode: 'basic' |
65 | - custom_name_enabled: 'false' |
66 | - type_id: 'edma_6d0dd4e17e2f179c7d42d98767129ede' |
67 | - functional_group: 'BOARD_InitPeripherals' |
68 | - peripheral: 'DMA0' |
69 | - config_sets: |
70 | - fsl_edma: |
71 | - common_settings: |
72 | - enableContinuousLinkMode: 'false' |
73 | - enableHaltOnError: 'true' |
74 | - enableRoundRobinArbitration: 'false' |
75 | - enableDebugMode: 'false' |
76 | - dma_table: |
77 | - 0: [] |
78 | - edma_channels: |
79 | - 0: |
80 | - apiMode: 'trans' |
81 | - edma_channel: |
82 | - channel_prefix_id: 'CH0' |
83 | - uid: '1669452495191' |
84 | - eDMAn: '0' |
85 | - eDMA_source: 'dmaMuxAlwaysOn' |
86 | - enableTriggerPIT: 'false' |
87 | - init_channel_priority: 'false' |
88 | - edma_channel_Preemption: |
89 | - enableChannelPreemption: 'false' |
90 | - enablePreemptAbility: 'false' |
91 | - channelPriority: '0' |
92 | - enable_custom_name: 'false' |
93 | - enableChannelRequest: 'false' |
94 | - enableAsyncRequest: 'false' |
95 | - tcd_pool_enable: 'false' |
96 | - tcd_settings: |
97 | - tcd_size: '1' |
98 | - tcd_memory_custom_id: 'false' |
99 | - transfer_config: [] |
100 | - init_callback: 'false' |
101 | - callback_function: '' |
102 | - callback_user_data: '' |
103 | - channel_enabled_interrupts: '' |
104 | - interrupt_channel: |
105 | - IRQn: 'DMA0_DMA16_IRQn' |
106 | - enable_priority: 'false' |
107 | - priority: '0' |
108 | - errInterruptConfig: |
109 | - enableErrInterrupt: 'false' |
110 | - errorInterrupt: |
111 | - IRQn: 'DMA_ERROR_IRQn' |
112 | - enable_interrrupt: 'enabled' |
113 | - enable_priority: 'false' |
114 | - priority: '0' |
115 | - enable_custom_name: 'false' |
116 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
117 | /* clang-format on */ |
118 | const edma_config_t DMA0_config = { |
119 | .enableContinuousLinkMode = false, |
120 | .enableHaltOnError = true, |
121 | .enableRoundRobinArbitration = false, |
122 | .enableDebugMode = false |
123 | }; |
124 | edma_handle_t DMA0_CH0_Handle; |
125 | |
126 | static void DMA0_init(void) { |
127 | |
128 | /* Channel CH0 initialization */ |
129 | /* Set the DMA channel0 always on */ |
130 | DMAMUX_EnableAlwaysOn(DMA0_DMAMUX_BASEADDR, DMA0_CH0_DMA_CHANNEL, true); |
131 | /* Enable the channel 0 in the DMAMUX */ |
132 | DMAMUX_EnableChannel(DMA0_DMAMUX_BASEADDR, DMA0_CH0_DMA_CHANNEL); |
133 | /* Create the eDMA DMA0_CH0_Handle handle */ |
134 | EDMA_CreateHandle(&DMA0_CH0_Handle, DMA0_DMA_BASEADDR, DMA0_CH0_DMA_CHANNEL); |
135 | } |
136 | |
137 | /*********************************************************************************************************************** |
138 | * ADC_1 initialization code |
139 | **********************************************************************************************************************/ |
140 | /* clang-format off */ |
141 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
142 | instance: |
143 | - name: 'ADC_1' |
144 | - type: 'adc_12b1msps_sar' |
145 | - mode: 'ADC_GENERAL' |
146 | - custom_name_enabled: 'true' |
147 | - type_id: 'adc_12b1msps_sar_6a490e886349a7b2b07bed10ce7b299b' |
148 | - functional_group: 'BOARD_InitPeripherals' |
149 | - peripheral: 'ADC1' |
150 | - config_sets: |
151 | - fsl_adc: |
152 | - clockConfig: |
153 | - clockSource: 'kADC_ClockSourceAD' |
154 | - clockSourceFreq: 'custom:10 MHz' |
155 | - clockDriver: 'kADC_ClockDriver2' |
156 | - samplePeriodMode: 'kADC_SamplePeriodShort2Clocks' |
157 | - enableAsynchronousClockOutput: 'true' |
158 | - conversionConfig: |
159 | - resolution: 'kADC_Resolution12Bit' |
160 | - hardwareAverageMode: 'kADC_HardwareAverageDisable' |
161 | - enableHardwareTrigger: 'software' |
162 | - enableHighSpeed: 'false' |
163 | - enableLowPower: 'false' |
164 | - enableContinuousConversion: 'false' |
165 | - enableOverWrite: 'false' |
166 | - enableDma: 'false' |
167 | - resultingTime: [] |
168 | - resultCorrection: |
169 | - doAutoCalibration: 'true' |
170 | - offset: '0' |
171 | - hardwareCompareConfiguration: |
172 | - hardwareCompareMode: 'disabled' |
173 | - value1: '0' |
174 | - value2: '0' |
175 | - enableInterrupt: 'true' |
176 | - adc_interrupt: |
177 | - IRQn: 'ADC1_IRQn' |
178 | - enable_interrrupt: 'enabled' |
179 | - enable_priority: 'false' |
180 | - priority: '0' |
181 | - enable_custom_name: 'false' |
182 | - adc_channels_config: |
183 | - 0: |
184 | - channelNumber: 'IN.9' |
185 | - channelName: '' |
186 | - channelGroup: '0' |
187 | - initializeChannel: 'false' |
188 | - enableInterruptOnConversionCompleted: 'false' |
189 | - 1: |
190 | - channelNumber: 'IN.0' |
191 | - channelName: '' |
192 | - channelGroup: '0' |
193 | - initializeChannel: 'false' |
194 | - enableInterruptOnConversionCompleted: 'true' |
195 | - 2: |
196 | - channelNumber: 'IN.15' |
197 | - channelName: '' |
198 | - channelGroup: '0' |
199 | - initializeChannel: 'false' |
200 | - enableInterruptOnConversionCompleted: 'true' |
201 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
202 | /* clang-format on */ |
203 | const adc_config_t ADC_1_config = { |
204 | .enableOverWrite = false, |
205 | .enableContinuousConversion = false, |
206 | .enableHighSpeed = false, |
207 | .enableLowPower = false, |
208 | .enableLongSample = false, |
209 | .enableAsynchronousClockOutput = true, |
210 | .referenceVoltageSource = kADC_ReferenceVoltageSourceAlt0, |
211 | .samplePeriodMode = kADC_SamplePeriodShort2Clocks, |
212 | .clockSource = kADC_ClockSourceAD, |
213 | .clockDriver = kADC_ClockDriver2, |
214 | .resolution = kADC_Resolution12Bit |
215 | }; |
216 | const adc_channel_config_t ADC_1_channels_config[3] = { |
217 | { |
218 | .channelNumber = 9U, |
219 | .enableInterruptOnConversionCompleted = false |
220 | }, |
221 | { |
222 | .channelNumber = 0U, |
223 | .enableInterruptOnConversionCompleted = true |
224 | }, |
225 | { |
226 | .channelNumber = 15U, |
227 | .enableInterruptOnConversionCompleted = true |
228 | } |
229 | }; |
230 | static void ADC_1_init(void) { |
231 | /* Initialize ADC1 peripheral. */ |
232 | ADC_Init(ADC_1_PERIPHERAL, &ADC_1_config); |
233 | /* Perform ADC1 auto calibration. */ |
234 | ADC_DoAutoCalibration(ADC_1_PERIPHERAL); |
235 | /* Enable interrupt ADC1_IRQn request in the NVIC. */ |
236 | EnableIRQ(ADC_1_IRQN); |
237 | } |
238 | |
239 | /*********************************************************************************************************************** |
240 | * AOI_1 initialization code |
241 | **********************************************************************************************************************/ |
242 | /* clang-format off */ |
243 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
244 | instance: |
245 | - name: 'AOI_1' |
246 | - type: 'aoi' |
247 | - mode: 'AOI' |
248 | - custom_name_enabled: 'true' |
249 | - type_id: 'aoi_5a2efbfd7a8a5208f8f552077e2b4ded' |
250 | - functional_group: 'BOARD_InitPeripherals' |
251 | - peripheral: 'AOI1' |
252 | - config_sets: |
253 | - fsl_aoi: |
254 | - events: |
255 | - 0: |
256 | - product_terms: |
257 | - 0: |
258 | - input0: 'kAOI_LogicZero' |
259 | - input1: 'kAOI_LogicZero' |
260 | - input2: 'kAOI_LogicZero' |
261 | - input3: 'kAOI_LogicZero' |
262 | - 1: |
263 | - input0: 'kAOI_LogicZero' |
264 | - input1: 'kAOI_LogicZero' |
265 | - input2: 'kAOI_LogicZero' |
266 | - input3: 'kAOI_LogicZero' |
267 | - 2: |
268 | - input0: 'kAOI_LogicZero' |
269 | - input1: 'kAOI_LogicZero' |
270 | - input2: 'kAOI_LogicZero' |
271 | - input3: 'kAOI_LogicZero' |
272 | - 3: |
273 | - input0: 'kAOI_LogicZero' |
274 | - input1: 'kAOI_LogicZero' |
275 | - input2: 'kAOI_LogicZero' |
276 | - input3: 'kAOI_LogicZero' |
277 | - define: 'false' |
278 | - initialize: 'true' |
279 | - 1: |
280 | - product_terms: |
281 | - 0: |
282 | - input0: 'kAOI_LogicZero' |
283 | - input1: 'kAOI_LogicZero' |
284 | - input2: 'kAOI_LogicZero' |
285 | - input3: 'kAOI_LogicZero' |
286 | - 1: |
287 | - input0: 'kAOI_LogicZero' |
288 | - input1: 'kAOI_LogicZero' |
289 | - input2: 'kAOI_LogicZero' |
290 | - input3: 'kAOI_LogicZero' |
291 | - 2: |
292 | - input0: 'kAOI_LogicZero' |
293 | - input1: 'kAOI_LogicZero' |
294 | - input2: 'kAOI_LogicZero' |
295 | - input3: 'kAOI_LogicZero' |
296 | - 3: |
297 | - input0: 'kAOI_LogicZero' |
298 | - input1: 'kAOI_LogicZero' |
299 | - input2: 'kAOI_LogicZero' |
300 | - input3: 'kAOI_LogicZero' |
301 | - define: 'false' |
302 | - initialize: 'false' |
303 | - 2: |
304 | - product_terms: |
305 | - 0: |
306 | - input0: 'kAOI_LogicZero' |
307 | - input1: 'kAOI_LogicZero' |
308 | - input2: 'kAOI_LogicZero' |
309 | - input3: 'kAOI_LogicZero' |
310 | - 1: |
311 | - input0: 'kAOI_LogicZero' |
312 | - input1: 'kAOI_LogicZero' |
313 | - input2: 'kAOI_LogicZero' |
314 | - input3: 'kAOI_LogicZero' |
315 | - 2: |
316 | - input0: 'kAOI_LogicZero' |
317 | - input1: 'kAOI_LogicZero' |
318 | - input2: 'kAOI_LogicZero' |
319 | - input3: 'kAOI_LogicZero' |
320 | - 3: |
321 | - input0: 'kAOI_LogicZero' |
322 | - input1: 'kAOI_LogicZero' |
323 | - input2: 'kAOI_LogicZero' |
324 | - input3: 'kAOI_LogicZero' |
325 | - define: 'false' |
326 | - initialize: 'false' |
327 | - 3: |
328 | - product_terms: |
329 | - 0: |
330 | - input0: 'kAOI_LogicZero' |
331 | - input1: 'kAOI_LogicZero' |
332 | - input2: 'kAOI_LogicZero' |
333 | - input3: 'kAOI_LogicZero' |
334 | - 1: |
335 | - input0: 'kAOI_LogicZero' |
336 | - input1: 'kAOI_LogicZero' |
337 | - input2: 'kAOI_LogicZero' |
338 | - input3: 'kAOI_LogicZero' |
339 | - 2: |
340 | - input0: 'kAOI_LogicZero' |
341 | - input1: 'kAOI_LogicZero' |
342 | - input2: 'kAOI_LogicZero' |
343 | - input3: 'kAOI_LogicZero' |
344 | - 3: |
345 | - input0: 'kAOI_LogicZero' |
346 | - input1: 'kAOI_LogicZero' |
347 | - input2: 'kAOI_LogicZero' |
348 | - input3: 'kAOI_LogicZero' |
349 | - define: 'false' |
350 | - initialize: 'false' |
351 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
352 | /* clang-format on */ |
353 | |
354 | static void AOI_1_init(void) { |
355 | /* Initialize AOI1 peripheral. */ |
356 | AOI_Init(AOI_1_PERIPHERAL); |
357 | } |
358 | |
359 | /*********************************************************************************************************************** |
360 | * CMP_2 initialization code |
361 | **********************************************************************************************************************/ |
362 | /* clang-format off */ |
363 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
364 | instance: |
365 | - name: 'CMP_2' |
366 | - type: 'cmp' |
367 | - mode: 'polling' |
368 | - custom_name_enabled: 'true' |
369 | - type_id: 'cmp_306724f57b92dbe1771f1514089d2b18' |
370 | - functional_group: 'BOARD_InitPeripherals' |
371 | - peripheral: 'CMP2' |
372 | - config_sets: |
373 | - fsl_filter: |
374 | - filter_config: |
375 | - filteringOptions: '' |
376 | - quick_selection: 'ContinuousMode' |
377 | - fsl_cmp: |
378 | - main_config: |
379 | - explicitEnableCmp: 'true' |
380 | - hysteresisMode: 'kCMP_HysteresisLevel0' |
381 | - enableHighSpeed: 'false' |
382 | - enableInvertOutput: 'false' |
383 | - useUnfilteredOutput: 'false' |
384 | - enablePinOut: 'false' |
385 | - positiveChannel: 'IN.5' |
386 | - negativeChannel: 'IN.7' |
387 | - fsl_dac: |
388 | - enableDAC: 'true' |
389 | - dac_config: |
390 | - referenceVoltageSource: 'DAC_6bit_VIN1' |
391 | - DACValue: '1' |
392 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
393 | /* clang-format on */ |
394 | /* CMP_2 main configuration */ |
395 | const cmp_config_t CMP_2_config = { |
396 | .enableCmp = false, |
397 | .hysteresisMode = kCMP_HysteresisLevel0, |
398 | .enableHighSpeed = false, |
399 | .enableInvertOutput = false, |
400 | .useUnfilteredOutput = false, |
401 | .enablePinOut = false, |
402 | }; |
403 | /* Configuration of the DAC sub-module, used in the CMP_SetDACConfig() function */ |
404 | const cmp_dac_config_t CMP_2_dac_config = { |
405 | .referenceVoltageSource = kCMP_VrefSourceVin1, |
406 | .DACValue = 0U |
407 | }; |
408 | |
409 | static void CMP_2_init(void) { |
410 | /* Initialize CMP main sub-module functionality */ |
411 | CMP_Init(CMP_2_PERIPHERAL, &CMP_2_config); |
412 | /* Set up internal DAC sub-module, that can be used as input 7 of the CMP both inputs. */ |
413 | CMP_SetDACConfig(CMP_2_PERIPHERAL, &CMP_2_dac_config); |
414 | /* Initialize CMP main sub-module functionality */ |
415 | CMP_SetInputChannels(CMP_2_PERIPHERAL, CMP_2_POSITIVE_INPUT_NUMBER, CMP_2_NEGATIVE_INPUT_NUMBER); |
416 | /* Explicitly enables CMP periphery to satisfy glitch limitations. */ |
417 | CMP_Enable(CMP_2_PERIPHERAL, true); |
418 | } |
419 | |
420 | /*********************************************************************************************************************** |
421 | * ENC_1 initialization code |
422 | **********************************************************************************************************************/ |
423 | /* clang-format off */ |
424 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
425 | instance: |
426 | - name: 'ENC_1' |
427 | - type: 'enc' |
428 | - mode: 'general' |
429 | - custom_name_enabled: 'true' |
430 | - type_id: 'enc_a31ae546b0cbfc3aa2c35851e1fcb3b8' |
431 | - functional_group: 'BOARD_InitPeripherals' |
432 | - peripheral: 'ENC1' |
433 | - config_sets: |
434 | - fsl_enc: |
435 | - config: |
436 | - clockConfig_t: |
437 | - clockSource: 'BusInterfaceClock' |
438 | - clockSourceFreq: 'BOARD_BootClockRUN' |
439 | - decoderWorkMode: 'kENC_DecoderWorkAsNormalMode' |
440 | - enableReverseDirection: 'false' |
441 | - posInitialization: |
442 | - HOMETriggerMode: 'kENC_HOMETriggerDisabled' |
443 | - INDEXTriggerMode: 'kENC_INDEXTriggerDisabled' |
444 | - positionInitialValue: '0' |
445 | - triggerAction: '' |
446 | - positionMatchConfig: |
447 | - positionMatchMode: 'kENC_POSMATCHOnPositionCounterEqualToComapreValue' |
448 | - positionCompareValue: '0xFFFFFFFF' |
449 | - modulusConfig: |
450 | - revolutionCountCondition: 'kENC_RevolutionCountOnINDEXPulse' |
451 | - enableModuloCountMode: 'false' |
452 | - wdogConfig: |
453 | - enableWatchdog: 'false' |
454 | - filter_config_t: |
455 | - enableFilter: 'false' |
456 | - interruptsCfg: |
457 | - interruptSources: 'kENC_INDEXPulseInterruptEnable' |
458 | - isInterruptEnabled: 'false' |
459 | - interrupt: |
460 | - IRQn: 'ENC1_IRQn' |
461 | - enable_interrrupt: 'enabled' |
462 | - enable_priority: 'false' |
463 | - priority: '0' |
464 | - enable_custom_name: 'false' |
465 | - enable_home_irq: 'false' |
466 | - interrupt_home: |
467 | - IRQn: 'ENC1_IRQn' |
468 | - enable_interrrupt: 'enabled' |
469 | - enable_priority: 'false' |
470 | - priority: '0' |
471 | - enable_custom_name: 'false' |
472 | - enable_wdog_irq: 'false' |
473 | - interrupt_wdog: |
474 | - IRQn: 'ENC1_IRQn' |
475 | - enable_interrrupt: 'enabled' |
476 | - enable_priority: 'false' |
477 | - priority: '0' |
478 | - enable_custom_name: 'false' |
479 | - enable_index_irq: 'false' |
480 | - interrupt_index: |
481 | - IRQn: 'ENC1_IRQn' |
482 | - enable_interrrupt: 'enabled' |
483 | - enable_priority: 'false' |
484 | - priority: '0' |
485 | - enable_custom_name: 'false' |
486 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
487 | /* clang-format on */ |
488 | /* ENC configuration */ |
489 | enc_config_t ENC_1_config = { |
490 | .decoderWorkMode = kENC_DecoderWorkAsNormalMode, |
491 | .enableReverseDirection = false, |
492 | .HOMETriggerMode = kENC_HOMETriggerDisabled, |
493 | .INDEXTriggerMode = kENC_INDEXTriggerDisabled, |
494 | .positionInitialValue = 0, |
495 | .enableTRIGGERClearPositionCounter = false, |
496 | .enableTRIGGERClearHoldPositionCounter = false, |
497 | .positionMatchMode = kENC_POSMATCHOnPositionCounterEqualToComapreValue, |
498 | .positionCompareValue = 4294967295, |
499 | .revolutionCountCondition = kENC_RevolutionCountOnINDEXPulse, |
500 | .enableModuloCountMode = false, |
501 | .positionModulusValue = 0, |
502 | .enableWatchdog = false, |
503 | .watchdogTimeoutValue = 0, |
504 | .filterCount = 0, |
505 | .filterSamplePeriod = 0 |
506 | }; |
507 | |
508 | static void ENC_1_init(void) { |
509 | /* ENC initialization */ |
510 | ENC_Init(ENC_1_PERIPHERAL, &ENC_1_config); |
511 | /* ENC enable selected interrupts */ |
512 | ENC_EnableInterrupts(ENC_1_PERIPHERAL, kENC_INDEXPulseInterruptEnable); |
513 | } |
514 | |
515 | /*********************************************************************************************************************** |
516 | * FLEXIO_I2C_1 initialization code |
517 | **********************************************************************************************************************/ |
518 | /* clang-format off */ |
519 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
520 | instance: |
521 | - name: 'FLEXIO_I2C_1' |
522 | - type: 'flexio_i2c_master' |
523 | - mode: 'polling' |
524 | - custom_name_enabled: 'true' |
525 | - type_id: 'flexio_i2c_master_337812fef13382b42ae08a3bbf349c7c' |
526 | - functional_group: 'BOARD_InitPeripherals' |
527 | - peripheral: 'FLEXIO1' |
528 | - config_sets: |
529 | - fsl_flexio_i2c_master: |
530 | - clockSource: 'FlexIoClock' |
531 | - clockSourceFreq: 'BOARD_BootClockRUN' |
532 | - peripheralConfig: |
533 | - SDAPinIndex: '0' |
534 | - SCLPinIndex: '1' |
535 | - shifterIndex_0: '0' |
536 | - shifterIndex_1: '1' |
537 | - timerIndex_0: '0' |
538 | - timerIndex_1: '1' |
539 | - timerIndex_2: '2' |
540 | - config: |
541 | - enableMaster: 'true' |
542 | - enableInDoze: 'false' |
543 | - enableInDebug: 'true' |
544 | - enableFastAccess: 'false' |
545 | - baudRate_Bps: '100000' |
546 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
547 | /* clang-format on */ |
548 | /* FlexIO peripheral configuration */ |
549 | FLEXIO_I2C_Type FLEXIO_I2C_1_peripheralConfig = { |
550 | .flexioBase = FLEXIO_I2C_1_PERIPHERAL, |
551 | .SDAPinIndex = 0, |
552 | .SCLPinIndex = 1, |
553 | .shifterIndex = {0, 1}, |
554 | .timerIndex = {0, 1, 2} |
555 | }; |
556 | /* I2C master configuration */ |
557 | flexio_i2c_master_config_t FLEXIO_I2C_1_config = { |
558 | .enableMaster = true, |
559 | .enableInDoze = false, |
560 | .enableInDebug = true, |
561 | .enableFastAccess = false, |
562 | .baudRate_Bps = 100000UL |
563 | }; |
564 | |
565 | static void FLEXIO_I2C_1_init(void) { |
566 | /* Master initialization */ |
567 | FLEXIO_I2C_MasterInit(&FLEXIO_I2C_1_peripheralConfig, &FLEXIO_I2C_1_config, FLEXIO_I2C_1_CLK_FREQ); |
568 | } |
569 | |
570 | /*********************************************************************************************************************** |
571 | * FLEXIO_SPI_1 initialization code |
572 | **********************************************************************************************************************/ |
573 | /* clang-format off */ |
574 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
575 | instance: |
576 | - name: 'FLEXIO_SPI_1' |
577 | - type: 'flexio_spi' |
578 | - mode: 'polling' |
579 | - custom_name_enabled: 'true' |
580 | - type_id: 'flexio_spi_d67d6584d62b130dba246fa5abb61949' |
581 | - functional_group: 'BOARD_InitPeripherals' |
582 | - peripheral: 'FLEXIO2' |
583 | - config_sets: |
584 | - fsl_flexio_spi: |
585 | - spi_mode: 'kSPI_Master' |
586 | - clockSource: 'FlexIoClock' |
587 | - clockSourceFreq: 'BOARD_BootClockRUN' |
588 | - peripheralConfig: |
589 | - SDOPinIndex: '4' |
590 | - SDIPinIndex: '5' |
591 | - SCKPinIndex: '6' |
592 | - CSnPinIndex: '7' |
593 | - shifterIndex_0: '0' |
594 | - shifterIndex_1: '1' |
595 | - timerIndex_0: '0' |
596 | - timerIndex_1: '1' |
597 | - master_config: |
598 | - enableMaster: 'true' |
599 | - enableInDoze: 'false' |
600 | - enableInDebug: 'true' |
601 | - enableFastAccess: 'false' |
602 | - baudRate_Bps: '500000' |
603 | - phase: 'kFLEXIO_SPI_ClockPhaseFirstEdge' |
604 | - dataMode: 'kFLEXIO_SPI_8BitMode' |
605 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
606 | /* clang-format on */ |
607 | /* FlexIO access configuration */ |
608 | FLEXIO_SPI_Type FLEXIO_SPI_1_peripheralConfig = { |
609 | .flexioBase = FLEXIO_SPI_1_PERIPHERAL, |
610 | .SDOPinIndex = 4, |
611 | .SDIPinIndex = 5, |
612 | .SCKPinIndex = 6, |
613 | .CSnPinIndex = 7, |
614 | .shifterIndex = {0, 1}, |
615 | .timerIndex = {0, 1} |
616 | }; |
617 | /* SPI master configuration */ |
618 | flexio_spi_master_config_t FLEXIO_SPI_1_config = { |
619 | .enableMaster = true, |
620 | .enableInDoze = false, |
621 | .enableInDebug = true, |
622 | .enableFastAccess = false, |
623 | .baudRate_Bps = 500000UL, |
624 | .phase = kFLEXIO_SPI_ClockPhaseFirstEdge, |
625 | .dataMode = kFLEXIO_SPI_8BitMode |
626 | }; |
627 | |
628 | static void FLEXIO_SPI_1_init(void) { |
629 | /* Master initialization */ |
630 | FLEXIO_SPI_MasterInit(&FLEXIO_SPI_1_peripheralConfig, &FLEXIO_SPI_1_config, FLEXIO_SPI_1_CLK_FREQ); |
631 | } |
632 | |
633 | /*********************************************************************************************************************** |
634 | * FLEXIO_UART_1 initialization code |
635 | **********************************************************************************************************************/ |
636 | /* clang-format off */ |
637 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
638 | instance: |
639 | - name: 'FLEXIO_UART_1' |
640 | - type: 'flexio_uart' |
641 | - mode: 'polling' |
642 | - custom_name_enabled: 'true' |
643 | - type_id: 'flexio_uart_fc94dc0ace2887e1e4712084856919fa' |
644 | - functional_group: 'BOARD_InitPeripherals' |
645 | - peripheral: 'FLEXIO3' |
646 | - config_sets: |
647 | - fsl_flexio_uart: |
648 | - deviceConfig: |
649 | - TxPinIndex: '6' |
650 | - RxPinIndex: '7' |
651 | - shifterIndex0: '0' |
652 | - shifterIndex1: '1' |
653 | - timerIndex0: '0' |
654 | - timerIndex1: '1' |
655 | - uartConfig: |
656 | - clockSource: 'FlexIoClock' |
657 | - clockSourceFreq: 'BOARD_BootClockRUN' |
658 | - baudRate_Bps: '115200' |
659 | - bitCountPerChar: 'kFLEXIO_UART_8BitsPerChar' |
660 | - enableUart: 'true' |
661 | - enableInDoze: 'false' |
662 | - enableInDebug: 'true' |
663 | - enableFastAccess: 'false' |
664 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
665 | /* clang-format on */ |
666 | FLEXIO_UART_Type FLEXIO_UART_1_device = { |
667 | .flexioBase = FLEXIO_UART_1_PERIPHERAL, |
668 | .TxPinIndex = 6, |
669 | .RxPinIndex = 7, |
670 | .shifterIndex = {0, 1}, |
671 | .timerIndex = {0, 1} |
672 | }; |
673 | const flexio_uart_config_t FLEXIO_UART_1_config = { |
674 | .baudRate_Bps = 115200UL, |
675 | .bitCountPerChar = kFLEXIO_UART_8BitsPerChar, |
676 | .enableUart = true, |
677 | .enableInDoze = false, |
678 | .enableInDebug = true, |
679 | .enableFastAccess = false |
680 | }; |
681 | |
682 | static void FLEXIO_UART_1_init(void) { |
683 | FLEXIO_UART_Init(&FLEXIO_UART_1_device, &FLEXIO_UART_1_config, FLEXIO_UART_1_CLOCK_SOURCE); |
684 | } |
685 | |
686 | /*********************************************************************************************************************** |
687 | * FlexCAN_2 initialization code |
688 | **********************************************************************************************************************/ |
689 | /* clang-format off */ |
690 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
691 | instance: |
692 | - name: 'FlexCAN_2' |
693 | - type: 'flexcan' |
694 | - mode: 'interrupts' |
695 | - custom_name_enabled: 'true' |
696 | - type_id: 'flexcan_10d80efac19b25dcd240244aae88dca0' |
697 | - functional_group: 'BOARD_InitPeripherals' |
698 | - peripheral: 'CAN2' |
699 | - config_sets: |
700 | - interruptsCfg: |
701 | - messageBufferIrqs: '0' |
702 | - messageBufferIrqs2: '0' |
703 | - interruptsEnable: '' |
704 | - enable_irq: 'true' |
705 | - interrupt_shared: |
706 | - IRQn: 'CAN2_IRQn' |
707 | - enable_interrrupt: 'enabled' |
708 | - enable_priority: 'false' |
709 | - priority: '0' |
710 | - enable_custom_name: 'false' |
711 | - fsl_flexcan: |
712 | - can_config: |
713 | - clockSource: 'kFLEXCAN_ClkSrcOsc' |
714 | - clockSourceFreq: 'BOARD_BootClockRUN' |
715 | - wakeupSrc: 'kFLEXCAN_WakeupSrcUnfiltered' |
716 | - baudRate: '1000000' |
717 | - maxMbNum: '16' |
718 | - enableLoopBack: 'false' |
719 | - enableTimerSync: 'true' |
720 | - enableSelfWakeup: 'false' |
721 | - enableIndividMask: 'false' |
722 | - timingConfig: |
723 | - propSeg: '2' |
724 | - phaseSeg1: '4' |
725 | - phaseSeg2: '3' |
726 | - rJumpwidth: '2' |
727 | - bitTime: [] |
728 | - enableRxFIFO: 'false' |
729 | - rxFIFO: |
730 | - idFilterTable: '' |
731 | - idFilterNum: 'num0' |
732 | - idFilterType: 'kFLEXCAN_RxFifoFilterTypeA' |
733 | - priority: 'kFLEXCAN_RxFifoPrioLow' |
734 | - channels: |
735 | - 0: |
736 | - mbID: '9' |
737 | - mbType: 'mbRx' |
738 | - rxMb: |
739 | - id: '0' |
740 | - format: 'kFLEXCAN_FrameFormatStandard' |
741 | - type: 'kFLEXCAN_FrameTypeData' |
742 | - 1: |
743 | - mbID: '8' |
744 | - mbType: 'mbTx' |
745 | - rxMb: |
746 | - id: '0' |
747 | - format: 'kFLEXCAN_FrameFormatStandard' |
748 | - type: 'kFLEXCAN_FrameTypeData' |
749 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
750 | /* clang-format on */ |
751 | const flexcan_config_t FlexCAN_2_config = { |
752 | .wakeupSrc = kFLEXCAN_WakeupSrcUnfiltered, |
753 | .baudRate = 1000000UL, |
754 | .maxMbNum = 16U, |
755 | .enableLoopBack = false, |
756 | .enableTimerSync = true, |
757 | .enableSelfWakeup = false, |
758 | .enableIndividMask = false, |
759 | .timingConfig = { |
760 | .preDivider = 2, |
761 | .propSeg = 1, |
762 | .phaseSeg1 = 3, |
763 | .phaseSeg2 = 2, |
764 | .rJumpwidth = 1 |
765 | } |
766 | }; |
767 | /* Message buffer 9 configuration structure */ |
768 | const flexcan_rx_mb_config_t FlexCAN_2_rx_mb_config_9 = { |
769 | .id = FLEXCAN_ID_STD(0UL), |
770 | .format = kFLEXCAN_FrameFormatStandard, |
771 | .type = kFLEXCAN_FrameTypeData |
772 | }; |
773 | |
774 | static void FlexCAN_2_init(void) { |
775 | FLEXCAN_Init(FLEXCAN_2_PERIPHERAL, &FlexCAN_2_config, FLEXCAN_2_CLOCK_SOURCE); |
776 | |
777 | /* Message buffer 9 initialization */ |
778 | FLEXCAN_SetRxMbConfig(FLEXCAN_2_PERIPHERAL, 9, &FlexCAN_2_rx_mb_config_9, true); |
779 | /* Message buffer 8 initialization */ |
780 | FLEXCAN_SetTxMbConfig(FLEXCAN_2_PERIPHERAL, 8, true); |
781 | /* Enable interrupt CAN2_IRQn request in the NVIC. */ |
782 | EnableIRQ(FLEXCAN_2_FLEXCAN_IRQN); |
783 | } |
784 | |
785 | /*********************************************************************************************************************** |
786 | * GPIO_1 initialization code |
787 | **********************************************************************************************************************/ |
788 | /* clang-format off */ |
789 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
790 | instance: |
791 | - name: 'GPIO_1' |
792 | - type: 'igpio' |
793 | - mode: 'GPIO' |
794 | - custom_name_enabled: 'true' |
795 | - type_id: 'igpio_b1c1fa279aa7069dca167502b8589cb7' |
796 | - functional_group: 'BOARD_InitPeripherals' |
797 | - peripheral: 'GPIO1' |
798 | - config_sets: |
799 | - fsl_gpio: |
800 | - enable_irq_comb_0_15: 'true' |
801 | - gpio_interrupt_comb_0_15: |
802 | - IRQn: 'GPIO1_Combined_0_15_IRQn' |
803 | - enable_interrrupt: 'noInit' |
804 | - enable_priority: 'true' |
805 | - priority: '0' |
806 | - enable_custom_name: 'false' |
807 | - enable_irq_comb_16_31: 'true' |
808 | - gpio_interrupt_comb_16_31: |
809 | - IRQn: 'GPIO1_Combined_16_31_IRQn' |
810 | - enable_interrrupt: 'noInit' |
811 | - enable_priority: 'true' |
812 | - priority: '0' |
813 | - enable_custom_name: 'false' |
814 | - enable_irq_int0: 'false' |
815 | - gpio_interrupt_int0: |
816 | - IRQn: 'GPIO1_INT0_IRQn' |
817 | - enable_interrrupt: 'enabled' |
818 | - enable_priority: 'false' |
819 | - priority: '0' |
820 | - enable_custom_name: 'false' |
821 | - enable_irq_int1: 'false' |
822 | - gpio_interrupt_int1: |
823 | - IRQn: 'GPIO1_INT1_IRQn' |
824 | - enable_interrrupt: 'enabled' |
825 | - enable_priority: 'false' |
826 | - priority: '0' |
827 | - enable_custom_name: 'false' |
828 | - enable_irq_int2: 'false' |
829 | - gpio_interrupt_int2: |
830 | - IRQn: 'GPIO1_INT2_IRQn' |
831 | - enable_interrrupt: 'enabled' |
832 | - enable_priority: 'false' |
833 | - priority: '0' |
834 | - enable_custom_name: 'false' |
835 | - enable_irq_int3: 'false' |
836 | - gpio_interrupt_int3: |
837 | - IRQn: 'GPIO1_INT3_IRQn' |
838 | - enable_interrrupt: 'enabled' |
839 | - enable_priority: 'false' |
840 | - priority: '0' |
841 | - enable_custom_name: 'false' |
842 | - enable_irq_int4: 'false' |
843 | - gpio_interrupt_int4: |
844 | - IRQn: 'GPIO1_INT4_IRQn' |
845 | - enable_interrrupt: 'enabled' |
846 | - enable_priority: 'false' |
847 | - priority: '0' |
848 | - enable_custom_name: 'false' |
849 | - enable_irq_int5: 'false' |
850 | - gpio_interrupt_int5: |
851 | - IRQn: 'GPIO1_INT5_IRQn' |
852 | - enable_interrrupt: 'enabled' |
853 | - enable_priority: 'false' |
854 | - priority: '0' |
855 | - enable_custom_name: 'false' |
856 | - enable_irq_int6: 'false' |
857 | - gpio_interrupt_int6: |
858 | - IRQn: 'GPIO1_INT6_IRQn' |
859 | - enable_interrrupt: 'enabled' |
860 | - enable_priority: 'false' |
861 | - priority: '0' |
862 | - enable_custom_name: 'false' |
863 | - enable_irq_int7: 'false' |
864 | - gpio_interrupt_int7: |
865 | - IRQn: 'GPIO1_INT7_IRQn' |
866 | - enable_interrrupt: 'enabled' |
867 | - enable_priority: 'false' |
868 | - priority: '0' |
869 | - enable_custom_name: 'false' |
870 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
871 | /* clang-format on */ |
872 | |
873 | static void GPIO_1_init(void) { |
874 | /* Make sure, the clock gate for GPIO1 is enabled (e. g. in pin_mux.c) */ |
875 | /* Interrupt vector GPIO1_Combined_0_15_IRQn priority settings in the NVIC. */ |
876 | NVIC_SetPriority(GPIO_1_GPIO_COMB_0_15_IRQN, GPIO_1_GPIO_COMB_0_15_IRQ_PRIORITY); |
877 | /* Interrupt GPIO1_Combined_0_15_IRQn request in the NVIC is not initialized (disabled by default). */ |
878 | /* It can be enabled later by EnableIRQ(GPIO_1_GPIO_COMB_0_15_IRQN); function call. */ |
879 | /* Interrupt vector GPIO1_Combined_16_31_IRQn priority settings in the NVIC. */ |
880 | NVIC_SetPriority(GPIO_1_GPIO_COMB_16_31_IRQN, GPIO_1_GPIO_COMB_16_31_IRQ_PRIORITY); |
881 | /* Interrupt GPIO1_Combined_16_31_IRQn request in the NVIC is not initialized (disabled by default). */ |
882 | /* It can be enabled later by EnableIRQ(GPIO_1_GPIO_COMB_16_31_IRQN); function call. */ |
883 | } |
884 | |
885 | /*********************************************************************************************************************** |
886 | * GPIO_3 initialization code |
887 | **********************************************************************************************************************/ |
888 | /* clang-format off */ |
889 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
890 | instance: |
891 | - name: 'GPIO_3' |
892 | - type: 'igpio' |
893 | - mode: 'GPIO' |
894 | - custom_name_enabled: 'true' |
895 | - type_id: 'igpio_b1c1fa279aa7069dca167502b8589cb7' |
896 | - functional_group: 'BOARD_InitPeripherals' |
897 | - peripheral: 'GPIO3' |
898 | - config_sets: |
899 | - fsl_gpio: |
900 | - enable_irq_comb_0_15: 'true' |
901 | - gpio_interrupt_comb_0_15: |
902 | - IRQn: 'GPIO3_Combined_0_15_IRQn' |
903 | - enable_interrrupt: 'enabled' |
904 | - enable_priority: 'false' |
905 | - priority: '0' |
906 | - enable_custom_name: 'false' |
907 | - enable_irq_comb_16_31: 'true' |
908 | - gpio_interrupt_comb_16_31: |
909 | - IRQn: 'GPIO3_Combined_16_31_IRQn' |
910 | - enable_interrrupt: 'enabled' |
911 | - enable_priority: 'false' |
912 | - priority: '0' |
913 | - enable_custom_name: 'false' |
914 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
915 | /* clang-format on */ |
916 | |
917 | static void GPIO_3_init(void) { |
918 | /* Make sure, the clock gate for GPIO3 is enabled (e. g. in pin_mux.c) */ |
919 | /* Enable interrupt GPIO3_Combined_0_15_IRQn request in the NVIC. */ |
920 | EnableIRQ(GPIO_3_GPIO_COMB_0_15_IRQN); |
921 | /* Enable interrupt GPIO3_Combined_16_31_IRQn request in the NVIC. */ |
922 | EnableIRQ(GPIO_3_GPIO_COMB_16_31_IRQN); |
923 | } |
924 | |
925 | /*********************************************************************************************************************** |
926 | * GPIO_5 initialization code |
927 | **********************************************************************************************************************/ |
928 | /* clang-format off */ |
929 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
930 | instance: |
931 | - name: 'GPIO_5' |
932 | - type: 'igpio' |
933 | - mode: 'GPIO' |
934 | - custom_name_enabled: 'true' |
935 | - type_id: 'igpio_b1c1fa279aa7069dca167502b8589cb7' |
936 | - functional_group: 'BOARD_InitPeripherals' |
937 | - peripheral: 'GPIO5' |
938 | - config_sets: |
939 | - fsl_gpio: |
940 | - enable_irq_comb_0_15: 'true' |
941 | - gpio_interrupt_comb_0_15: |
942 | - IRQn: 'GPIO5_Combined_0_15_IRQn' |
943 | - enable_interrrupt: 'noInit' |
944 | - enable_priority: 'false' |
945 | - priority: '0' |
946 | - enable_custom_name: 'false' |
947 | - enable_irq_comb_16_31: 'false' |
948 | - gpio_interrupt_comb_16_31: |
949 | - IRQn: 'GPIO5_Combined_16_31_IRQn' |
950 | - enable_interrrupt: 'enabled' |
951 | - enable_priority: 'false' |
952 | - priority: '0' |
953 | - enable_custom_name: 'false' |
954 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
955 | /* clang-format on */ |
956 | |
957 | static void GPIO_5_init(void) { |
958 | /* Make sure, the clock gate for GPIO5 is enabled (e. g. in pin_mux.c) */ |
959 | /* Interrupt GPIO5_Combined_0_15_IRQn request in the NVIC is not initialized (disabled by default). */ |
960 | /* It can be enabled later by EnableIRQ(GPIO_5_GPIO_COMB_0_15_IRQN); function call. */ |
961 | } |
962 | |
963 | /*********************************************************************************************************************** |
964 | * GPT_2 initialization code |
965 | **********************************************************************************************************************/ |
966 | /* clang-format off */ |
967 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
968 | instance: |
969 | - name: 'GPT_2' |
970 | - type: 'gpt' |
971 | - mode: 'general' |
972 | - custom_name_enabled: 'true' |
973 | - type_id: 'gpt_e92a0cbd07e389b82a1d19b05eb9fdda' |
974 | - functional_group: 'BOARD_InitPeripherals' |
975 | - peripheral: 'GPT2' |
976 | - config_sets: |
977 | - fsl_gpt: |
978 | - gpt_config: |
979 | - clockSource: 'kGPT_ClockSource_Periph' |
980 | - clockSourceFreq: 'BOARD_BootClockRUN' |
981 | - oscDivider: '1' |
982 | - divider: '1' |
983 | - enableFreeRun: 'false' |
984 | - enableRunInWait: 'true' |
985 | - enableRunInStop: 'true' |
986 | - enableRunInDoze: 'true' |
987 | - enableRunInDbg: 'true' |
988 | - enableMode: 'true' |
989 | - input_capture_channels: |
990 | - 0: |
991 | - channelName: '' |
992 | - channel: 'kGPT_InputCapture_Channel1' |
993 | - mode: 'kGPT_InputOperation_BothEdge' |
994 | - output_compare_channels: |
995 | - 0: |
996 | - channelName: '' |
997 | - channel: 'kGPT_OutputCompare_Channel1' |
998 | - mode: 'kGPT_OutputOperation_Disconnected' |
999 | - compare_value_str: '150000000' |
1000 | - interrupt_requests: 'kGPT_OutputCompare1InterruptEnable' |
1001 | - isInterruptEnabled: 'true' |
1002 | - interrupt: |
1003 | - IRQn: 'GPT2_IRQn' |
1004 | - enable_interrrupt: 'enabled' |
1005 | - enable_priority: 'false' |
1006 | - priority: '0' |
1007 | - enable_custom_name: 'false' |
1008 | - EnableTimerInInit: 'false' |
1009 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
1010 | /* clang-format on */ |
1011 | const gpt_config_t GPT_2_config = { |
1012 | .clockSource = kGPT_ClockSource_Periph, |
1013 | .divider = 1UL, |
1014 | .enableFreeRun = false, |
1015 | .enableRunInWait = true, |
1016 | .enableRunInStop = true, |
1017 | .enableRunInDoze = true, |
1018 | .enableRunInDbg = true, |
1019 | .enableMode = true |
1020 | }; |
1021 | |
1022 | static void GPT_2_init(void) { |
1023 | /* GPT device and channels initialization */ |
1024 | GPT_Init(GPT_2_PERIPHERAL, &GPT_2_config); |
1025 | GPT_SetOscClockDivider(GPT_2_PERIPHERAL, 1); |
1026 | GPT_SetInputOperationMode(GPT_2_PERIPHERAL, kGPT_InputCapture_Channel1, kGPT_InputOperation_BothEdge); |
1027 | GPT_SetOutputCompareValue(GPT_2_PERIPHERAL, kGPT_OutputCompare_Channel1, 150000000); |
1028 | GPT_SetOutputOperationMode(GPT_2_PERIPHERAL, kGPT_OutputCompare_Channel1, kGPT_OutputOperation_Disconnected); |
1029 | /* Enable GPT interrupt sources */ |
1030 | GPT_EnableInterrupts(GPT_2_PERIPHERAL, kGPT_OutputCompare1InterruptEnable); |
1031 | /* Enable interrupt GPT2_IRQn request in the NVIC. */ |
1032 | EnableIRQ(GPT_2_GPT_IRQN); |
1033 | } |
1034 | |
1035 | /*********************************************************************************************************************** |
1036 | * LPI2C_1 initialization code |
1037 | **********************************************************************************************************************/ |
1038 | /* clang-format off */ |
1039 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
1040 | instance: |
1041 | - name: 'LPI2C_1' |
1042 | - type: 'lpi2c' |
1043 | - mode: 'master' |
1044 | - custom_name_enabled: 'true' |
1045 | - type_id: 'lpi2c_db68d4f4f06a22e25ab51fe9bd6db4d2' |
1046 | - functional_group: 'BOARD_InitPeripherals' |
1047 | - peripheral: 'LPI2C1' |
1048 | - config_sets: |
1049 | - main: |
1050 | - clockSource: 'Lpi2cClock' |
1051 | - clockSourceFreq: 'BOARD_BootClockRUN' |
1052 | - interrupt: |
1053 | - IRQn: 'LPI2C1_IRQn' |
1054 | - enable_interrrupt: 'enabled' |
1055 | - enable_priority: 'false' |
1056 | - priority: '0' |
1057 | - enable_custom_name: 'false' |
1058 | - master: |
1059 | - mode: 'polling' |
1060 | - config: |
1061 | - enableMaster: 'true' |
1062 | - enableDoze: 'true' |
1063 | - debugEnable: 'false' |
1064 | - ignoreAck: 'false' |
1065 | - pinConfig: 'kLPI2C_2PinOpenDrain' |
1066 | - baudRate_Hz: '100000' |
1067 | - busIdleTimeout_ns: '0' |
1068 | - pinLowTimeout_ns: '0' |
1069 | - sdaGlitchFilterWidth_ns: '0' |
1070 | - sclGlitchFilterWidth_ns: '0' |
1071 | - hostRequest: |
1072 | - enable: 'false' |
1073 | - source: 'kLPI2C_HostRequestExternalPin' |
1074 | - polarity: 'kLPI2C_HostRequestPinActiveHigh' |
1075 | - edmaRequestSources: '' |
1076 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
1077 | /* clang-format on */ |
1078 | const lpi2c_master_config_t LPI2C_1_masterConfig = { |
1079 | .enableMaster = true, |
1080 | .enableDoze = true, |
1081 | .debugEnable = false, |
1082 | .ignoreAck = false, |
1083 | .pinConfig = kLPI2C_2PinOpenDrain, |
1084 | .baudRate_Hz = 100000UL, |
1085 | .busIdleTimeout_ns = 0UL, |
1086 | .pinLowTimeout_ns = 0UL, |
1087 | .sdaGlitchFilterWidth_ns = 0U, |
1088 | .sclGlitchFilterWidth_ns = 0U, |
1089 | .hostRequest = { |
1090 | .enable = false, |
1091 | .source = kLPI2C_HostRequestExternalPin, |
1092 | .polarity = kLPI2C_HostRequestPinActiveHigh |
1093 | } |
1094 | }; |
1095 | |
1096 | static void LPI2C_1_init(void) { |
1097 | LPI2C_MasterInit(LPI2C_1_PERIPHERAL, &LPI2C_1_masterConfig, LPI2C_1_CLOCK_FREQ); |
1098 | } |
1099 | |
1100 | /*********************************************************************************************************************** |
1101 | * LPSPI_1 initialization code |
1102 | **********************************************************************************************************************/ |
1103 | /* clang-format off */ |
1104 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
1105 | instance: |
1106 | - name: 'LPSPI_1' |
1107 | - type: 'lpspi' |
1108 | - mode: 'polling' |
1109 | - custom_name_enabled: 'true' |
1110 | - type_id: 'lpspi_6e21a1e0a09f0a012d683c4f91752db8' |
1111 | - functional_group: 'BOARD_InitPeripherals' |
1112 | - peripheral: 'LPSPI1' |
1113 | - config_sets: |
1114 | - main: |
1115 | - mode: 'kLPSPI_Master' |
1116 | - clockSource: 'LpspiClock' |
1117 | - clockSourceFreq: 'BOARD_BootClockRUN' |
1118 | - master: |
1119 | - baudRate: '500000' |
1120 | - bitsPerFrame: '8' |
1121 | - cpol: 'kLPSPI_ClockPolarityActiveHigh' |
1122 | - cpha: 'kLPSPI_ClockPhaseFirstEdge' |
1123 | - direction: 'kLPSPI_MsbFirst' |
1124 | - pcsToSckDelayInNanoSec: '1000' |
1125 | - lastSckToPcsDelayInNanoSec: '1000' |
1126 | - betweenTransferDelayInNanoSec: '1000' |
1127 | - whichPcs: 'kLPSPI_Pcs0' |
1128 | - pcsActiveHighOrLow: 'kLPSPI_PcsActiveLow' |
1129 | - pinCfg: 'kLPSPI_SdiInSdoOut' |
1130 | - dataOutConfig: 'kLpspiDataOutRetained' |
1131 | - set_FifoWaterMarks: 'false' |
1132 | - fifoWaterMarks: |
1133 | - txWatermark: '0' |
1134 | - rxWatermark: '0' |
1135 | - allPcsPolarityEnable: 'false' |
1136 | - allPcsPolarity: |
1137 | - kLPSPI_Pcs1Active: 'kLPSPI_PcsActiveHigh' |
1138 | - kLPSPI_Pcs2Active: 'kLPSPI_PcsActiveHigh' |
1139 | - kLPSPI_Pcs3Active: 'kLPSPI_PcsActiveHigh' |
1140 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
1141 | /* clang-format on */ |
1142 | const lpspi_master_config_t LPSPI_1_config = { |
1143 | .baudRate = 500000UL, |
1144 | .bitsPerFrame = 8UL, |
1145 | .cpol = kLPSPI_ClockPolarityActiveHigh, |
1146 | .cpha = kLPSPI_ClockPhaseFirstEdge, |
1147 | .direction = kLPSPI_MsbFirst, |
1148 | .pcsToSckDelayInNanoSec = 1000UL, |
1149 | .lastSckToPcsDelayInNanoSec = 1000UL, |
1150 | .betweenTransferDelayInNanoSec = 1000UL, |
1151 | .whichPcs = kLPSPI_Pcs0, |
1152 | .pcsActiveHighOrLow = kLPSPI_PcsActiveLow, |
1153 | .pinCfg = kLPSPI_SdiInSdoOut, |
1154 | .dataOutConfig = kLpspiDataOutRetained |
1155 | }; |
1156 | |
1157 | static void LPSPI_1_init(void) { |
1158 | LPSPI_MasterInit(LPSPI_1_PERIPHERAL, &LPSPI_1_config, LPSPI_1_CLOCK_FREQ); |
1159 | } |
1160 | |
1161 | /*********************************************************************************************************************** |
1162 | * LPUART_1 initialization code |
1163 | **********************************************************************************************************************/ |
1164 | /* clang-format off */ |
1165 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
1166 | instance: |
1167 | - name: 'LPUART_1' |
1168 | - type: 'lpuart' |
1169 | - mode: 'polling' |
1170 | - custom_name_enabled: 'true' |
1171 | - type_id: 'lpuart_bebe3e12b6ec22bbd14199038f2bf459' |
1172 | - functional_group: 'BOARD_InitPeripherals' |
1173 | - peripheral: 'LPUART1' |
1174 | - config_sets: |
1175 | - lpuartConfig_t: |
1176 | - lpuartConfig: |
1177 | - clockSource: 'LpuartClock' |
1178 | - lpuartSrcClkFreq: 'BOARD_BootClockRUN' |
1179 | - baudRate_Bps: '115200' |
1180 | - parityMode: 'kLPUART_ParityDisabled' |
1181 | - dataBitsCount: 'kLPUART_EightDataBits' |
1182 | - isMsb: 'false' |
1183 | - stopBitCount: 'kLPUART_OneStopBit' |
1184 | - txFifoWatermark: '0' |
1185 | - rxFifoWatermark: '0' |
1186 | - enableRxRTS: 'false' |
1187 | - enableTxCTS: 'false' |
1188 | - txCtsSource: 'kLPUART_CtsSourcePin' |
1189 | - txCtsConfig: 'kLPUART_CtsSampleAtStart' |
1190 | - rxIdleType: 'kLPUART_IdleTypeStartBit' |
1191 | - rxIdleConfig: 'kLPUART_IdleCharacter1' |
1192 | - enableTx: 'true' |
1193 | - enableRx: 'true' |
1194 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
1195 | /* clang-format on */ |
1196 | const lpuart_config_t LPUART_1_config = { |
1197 | .baudRate_Bps = 115200UL, |
1198 | .parityMode = kLPUART_ParityDisabled, |
1199 | .dataBitsCount = kLPUART_EightDataBits, |
1200 | .isMsb = false, |
1201 | .stopBitCount = kLPUART_OneStopBit, |
1202 | .txFifoWatermark = 0U, |
1203 | .rxFifoWatermark = 0U, |
1204 | .enableRxRTS = false, |
1205 | .enableTxCTS = false, |
1206 | .txCtsSource = kLPUART_CtsSourcePin, |
1207 | .txCtsConfig = kLPUART_CtsSampleAtStart, |
1208 | .rxIdleType = kLPUART_IdleTypeStartBit, |
1209 | .rxIdleConfig = kLPUART_IdleCharacter1, |
1210 | .enableTx = true, |
1211 | .enableRx = true |
1212 | }; |
1213 | |
1214 | static void LPUART_1_init(void) { |
1215 | LPUART_Init(LPUART_1_PERIPHERAL, &LPUART_1_config, LPUART_1_CLOCK_SOURCE); |
1216 | } |
1217 | |
1218 | /*********************************************************************************************************************** |
1219 | * PIT_1 initialization code |
1220 | **********************************************************************************************************************/ |
1221 | /* clang-format off */ |
1222 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
1223 | instance: |
1224 | - name: 'PIT_1' |
1225 | - type: 'pit' |
1226 | - mode: 'LPTMR_GENERAL' |
1227 | - custom_name_enabled: 'true' |
1228 | - type_id: 'pit_a4782ba5223c8a2527ba91aeb2bc4159' |
1229 | - functional_group: 'BOARD_InitPeripherals' |
1230 | - peripheral: 'PIT' |
1231 | - config_sets: |
1232 | - fsl_pit: |
1233 | - enableRunInDebug: 'false' |
1234 | - enableSharedInterrupt: 'true' |
1235 | - sharedInterrupt: |
1236 | - IRQn: 'PIT_IRQn' |
1237 | - enable_interrrupt: 'noInit' |
1238 | - enable_priority: 'true' |
1239 | - priority: '0' |
1240 | - enable_custom_name: 'false' |
1241 | - timingConfig: |
1242 | - clockSource: 'BusInterfaceClock' |
1243 | - clockSourceFreq: 'BOARD_BootClockRUN' |
1244 | - channels: |
1245 | - 0: |
1246 | - channel_id: '' |
1247 | - channelNumber: '1' |
1248 | - enableChain: 'false' |
1249 | - timerPeriod: '1000000' |
1250 | - startTimer: 'true' |
1251 | - enableInterrupt: 'true' |
1252 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
1253 | /* clang-format on */ |
1254 | const pit_config_t PIT_1_config = { |
1255 | .enableRunInDebug = false |
1256 | }; |
1257 | |
1258 | static void PIT_1_init(void) { |
1259 | /* Initialize the PIT. */ |
1260 | PIT_Init(PIT_1_PERIPHERAL, &PIT_1_config); |
1261 | /* Set channel 1 period to 1 s (75000000 ticks). */ |
1262 | PIT_SetTimerPeriod(PIT_1_PERIPHERAL, PIT_1_1, PIT_1_1_TICKS); |
1263 | /* Enable interrupts from channel 1. */ |
1264 | PIT_EnableInterrupts(PIT_1_PERIPHERAL, PIT_1_1, kPIT_TimerInterruptEnable); |
1265 | /* Interrupt vector PIT_1_IRQN priority settings in the NVIC */ |
1266 | NVIC_SetPriority(PIT_1_IRQN, PIT_1_IRQ_PRIORITY); |
1267 | /* Interrupt PIT_1_IRQN request in the NVIC is not initialized (disabled by default). */ |
1268 | /* It can be enabled later by EnableIRQ(PIT_1_IRQN); function call. */ |
1269 | /* Start channel 1. */ |
1270 | PIT_StartTimer(PIT_1_PERIPHERAL, PIT_1_1); |
1271 | } |
1272 | |
1273 | /*********************************************************************************************************************** |
1274 | * PWM1 initialization code |
1275 | **********************************************************************************************************************/ |
1276 | /* clang-format off */ |
1277 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
1278 | instance: |
1279 | - name: 'PWM1' |
1280 | - type: 'pwm' |
1281 | - mode: 'general' |
1282 | - custom_name_enabled: 'false' |
1283 | - type_id: 'pwm_8b65bb514bad0e7add761f3ca35a604d' |
1284 | - functional_group: 'BOARD_InitPeripherals' |
1285 | - peripheral: 'PWM1' |
1286 | - config_sets: |
1287 | - fsl_pwm: |
1288 | - clockSource: 'SystemClock' |
1289 | - clockSourceFreq: 'BOARD_BootClockRUN' |
1290 | - submodules: |
1291 | - 0: |
1292 | - sm: 'kPWM_Module_0' |
1293 | - sm_id: 'SM0' |
1294 | - config: |
1295 | - clockSource: 'kPWM_BusClock' |
1296 | - prescale: 'kPWM_Prescale_Divide_1' |
1297 | - pwmFreq: '8 kHz' |
1298 | - pairOperation: 'kPWM_Independent' |
1299 | - operationMode: 'kPWM_SignedCenterAligned' |
1300 | - initializationControl: 'kPWM_Initialize_LocalSync' |
1301 | - reloadLogic: 'kPWM_ReloadImmediate' |
1302 | - reloadSelect: 'kPWM_LocalReload' |
1303 | - reloadFrequency: 'kPWM_LoadEveryOportunity' |
1304 | - forceTrigger: 'kPWM_Force_Local' |
1305 | - enableDebugMode: 'false' |
1306 | - enableWait: 'false' |
1307 | - outputTrigger_sel: '' |
1308 | - loadOK: 'false' |
1309 | - startCounter: 'false' |
1310 | - interrupt_sel: '' |
1311 | - channels: |
1312 | - 0: |
1313 | - channel_id: 'A' |
1314 | - functionSel: 'pwmOutput' |
1315 | - pwm: |
1316 | - dutyCyclePercent: '70' |
1317 | - level: 'kPWM_HighTrue' |
1318 | - deadtime_input_by_force: 'kPWM_UsePwm' |
1319 | - clockSource: 'kPWM_BusClock' |
1320 | - deadtimeValue: '0' |
1321 | - interrupt_sel: '' |
1322 | - 1: |
1323 | - channel_id: 'B' |
1324 | - functionSel: 'pwmOutput' |
1325 | - pwm: |
1326 | - dutyCyclePercent: '30' |
1327 | - level: 'kPWM_HighTrue' |
1328 | - deadtime_input_by_force: 'kPWM_UsePwm' |
1329 | - clockSource: 'kPWM_BusClock' |
1330 | - deadtimeValue: '0' |
1331 | - interrupt_sel: '' |
1332 | - 2: |
1333 | - channel_id: 'X' |
1334 | - functionSel: 'notUsed' |
1335 | - common_interruptEn: 'false' |
1336 | - common_interrupt: |
1337 | - IRQn: 'PWM1_0_IRQn' |
1338 | - enable_interrrupt: 'enabled' |
1339 | - enable_priority: 'false' |
1340 | - priority: '0' |
1341 | - enable_custom_name: 'false' |
1342 | - faultChannels: |
1343 | - 0: |
1344 | - commonFaultSetting: |
1345 | - clockSource: 'kPWM_BusClock' |
1346 | - faultFilterPeriod: '1' |
1347 | - faultFilterCount: '3' |
1348 | - faultGlitchStretch: 'false' |
1349 | - faults: |
1350 | - 0: |
1351 | - fault_id: 'Fault0' |
1352 | - faultClearingMode: 'kPWM_Automatic' |
1353 | - faultLevelR: 'low' |
1354 | - enableCombinationalPathR: 'nonFiltered' |
1355 | - recoverMode: 'kPWM_NoRecovery' |
1356 | - fault_int_source: 'false' |
1357 | - 1: |
1358 | - fault_id: 'Fault1' |
1359 | - faultClearingMode: 'kPWM_Automatic' |
1360 | - faultLevelR: 'low' |
1361 | - enableCombinationalPathR: 'nonFiltered' |
1362 | - recoverMode: 'kPWM_NoRecovery' |
1363 | - fault_int_source: 'false' |
1364 | - 2: |
1365 | - fault_id: 'Fault2' |
1366 | - faultClearingMode: 'kPWM_Automatic' |
1367 | - faultLevelR: 'low' |
1368 | - enableCombinationalPathR: 'nonFiltered' |
1369 | - recoverMode: 'kPWM_NoRecovery' |
1370 | - fault_int_source: 'false' |
1371 | - 3: |
1372 | - fault_id: 'Fault3' |
1373 | - faultClearingMode: 'kPWM_Automatic' |
1374 | - faultLevelR: 'low' |
1375 | - enableCombinationalPathR: 'nonFiltered' |
1376 | - recoverMode: 'kPWM_NoRecovery' |
1377 | - fault_int_source: 'false' |
1378 | - fault_error_interruptEn: 'false' |
1379 | - fault_error_interrupt: |
1380 | - IRQn: 'PWM1_FAULT_IRQn' |
1381 | - enable_interrrupt: 'enabled' |
1382 | - enable_priority: 'false' |
1383 | - priority: '0' |
1384 | - enable_custom_name: 'false' |
1385 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
1386 | /* clang-format on */ |
1387 | /* PWM main configuration */ |
1388 | pwm_config_t PWM1_SM0_config = { |
1389 | .clockSource = kPWM_BusClock, |
1390 | .prescale = kPWM_Prescale_Divide_1, |
1391 | .pairOperation = kPWM_Independent, |
1392 | .initializationControl = kPWM_Initialize_LocalSync, |
1393 | .reloadLogic = kPWM_ReloadImmediate, |
1394 | .reloadSelect = kPWM_LocalReload, |
1395 | .reloadFrequency = kPWM_LoadEveryOportunity, |
1396 | .forceTrigger = kPWM_Force_Local, |
1397 | .enableDebugMode = false, |
1398 | .enableWait = false |
1399 | }; |
1400 | |
1401 | pwm_signal_param_t PWM1_SM0_pwm_function_config[2]= { |
1402 | { |
1403 | .pwmChannel = kPWM_PwmA, |
1404 | .dutyCyclePercent = 70U, |
1405 | .level = kPWM_HighTrue, |
1406 | .deadtimeValue = 0U |
1407 | }, |
1408 | { |
1409 | .pwmChannel = kPWM_PwmB, |
1410 | .dutyCyclePercent = 30U, |
1411 | .level = kPWM_HighTrue, |
1412 | .deadtimeValue = 0U |
1413 | }, |
1414 | }; |
1415 | |
1416 | const pwm_fault_input_filter_param_t PWM1_faultInputFilter_config = { |
1417 | .faultFilterPeriod = 1U, |
1418 | .faultFilterCount = 3U, |
1419 | .faultGlitchStretch = false |
1420 | }; |
1421 | const pwm_fault_param_t PWM1_Fault0_fault_config = { |
1422 | .faultClearingMode = kPWM_Automatic, |
1423 | .faultLevel = false, |
1424 | .enableCombinationalPath = false, |
1425 | .recoverMode = kPWM_NoRecovery |
1426 | }; |
1427 | const pwm_fault_param_t PWM1_Fault1_fault_config = { |
1428 | .faultClearingMode = kPWM_Automatic, |
1429 | .faultLevel = false, |
1430 | .enableCombinationalPath = false, |
1431 | .recoverMode = kPWM_NoRecovery |
1432 | }; |
1433 | const pwm_fault_param_t PWM1_Fault2_fault_config = { |
1434 | .faultClearingMode = kPWM_Automatic, |
1435 | .faultLevel = false, |
1436 | .enableCombinationalPath = false, |
1437 | .recoverMode = kPWM_NoRecovery |
1438 | }; |
1439 | const pwm_fault_param_t PWM1_Fault3_fault_config = { |
1440 | .faultClearingMode = kPWM_Automatic, |
1441 | .faultLevel = false, |
1442 | .enableCombinationalPath = false, |
1443 | .recoverMode = kPWM_NoRecovery |
1444 | }; |
1445 | |
1446 | static void PWM1_init(void) { |
1447 | /* Initialize PWM submodule SM0 main configuration */ |
1448 | PWM_Init(PWM1_PERIPHERAL, PWM1_SM0, &PWM1_SM0_config); |
1449 | /* Initialize fault input filter configuration */ |
1450 | PWM_SetupFaultInputFilter(PWM1_PERIPHERAL, &PWM1_faultInputFilter_config); |
1451 | /* Initialize fault channel 0 fault Fault0 configuration */ |
1452 | PWM_SetupFaults(PWM1_PERIPHERAL, PWM1_F0_FAULT0, &PWM1_Fault0_fault_config); |
1453 | /* Initialize fault channel 0 fault Fault1 configuration */ |
1454 | PWM_SetupFaults(PWM1_PERIPHERAL, PWM1_F0_FAULT1, &PWM1_Fault1_fault_config); |
1455 | /* Initialize fault channel 0 fault Fault2 configuration */ |
1456 | PWM_SetupFaults(PWM1_PERIPHERAL, PWM1_F0_FAULT2, &PWM1_Fault2_fault_config); |
1457 | /* Initialize fault channel 0 fault Fault3 configuration */ |
1458 | PWM_SetupFaults(PWM1_PERIPHERAL, PWM1_F0_FAULT3, &PWM1_Fault3_fault_config); |
1459 | /* Initialize deadtime logic input for the channel A */ |
1460 | PWM_SetupForceSignal(PWM1_PERIPHERAL, PWM1_SM0, PWM1_SM0_A, kPWM_UsePwm); |
1461 | /* Initialize deadtime logic input for the channel B */ |
1462 | PWM_SetupForceSignal(PWM1_PERIPHERAL, PWM1_SM0, PWM1_SM0_B, kPWM_UsePwm); |
1463 | /* Setup PWM output setting for submodule SM0 */ |
1464 | PWM_SetupPwm(PWM1_PERIPHERAL, PWM1_SM0, PWM1_SM0_pwm_function_config, 2U, kPWM_SignedCenterAligned, PWM1_SM0_COUNTER_FREQ_HZ, PWM1_SM0_SM_CLK_SOURCE_FREQ_HZ); |
1465 | } |
1466 | |
1467 | /*********************************************************************************************************************** |
1468 | * QuadTimer_1 initialization code |
1469 | **********************************************************************************************************************/ |
1470 | /* clang-format off */ |
1471 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
1472 | instance: |
1473 | - name: 'QuadTimer_1' |
1474 | - type: 'qtmr' |
1475 | - mode: 'general' |
1476 | - custom_name_enabled: 'true' |
1477 | - type_id: 'qtmr_460dd7aa3f3371843c2548acd54252b0' |
1478 | - functional_group: 'BOARD_InitPeripherals' |
1479 | - peripheral: 'TMR1' |
1480 | - config_sets: |
1481 | - fsl_qtmr: |
1482 | - clockSource: 'BusInterfaceClock' |
1483 | - clockSourceFreq: 'BOARD_BootClockRUN' |
1484 | - qtmr_channels: |
1485 | - 0: |
1486 | - channel_prefix_id: 'Channel_0' |
1487 | - channel: 'kQTMR_Channel_0' |
1488 | - primarySource: 'kQTMR_ClockDivide_2' |
1489 | - secondarySource: 'kQTMR_Counter2InputPin' |
1490 | - countingMode: 'kQTMR_NoOperation' |
1491 | - enableMasterMode: 'false' |
1492 | - enableExternalForce: 'false' |
1493 | - faultFilterCount: '3' |
1494 | - faultFilterPeriod: '0' |
1495 | - debugMode: 'kQTMR_RunNormalInDebug' |
1496 | - timerModeInit: 'timer' |
1497 | - timerMode: |
1498 | - freq_value_str: '100' |
1499 | - dmaIntMode: 'polling' |
1500 | - 1: |
1501 | - channel_prefix_id: 'Channel_1' |
1502 | - channel: 'kQTMR_Channel_1' |
1503 | - primarySource: 'kQTMR_ClockDivide_2' |
1504 | - secondarySource: 'kQTMR_Counter2InputPin' |
1505 | - countingMode: 'kQTMR_NoOperation' |
1506 | - enableMasterMode: 'false' |
1507 | - enableExternalForce: 'false' |
1508 | - faultFilterCount: '3' |
1509 | - faultFilterPeriod: '0' |
1510 | - debugMode: 'kQTMR_RunNormalInDebug' |
1511 | - timerModeInit: 'timer' |
1512 | - timerMode: |
1513 | - freq_value_str: '100' |
1514 | - dmaIntMode: 'polling' |
1515 | - interruptVector: |
1516 | - enable_irq: 'false' |
1517 | - interrupt: |
1518 | - IRQn: 'TMR1_IRQn' |
1519 | - enable_interrrupt: 'enabled' |
1520 | - enable_priority: 'false' |
1521 | - priority: '0' |
1522 | - enable_custom_name: 'false' |
1523 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
1524 | /* clang-format on */ |
1525 | const qtmr_config_t QuadTimer_1_Channel_0_config = { |
1526 | .primarySource = kQTMR_ClockDivide_2, |
1527 | .secondarySource = kQTMR_Counter2InputPin, |
1528 | .enableMasterMode = false, |
1529 | .enableExternalForce = false, |
1530 | .faultFilterCount = 0, |
1531 | .faultFilterPeriod = 0, |
1532 | .debugMode = kQTMR_RunNormalInDebug |
1533 | }; |
1534 | const qtmr_config_t QuadTimer_1_Channel_1_config = { |
1535 | .primarySource = kQTMR_ClockDivide_2, |
1536 | .secondarySource = kQTMR_Counter2InputPin, |
1537 | .enableMasterMode = false, |
1538 | .enableExternalForce = false, |
1539 | .faultFilterCount = 0, |
1540 | .faultFilterPeriod = 0, |
1541 | .debugMode = kQTMR_RunNormalInDebug |
1542 | }; |
1543 | |
1544 | static void QuadTimer_1_init(void) { |
1545 | /* Quad timer channel Channel_0 peripheral initialization */ |
1546 | QTMR_Init(QUADTIMER_1_PERIPHERAL, QUADTIMER_1_CHANNEL_0_CHANNEL, &QuadTimer_1_Channel_0_config); |
1547 | /* Setup the timer period of the channel */ |
1548 | QTMR_SetTimerPeriod(QUADTIMER_1_PERIPHERAL, QUADTIMER_1_CHANNEL_0_CHANNEL, 100U); |
1549 | /* Quad timer channel Channel_1 peripheral initialization */ |
1550 | QTMR_Init(QUADTIMER_1_PERIPHERAL, QUADTIMER_1_CHANNEL_1_CHANNEL, &QuadTimer_1_Channel_1_config); |
1551 | /* Setup the timer period of the channel */ |
1552 | QTMR_SetTimerPeriod(QUADTIMER_1_PERIPHERAL, QUADTIMER_1_CHANNEL_1_CHANNEL, 100U); |
1553 | /* Start the timer - select the timer counting mode */ |
1554 | QTMR_StartTimer(QUADTIMER_1_PERIPHERAL, QUADTIMER_1_CHANNEL_0_CHANNEL, kQTMR_NoOperation); |
1555 | /* Start the timer - select the timer counting mode */ |
1556 | QTMR_StartTimer(QUADTIMER_1_PERIPHERAL, QUADTIMER_1_CHANNEL_1_CHANNEL, kQTMR_NoOperation); |
1557 | } |
1558 | |
1559 | /*********************************************************************************************************************** |
1560 | * WDOG_1 initialization code |
1561 | **********************************************************************************************************************/ |
1562 | /* clang-format off */ |
1563 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
1564 | instance: |
1565 | - name: 'WDOG_1' |
1566 | - type: 'wdog01' |
1567 | - mode: 'general' |
1568 | - custom_name_enabled: 'true' |
1569 | - type_id: 'wdog01_510a9c5ba7e0ced8deac305549f23fa9' |
1570 | - functional_group: 'BOARD_InitPeripherals' |
1571 | - peripheral: 'WDOG1' |
1572 | - config_sets: |
1573 | - fsl_wdog: |
1574 | - wdogConfig: |
1575 | - clockSource: 'LowFreqClock' |
1576 | - timeoutValue_str: '10' |
1577 | - enablePowerDown: 'false' |
1578 | - softwareResetExtension: 'false' |
1579 | - enableTimeOutAssert: 'false' |
1580 | - enableWdog: 'false' |
1581 | - workMode: |
1582 | - enableWait: 'false' |
1583 | - enableStop: 'false' |
1584 | - enableDebug: 'false' |
1585 | - interrupt_config: |
1586 | - enableInterrupt: 'false' |
1587 | - interruptTimeValue_str: '4' |
1588 | - interrupt_vectors: |
1589 | - enable_irq: 'false' |
1590 | - interrupt: |
1591 | - IRQn: 'WDOG1_IRQn' |
1592 | - enable_interrrupt: 'enabled' |
1593 | - enable_priority: 'false' |
1594 | - priority: '0' |
1595 | - enable_custom_name: 'false' |
1596 | - signals: [] |
1597 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
1598 | /* clang-format on */ |
1599 | const wdog_config_t WDOG_1_config = { |
1600 | .timeoutValue = 9, |
1601 | .enablePowerDown = false, |
1602 | .softwareResetExtension = false, |
1603 | .enableTimeOutAssert = false, |
1604 | .enableWdog = false, |
1605 | .workMode = { |
1606 | .enableWait = false, |
1607 | .enableStop = false, |
1608 | .enableDebug = false |
1609 | }, |
1610 | .enableInterrupt = false, |
1611 | .interruptTimeValue = 3 |
1612 | }; |
1613 | |
1614 | static void WDOG_1_init(void) { |
1615 | /* WDOG peripheral initialization */ |
1616 | WDOG_Init(WDOG_1_PERIPHERAL, &WDOG_1_config); |
1617 | } |
1618 | |
1619 | /*********************************************************************************************************************** |
1620 | * NVIC initialization code |
1621 | **********************************************************************************************************************/ |
1622 | /* clang-format off */ |
1623 | /* TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* |
1624 | instance: |
1625 | - name: 'NVIC' |
1626 | - type: 'nvic' |
1627 | - mode: 'general' |
1628 | - custom_name_enabled: 'false' |
1629 | - type_id: 'nvic_57b5eef3774cc60acaede6f5b8bddc67' |
1630 | - functional_group: 'BOARD_InitPeripherals' |
1631 | - peripheral: 'NVIC' |
1632 | - config_sets: |
1633 | - nvic: |
1634 | - interrupt_table: |
1635 | - 0: [] |
1636 | - 1: [] |
1637 | - 2: [] |
1638 | - 3: [] |
1639 | - 4: [] |
1640 | - 5: [] |
1641 | - 6: [] |
1642 | - 7: [] |
1643 | - 8: [] |
1644 | - 9: [] |
1645 | - interrupts: [] |
1646 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/ |
1647 | /* clang-format on */ |
1648 | |
1649 | /* Empty initialization function (commented out) |
1650 | static void NVIC_init(void) { |
1651 | } */ |
1652 | |
1653 | /*********************************************************************************************************************** |
1654 | * Initialization functions |
1655 | **********************************************************************************************************************/ |
1656 | void BOARD_InitPeripherals(void) |
1657 | { |
1658 | /* Global initialization */ |
1659 | DMAMUX_Init(DMA0_DMAMUX_BASEADDR); |
1660 | EDMA_Init(DMA0_DMA_BASEADDR, &DMA0_config); |
1661 | |
1662 | /* Initialize components */ |
1663 | DMA0_init(); |
1664 | ADC_1_init(); |
1665 | AOI_1_init(); |
1666 | CMP_2_init(); |
1667 | ENC_1_init(); |
1668 | FLEXIO_I2C_1_init(); |
1669 | FLEXIO_SPI_1_init(); |
1670 | FLEXIO_UART_1_init(); |
1671 | FlexCAN_2_init(); |
1672 | GPIO_1_init(); |
1673 | GPIO_3_init(); |
1674 | GPIO_5_init(); |
1675 | GPT_2_init(); |
1676 | LPI2C_1_init(); |
1677 | LPSPI_1_init(); |
1678 | LPUART_1_init(); |
1679 | PIT_1_init(); |
1680 | PWM1_init(); |
1681 | QuadTimer_1_init(); |
1682 | WDOG_1_init(); |
1683 | } |
1684 | |
1685 | /*********************************************************************************************************************** |
1686 | * BOARD_InitBootPeripherals function |
1687 | **********************************************************************************************************************/ |
1688 | void BOARD_InitBootPeripherals(void) |
1689 | { |
1690 | BOARD_InitPeripherals(); |
1691 | } |
1692 | |