Init method that is defined in all Peripheral
Initialization Beans. Init method contains a complete initialization
of the peripheral according to the bean's settings. In the following examples, let's assume a bean named "Init1"
has been added into the project. The Init method of the Peripheral Initialization bean 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 Bean'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. Add 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:
Put the Init method right below the PE_low_level_init call. Some Peripheral Initialization beans allow the
initialization of an interrupt service routine. Interrupt(s) can be
enabled in initialization code using appropriate properties that can be
usually found within a 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 Beans 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. Declarations of
the ISRs that already do not exist can be generated automatically by PE
during the code generation process into the Event module of the CPU bean (name
of the CPU event module could be changed in the Advanced view mode of the
Bean Inspector) if the project option Project
Options | Generate ISR is enabled (this option is visible in
the Advanced level of view). Notice 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.
|