AN2292 Freescale Semiconductor / Motorola, AN2292 Datasheet - Page 9

no-image

AN2292

Manufacturer Part Number
AN2292
Description
8-Bit Software Development Kit
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Algorithms
MOTOROLA
The command_specific_parameter parameter specifies other data required to
execute the command. Generally speaking, it can be a pointer to the structure,
the “NULL” value or a variable value dependent on the specific command. If the
required parameter is a variable value, you should use a constant value if
possible, because it influences the efficiency of the resulting code. The
efficiency is illustrated by the following examples:
Using of the compilation constant as a command specific parameter
(written in “C”):
/* Write 1 to CH1IE in TBSC1
(Enable Interrupt for channel 1 of Timer B) */
IOCTL(TIMB,TIM_SET_CH1_INT,TIM_ENABLE);
assembly code as compilation result:
Using a variable as a command specific parameter (written in “C”):
/* Write varU8 to CH1IE in TBSC1
(If varU8, Enable Interrupt for channel 1 of Timer B) */
IOCTL(TIMB,TIM_SET_CH1_INT,varU8);
assembly code as compilation result:
L1673:
L1675:
If the parameter in this example is constant then the command is compiled to
one assembly instruction. If the parameter is variable the parameter value is
tested at execution time resulting in longer code.
To use an algorithm from the SDK library, add the source file of the algorithm
to your project and include the appropriate header file in your source code.
For example, if you are going to use a controller, add the “mccontrollers.c” to
your project file (*.mcp) and put the
#include mccontrollers.h
in your source file.
Available algorithms with detailed descriptions can be found in the “Algorithm
Library” documentation.
Freescale Semiconductor, Inc.
For More Information On This Product,
8-Bit Software Development Kit
Go to: www.freescale.com
LDA
BIT
BNE
BCLR
SKIP2
BSET
BSET
6,89
varU8
#1
L1673 ;abs = 1673
6,89
L1675 ;abs = 1675
6,89
Quick Start with the 8-Bit SDK
AN2292
9

Related parts for AN2292