Adding the Echo Driver to an Application
ECHO_ENABLELNA_DDR
Description: This defines the data direction bit for the I/O pin used control Echo’s ENABLELNA pin.
Values:
Any I/O pin configurable as an output can be used. Use the naming convention specified
in the CodeWarrior header file.
#define ECHO_ENABLELNA_DDR PTEDD_PTEDD5
Example:
12 Adding the Echo Driver to an Application
To add the Echo driver to an application:
1. Copy the files Echo.c and Echo.h to the Sources directory for the project you are using.
2. Add the Echo.c and Echo.h driver files to the project. In CodeWarrior, right click on Sources folder,
then select Add Files…
3. Add the line #include “Echo.h”to the main application program file.
4. Add the following lines to the main application program to give access to the Echo drivers global
storage:
extern unsigned char *echoNextMessage;
extern unsigned char echoTransmitBuffer[];
5. Decide which I/O pins in your application will control Echo functions. Modify Echo.h to link these
pins to the Echo driver.
6. Modify Echo.h to define the other parameters as required by the application.
7. Modify the project parameter file to link the timer channel and SPI to the Echo services
Echo_TxTimer_Interruptand Echo_RxSPI_Interrupt, respectively.
The files are now added to the project and you are ready to begin using the Echo driver.
Figure 12 shows a simple application template with the Echo.c and Echo.h files added to the sources folder
and the necessary additions to main.c.
Figure 13 shows the project parameter file set up to link the Echo services Echo_TxTimer_Interruptand
Echo_RxSPI_Interruptto their corresponding interrupt vectors on the RG60.
Software Drivers for MC33696, Rev. 1
Freescale Semiconductor
39