Specifications

October 25, 2006 Cypress Semiconductor – Rev. ** 27
LIN Bus 2.0 Reference Design 3. Master Design IP
Description: Clears the LIN ready flag.
Parameters: None.
Returns: None.
LinMaster_SetReadyFlag
C Prototype: void LinMaster_ClrReadyFlag
(void);
Description: Sets the LIN ready flag. This function is called
inside the schedule timers ISR when a frame slot is com-
plete.
Parameters: None.
Returns: None.
3.7.3 LIN Node Configuration API
Functions
The Lin20NodeConfigurationAPI.asm file has all the
required functions to perform node configuration. These
functions are listed below.
ld_is_ready
C Prototype: BYTE ld_is_ready(void);
Description: This function returns true (non zero) if the
diagnostic module is ready for the next command. This also
implies that the previous command has completed. Use this
to process the received response. Unless the ld_is_ready
returns true, no other node configuration call is issued.
Parameters: None.
Returns: Zero, not ready.
Non zero, ready.
ld_check_response
C Prototype: BYTE ld_check_response(char* RSID,
char* error_code);
Description: This routine returns the result of the last com-
pleted node configuration call. The RSID and error code
sent by the slave are also returned for analysis. The result is
interpreted as follows.
Parameters:
char *RSID: Pointer to the variable where the RSID of the
slave is stored.
char *error_code: Pointer to the variable where the error
code from slave is stored.
Returns: An unsigned char containing the status of the pre-
vious node configuration call. This table defines the flags.
ld_assign_nad
C Prototype: void ld_assign_NAD(l_u8 NAD, l_u16
supplier_id, l_u16 function_id, l_u8
new_NAD);
Description: The call assigns the NAD of all the slaves that
match the NAD, supplier_id and function_id. The new NAD
of the nodes after this is new_NAD.
Parameters:
NAD: The NAD of the nodes.
supplier_id: The supplier_id for which the slaves are
matched.
function_id: The function_id for which the slaves are
matched.
new_NAD: The new NAD to be assigned to the matching
slaves.
Returns: None.
Usage Notes: When this function is called, the diagnostic
buffer in the RAM is updated with all the parameters. To
actually send the command, point the l_sch_set function to
a master request frame and call a l_sch_tick function.
ld_assign_frame_id
C Prototype: void ld_assign_frame_id(l_u8 NAD,
l_u16 supplier_id, l_u16 message_id, l_u8
PID);
Description: This call assigns the protected identifier of a
frame in the slave node with the address NAD and the spec-
ified supplier ID.
Parameters:
NAD: The NAD of the node.
supplier_id: The supplier_id of the slave.
message_id: The message ID for which the PID must be
assigned.
PID: The protected identifier to be assigned to message_id.
Returns: None.
Usage Notes: When this function is called, the diagnostic
buffer in the RAM is updated with all the parameters. To
Table 3-4.
Flag Description
LD_SUCCESS The call succeeded.
LD_NEGATIVE The call failed. Parse the code to find more infor-
mation.
LD_NO_RESPONSE No response received for the request.
LD_OVERWRITTEN Not used.