AN2292 Freescale Semiconductor / Motorola, AN2292 Datasheet - Page 8

no-image

AN2292

Manufacturer Part Number
AN2292
Description
8-Bit Software Development Kit
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2292
Static Initialization
On-Chip Drivers
8
NOTE:
The static initialization of the on-chip drivers is set in the “appconfig.h” file.
Follow these steps to configure the on-chip peripherals:
Unchanged constants in the “appconfig.h” do not bring any code overhead.
Only non-default values are written to registers. If a constant is not defined in
the “appconfig.h”, then the default value, defined in the driver header file, is
used.
On-chip peripherals are controlled by the IOCTL driver commands. The
general form of the driver command is the following:
IOCTL(peripheral_module_identifier,command,command_specif_parameter);
Where:
The peripheral_module_identifier parameter specifies the peripheral module
with predefined symbolic constants, like PWM for PWM module, TIMA for
Timer A, TIMB for Timer B etc.
The command parameter specifies the action, which will be performed on the
peripheral module. It represents the command name as it is implemented for
each on-chip driver.
1. Copy the configuration items from the driver “name.txt” e.g. “pwmdrv.txt”
2. In the “appconfig.h” file select the appropriate value for the driver
3. Include the desired driver by defining INCLUDE_driver in “appconfig.h”;
4. Call Initialization function in the main():
Freescale Semiconductor, Inc.
For More Information On This Product,
#define INCLUDE_PWM
to the “appconfig.h” file. The files can be found in the project window
(see
constants. The possible value are in comments. The individual options
are described in the 8-bit SDK User’s Manual. E.g., to define PWM
reload frequency use:
e.g., to include PWM driver use:
void main (void)
{
}
#define PWM_RELOAD_FREQUENCY PWM_EVERY_4_CYCLE
Figure
/* Static Initialization of periphery */
(void) peripheralInit();
8-Bit Software Development Kit
Go to: www.freescale.com
4).
/*PWM_EVERY_1_CYCLE*/
/*PWM_EVERY_2_CYCLE*/
/*PWM_EVERY_4_CYCLE*/
/*PWM_EVERY_8_CYCLE*/
MOTOROLA

Related parts for AN2292