Documentation PDF

MUXDLL  V6.55
LIN Configuration

Functions

_MUXSPEC tMuxStatus _MUXAPI LinConfigBus (unsigned short wCard, unsigned short wBus, tLinBus *hLinBus)
 Bus configuration. More...
 
tMuxStatus LinConfigBusTiming (unsigned short wCard, unsigned short wBus, unsigned long dwBaudRate)
 Configuration of timing bus. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinConfigOper (unsigned short wCard, unsigned short wBus, tLinOper *hLinOper)
 Routines mode of operation. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinConfigParam (unsigned short wCard, unsigned short wBus, tLinParam *hLinParam)
 Configuration of supplementary parameters. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinConfigPeriodic (unsigned short wCard, unsigned short wBus, unsigned short wOffset, unsigned short wParam, tLinMsg *hLinMsgNew)
 Programming a periodic message. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinConfigPeriodicList (unsigned short wCard, unsigned short wBus, unsigned short wPeriodicCount, tLinPeriodicMsg *hLinPeriodicMsgList)
 Programming a periodic message. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinConfigStat (unsigned short wCard, unsigned short wBus, unsigned short wBusLoadTime)
 Configuration of statistics. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinConfigTransceiver (unsigned short wCard, unsigned short wBus, unsigned short wEnable, unsigned short wRMaster)
 Transceiver configuration. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinConfigUart (unsigned short wCard, unsigned short wBus, tUartConfig *hUartConfig)
 Configuration of bus advanced settings. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinSetNotification (unsigned short wCard, unsigned short wBus, void *hWinEvent)
 Declaration of the application event. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinSetVersion (uint16_t wCard, uint16_t wBus, uint32_t dwVersion)
 Indication of protocol version. More...
 

Detailed Description

Function Documentation

◆ LinConfigBus()

_MUXSPEC tMuxStatus _MUXAPI LinConfigBus ( unsigned short  wCard,
unsigned short  wBus,
tLinBus hLinBus 
)

Bus configuration.

This request allows configuring a communication channel.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
[in]hLinBusBus parameter (baud rate)
Returns
Summary of the function execution
Return values
STATUS_OKSuccess
STATUS_ERR_PARAMParameters error
STATUS_ERR_SEQUENCESequences error
See also
STATUS_OK, STATUS_ERR_PARAM, STATUS_ERR_SEQUENCE

◆ LinConfigBusTiming()

tMuxStatus LinConfigBusTiming ( unsigned short  wCard,
unsigned short  wBus,
unsigned long  dwBaudRate 
)

Configuration of timing bus.

Parameters
[in]wCardIndex of card number
[in]wBusIndex of bus number [0-x]
[in]dwBaudRateBaud rate
Returns
Summary of the function execution
Return values
STATUS_OKSuccess
See also
STATUS_OK

◆ LinConfigOper()

_MUXSPEC tMuxStatus _MUXAPI LinConfigOper ( unsigned short  wCard,
unsigned short  wBus,
tLinOper hLinOper 
)

Routines mode of operation.

This function determines the interface mode between the application and the card.

Parameters
[in]wCardIndex of card number
[in]wBusIndex of bus number [0-x]
[in]hLinOperType of interface with the application
Returns
Summary of the function execution
Return values
STATUS_OKSuccess
STATUS_ERR_PARAMParameters error
STATUS_ERR_SEQUENCESequences error
See also
STATUS_OK, STATUS_ERR_PARAM, STATUS_ERR_SEQUENCE
Precondition
FIFO storage: in this mode, the events to be transferred to the application are stocked in a waiting list. These events are of the following types: end of transmission, reception, errors... When the application calls the LinGetEvent function, the first event (the oldest in time) comes off the list. If the waiting list is full and an event takes place, then a bit indicating loss of event is placed on the last event.

◆ LinConfigParam()

_MUXSPEC tMuxStatus _MUXAPI LinConfigParam ( unsigned short  wCard,
unsigned short  wBus,
tLinParam hLinParam 
)

Configuration of supplementary parameters.

This function allows configuration of additional operational parameters.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
[in]hLinParamAuxiliary operation parameters
Returns
Summary of the function execution
Return values
STATUS_OKSuccess
STATUS_ERR_PARAMParameters error
STATUS_ERR_SEQUENCESequences error
See also
STATUS_OK, STATUS_ERR_PARAM, STATUS_ERR_SEQUENCE

◆ LinConfigPeriodic()

_MUXSPEC tMuxStatus _MUXAPI LinConfigPeriodic ( unsigned short  wCard,
unsigned short  wBus,
unsigned short  wOffset,
unsigned short  wParam,
tLinMsg hLinMsgNew 
)

Programming a periodic message.

This function allows the user to start, stop and update the emission of periodic messages. This function is often used within the framework of the management of maintenance of the communication (Tester Present frame).

Parameters
[in]wCardIndex of card number to be accessed
[in]wBusIndex of bus number [0-x]
[in]wOffsetIndex of periodic message [0-15]. The application is composed of 16 periodic messages. This parameter corresponds to the message index the application wants to access. Note that the 16 messages are dealt with independently.
[in]wParamMessage parameter
  • Bit 0: Indicator of periodic message in operation
    • 0: The periodic message is stopped
    • 1: The periodic message is activated (start of periodicity or update)
[in]hLinMsgNewParameter of message to be sent
Returns
Summary of the function execution
Return values
STATUS_OKSuccess
STATUS_ERR_PARAMParameters error
STATUS_ERR_SEQUENCESequences error
STATUS_ERR_FIFOFULLThe new message cannot be taken into account: the transmitting FIFO is full
STATUS_ERR_MSGEXCEEDWrong message offset
STATUS_ERR_MSGSVCNot supported service
See also
STATUS_OK, STATUS_ERR_PARAM, STATUS_ERR_SEQUENCE, STATUS_ERR_FIFOFULL, STATUS_ERR_MSGEXCEED, STATUS_ERR_MSGSVC

◆ LinConfigPeriodicList()

_MUXSPEC tMuxStatus _MUXAPI LinConfigPeriodicList ( unsigned short  wCard,
unsigned short  wBus,
unsigned short  wPeriodicCount,
tLinPeriodicMsg hLinPeriodicMsgList 
)

Programming a periodic message.

This function allows the user to start, stop and update the emission of periodic messages. This function is often used within the framework of the management of maintenance of the communication (Tester Present frame).

Parameters
[in]wCardIndex of card number to be accessed
[in]wBusIndex of bus number [0-x]
[in]wPeriodicCountNumber of messages (limited to 16)
[in]hLinPeriodicMsgListParameter of message to be sent
Returns
Summary of the function execution
Return values
STATUS_OKSuccess
STATUS_ERR_PARAMParameters error
STATUS_ERR_SEQUENCESequences error
STATUS_ERR_FIFOFULLThe new message cannot be taken into account: the transmitting FIFO is full
STATUS_ERR_MSGSVCNot supported service
See also
LinConfigPeriodic
STATUS_OK, STATUS_ERR_PARAM, STATUS_ERR_SEQUENCE, STATUS_ERR_FIFOFULL, STATUS_ERR_MSGSVC

◆ LinConfigStat()

_MUXSPEC tMuxStatus _MUXAPI LinConfigStat ( unsigned short  wCard,
unsigned short  wBus,
unsigned short  wBusLoadTime 
)

Configuration of statistics.

This function allows configuration of the duration on which the bus charge is calculated. Duration of 0 inhibits the charge calculation.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
[in]wBusLoadTimeThis parameter defines the duration on which the bus charge is calculated. It is expressed in milliseconds. Value: 0 indicates that no bus charge has been transferred to the application. The bus charge is transferred in FIFO mode, by means of the event EVENT_LIN_BUSLOAD and of the wBusLoad parameter (0 by default).
Returns
Summary of the function execution
Return values
STATUS_OKSuccess
STATUS_ERR_PARAMParameters error
STATUS_ERR_SEQUENCESequences error
See also
STATUS_OK, STATUS_ERR_PARAM, STATUS_ERR_SEQUENCE

◆ LinConfigTransceiver()

_MUXSPEC tMuxStatus _MUXAPI LinConfigTransceiver ( unsigned short  wCard,
unsigned short  wBus,
unsigned short  wEnable,
unsigned short  wRMaster 
)

Transceiver configuration.

This function makes it possible to control the various signals of the LIN transceiver.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
[in]wEnablePIN value «enable» [0-1]
[in]wRMasterPull-up value (0 = 30Ko master, 1= 1Ko slave)
Returns
Summary of the function execution
Return values
STATUS_OKSuccess
STATUS_ERR_PARAMParameters error
STATUS_ERR_SEQUENCESequences error
STATUS_ERR_WARNINGNot supported on this type of material
See also
STATUS_OK, STATUS_ERR_PARAM, STATUS_ERR_SEQUENCE, STATUS_ERR_WARNING

◆ LinConfigUart()

_MUXSPEC tMuxStatus _MUXAPI LinConfigUart ( unsigned short  wCard,
unsigned short  wBus,
tUartConfig hUartConfig 
)

Configuration of bus advanced settings.

This function enables configuration of bus advanced settings.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
[in]hUartConfigBus advanced settings
Returns
Summary of the function execution
Return values
STATUS_OKSuccess
STATUS_ERR_PARAMParameters error
STATUS_ERR_SEQUENCESequences error
See also
STATUS_OK, STATUS_ERR_PARAM, STATUS_ERR_SEQUENCE

◆ LinSetNotification()

_MUXSPEC tMuxStatus _MUXAPI LinSetNotification ( unsigned short  wCard,
unsigned short  wBus,
void *  hWinEvent 
)

Declaration of the application event.

This function allows the application to use the task synchronisation methods provided for Windows operating systems (API WIN32). This function allows the user to transfer a handle of event created by the Windows «CreateEvent» function to the DLL. This event is used to transfer the timer event to the application. From then on, the application can wait for events by means of waiting functions such as WaitForSingleObject or WaitForMultipleObject.

Parameters
[in]wCardIndex of card number
[in]wBusIndex of bus number [0-x]
[in]hWinEvent«Handle» returned by the CreateEvent function
Returns
Summary of the function execution
Return values
STATUS_OKSuccess
STATUS_ERR_PARAMParameters error
STATUS_ERR_SEQUENCESequences error
See also
STATUS_OK, STATUS_ERR_PARAM, STATUS_ERR_SEQUENCE
// Request for indication of event
HANDLE hWinEvent;
tIsoEvent hLinEvent;
tMuxStatus Status;
unsigned short wCard=0,wBus=0;
hWinEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
if (hWinEvent== NULL) return;
Status=LinSetNotification (wCard,wBus,hWinEvent);
if (Status!= STATUS_OK) return;
Status=LinActivate(wCard,wBus);
if(Status!= STATUS_OK) return;
if (WaitForSingleObject(hWinEvent,INFINITE) == WAIT_OBJECT_0)
{
LinGetEvent(wCard,wBus,&hIsoEvent);
}

◆ LinSetVersion()

_MUXSPEC tMuxStatus _MUXAPI LinSetVersion ( uint16_t  wCard,
uint16_t  wBus,
uint32_t  dwVersion 
)

Indication of protocol version.

This function indicates version of LIN standard (the difference between V1 and V2 appears when it comes to calculating CRC).

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
[in]dwVersionRequested version in BCD hexadecimal format (ex. 0x0210 for V2.1)
Returns
Summary of the function execution
Return values
STATUS_OKSuccess
STATUS_ERR_PARAMParameters error
STATUS_ERR_SEQUENCESequences error
See also
STATUS_OK, STATUS_ERR_PARAM, STATUS_ERR_SEQUENCE