/* ** =================================================================== ** Method : PE_low_level_init (component MK20DX128EX5) ** ** 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_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 */ /* NVICIP8: PRI8=0 */ NVICIP8 = NVIC_IP_PRI8(0x00); /* SCB_SHPR2: PRI_11=0 */ SCB_SHPR2 &= (uint32_t)~(uint32_t)(SCB_SHPR2_PRI_11(0xFF)); /* ### Asynchro serial "AS1" init code ... */ AS1_Init(); /* ### InternalI2C "CI2C0" init code ... */ CI2C0_Init(); /* ### Asynchro serial "AS0" init code ... */ AS0_Init(); /* ### SynchroMaster "SM1" init code ... */ SM1_Init(); /* Enable interrupts of the given priority level */ Cpu_SetBASEPRI(0U); }
/* ** =================================================================== ** 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 */ }
/* ** =================================================================== ** 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 */ /* 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 */ /* NVIC_IPR6: PRI_24=0 */ NVIC_IPR6 &= (uint32_t)~(uint32_t)(NVIC_IP_PRI_24(0xFF)); /* 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)); /* ### Init_USB_OTG "USB0" init code ... */ USB0_Init(); /* ### RingBufferUInt8 "Tx1" init code ... */ Tx1_Init(); /* ### RingBufferUInt8 "Rx1" init code ... */ Rx1_Init(); (void)USB1_Init(); __EI(); }
/* ** =================================================================== ** Method : PE_low_level_init (component MKL46Z256MC4) ** ** 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 /* {MQXLite RTOS Adapter} Set new interrupt vector (function handler and ISR parameter) */ /* 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)); /* ### Serial_LDD "IO1" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)IO1_Init(NULL); }
/* ** =================================================================== ** Method : PE_low_level_init (component MK20DX128EX5) ** ** 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_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 */ /* NVICIP8: PRI8=0 */ NVICIP8 = NVIC_IP_PRI8(0x00); /* ### 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); /* Enable interrupts of the given priority level */ Cpu_SetBASEPRI(0U); }
/* ** =================================================================== ** Method : PE_low_level_init (component MK20DX128EX5) ** ** 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 /* {MQXLite RTOS Adapter} Set new interrupt vector (function handler and ISR parameter) */ /* 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_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 */ /* NVICIP8: PRI8=0 */ NVICIP8 = NVIC_IP_PRI8(0x00); /* ### InternalI2C "Accel" init code ... */ Accel_Init(); /* ### Asynchro serial "Inhr1" init code ... */ Inhr1_Init(); /* ### "Term1" init code ... */ }
/* ** =================================================================== ** Method : PE_low_level_init (component MK60N512LQ100) ** ** 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) )); /* SIM_SOPT6: RSTFLTEN=0,RSTFLTSEL=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0,??=0 */ SIM_SOPT6 = (SIM_SOPT6_RSTFLTEN(0x00) | SIM_SOPT6_RSTFLTSEL(0x00)); /* Set reset pin filter */ /* 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: TRAMPO=0,??=0,BGBE=0 */ PMC_REGSC &= (uint8_t)~(uint8_t)( PMC_REGSC_TRAMPO_MASK | PMC_REGSC_BGBE_MASK | 0x02U ); /* MC_PMPROT: ??=0,??=0,AVLP=0,ALLS=0,??=0,AVLLS3=0,AVLLS2=0,AVLLS1=0 */ MC_PMPROT = 0x00U; /* Setup Power mode protection register */ /* Common initialization of the CPU registers */ /* NVICIP20: PRI20=0 */ NVICIP20 = NVIC_IP_PRI20(0x00); /* ### BitIO_LDD "BitIoLdd1" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd1_Init(NULL); /* ### Asynchro serial "UART3" init code ... */ UART3_Init(); /* Enable interrupts of the given priority level */ Cpu_SetBASEPRI(0U); }
/* ** =================================================================== ** Method : PE_low_level_init ** ** Description : ** Initializes components 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) { /* Global routing function and crystal values initialization */ #if CPU_HARDWARE_INIT hardware_init(); #endif /* CPU_HARDWARE_INIT */ /* RTOS initialization */ #ifdef PEX_RTOS_INIT PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */ #endif /* Components initialization, when RTOS is active this method is called in rtos_main_task() (from MainTask component) */ #ifdef PEX_COMPONENTS_INIT PEX_components_init(); #endif }
/* ** =================================================================== ** Method : PE_low_level_init (component MC9S08SC4_16) ** ** Description : ** Initializes components 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 /* Common initialization of the CPU registers */ /* PTBD: PTBD7=0,PTBD6=0,PTBD5=0,PTBD4=0 */ clrReg8Bits(PTBD, 0xF0U); /* PTBPE: PTBPE7=0,PTBPE6=0,PTBPE5=0,PTBPE4=0,PTBPE3=0,PTBPE2=0,PTBPE1=0,PTBPE0=0 */ setReg8(PTBPE, 0x00U); /* PTBDD: PTBDD7=1,PTBDD6=1,PTBDD5=1,PTBDD4=1,PTBDD3=0,PTBDD2=0,PTBDD1=0,PTBDD0=0 */ setReg8(PTBDD, 0xF0U); /* PTAD: PTAD3=0 */ clrReg8Bits(PTAD, 0x08U); /* PTAPE: PTAPE3=0,PTAPE1=0 */ clrReg8Bits(PTAPE, 0x0AU); /* PTADD: PTADD3=1,PTADD1=0 */ clrSetReg8Bits(PTADD, 0x02U, 0x08U); /* PTASE: PTASE3=0,PTASE2=0,PTASE1=0,PTASE0=0 */ clrReg8Bits(PTASE, 0x0FU); /* PTBSE: PTBSE7=0,PTBSE6=0,PTBSE5=0,PTBSE4=0,PTBSE3=0,PTBSE2=0,PTBSE1=0,PTBSE0=0 */ setReg8(PTBSE, 0x00U); /* PTADS: ??=0,??=0,??=0,??=0,PTADS3=0,PTADS2=1,PTADS1=1,PTADS0=1 */ setReg8(PTADS, 0x07U); /* PTBDS: PTBDS7=0,PTBDS6=0,PTBDS5=0,PTBDS4=0,PTBDS3=0,PTBDS2=0,PTBDS1=0,PTBDS0=0 */ setReg8(PTBDS, 0x00U); /* ### Shared modules init code ... */ /* ### BitsIO "Signal_In" init code ... */ /* ### BitsIO "Lever_Pos_MPND" init code ... */ /* ### BitIO "Lever_Pos_R" init code ... */ /* ### BitIO "AD1" init code ... */ /* ### Timer capture encapsulation "PWM_In" init code ... */ PWM_In_Init(); /* ### TimerInt "PWM_Timer" init code ... */ PWM_Timer_Init(); /* ### WatchDog "WDT" init code ... */ /* SRS: POR=0,PIN=1,COP=0,ILOP=1,ILAD=0,??=1,LVD=0,??=1 */ setReg8(SRS, 0x55U); /* SRS: POR=1,PIN=0,COP=1,ILOP=0,ILAD=1,??=0,LVD=1,??=0 */ setReg8(SRS, 0xAAU); CCR_lock = (byte)0; __EI(); /* Enable interrupts */ /* TPM2SC: TOIE=0 */ clrReg8Bits(TPM2SC, 0x40U); /* Disable overflow interrupt */ }
void main(void) { /* Write your local variable definition here */ PEX_RTOS_INIT(); /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/ PE_low_level_init(); /*** End of Processor Expert internal initialization. ***/ if (FRTOS1_xTaskCreate( Task1, /* pointer to the task */ (signed portCHAR *)"Task1", /* task name for kernel awareness debugging */ configMINIMAL_STACK_SIZE, /* task stack size */ (void*)NULL, /* optional task startup argument */ tskIDLE_PRIORITY, /* initial priority */ (xTaskHandle*)NULL /* optional task handle to create */ ) != pdPASS) { /*lint -e527 */ for(;;){}; /* error! probably out of memory */ /*lint +e527 */ } if (FRTOS1_xTaskCreate( Task2, /* pointer to the task */ (signed portCHAR *)"Task2", /* task name for kernel awareness debugging */ configMINIMAL_STACK_SIZE, /* task stack size */ (void*)NULL, /* optional task startup argument */ tskIDLE_PRIORITY, /* initial priority */ (xTaskHandle*)NULL /* optional task handle to create */ ) != pdPASS) { /*lint -e527 */ for(;;){}; /* error! probably out of memory */ /*lint +e527 */ } FRTOS1_vTaskStartScheduler(); /*** Don't write any code pass this line, or it will be deleted during code generation. ***/ /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/ for(;;){} /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/ } /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
/* ** =================================================================== ** 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 */ /* GPIOA_PDDR: PDD&=~0x00010000 */ GPIOA_PDDR &= (uint32_t)~(uint32_t)(GPIO_PDDR_PDD(0x00010000)); /* 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)); /* ### 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); /* ### ExtInt_LDD "ExtIntLdd1" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)ExtIntLdd1_Init(NULL); /* ### SynchroMaster "SM1" init code ... */ SM1_Init(); /* ### BitIO_LDD "BitIoLdd3" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd3_Init(NULL); /* ### 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); __EI(); }
/* ** =================================================================== ** 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 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)); /* ### Serial_LDD "IO1" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)IO1_Init(NULL); /* ### BitIO_LDD "BitIoLdd1" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd1_Init(NULL); /* ### LED "LEDgreen" init code ... */ LEDgreen_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 "LEDred" init code ... */ LEDred_Init(); /* initializes the driver */ /* ### ADC "AD1" init code ... */ AD1_Init(); __EI(); }
/* ** =================================================================== ** Method : PE_low_level_init (component MKL26Z128FT4) ** ** 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 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 */ /* PORTD_ISFR: ISF=0xD2 */ PORTD_ISFR = PORT_ISFR_ISF(0xD2); /* Common initialization of the CPU registers */ /* PORTD_PCR1: ISF=0,IRQC=0x0B,PE=1 */ PORTD_PCR1 = (uint32_t)((PORTD_PCR1 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK | PORT_PCR_IRQC(0x04) )) | (uint32_t)( PORT_PCR_IRQC(0x0B) | PORT_PCR_PE_MASK )); /* PORTD_PCR2: ISF=0,PE=1,PS=1 */ PORTD_PCR2 = (uint32_t)((PORTD_PCR2 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK )) | (uint32_t)( PORT_PCR_PE_MASK | PORT_PCR_PS_MASK )); /* PORTD_PCR4: ISF=0,IRQC=0x0B,PE=1 */ PORTD_PCR4 = (uint32_t)((PORTD_PCR4 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK | PORT_PCR_IRQC(0x04) )) | (uint32_t)( PORT_PCR_IRQC(0x0B) | PORT_PCR_PE_MASK )); /* PORTD_PCR5: ISF=0,PE=1 */ PORTD_PCR5 = (uint32_t)((PORTD_PCR5 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK )) | (uint32_t)( PORT_PCR_PE_MASK )); /* PORTD_PCR6: ISF=0,IRQC=0x0B,DSE=0,PE=1 */ PORTD_PCR6 = (uint32_t)((PORTD_PCR6 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK | PORT_PCR_IRQC(0x04) | PORT_PCR_DSE_MASK )) | (uint32_t)( PORT_PCR_IRQC(0x0B) | PORT_PCR_PE_MASK )); /* PORTD_PCR7: ISF=0,IRQC=0x0B,DSE=0,PE=1 */ PORTD_PCR7 = (uint32_t)((PORTD_PCR7 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK | PORT_PCR_IRQC(0x04) | PORT_PCR_DSE_MASK )) | (uint32_t)( PORT_PCR_IRQC(0x0B) | PORT_PCR_PE_MASK )); /* NVIC_ISER: SETENA|=0x80000040 */ NVIC_ISER |= NVIC_ISER_SETENA(0x80000040); /* NVIC_IPR7: PRI_31=0 */ NVIC_IPR7 &= (uint32_t)~(uint32_t)(NVIC_IP_PRI_31(0xFF)); /* PORTC_PCR3: ISF=0,PE=1 */ PORTC_PCR3 = (uint32_t)((PORTC_PCR3 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK )) | (uint32_t)( PORT_PCR_PE_MASK )); /* PORTC_PCR5: ISF=0,PE=1,PS=1 */ PORTC_PCR5 = (uint32_t)((PORTC_PCR5 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK )) | (uint32_t)( PORT_PCR_PE_MASK | PORT_PCR_PS_MASK )); /* NVIC_IPR5: PRI_21=0,PRI_20=0 */ NVIC_IPR5 &= (uint32_t)~(uint32_t)( NVIC_IP_PRI_21(0xFF) | NVIC_IP_PRI_20(0xFF) ); /* PORTB_PCR0: ISF=0,PE=1,PS=1 */ PORTB_PCR0 = (uint32_t)((PORTB_PCR0 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK )) | (uint32_t)( PORT_PCR_PE_MASK | PORT_PCR_PS_MASK )); /* PORTB_PCR1: ISF=0,PE=1,PS=1 */ PORTB_PCR1 = (uint32_t)((PORTB_PCR1 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK )) | (uint32_t)( PORT_PCR_PE_MASK | PORT_PCR_PS_MASK )); /* NVIC_IPR1: PRI_6=0 */ NVIC_IPR1 &= (uint32_t)~(uint32_t)(NVIC_IP_PRI_6(0xFF)); /* ### FreeRTOS "FRTOS1" init code ... */ #if configSYSTICK_USE_LOW_POWER_TIMER /* enable clocking for low power timer, otherwise vPortStopTickTimer() will crash */ SIM_SCGC5 |= SIM_SCGC5_LPTMR_MASK; /* SIM_SCGC5: LPTMR=1 */ #endif vPortStopTickTimer(); /* tick timer shall not run until the RTOS scheduler is started */ /* ### Serial_LDD "IO1" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)IO1_Init(NULL); /* ### Init_GPIO "PTD" init code ... */ PTD_Init(); /* ### BitIO_LDD "StartStopButton" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)StartStopButton_Init(NULL); /* ### 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); /* ### BitIO_LDD "BitIoLdd3" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd3_Init(NULL); /* ### 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); /* ### BitIO_LDD "ModeButton" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)ModeButton_Init(NULL); /* ### Init_GPIO "PTC" init code ... */ PTC_Init(); /* ### BitIO_LDD "BitIoLdd6" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd6_Init(NULL); /* ### BitIO_LDD "EncoderA" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)EncoderA_Init(NULL); /* ### BitIO_LDD "EncoderB" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)EncoderB_Init(NULL); /* ### BitIO_LDD "PreampEnable" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)PreampEnable_Init(NULL); /* ### Init_SRTC "RTC" init code ... */ RTC_Init(); /* ### Init_GPIO "PTB" init code ... */ PTB_Init(); /* ### DMATransfer_LDD "SSI1_TxDMA" component auto initialization. Auto initialization feature can be disabled by component's property "Auto initialization". */ (void)SSI1_TxDMA_Init(NULL); /* ### BitIO_LDD "BitIoLdd7" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)BitIoLdd7_Init(NULL); }
/* ** =================================================================== ** 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 */ }
/*lint -save -e970 Disable MISRA rule (6.3) checking. */ int main(void) { PEX_RTOS_INIT(); }
/* ** =================================================================== ** Method : PE_low_level_init (component MKL46Z256MC4) ** ** 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 */ /* 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 */ /* PORTC_PCR3: ISF=0,PE=1,PS=1 */ PORTC_PCR3 = (uint32_t)((PORTC_PCR3 & (uint32_t)~(uint32_t)( PORT_PCR_ISF_MASK )) | (uint32_t)( PORT_PCR_PE_MASK | PORT_PCR_PS_MASK )); /* 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)); /* ### Serial_LDD "IO1" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)IO1_Init(NULL); /* ### BitIO_LDD "LED_OR" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)LED_OR_Init(NULL); /* ### BitIO_LDD "LED_YEL" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)LED_YEL_Init(NULL); /* ### BitIO_LDD "LED_RED" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)LED_RED_Init(NULL); /* ### BitIO_LDD "LED_GRE" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)LED_GRE_Init(NULL); /* ### BitIO_LDD "SW4" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)SW4_Init(NULL); /* ### BitIO_LDD "SW2" component auto initialization. Auto initialization feature can be disabled by component property "Auto initialization". */ (void)SW2_Init(NULL); /* ### Init_GPIO "PTC" init code ... */ PTC_Init(); }
/* ** =================================================================== ** 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 MKE06Z128LK4) ** ** Description : ** Initializes components 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) { /* RTOS initialization */ #ifdef PEX_RTOS_INIT PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */ #endif /* Debug pins port clock gate enable */ #if CPU_SWD_DIO_PIN | CPU_SWD_CLK_PIN SIM_SCGC |= (uint32_t)SIM_SCGC_SWD_MASK; /* SWD pins clock gate enable */ #endif /* CPU_SWD_DIO_PIN | CPU_SWD_CLK_PIN */ /* NMI pin initialization */ #if CPU_NMI_PIN SIM_SOPT0 |= (uint32_t)SIM_SOPT0_NMIE_MASK; /* Enable NMI pin */ #else SIM_SOPT0 &= (uint32_t)~(uint32_t)SIM_SOPT0_NMIE_MASK; /* Disable NMI pin */ #endif /* CPU_NMI_PIN */ /* Reset pin initialization */ #if CPU_RESET_PIN SIM_SOPT0 |= (uint32_t)SIM_SOPT0_RSTPE_MASK; /* Enable Reset pin */ #else SIM_SOPT0 &= (uint32_t)~(uint32_t)SIM_SOPT0_RSTPE_MASK; /* Disable Reset pin */ #endif /* CPU_RESET_PIN */ /* SWD pins initialization */ #if CPU_SWD_DIO_PIN | CPU_SWD_CLK_PIN SIM_SOPT0 |= (uint32_t)SIM_SOPT0_SWDE_MASK; /* Enable SWD pins */ #else SIM_SOPT0 &= (uint32_t)~(uint32_t)SIM_SOPT0_SWDE_MASK; /* Disable SWD pins */ #endif /* CPU_SWD_DIO_PIN | CPU_SWD_CLK_PIN */ /* Common initialization */ #if CPU_COMMON_INIT Common_Init(); #endif /* CPU_COMMON_INIT */ /* Peripheral initialization components initialization */ #if CPU_PERIPHERALS_INIT Peripherals_Init(); #endif /* CPU_PERIPHERALS_INIT */ /* OnReset event */ #ifdef CPU_ON_RESET_EVENT_NAME CPU_ON_RESET_EVENT_NAME((uint16_t)SIM_SRSID); /* Invoke an user event */ #endif /* CPU_ON_RESET_EVENT_NAME */ /* Rest of components initialization */ #if CPU_COMPONENTS_INIT Components_Init(); #endif /* CPU_COMPONENTS_INIT */ /* Interrupts priority level initialization */ #if CPU_INT_PRIORITY == 0 __DI(); /* Disable interrupts */ #elif CPU_INT_PRIORITY == 1 __EI(); /* Enable interrupts */ #else #error Unsupported interrupt priority level #endif }
/* ** =================================================================== ** Method : PE_low_level_init (component MKL26Z256LH4) ** ** 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 */ /* SCB_SHPR3: PRI_15=0 */ SCB_SHPR3 &= (uint32_t)~(uint32_t)(SCB_SHPR3_PRI_15(0xFF)); /* GPIOA_PDDR: PDD&=~6 */ GPIOA_PDDR &= (uint32_t)~(uint32_t)(GPIO_PDDR_PDD(0x06)); /* 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)); /* ### Init_SysTick "SysTick" init code ... */ /* ### Call "SysTick_Init();" init method in a user code, i.e. in the main code */ /* ### Note: To enable automatic calling of the "SysTick" init code here, the 'Call Init method' property must be set to 'yes'. */ __EI(); }
/* ** =================================================================== ** Method : PE_low_level_init (component MC9S08PA16_32) ** ** Description : ** Initializes components 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 /* SCG_C1: FTM2=1,??=0,FTM0=1,??=0,??=0,??=0,MTIM0=1,RTC=1 */ setReg8(SCG_C1, 0xA3U); /* SCG_C2: ??=0,??=0,DBG=1,NVM=1,IPC=1,CRC=1,??=0,??=0 */ setReg8(SCG_C2, 0x3CU); /* SCG_C3: ??=0,??=0,SCI1=1,SCI0=1,??=0,SPI0=1,IIC=1,??=0 */ setReg8(SCG_C3, 0x36U); /* SCG_C4: ACMP=1,??=0,ADC=1,??=0,IRQ=1,??=0,??=0,KBI0=1 */ setReg8(SCG_C4, 0xA9U); /* Common initialization of the CPU registers */ /* SYS_SOPT2: TXDME=0 */ clrReg8Bits(SYS_SOPT2, 0x80U); /* PORT_PTBOE: PTBOE1=1,PTBOE0=0 */ clrSetReg8Bits(PORT_PTBOE, 0x01U, 0x02U); /* PORT_PTBIE: PTBIE1=0,PTBIE0=1 */ clrSetReg8Bits(PORT_PTBIE, 0x02U, 0x01U); /* PORT_PTBD: PTBD1=1 */ setReg8Bits(PORT_PTBD, 0x02U); /* PORT_PTCOE: PTCOE7=1,PTCOE6=0 */ clrSetReg8Bits(PORT_PTCOE, 0x40U, 0x80U); /* PORT_PTCIE: PTCIE7=0,PTCIE6=1 */ clrSetReg8Bits(PORT_PTCIE, 0x80U, 0x40U); /* PORT_PTCD: PTCD7=1 */ setReg8Bits(PORT_PTCD, 0x80U); /* PORT_PTAD: PTAD0=0 */ clrReg8Bits(PORT_PTAD, 0x01U); /* PORT_PTAPE: PTAPE0=0 */ clrReg8Bits(PORT_PTAPE, 0x01U); /* PORT_PTAOE: PTAOE0=1 */ setReg8Bits(PORT_PTAOE, 0x01U); /* PORT_PTAIE: PTAIE0=0 */ clrReg8Bits(PORT_PTAIE, 0x01U); /* PORT_PTDD: PTDD0=0 */ clrReg8Bits(PORT_PTDD, 0x01U); /* PORT_PTDPE: PTDPE0=0 */ clrReg8Bits(PORT_PTDPE, 0x01U); /* PORT_PTDOE: PTDOE0=1 */ setReg8Bits(PORT_PTDOE, 0x01U); /* PORT_PTDIE: PTDIE0=0 */ clrReg8Bits(PORT_PTDIE, 0x01U); /* SYS_SOPT3: CLKOE=0,BUSREF=0 */ clrReg8Bits(SYS_SOPT3, 0x0FU); /* IPC_ILRS9: ILRn3=0,ILRn2=0,ILRn1=0,ILRn0=0 */ setReg8(IPC_ILRS9, 0x00U); /* IPC_ILRS8: ILRn3=0,ILRn2=0,ILRn1=0,ILRn0=0 */ setReg8(IPC_ILRS8, 0x00U); /* IPC_ILRS7: ILRn3=0,ILRn2=0,ILRn1=0,ILRn0=2 */ setReg8(IPC_ILRS7, 0x02U); /* IPC_ILRS6: ILRn3=2,ILRn2=2,ILRn1=2,ILRn0=2 */ setReg8(IPC_ILRS6, 0xAAU); /* IPC_ILRS5: ILRn3=2,ILRn2=0,ILRn1=0,ILRn0=0 */ setReg8(IPC_ILRS5, 0x80U); /* IPC_ILRS4: ILRn3=2,ILRn2=0,ILRn1=2,ILRn0=2 */ setReg8(IPC_ILRS4, 0x8AU); /* IPC_ILRS3: ILRn3=0,ILRn2=0,ILRn1=0,ILRn0=0 */ setReg8(IPC_ILRS3, 0x00U); /* IPC_ILRS2: ILRn3=0,ILRn2=0,ILRn1=0,ILRn0=0 */ setReg8(IPC_ILRS2, 0x00U); /* IPC_ILRS1: ILRn3=2,ILRn2=2,ILRn1=0,ILRn0=0 */ setReg8(IPC_ILRS1, 0xA0U); /* IPC_ILRS0: ILRn3=0,ILRn2=0,ILRn1=0,ILRn0=0 */ setReg8(IPC_ILRS0, 0x00U); /* IPC_SC: IPCE=1,??=0,PSE=0,PSF=0,PULIPM=0,??=0,IPM=0 */ setReg8(IPC_SC, 0x80U); /* Initialization of the PORT module */ /* ### Shared modules init code ... */ /* ### Asynchro serial "AS_CCTALK" init code ... */ AS_CCTALK_Init(); /* ### Free running 8-bit counter "FC_CCTALK" init code ... */ FC_CCTALK_Init(); /* ### TimerInt "TI_CCTALK" init code ... */ TI_CCTALK_Init(); /* ### WatchDog "WDOG" init code ... */ WDOG_Init(); /* WDOG_CNT: CNT=0xA602 */ setReg16(WDOG_CNT, 0xA602U); /* WDOG_CNT: CNT=0xB480 */ setReg16(WDOG_CNT, 0xB480U); /* ### Asynchro serial "AS_DATABUS" init code ... */ AS_DATABUS_Init(); /* ### BitIO "LED_RUN" init code ... */ /* ### BitIO "LED_CCTALK" init code ... */ /* ### Free running 8-bit counter "FC_DATABUS" init code ... */ FC_DATABUS_Init(); /* ### TimerInt "TI_LEDS" init code ... */ TI_LEDS_Init(); /* ### IntEEPROM "EEPROM" init code ... */ EEPROM_Init(); /* ### Free running 8-bit counter "FC_HOPPER" init code ... */ FC_HOPPER_Init(); /* Common peripheral initialization - ENABLE */ /* FTM0_SC: CLKS=1 */ clrSetReg8Bits(FTM0_SC, 0x10U, 0x08U); /* FTM2_SC: CLKS=1 */ clrSetReg8Bits(FTM2_SC, 0x10U, 0x08U); CCR_lock = (byte)0; __EI(); /* Enable interrupts */ }
/* ** =================================================================== ** 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 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); }