AN2633 Freescale Semiconductor / Motorola, AN2633 Datasheet - Page 21

no-image

AN2633

Manufacturer Part Number
AN2633
Description
LIN Drivers for SLIC Module on the MC68HC908QL4
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
LIN_GetMsg()
LIN_PutMsg()
LIN_MsgStatus()
LIN_GotoRun()
MOTOROLA
This function is used for getting the data of the message with a certain ID and
copying its message data into a buffer. The parameters for this function are the
ID of the message (with parity) and a pointer to the buffer where to put the
message data.
LIN_GetMsg() returns a status constant describing whether the call was
successful (LIN_OK, LIN_INVALID_ID, LIN_NO_ID).
If the status is not LIN_OK, no data will have been retrieved from the buffer. If
the message data has been copied into the buffer, the status of the message
will be changed to show that the message has been read. Frame-level atomic
operation is automatically guaranteed by the fact that while the SLIC_ISR is
transferring data from the SLIC module to the message buffer, interrupts are
suspended.
Usage example:
This function is used for copying data to send from a temporary buffer into the
message data of the message with a certain ID. The parameters for this
function are the ID of the message (with parity) and a pointer to the buffer
where the data to send can be found. The function returns a status constant
describing whether the call was successful or not (LIN_OK, LIN_INVALID_ID,
LIN_NO_ID). When the message data has been updated, the message status
will be changed to show that the message has been written. The call itself does
not send any data on the LIN bus, however the next time the master requests
this ID, the updated data will be sent. Frame-level atomic operation is
guaranteed because the LIN_PutMsg() routine disables interrupts during the
buffer copy operation.
Usage example:
This function returns the current status of the specified message. It takes the
message ID (with parity) as a parameter. If the ID is not defined, the function
will return LIN_NO_ID.
Usage example:
This function changes the current driver state from SLEEP to RUN by clearing
the LINSleep flag. If the driver state is RUN (LINSleep = 0), the function does
nothing. It takes no parameters and returns nothing.
Note: This function should be called before calling LIN_Wakeup().
Usage example:
LIN Drivers for SLIC Module on the MC68HC908QL4
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
status = LIN_GetMsg (0x99, MsgData);
status = LIN_PutMsg (0x1A, MsgData);
msgstatus = LIN_MsgStatus (0x1A);
LIN_GotoRun();
CodeWarrior Project — C Source Code SLIC Driver with API
AN2633/D
21

Related parts for AN2633