/* ===================================================================*/ LDD_TDeviceData* DMA1_Init(void) { DMA1_TDeviceData *DevDataPtr; /* LDD device structure */ /* {Default RTOS Adapter} Driver memory allocation: Dynamic allocation is simulated by a pointer to the static object */ DevDataPtr = &DevDataPtr__DEFAULT_RTOS_ALLOC; /* {Default RTOS Adapter} Driver memory allocation: Fill the allocated memory by zero value */ PE_FillMemory(DevDataPtr, 0U, sizeof(DMA1_TDeviceData)); /* Transfer complete interrupt vector(INT_DMA0) allocation */ /* {Default RTOS Adapter} Set interrupt vector: IVT is static, ISR parameter is passed by the global variable */ INT_DMA0__DEFAULT_RTOS_ISRPARAM = DevDataPtr; /* Transfer error interrupt vector(INT_DMA_Error) allocation */ /* {Default RTOS Adapter} Set interrupt vector: IVT is static, ISR parameter is passed by the global variable */ INT_DMA_Error__DEFAULT_RTOS_ISRPARAM = DevDataPtr; /* Transfer complete interrupt vector(INT_DMA0) priority setting */ /* NVIC_IPR0: PRI_0=1 */ NVIC_IPR0 = (uint32_t)((NVIC_IPR0 & (uint32_t)~(uint32_t)( NVIC_IP_PRI_0(0x02) )) | (uint32_t)( NVIC_IP_PRI_0(0x01) )); /* NVIC_ISER: SETENA31=0,SETENA30=0,SETENA29=0,SETENA28=0,SETENA27=0,SETENA26=0,SETENA25=0,SETENA24=0,SETENA23=0,SETENA22=0,SETENA21=0,SETENA20=0,SETENA19=0,SETENA18=0,SETENA17=0,SETENA16=0,SETENA15=0,SETENA14=0,SETENA13=0,SETENA12=0,SETENA11=0,SETENA10=0,SETENA9=0,SETENA8=0,SETENA7=0,SETENA6=0,SETENA5=0,SETENA4=0,SETENA3=0,SETENA2=0,SETENA1=0,SETENA0=1 */ NVIC_ISER = NVIC_ISER_SETENA0_MASK; /* NVIC_ICER: CLRENA31=0,CLRENA30=0,CLRENA29=0,CLRENA28=0,CLRENA27=0,CLRENA26=0,CLRENA25=0,CLRENA24=0,CLRENA23=0,CLRENA22=0,CLRENA21=0,CLRENA20=0,CLRENA19=0,CLRENA18=0,CLRENA17=0,CLRENA16=0,CLRENA15=0,CLRENA14=0,CLRENA13=0,CLRENA12=0,CLRENA11=0,CLRENA10=0,CLRENA9=0,CLRENA8=0,CLRENA7=0,CLRENA6=0,CLRENA5=0,CLRENA4=0,CLRENA3=0,CLRENA2=0,CLRENA1=0,CLRENA0=0 */ NVIC_ICER = 0x00U; /* Transfer error interrupt vector(INT_DMA_Error) priority setting */ /* NVIC_IPR1: PRI_4=1 */ NVIC_IPR1 = (uint32_t)((NVIC_IPR1 & (uint32_t)~(uint32_t)( NVIC_IP_PRI_4(0x02) )) | (uint32_t)( NVIC_IP_PRI_4(0x01) )); /* NVIC_ISER: SETENA31=0,SETENA30=0,SETENA29=0,SETENA28=0,SETENA27=0,SETENA26=0,SETENA25=0,SETENA24=0,SETENA23=0,SETENA22=0,SETENA21=0,SETENA20=0,SETENA19=0,SETENA18=0,SETENA17=0,SETENA16=0,SETENA15=0,SETENA14=0,SETENA13=0,SETENA12=0,SETENA11=0,SETENA10=0,SETENA9=0,SETENA8=0,SETENA7=0,SETENA6=0,SETENA5=0,SETENA4=1,SETENA3=0,SETENA2=0,SETENA1=0,SETENA0=0 */ NVIC_ISER = NVIC_ISER_SETENA4_MASK; /* NVIC_ICER: CLRENA31=0,CLRENA30=0,CLRENA29=0,CLRENA28=0,CLRENA27=0,CLRENA26=0,CLRENA25=0,CLRENA24=0,CLRENA23=0,CLRENA22=0,CLRENA21=0,CLRENA20=0,CLRENA19=0,CLRENA18=0,CLRENA17=0,CLRENA16=0,CLRENA15=0,CLRENA14=0,CLRENA13=0,CLRENA12=0,CLRENA11=0,CLRENA10=0,CLRENA9=0,CLRENA8=0,CLRENA7=0,CLRENA6=0,CLRENA5=0,CLRENA4=0,CLRENA3=0,CLRENA2=0,CLRENA1=0,CLRENA0=0 */ NVIC_ICER = 0x00U; /* Enable clock gates */ #ifdef SIM_PDD_CLOCK_GATE_DMA SIM_PDD_SetClockGate(SIM_BASE_PTR, SIM_PDD_CLOCK_GATE_DMA, PDD_ENABLE); #endif #ifdef SIM_PDD_CLOCK_GATE_DMAMUX SIM_PDD_SetClockGate(SIM_BASE_PTR, SIM_PDD_CLOCK_GATE_DMAMUX, PDD_ENABLE); #endif /* Registration of the device structure */ PE_LDD_RegisterDeviceStructure(PE_LDD_COMPONENT_DMA1_ID,DevDataPtr); /* Discard previous setting */ DMA_PDD_ClearRequestEnable(DMA_BASE_PTR, DMA_PDD_ALL_CHANNELS, 0x00U); /* Disable all request from peripheral */ DMA_PDD_ClearErrorInterruptEnable(DMA_BASE_PTR, DMA_PDD_ALL_CHANNELS, 0x00U); /* Disable all error interrupts */ DMA_PDD_CancelTransfer(DMA_BASE_PTR); /* Cancel transfer (if any in progress) */ DMA_PDD_ClearInterruptFlags(DMA_BASE_PTR, DMA_PDD_ALL_CHANNELS, 0x00U); /* Clear all channel interrupt flags */ DMA_PDD_InitChannelsPriority(DMA_BASE_PTR,DMA1_DevConst.ChnPriorities); /* Initialize channel TCD (channel registers) */ DMA_CR = 0x00U; /* initialize Control register */ return DevDataPtr; }
/* ** =================================================================== ** Method : PE_low_level_init (component MK60DN512LQ10) ** ** Description : ** Initializes beans and provides common register initialization. ** The method is called automatically as a part of the ** application initialization code. ** This method is internal. It is used by Processor Expert only. ** =================================================================== */ void PE_low_level_init(void) { #ifdef PEX_RTOS_INIT PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */ #endif /* Initialization of the SIM module */ /* PORTA_PCR4: ISF=0,MUX=7 */ PORTA_PCR4 = (uint32_t)((PORTA_PCR4 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK )) | (uint32_t)( PORT_PCR_MUX(0x07) )); /* Initialization of the RCM module */ /* RCM_RPFW: RSTFLTSEL=0 */ RCM_RPFW &= (uint8_t)~(uint8_t)(RCM_RPFW_RSTFLTSEL(0x1F)); /* RCM_RPFC: RSTFLTSS=0,RSTFLTSRW=0 */ RCM_RPFC &= (uint8_t)~(uint8_t)( RCM_RPFC_RSTFLTSS_MASK | RCM_RPFC_RSTFLTSRW(0x03) ); /* Initialization of the FTFL_FlashConfig module */ /* SIM_SCGC7: MPU=1 */ SIM_SCGC7 |= SIM_SCGC7_MPU_MASK; /* Initialization of the MPU module */ /* MPU_CESR: SPERR=0,VLD=0 */ MPU_CESR &= (uint32_t)~(uint32_t)((MPU_CESR_SPERR(0x1F) | MPU_CESR_VLD_MASK)); /* Initialization of the PMC module */ /* PMC_LVDSC1: LVDACK=1,LVDIE=0,LVDRE=1,LVDV=0 */ PMC_LVDSC1 = (uint8_t)((PMC_LVDSC1 & (uint8_t)~(uint8_t)( PMC_LVDSC1_LVDIE_MASK | PMC_LVDSC1_LVDV(0x03) )) | (uint8_t)( PMC_LVDSC1_LVDACK_MASK | PMC_LVDSC1_LVDRE_MASK )); /* PMC_LVDSC2: LVWACK=1,LVWIE=0,LVWV=0 */ PMC_LVDSC2 = (uint8_t)((PMC_LVDSC2 & (uint8_t)~(uint8_t)( PMC_LVDSC2_LVWIE_MASK | PMC_LVDSC2_LVWV(0x03) )) | (uint8_t)( PMC_LVDSC2_LVWACK_MASK )); /* PMC_REGSC: BGEN=0,ACKISO=0,BGBE=0 */ PMC_REGSC &= (uint8_t)~(uint8_t)( PMC_REGSC_BGEN_MASK | PMC_REGSC_ACKISO_MASK | PMC_REGSC_BGBE_MASK ); /* SMC_PMPROT: ??=0,??=0,AVLP=0,??=0,ALLS=0,??=0,AVLLS=0,??=0 */ SMC_PMPROT = 0x00U; /* Setup Power mode protection register */ /* Common initialization of the CPU registers */ /* NVICIP20: PRI20=0 */ NVICIP20 = NVIC_IP_PRI20(0x00); /* ### FreeRTOS "FRTOS1" init code ... */ #if configSYSTICK_USE_LOW_POWER_TIMER /* enable clocking for low power timer, otherwise vPortStopTickTimer() will crash */ SIM_PDD_SetClockGate(SIM_BASE_PTR, SIM_PDD_CLOCK_GATE_LPTMR0, PDD_ENABLE); #endif vPortStopTickTimer(); /* tick timer shall not run until the RTOS scheduler is started */ }
void Components_Init(void) { /* ### KinetisSDK "KSDK1" init code ... */ /* Write code here ... */ /* ### SeggerRTT "RTT1" init code ... */ RTT1_Init(); /* ### SeggerSystemView "SYS1" init code ... */ SYS1_Init(); /* ### FreeRTOS "FRTOS1" init code ... */ #if configSYSTICK_USE_LOW_POWER_TIMER /* enable clocking for low power timer, otherwise vPortStopTickTimer() will crash */ SIM_PDD_SetClockGate(SIM_BASE_PTR, SIM_PDD_CLOCK_GATE_LPTMR0, PDD_ENABLE); #endif vPortStopTickTimer(); /* tick timer shall not run until the RTOS scheduler is started */ /* ### GenericI2C "GI2C1" init code ... */ GI2C1_Init(); }
/* ** =================================================================== ** Method : PE_low_level_init (component MK22FN1M0LQ12) ** ** Description : ** Initializes beans and provides common register initialization. ** The method is called automatically as a part of the ** application initialization code. ** This method is internal. It is used by Processor Expert only. ** =================================================================== */ void PE_low_level_init(void) { #ifdef PEX_RTOS_INIT PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */ #endif /* Initialization of the SIM module */ /* PORTA_PCR4: ISF=0,MUX=7 */ PORTA_PCR4 = (uint32_t)((PORTA_PCR4 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK )) | (uint32_t)( PORT_PCR_MUX(0x07) )); /* Initialization of the RCM module */ /* RCM_RPFW: RSTFLTSEL=0 */ RCM_RPFW &= (uint8_t)~(uint8_t)(RCM_RPFW_RSTFLTSEL(0x1F)); /* RCM_RPFC: RSTFLTSS=0,RSTFLTSRW=0 */ RCM_RPFC &= (uint8_t)~(uint8_t)( RCM_RPFC_RSTFLTSS_MASK | RCM_RPFC_RSTFLTSRW(0x03) ); /* SIM_SCGC7: MPU=1 */ SIM_SCGC7 |= SIM_SCGC7_MPU_MASK; /* Initialization of the MPU module */ /* MPU_CESR: SPERR=0,VLD=0 */ MPU_CESR &= (uint32_t)~(uint32_t)((MPU_CESR_SPERR(0x1F) | MPU_CESR_VLD_MASK)); /* Initialization of the PMC module */ /* PMC_LVDSC1: LVDACK=1,LVDIE=0,LVDRE=1,LVDV=0 */ PMC_LVDSC1 = (uint8_t)((PMC_LVDSC1 & (uint8_t)~(uint8_t)( PMC_LVDSC1_LVDIE_MASK | PMC_LVDSC1_LVDV(0x03) )) | (uint8_t)( PMC_LVDSC1_LVDACK_MASK | PMC_LVDSC1_LVDRE_MASK )); /* PMC_LVDSC2: LVWACK=1,LVWIE=0,LVWV=0 */ PMC_LVDSC2 = (uint8_t)((PMC_LVDSC2 & (uint8_t)~(uint8_t)( PMC_LVDSC2_LVWIE_MASK | PMC_LVDSC2_LVWV(0x03) )) | (uint8_t)( PMC_LVDSC2_LVWACK_MASK )); /* PMC_REGSC: BGEN=0,ACKISO=0,BGBE=0 */ PMC_REGSC &= (uint8_t)~(uint8_t)( PMC_REGSC_BGEN_MASK | PMC_REGSC_ACKISO_MASK | PMC_REGSC_BGBE_MASK ); /* SMC_PMPROT: ??=0,??=0,AVLP=0,??=0,ALLS=0,??=0,AVLLS=0,??=0 */ SMC_PMPROT = 0x00U; /* Setup Power mode protection register */ /* Common initialization of the CPU registers */ /* NVICIP59: PRI59=0 */ NVICIP59 = NVIC_IP_PRI59(0x00); /* NVICIP53: PRI53=0 */ NVICIP53 = NVIC_IP_PRI53(0x00); /* NVICIP20: PRI20=0 */ NVICIP20 = NVIC_IP_PRI20(0x00); /* GPIOA_PDDR: PDD&=~0x4000 */ GPIOA_PDDR &= (uint32_t)~(uint32_t)(GPIO_PDDR_PDD(0x4000)); /* PORTE_PCR26: ISF=0,MUX=7 */ PORTE_PCR26 = (uint32_t)((PORTE_PCR26 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK )) | (uint32_t)( PORT_PCR_MUX(0x07) )); /* ### BitIO_LDD "BitIoLdd1" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd1_Init(NULL); /* ### LEDbit "LED1" init code ... */ LED1_Init(); /* initializes the driver */ /* ### BitIO_LDD "BitIoLdd2" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd2_Init(NULL); /* ### LEDbit "LED2" init code ... */ LED2_Init(); /* initializes the driver */ /* ### CriticalSection "CS1" init code ... */ /* ### HardFault "HF1" init code ... */ /* Write code here ... */ /* ### TimerInt_LDD "TimerIntLdd1" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)TimerIntLdd1_Init(NULL); /* ### TimerInt "TI1" init code ... */ /* ### Asynchro serial "AS1" init code ... */ AS1_Init(); /* ### Shell "CLS1" init code ... */ CLS1_Init(); /* initialize shell */ /* ### ExtInt_LDD "ExtIntLdd1" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)ExtIntLdd1_Init(NULL); /* ### BitIO_LDD "BitIoLdd4" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd4_Init(NULL); /* ### Init_GPIO "PTA" init code ... */ PTA_Init(); /* ### Asynchro serial "Serial1" init code ... */ Serial1_Init(); /* ### Bluetooth_EGBT "BT1" init code ... */ BT1_Init(); /* ### Init_USB_OTG "USB0" init code ... */ USB0_Init(); /* ### RingBuffer "Tx1" init code ... */ Tx1_Init(); /* ### RingBuffer "Rx1" init code ... */ Rx1_Init(); (void)USB1_Init(); /* ### FreeRTOS "FRTOS1" init code ... */ #if configSYSTICK_USE_LOW_POWER_TIMER /* enable clocking for low power timer, otherwise vPortStopTickTimer() will crash */ SIM_PDD_SetClockGate(SIM_BASE_PTR, SIM_PDD_CLOCK_GATE_LPTMR0, PDD_ENABLE); #endif vPortStopTickTimer(); /* tick timer shall not run until the RTOS scheduler is started */ }
/* ** =================================================================== ** Method : PE_low_level_init (component MK22FN1M0LH12) ** ** Description : ** Initializes beans and provides common register initialization. ** The method is called automatically as a part of the ** application initialization code. ** This method is internal. It is used by Processor Expert only. ** =================================================================== */ void PE_low_level_init(void) { #ifdef PEX_RTOS_INIT PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */ #endif /* Initialization of the SIM module */ /* PORTA_PCR4: ISF=0,MUX=7 */ PORTA_PCR4 = (uint32_t)((PORTA_PCR4 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK )) | (uint32_t)( PORT_PCR_MUX(0x07) )); /* Initialization of the RCM module */ /* RCM_RPFW: RSTFLTSEL=0 */ RCM_RPFW &= (uint8_t)~(uint8_t)(RCM_RPFW_RSTFLTSEL(0x1F)); /* RCM_RPFC: RSTFLTSS=0,RSTFLTSRW=0 */ RCM_RPFC &= (uint8_t)~(uint8_t)( RCM_RPFC_RSTFLTSS_MASK | RCM_RPFC_RSTFLTSRW(0x03) ); /* SIM_SCGC7: MPU=1 */ SIM_SCGC7 |= SIM_SCGC7_MPU_MASK; /* Initialization of the MPU module */ /* MPU_CESR: SPERR=0,VLD=0 */ MPU_CESR &= (uint32_t)~(uint32_t)((MPU_CESR_SPERR(0x1F) | MPU_CESR_VLD_MASK)); /* Initialization of the PMC module */ /* PMC_LVDSC1: LVDACK=1,LVDIE=0,LVDRE=1,LVDV=0 */ PMC_LVDSC1 = (uint8_t)((PMC_LVDSC1 & (uint8_t)~(uint8_t)( PMC_LVDSC1_LVDIE_MASK | PMC_LVDSC1_LVDV(0x03) )) | (uint8_t)( PMC_LVDSC1_LVDACK_MASK | PMC_LVDSC1_LVDRE_MASK )); /* PMC_LVDSC2: LVWACK=1,LVWIE=0,LVWV=0 */ PMC_LVDSC2 = (uint8_t)((PMC_LVDSC2 & (uint8_t)~(uint8_t)( PMC_LVDSC2_LVWIE_MASK | PMC_LVDSC2_LVWV(0x03) )) | (uint8_t)( PMC_LVDSC2_LVWACK_MASK )); /* PMC_REGSC: BGEN=0,ACKISO=0,BGBE=0 */ PMC_REGSC &= (uint8_t)~(uint8_t)( PMC_REGSC_BGEN_MASK | PMC_REGSC_ACKISO_MASK | PMC_REGSC_BGBE_MASK ); /* SMC_PMPROT: ??=0,??=0,AVLP=0,??=0,ALLS=0,??=0,AVLLS=0,??=0 */ SMC_PMPROT = 0x00U; /* Setup Power mode protection register */ /* Common initialization of the CPU registers */ /* NVICIP42: PRI42=0x80 */ NVICIP42 = NVIC_IP_PRI42(0x80); /* NVICIP53: PRI53=0 */ NVICIP53 = NVIC_IP_PRI53(0x00); /* NVICIP20: PRI20=0 */ NVICIP20 = NVIC_IP_PRI20(0x00); /* NVICISER1: SETENA|=0x0400 */ NVICISER1 |= NVIC_ISER_SETENA(0x0400); /* GPIOC_PDDR: PDD&=~0x0104 */ GPIOC_PDDR &= (uint32_t)~(uint32_t)(GPIO_PDDR_PDD(0x0104)); /* ### BitIO_LDD "BitIoLdd1" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd1_Init(NULL); /* ### BitIO_LDD "BitIoLdd2" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd2_Init(NULL); /* ### Init_FTM "FTM0" init code ... */ FTM0_Init(); /* ### SynchroMaster "SM1" init code ... */ SM1_Init(); /* ### BitIO_LDD "BitIoLdd4" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd4_Init(NULL); /* ### BitIO_LDD "BitIoLdd5" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd5_Init(NULL); /* ### ExtInt_LDD "ExtIntLdd1" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)ExtIntLdd1_Init(NULL); /* ### nRF24L01 "RF24" init code ... */ /* ### CriticalSection "CS1" init code ... */ /* ### Asynchro serial "AS1" init code ... */ AS1_Init(); /* ### KinetisSDK "KSDK1" init code ... */ /* Write code here ... */ /* ### Shell "mainShell" init code ... */ mainShell_Init(); /* initialize shell */ /* ### FreeRTOS "FRTOS1" init code ... */ #if configSYSTICK_USE_LOW_POWER_TIMER /* enable clocking for low power timer, otherwise vPortStopTickTimer() will crash */ SIM_PDD_SetClockGate(SIM_BASE_PTR, SIM_PDD_CLOCK_GATE_LPTMR0, PDD_ENABLE); #endif vPortStopTickTimer(); /* tick timer shall not run until the RTOS scheduler is started */ /* ### FreeRTOS_Tasks "rtTasks" init code ... */ rtTasks_CreateTasks(); /* ### BitIO_LDD "BitIoLdd6" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd6_Init(NULL); /* ### BitIO_LDD "BitIoLdd7" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd7_Init(NULL); /* ### BitIO_LDD "BitIoLdd8" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd8_Init(NULL); /* ### GenericSWSPI "RFIDspi" init code ... */ RFIDspi_Init(); /* ### BitIO_LDD "BitIoLdd9" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd9_Init(NULL); /* ### ExtInt_LDD "ExtIntLdd2" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)ExtIntLdd2_Init(NULL); /* ### BitIO_LDD "BitIoLdd10" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd10_Init(NULL); /* ### BitIO_LDD "BitIoLdd11" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd11_Init(NULL); /* ### LEDbit "LED1" init code ... */ LED1_Init(); /* initializes the driver */ /* ### BitIO_LDD "BitIoLdd3" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd3_Init(NULL); /* ### LEDbit "LED2" init code ... */ LED2_Init(); /* initializes the driver */ /* ### BitIO_LDD "BitIoLdd12" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd12_Init(NULL); /* ### LEDbit "LED3" init code ... */ LED3_Init(); /* initializes the driver */ /* ### Init_USB_OTG "USB0" init code ... */ USB0_Init(); /* ### RingBuffer "Tx1" init code ... */ Tx1_Init(); /* ### RingBuffer "Rx1" init code ... */ Rx1_Init(); (void)USB1_Init(); }
/* ** =================================================================== ** Method : PE_low_level_init (component MKL25Z128LK4) ** ** Description : ** Initializes beans and provides common register initialization. ** The method is called automatically as a part of the ** application initialization code. ** This method is internal. It is used by Processor Expert only. ** =================================================================== */ void PE_low_level_init(void) { #ifdef PEX_RTOS_INIT PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */ #endif /* Initialization of the SIM module */ /* PORTA_PCR4: ISF=0,MUX=7 */ PORTA_PCR4 = (uint32_t)((PORTA_PCR4 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK )) | (uint32_t)( PORT_PCR_MUX(0x07) )); /* Initialization of the RCM module */ /* RCM_RPFW: RSTFLTSEL=0 */ RCM_RPFW &= (uint8_t)~(uint8_t)(RCM_RPFW_RSTFLTSEL(0x1F)); /* RCM_RPFC: RSTFLTSS=0,RSTFLTSRW=0 */ RCM_RPFC &= (uint8_t)~(uint8_t)( RCM_RPFC_RSTFLTSS_MASK | RCM_RPFC_RSTFLTSRW(0x03) ); /* Initialization of the FTFL_FlashConfig module */ /* Initialization of the PMC module */ /* PMC_LVDSC1: LVDACK=1,LVDIE=0,LVDRE=1,LVDV=0 */ PMC_LVDSC1 = (uint8_t)((PMC_LVDSC1 & (uint8_t)~(uint8_t)( PMC_LVDSC1_LVDIE_MASK | PMC_LVDSC1_LVDV(0x03) )) | (uint8_t)( PMC_LVDSC1_LVDACK_MASK | PMC_LVDSC1_LVDRE_MASK )); /* PMC_LVDSC2: LVWACK=1,LVWIE=0,LVWV=0 */ PMC_LVDSC2 = (uint8_t)((PMC_LVDSC2 & (uint8_t)~(uint8_t)( PMC_LVDSC2_LVWIE_MASK | PMC_LVDSC2_LVWV(0x03) )) | (uint8_t)( PMC_LVDSC2_LVWACK_MASK )); /* PMC_REGSC: BGEN=0,ACKISO=0,BGBE=0 */ PMC_REGSC &= (uint8_t)~(uint8_t)( PMC_REGSC_BGEN_MASK | PMC_REGSC_ACKISO_MASK | PMC_REGSC_BGBE_MASK ); /* SMC_PMPROT: ??=0,??=0,AVLP=0,??=0,ALLS=0,??=0,AVLLS=0,??=0 */ SMC_PMPROT = 0x00U; /* Setup Power mode protection register */ /* Common initialization of the CPU registers */ /* PORTA_PCR20: ISF=0,MUX=7 */ PORTA_PCR20 = (uint32_t)((PORTA_PCR20 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK )) | (uint32_t)( PORT_PCR_MUX(0x07) )); /* NVIC_IPR1: PRI_6=0 */ NVIC_IPR1 &= (uint32_t)~(uint32_t)(NVIC_IP_PRI_6(0xFF)); /* SCB_SHPR2: PRI_11=0 */ SCB_SHPR2 &= (uint32_t)~(uint32_t)(SCB_SHPR2_PRI_11(0xFF)); /* SCB_SHPR3: PRI_14=0 */ SCB_SHPR3 &= (uint32_t)~(uint32_t)(SCB_SHPR3_PRI_14(0xFF)); /* ### FreeRTOS "FRTOS1" init code ... */ #if configSYSTICK_USE_LOW_POWER_TIMER /* enable clocking for low power timer, otherwise vPortStopTickTimer() will crash */ SIM_PDD_SetClockGate(SIM_BASE_PTR, SIM_PDD_CLOCK_GATE_LPTMR0, PDD_ENABLE); #endif vPortStopTickTimer(); /* tick timer shall not run until the RTOS scheduler is started */ /* ### BitIO_LDD "BitIoLdd1" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd1_Init(NULL); /* ### LED "LEDR" init code ... */ LEDR_Init(); /* initializes the driver */ /* ### BitIO_LDD "BitIoLdd2" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd2_Init(NULL); /* ### LED "LEDB" init code ... */ LEDB_Init(); /* initializes the driver */ }
/* ** =================================================================== ** Method : PE_low_level_init (component MK70FN1M0MJ15) ** ** Description : ** Initializes beans and provides common register initialization. ** The method is called automatically as a part of the ** application initialization code. ** This method is internal. It is used by Processor Expert only. ** =================================================================== */ void PE_low_level_init(void) { #ifdef PEX_RTOS_INIT PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */ #endif /* Initialization of the SIM module */ /* SIM_SOPT2: CMTUARTPAD=0 */ SIM_SOPT2 &= (uint32_t)~(uint32_t)(SIM_SOPT2_CMTUARTPAD_MASK); /* PORTA_PCR4: ISF=0,MUX=7 */ PORTA_PCR4 = (uint32_t)((PORTA_PCR4 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK )) | (uint32_t)( PORT_PCR_MUX(0x07) )); /* Initialization of the RCM module */ /* RCM_RPFW: RSTFLTSEL=0 */ RCM_RPFW &= (uint8_t)~(uint8_t)(RCM_RPFW_RSTFLTSEL(0x1F)); /* RCM_RPFC: RSTFLTSS=0,RSTFLTSRW=0 */ RCM_RPFC &= (uint8_t)~(uint8_t)( RCM_RPFC_RSTFLTSS_MASK | RCM_RPFC_RSTFLTSRW(0x03) ); /* Initialization of the FTFL_FlashConfig module */ /* SIM_SCGC7: MPU=1 */ SIM_SCGC7 |= SIM_SCGC7_MPU_MASK; /* Initialization of the MPU module */ /* MPU_CESR: SPERR=0,VLD=0 */ MPU_CESR &= (uint32_t)~(uint32_t)((MPU_CESR_SPERR(0xFF) | MPU_CESR_VLD_MASK)); /* Initialization of the PMC module */ /* PMC_REGSC: ACKISO=0,BGBE=0 */ PMC_REGSC &= (uint8_t)~(uint8_t)( PMC_REGSC_ACKISO_MASK | PMC_REGSC_BGBE_MASK ); /* PMC_LVDSC1: LVDACK=1,LVDIE=0,LVDRE=1,LVDV=0 */ PMC_LVDSC1 = (uint8_t)((PMC_LVDSC1 & (uint8_t)~(uint8_t)( PMC_LVDSC1_LVDIE_MASK | PMC_LVDSC1_LVDV(0x03) )) | (uint8_t)( PMC_LVDSC1_LVDACK_MASK | PMC_LVDSC1_LVDRE_MASK )); /* PMC_LVDSC2: LVWACK=1,LVWIE=0,LVWV=0 */ PMC_LVDSC2 = (uint8_t)((PMC_LVDSC2 & (uint8_t)~(uint8_t)( PMC_LVDSC2_LVWIE_MASK | PMC_LVDSC2_LVWV(0x03) )) | (uint8_t)( PMC_LVDSC2_LVWACK_MASK )); /* SMC_PMPROT: ??=0,??=0,AVLP=0,??=0,ALLS=0,??=0,AVLLS=0,??=0 */ SMC_PMPROT = 0x00U; /* Setup Power mode protection register */ /* Common initialization of the CPU registers */ /* NVICIP20: PRI20=0 */ NVICIP20 = NVIC_IP_PRI20(0x00); /* GPIOE_PDDR: PDD&=~0x04000000 */ GPIOE_PDDR &= (uint32_t)~(uint32_t)(GPIO_PDDR_PDD(0x04000000)); /* ### FreeRTOS "FRTOS1" init code ... */ #if configSYSTICK_USE_LOW_POWER_TIMER /* enable clocking for low power timer, otherwise vPortStopTickTimer() will crash */ SIM_PDD_SetClockGate(SIM_BASE_PTR, SIM_PDD_CLOCK_GATE_LPTMR0, PDD_ENABLE); #endif vPortStopTickTimer(); /* tick timer shall not run until the RTOS scheduler is started */ /* ### BitIO_LDD "BitIoLdd1" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd1_Init(NULL); /* ### LED "LED_E1" init code ... */ LED_E1_Init(); /* initialize LED driver */ /* ### BitIO_LDD "BitIoLdd2" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd2_Init(NULL); /* ### LED "LED_E2" init code ... */ LED_E2_Init(); /* initialize LED driver */ /* ### BitIO_LDD "BitIoLdd3" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd3_Init(NULL); /* ### LED "LED_E3" init code ... */ LED_E3_Init(); /* initialize LED driver */ /* ### BitIO_LDD "BitIoLdd4" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd4_Init(NULL); /* ### LED "LED_E4" init code ... */ LED_E4_Init(); /* initialize LED driver */ /* ### ExtInt_LDD "EInt1" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)EInt1_Init(NULL); }