AN2633 Freescale Semiconductor / Motorola, AN2633 Datasheet - Page 17

no-image

AN2633

Manufacturer Part Number
AN2633
Description
LIN Drivers for SLIC Module on the MC68HC908QL4
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
How to Use the API
Driver
API Driver
Configuration
Message File
Configuration
MOTOROLA
The SLIC_LINdriver.c file used in the API version is different and more generic
for the API project than for the C project. It is designed to work with the
LINmsg.c file to search for messages, rather than hard coding them directly into
the interrupt service routine as the C project does.
The structure of LINmsg.c is very similar to the one used in AN2599/D with one
important difference. The SLIC module contains a register called the SLIC Data
Length Code register (SLCDLC) which encodes the number of bytes in a
message frame, the type of checksum calculation to be used (standard or
enhanced), and whether the SLIC is to transmit or receive this frame. To
simplify the ISR code for the API version, a data structure in LINmsg.c called
MessageDLCTbl[] contains the appropriate value for this register for each
message defined. This MessageDLCTbl[]replaces the function of
MessageCountTbl[] in the AN2599/D drivers.
The other files serve the same functions as they do in the assembly and C
projects.
The easiest way to begin developing a new application is to use the API sample
project. To do this, simply replace the sample application file slave.c with your
own application code. You can also begin developing by creating a new project
in a CodeWarrior development environment and adding the four LIN driver files
to the project. Then:
The driver configuration file, LINmsg.c, can be edited by the user. It contains
definitions of all messages to be recognized by the application and is set up for
the demo code to recognize all four possible IDs for the demo application.
Setting up this file is all that is needed for configuration of the API driver for
normal LIN applications.
All LIN message frames that the slave node is to use in the application must be
defined in the LINmsg.c file.
LIN Drivers for SLIC Module on the MC68HC908QL4
1. Define the messages you want to use, in the LINmsg.c file, as described
2. Make sure the vectors (_Startup() uses vector 0 and SLIC_ISR() uses
3. Don’t forget to #include the file LINdriver.h in your application code file.
Freescale Semiconductor, Inc.
For More Information On This Product,
below.
vector 10) are set up properly, either in the vector.c file or in a parameter
file.
Go to: www.freescale.com
CodeWarrior Project — C Source Code SLIC Driver with API
AN2633/D
17

Related parts for AN2633