|
Typical Usage of Peripheral Initialization Components Init methodInit method is defined in all Peripheral Initialization Components. Init method contains a complete initialization of the peripheral according to the component's settings. In the following examples, let's assume a component named "Init1" has been added to the project. The Init method of the Peripheral Initialization component can be used in two ways.
The user can let Processor Expert call the Init method automatically by selecting "yes" for the Call Init method in the Initialization group of the Component's properties. When this option is set, Processor Expert places the call of the Init method into the PE_low_level_init function of the CPU.c module. Manual calling of InitAdd the call of the Init method into the user's code, for example in main module. Enter the following line into the main module file: Init1_Init(); Put the Init method right below the PE_low_level_init call. void main(void) { /*** Processor Expert internal initialization. ***/ PE_low_level_init(); /*** End of Processor Expert internal initialization. ***/ Init1_Init(); for(;;) {} } Interrupt Handling Some Peripheral Initialization components allow the initialization of an interrupt service routine. Interrupt(s) can be enabled in the initialization code using appropriate properties that can be usually found within the group Interrupts.
Enabling/disabling peripheral interrupts during runtime has to be done by user's code, for example by utilizing PESL or direct register access macros, because the Peripheral Initialization Components do not offer any methods for interrupt handling. The ISR with the specified name has to be declared according to the compiler conventions and fully implemented by the user. Note for 56800/E version users: ISRs generated by Processor Expert contain the fast interrupt handling instructions if the interrupt priority is specified as fast interrupt. Copyright 2013 Freescale Semiconductor, Inc.
PROCESSOR EXPERT is trademark of Freescale Semiconductor, Inc. |