Following are the autogenerated code files.
1. peripherals.c
/***********************************************************************************************************************
* This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file
* will be overwritten if the respective MCUXpresso Config Tools is used to update this file.
**********************************************************************************************************************/
/* clang-format off */
/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
!!GlobalInfo
product: Peripherals v7.0
processor: MIMXRT1064xxxxA
package_id: MIMXRT1064DVL6A
mcu_data: ksdk2_0
processor_version: 7.0.1
board: MIMXRT1064-EVK
functionalGroups:
- name: BOARD_InitPeripherals
UUID: baf1d3cb-dc69-4730-83e8-c8fc29113df1
called_from_default_init: true
selectedCore: core0
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
component:
- type: 'system'
- type_id: 'system_54b53072540eeeb8f8e9343e71f28176'
- global_system_definitions: []
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
component:
- type: 'msg'
- type_id: 'msg_6e2baaf3b97dbeef01c0043275f9a0e7'
- global_messages: []
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
/* clang-format on */
/***********************************************************************************************************************
* Included files
**********************************************************************************************************************/
#include "peripherals.h"
/***********************************************************************************************************************
* BOARD_InitPeripherals functional group
**********************************************************************************************************************/
/***********************************************************************************************************************
* LPSPI1 initialization code
**********************************************************************************************************************/
/* clang-format off */
/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
instance:
- name: 'LPSPI1'
- type: 'lpspi'
- mode: 'polling'
- custom_name_enabled: 'true'
- type_id: 'lpspi_6e21a1e0a09f0a012d683c4f91752db8'
- functional_group: 'BOARD_InitPeripherals'
- peripheral: 'LPSPI1'
- config_sets:
- main:
- mode: 'kLPSPI_Master'
- clockSource: 'LpspiClock'
- clockSourceFreq: 'BOARD_BootClockRUN'
- master:
- baudRate: '2150000'
- bitsPerFrame: '8'
- cpol: 'kLPSPI_ClockPolarityActiveHigh'
- cpha: 'kLPSPI_ClockPhaseSecondEdge'
- direction: 'kLPSPI_MsbFirst'
- pcsToSckDelayInNanoSec: '1066'
- lastSckToPcsDelayInNanoSec: '1066'
- betweenTransferDelayInNanoSec: '1066'
- whichPcs: 'kLPSPI_Pcs0'
- pcsActiveHighOrLow: 'kLPSPI_PcsActiveLow'
- pinCfg: 'kLPSPI_SdiInSdoOut'
- dataOutConfig: 'kLpspiDataOutRetained'
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
/* clang-format on */
const lpspi_master_config_t LPSPI1_config = {
.baudRate = 2150000,
.bitsPerFrame = 8,
.cpol = kLPSPI_ClockPolarityActiveHigh,
.cpha = kLPSPI_ClockPhaseSecondEdge,
.direction = kLPSPI_MsbFirst,
.pcsToSckDelayInNanoSec = 1066,
.lastSckToPcsDelayInNanoSec = 1066,
.betweenTransferDelayInNanoSec = 1066,
.whichPcs = kLPSPI_Pcs0,
.pcsActiveHighOrLow = kLPSPI_PcsActiveLow,
.pinCfg = kLPSPI_SdiInSdoOut,
.dataOutConfig = kLpspiDataOutRetained
};
void LPSPI1_init(void) {
LPSPI_MasterInit(LPSPI1_PERIPHERAL, &LPSPI1_config, LPSPI1_CLOCK_FREQ);
}
/***********************************************************************************************************************
* LPUART2 initialization code
**********************************************************************************************************************/
/* clang-format off */
/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
instance:
- name: 'LPUART2'
- type: 'lpuart'
- mode: 'interrupts'
- custom_name_enabled: 'false'
- type_id: 'lpuart_54a65a580e3462acdbacefd5299e0cac'
- functional_group: 'BOARD_InitPeripherals'
- peripheral: 'LPUART2'
- config_sets:
- lpuartConfig_t:
- lpuartConfig:
- clockSource: 'LpuartClock'
- lpuartSrcClkFreq: 'BOARD_BootClockRUN'
- baudRate_Bps: '115200'
- parityMode: 'kLPUART_ParityEven'
- dataBitsCount: 'kLPUART_EightDataBits'
- isMsb: 'false'
- stopBitCount: 'kLPUART_OneStopBit'
- txFifoWatermark: '0'
- rxFifoWatermark: '1'
- enableRxRTS: 'false'
- enableTxCTS: 'false'
- txCtsSource: 'kLPUART_CtsSourcePin'
- txCtsConfig: 'kLPUART_CtsSampleAtStart'
- rxIdleType: 'kLPUART_IdleTypeStartBit'
- rxIdleConfig: 'kLPUART_IdleCharacter1'
- enableTx: 'false'
- enableRx: 'false'
- interruptsCfg:
- interrupts: 'kLPUART_RxDataRegFullInterruptEnable'
- interrupt_vectors:
- enable_rx_tx_irq: 'true'
- interrupt_rx_tx:
- IRQn: 'LPUART2_IRQn'
- enable_priority: 'false'
- priority: '0'
- enable_custom_name: 'true'
- handler_custom_name: 'Mins_IRQHandler'
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
/* clang-format on */
const lpuart_config_t LPUART2_config = {
.baudRate_Bps = 115200,
.parityMode = kLPUART_ParityEven,
.dataBitsCount = kLPUART_EightDataBits,
.isMsb = false,
.stopBitCount = kLPUART_OneStopBit,
.txFifoWatermark = 0,
.rxFifoWatermark = 1,
.enableRxRTS = false,
.enableTxCTS = false,
.txCtsSource = kLPUART_CtsSourcePin,
.txCtsConfig = kLPUART_CtsSampleAtStart,
.rxIdleType = kLPUART_IdleTypeStartBit,
.rxIdleConfig = kLPUART_IdleCharacter1,
.enableTx = false,
.enableRx = false
};
void LPUART2_init(void) {
LPUART_Init(LPUART2_PERIPHERAL, &LPUART2_config, LPUART2_CLOCK_SOURCE);
LPUART_EnableInterrupts(LPUART2_PERIPHERAL, kLPUART_RxDataRegFullInterruptEnable);
/* Enable interrupt LPUART2_IRQn request in the NVIC */
EnableIRQ(LPUART2_SERIAL_RX_TX_IRQN);
}
/***********************************************************************************************************************
* PIT initialization code
**********************************************************************************************************************/
/* clang-format off */
/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
instance:
- name: 'PIT'
- type: 'pit'
- mode: 'LPTMR_GENERAL'
- custom_name_enabled: 'false'
- type_id: 'pit_a4782ba5223c8a2527ba91aeb2bc4159'
- functional_group: 'BOARD_InitPeripherals'
- peripheral: 'PIT'
- config_sets:
- fsl_pit:
- enableRunInDebug: 'false'
- enableSharedInterrupt: 'true'
- sharedInterrupt:
- IRQn: 'PIT_IRQn'
- enable_priority: 'false'
- priority: '0'
- enable_custom_name: 'false'
- timingConfig:
- clockSource: 'BusInterfaceClock'
- clockSourceFreq: 'BOARD_BootClockRUN'
- channels:
- 0:
- channel_id: 'CHANNEL_0'
- channelNumber: '0'
- enableChain: 'false'
- timerPeriod: '25ms'
- startTimer: 'true'
- enableInterrupt: 'true'
- 1:
- channel_id: 'CHANNEL_1'
- channelNumber: '1'
- enableChain: 'false'
- timerPeriod: '1ms'
- startTimer: 'true'
- enableInterrupt: 'true'
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
/* clang-format on */
const pit_config_t PIT_config = {
.enableRunInDebug = false
};
void PIT_init(void) {
/* Initialize the PIT. */
PIT_Init(PIT_PERIPHERAL, &PIT_config);
/* Set channel 0 period to 25 ms (1875000 ticks). */
PIT_SetTimerPeriod(PIT_PERIPHERAL, PIT_CHANNEL_0, PIT_CHANNEL_0_TICKS);
/* Set channel 1 period to 1 ms (75000 ticks). */
PIT_SetTimerPeriod(PIT_PERIPHERAL, PIT_CHANNEL_1, PIT_CHANNEL_1_TICKS);
/* Enable interrupts from channel 0. */
PIT_EnableInterrupts(PIT_PERIPHERAL, PIT_CHANNEL_0, kPIT_TimerInterruptEnable);
/* Enable interrupts from channel 1. */
PIT_EnableInterrupts(PIT_PERIPHERAL, PIT_CHANNEL_1, kPIT_TimerInterruptEnable);
/* Enable interrupt PIT_IRQN request in the NVIC */
EnableIRQ(PIT_IRQN);
/* Start channel 0. */
PIT_StartTimer(PIT_PERIPHERAL, PIT_CHANNEL_0);
/* Start channel 1. */
PIT_StartTimer(PIT_PERIPHERAL, PIT_CHANNEL_1);
}
/***********************************************************************************************************************
* Initialization functions
**********************************************************************************************************************/
void BOARD_InitPeripherals(void)
{
/* Initialize components */
LPSPI1_init();
LPUART2_init();
PIT_init();
}
/***********************************************************************************************************************
* BOARD_InitBootPeripherals function
**********************************************************************************************************************/
void BOARD_InitBootPeripherals(void)
{
BOARD_InitPeripherals();
}
2. peripherals.h
/***********************************************************************************************************************
* This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file
* will be overwritten if the respective MCUXpresso Config Tools is used to update this file.
**********************************************************************************************************************/
#ifndef _PERIPHERALS_H_
#define _PERIPHERALS_H_
/***********************************************************************************************************************
* Included files
**********************************************************************************************************************/
#include "fsl_common.h"
#include "fsl_clock.h"
#include "fsl_lpspi.h"
#include "fsl_lpuart.h"
#include "fsl_pit.h"
#if defined(__cplusplus)
extern "C" {
#endif /* __cplusplus */
/***********************************************************************************************************************
* Definitions
**********************************************************************************************************************/
/* Definitions for BOARD_InitPeripherals functional group */
/* BOARD_InitPeripherals defines for LPSPI1 */
/* Definition of peripheral ID */
#define LPSPI1_PERIPHERAL LPSPI1
/* Definition of clock source */
#define LPSPI1_CLOCK_FREQ 105600000UL
/* Definition of peripheral ID */
#define LPUART2_PERIPHERAL LPUART2
/* Definition of the clock source frequency */
#define LPUART2_CLOCK_SOURCE 80000000UL
/* LPUART2 interrupt vector ID (number). */
#define LPUART2_SERIAL_RX_TX_IRQN LPUART2_IRQn
/* LPUART2 interrupt handler identifier. */
#define Mins_IRQHandler LPUART2_IRQHandler
/* BOARD_InitPeripherals defines for PIT */
/* Definition of peripheral ID. */
#define PIT_PERIPHERAL PIT
/* Definition of clock source frequency. */
#define PIT_CLK_FREQ 75000000UL
/* Definition of ticks count for channel 0 - deprecated. */
#define PIT_0_TICKS 1874999U
/* Definition of ticks count for channel 1 - deprecated. */
#define PIT_1_TICKS 74999U
/* PIT interrupt vector ID (number) - deprecated. */
#define PIT_0_IRQN PIT_IRQn
/* PIT interrupt handler identifier - deprecated. */
#define PIT_0_IRQHANDLER PIT0_IRQHandler
/* PIT interrupt vector ID (number) - deprecated. */
#define PIT_1_IRQN PIT_IRQn
/* PIT interrupt handler identifier - deprecated. */
#define PIT_1_IRQHANDLER PIT1_IRQHandler
/* Definition of channel number for channel 0. */
#define PIT_CHANNEL_0 kPIT_Chnl_0
/* Definition of channel number for channel 1. */
#define PIT_CHANNEL_1 kPIT_Chnl_1
/* Definition of ticks count for channel 0. */
#define PIT_CHANNEL_0_TICKS 1874999U
/* Definition of ticks count for channel 1. */
#define PIT_CHANNEL_1_TICKS 74999U
/* PIT interrupt vector ID (number). */
#define PIT_IRQN PIT_IRQn
/* PIT interrupt handler identifier. */
#define PIT_IRQHANDLER PIT_IRQHandler
/***********************************************************************************************************************
* Global variables
**********************************************************************************************************************/
extern const lpspi_master_config_t LPSPI1_config;
extern const lpuart_config_t LPUART2_config;
extern const pit_config_t PIT_config;
/***********************************************************************************************************************
* Initialization functions
**********************************************************************************************************************/
void BOARD_InitPeripherals(void);
/***********************************************************************************************************************
* BOARD_InitBootPeripherals function
**********************************************************************************************************************/
void BOARD_InitBootPeripherals(void);
#if defined(__cplusplus)
}
#endif
#endif /* _PERIPHERALS_H_ */
Please let me know if you need any more information.
Thanks.