Documentation PDF

MUXDLL  V6.55

Modules

 LIN Configuration
 

Functions

_MUXSPEC tMuxStatus _MUXAPI LinActivate (unsigned short wCard, unsigned short wBus)
 Starting communication. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinClearBufferIFR (unsigned short wCard, unsigned short wBus)
 Purging the IFR transmission buffer. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinClearFifoRx (unsigned short wCard, unsigned short wBus)
 Clears the reception FIFO. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinDeactivate (unsigned short wCard, unsigned short wBus)
 Stopping communication. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinGetBusState (unsigned short wCard, unsigned short wBus, tLinChipState *eLinChipState, unsigned char *bTxErrCount, unsigned char *bRxErrCount)
 Launching communication. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinGetEvent (unsigned short wCard, unsigned short wBus, tLinEvent *hLinEvent)
 Reading of an event. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinGetFifoRxLevel (unsigned short wCard, unsigned short wBus, unsigned short wParam, unsigned short *wCount, unsigned short *wMaxCount)
 Get the level of filling of events waiting list. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinGetStat (unsigned short wCard, unsigned short wBus, tLinStat *hLinStat)
 Reading statistics counters. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinIsBusActive (unsigned short wCard, unsigned short wBus, unsigned short *wState)
 Launching communication. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinSendMsg (unsigned short wCard, unsigned short wBus, tLinMsg *hLinMsg)
 Send a message. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinSendMsgList (unsigned short wCard, unsigned short wBus, unsigned short wMsgCount, tLinMsg *hLinMsgList)
 Send a message. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinSetSleepMode (unsigned short wCard, unsigned short wBus)
 Send a master request frame for force all slaves into sleep mode. More...
 
_MUXSPEC tMuxStatus _MUXAPI LinSetWakeUpMode (unsigned short wCard, unsigned short wBus)
 Request a wake up. More...
 

Detailed Description

Order of call
The application must respect the sequencing according to the functions calling order.

Symbol Description
order_call_snok.png
Forbidden
order_call_sok.png
Authorized
order_call_arrow.png
Authorized and moved to followed status
Function CAN_INIT CAN_OPER CAN_BUS CAN_START
LinConfigOper
order_call_arrow.png
order_call_snok.png
order_call_snok.png
order_call_snok.png
LinConfigBus
order_call_snok.png
order_call_arrow.png
order_call_snok.png
order_call_snok.png
LinConfigUart
order_call_snok.png
order_call_snok.png
order_call_sok.png
order_call_snok.png
LinActivate
order_call_snok.png
order_call_snok.png
order_call_arrow.png
order_call_snok.png
LinDeactivate
order_call_sok.png
order_call_sok.png
order_call_sok.png
order_call_arrow.png
LinSetNotification
order_call_sok.png
order_call_sok.png
order_call_sok.png
order_call_snok.png
LinConfigParam
order_call_snok.png
order_call_sok.png
order_call_snok.png
order_call_snok.png
LinConfigStat
order_call_sok.png
order_call_sok.png
order_call_sok.png
order_call_sok.png
LinSetVersion
order_call_sok.png
order_call_sok.png
order_call_sok.png
order_call_sok.png
LinConfigTransceiver
order_call_sok.png
order_call_sok.png
order_call_sok.png
order_call_sok.png
LinConfigPeriodic
order_call_snok.png
order_call_sok.png
order_call_sok.png
order_call_sok.png
LinConfigPeriodicList
order_call_snok.png
order_call_sok.png
order_call_sok.png
order_call_sok.png
LinSendMsg
order_call_snok.png
order_call_snok.png
order_call_snok.png
order_call_sok.png
LinSendMsgList
order_call_snok.png
order_call_snok.png
order_call_snok.png
order_call_sok.png
LinGetEvent
order_call_snok.png
order_call_snok.png
order_call_snok.png
order_call_sok.png
LinGetBusState
order_call_snok.png
order_call_snok.png
order_call_snok.png
order_call_sok.png
LinSetSleepMode
order_call_snok.png
order_call_snok.png
order_call_snok.png
order_call_sok.png
LinSetWakeUpMode
order_call_snok.png
order_call_snok.png
order_call_snok.png
order_call_sok.png
LinGetStat
order_call_snok.png
order_call_snok.png
order_call_snok.png
order_call_sok.png
LinClearBufferIFR
order_call_sok.png
order_call_sok.png
order_call_sok.png
order_call_sok.png
LinGetFifoRxLevel
order_call_sok.png
order_call_sok.png
order_call_sok.png
order_call_sok.png

Function Documentation

◆ LinActivate()

_MUXSPEC tMuxStatus _MUXAPI LinActivate ( unsigned short  wCard,
unsigned short  wBus 
)

Starting communication.

This function allows communication with the network to start. After executing this function, the messages received are acknowledged and sent towards the application. The application can also send messages.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
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

◆ LinClearBufferIFR()

_MUXSPEC tMuxStatus _MUXAPI LinClearBufferIFR ( unsigned short  wCard,
unsigned short  wBus 
)

Purging the IFR transmission buffer.

This function allows the user to empty the buffer of IFR messages programmed in the card.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
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

◆ LinClearFifoRx()

_MUXSPEC tMuxStatus _MUXAPI LinClearFifoRx ( unsigned short  wCard,
unsigned short  wBus 
)

Clears the reception FIFO.

This function allows to clear the reception events queue.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
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

◆ LinDeactivate()

_MUXSPEC tMuxStatus _MUXAPI LinDeactivate ( unsigned short  wCard,
unsigned short  wBus 
)

Stopping communication.

This function stops communication with the network. After executing this function, messages are no longer received, acknowledged or sent.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
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

◆ LinGetBusState()

_MUXSPEC tMuxStatus _MUXAPI LinGetBusState ( unsigned short  wCard,
unsigned short  wBus,
tLinChipState eLinChipState,
unsigned char *  bTxErrCount,
unsigned char *  bRxErrCount 
)

Launching communication.

This function allows the user to directly read the status of LIN error counters. There is one transmission error counter and one receipt error counter. When an error occurs, one of the counter (switch Tx or Rx Message) is incremented of 8. When an message is correctly received, one of the counter (switch Tx or Rx Message) is decrease of 1. When one of the two counters reaches value 64 then the state of the communication passes from the nominal mode to the degraded mode. Conversely if the two counters are lower than 64 then the communication becomes again nominal.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
[in]eLinChipStatePointer on the status of component
[in]bTxErrCountPointer on the transmission counter
[in]bRxErrCountPointer on the reception counter
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

◆ LinGetEvent()

_MUXSPEC tMuxStatus _MUXAPI LinGetEvent ( unsigned short  wCard,
unsigned short  wBus,
tLinEvent hLinEvent 
)

Reading of an event.

This function allows the user to recover an event from the network.

Parameters
[in]wCardIndex of card number to be accessed
[in]wBusIndex of bus number [0-x]
[in,out]hLinEventPointer on the event
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
Note
For buffer mode: the application must give the handle of the message.
// Indication of event
tCanEvent hLinEvent;
tMuxStatus Status;
unsigned short wCard=0,wBus=0;
Status=LinGetEvent(wCard,wBus,&hCanEvent);
if (Status!= STATUS_OK) return;
switch(hLinEvent.eTypeEvent &~ EVENT_FIFO_OVF)
{
case EVENT_EMPTY: // No more events to be dealt with
break;
case EVENT_CAN_MSGTX: // Correct end of transmission
break;
case EVENT_CAN_MSGRX: // Correct reception
break;
case EVENT_CAN_ERROR: // Network error
break;
case EVENT_CAN_BUSCHANGE: // Change in the components status
break;
case EVENT_CAN_BUSLOAD: // Bus charge
break;
case EVENT_TIMER: // Applicable timer
break;
case EVENT_TIMEERROR: // Loss IT time
break;
default: // Reserved for future use
break;

◆ LinGetFifoRxLevel()

_MUXSPEC tMuxStatus _MUXAPI LinGetFifoRxLevel ( unsigned short  wCard,
unsigned short  wBus,
unsigned short  wParam,
unsigned short *  wCount,
unsigned short *  wMaxCount 
)

Get the level of filling of events waiting list.

This function allows the user to see how full the waiting list of events transferred to the application is.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
[in]wParamFunctions parameters
  • Bit 0: Type of waiting list (only for USB cases)
    • 0: The number of transferred event is that situated on the PC's waiting list
    • 1: The number of transferred event is that situated on the USB case's waiting list
[out]wCountNumber of event currently on waiting list
[out]wMaxCountMaximum number of events accepted on the waiting list
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

◆ LinGetStat()

_MUXSPEC tMuxStatus _MUXAPI LinGetStat ( unsigned short  wCard,
unsigned short  wBus,
tLinStat hLinStat 
)

Reading statistics counters.

This function allows the user to read the operational counters of the network.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
[in]hLinStatPointer of the static area
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

◆ LinIsBusActive()

_MUXSPEC tMuxStatus _MUXAPI LinIsBusActive ( unsigned short  wCard,
unsigned short  wBus,
unsigned short *  wState 
)

Launching communication.

This function allows communication with the network to start. After executing this function, the messages received are acknowledged and sent towards the application. The application can also send messages.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
[in]wStateBus state
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

◆ LinSendMsg()

_MUXSPEC tMuxStatus _MUXAPI LinSendMsg ( unsigned short  wCard,
unsigned short  wBus,
tLinMsg hLinMsg 
)

Send a message.

This function allows in master case to send a message of data and to send a message with an In Frame Response. In a Slave case, this function allows to update data for an In Frame Response.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
[in]hLinMsgParameter 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_MSGSVCThe channel is not a transmission channel
STATUS_ERR_FIFOFULLThe new message cannot be taken into account. The transmitting FIFO is full.

◆ LinSendMsgList()

_MUXSPEC tMuxStatus _MUXAPI LinSendMsgList ( unsigned short  wCard,
unsigned short  wBus,
unsigned short  wMsgCount,
tLinMsg hLinMsgList 
)

Send a message.

This function allows in master case to send one or several message of data and to send them with an In Frame Response. In a Slave case, this function allows to update data for an In Frame Response.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
[in]wMsgCountQuantity of messages to be emitted (limited to 32)
[in]hLinMsgListMessage board (cf LinSendMsg for details)
Returns
Summary of the function execution
Return values
STATUS_OKSuccess
STATUS_ERR_PARAMParameters error
STATUS_ERR_SEQUENCESequences error
STATUS_ERR_MSGSVCThe channel is not a transmission channel
STATUS_ERR_FIFOFULLThe new message cannot be taken into account. The transmitting FIFO is full.
See also
LinSendMsg
STATUS_OK, STATUS_ERR_PARAM, STATUS_ERR_SEQUENCE, STATUS_ERR_FIFOFULL, STATUS_ERR_MSGSVC

◆ LinSetSleepMode()

_MUXSPEC tMuxStatus _MUXAPI LinSetSleepMode ( unsigned short  wCard,
unsigned short  wBus 
)

Send a master request frame for force all slaves into sleep mode.

This function allows a master to send a request which force all slaves into sleep mode.
This function sends a request frame (frame identifier = 0x3c)with data length equal 8 and with the first data byte equal to zero.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
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

◆ LinSetWakeUpMode()

_MUXSPEC tMuxStatus _MUXAPI LinSetWakeUpMode ( unsigned short  wCard,
unsigned short  wBus 
)

Request a wake up.

This function allows a slave to request a wake-up. This function sends a byte 0x80 without any check. If the master does not issue frame headers within 64*TBit from the wake up request, this function will try issuing a new wake up request. After three (failing) requests this function stops to send wake up request.

Parameters
[in]wCardIndex of the card
[in]wBusIndex of bus number [0-x]
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