LIN2CAN API (L2CAPI)
MANUAL
ENGLISH
Page 1: ...LIN2CAN API L2CAPI MANUAL ENGLISH...
Page 2: ...s document is only allowed with explicit permission of HMS Technology Center Ravensburg GmbH HMS Technology Center Ravensburg GmbH reserves the right to change technical data without prior announcemen...
Page 3: ...CAN_SlaveConfig 14 2 9 Interface ILIN2CAN_MasterConfig2 15 2 10Interface ILIN2CAN_LINMsgQueue2 16 2 10 1 Error overview 17 2 11Interface ILIN2CAN_Master_Slave2 18 2 12Overview Permitted API calls oper...
Page 4: ......
Page 5: ...he LIN message traffic All functions of the LIN2CAN device can be used in own programs with the LIN2CAN gateway API Specific test applications or PC based network simulations can be realized For furth...
Page 6: ...LL file when the program is started The methods of the API are defined in the HPP file In addition the line define INITGUID must be contained in a CPP file of the project This serves to provide memory...
Page 7: ...y mode These include the CAN baud rate and the CAN transceiver mode and the translation table for translating LIN to CAN objects and vice versa ILIN2CAN_SlaveConfig Defines the response to a LIN ident...
Page 8: ...ce being that here no new instance of the class is created but a pointer of the required interfaces is returned By calling QueryInterface the reference counter is automatically increased by one ULONG...
Page 9: ...M1 or COM2 In pszMode baud 115200 parity N data 8 stop 1 must always be transmitted If the connection was made successfully S_OK is returned otherwise an error code that can be converted into a readab...
Page 10: ...possible 2400 9600 and 19200 bauds GetOperationMode out PL2C_OperationMode pnOperationMode SetOperationMode in L2C_OperationMode nOperationMode Define the current operation mode of the device The fol...
Page 11: ...pMsgConfig SetLinMessageConfig in PL2C_MessageConfig pMsgConfig These functions set or query the length and CRC calculation mode of the LIN message packages The structure is as follows struct BYTE bM...
Page 12: ...EIVER_LOWSPEED L2C_CAN_TRANSCEIVER_HIGHSPEED GetGatewayTranslation out PL2C_TranslationConfig2 pTranslationConfig2 SetGatewayTranslation in PL2C_TranslationConfig2 pTranslationConfig2 These two functi...
Page 13: ...66 entries has the following structure struct BOOL bValid L2C_TranslationDirection nTranslationDir BOOL b29BitIdentifier DWORD dwCANID L2C_IdentifierTranslation PL2C_IdentifierTranslation With bValid...
Page 14: ...ructure is used struct BYTE bLINID L2C_LINIDAction nAction BYTE pbAddInfo 64 BYTE bAddInfoLen L2C_ActionEntry PL2C_ActionEntry bLINID is always an in parameter which defines for which LIN ID the actio...
Page 15: ...ScheduleTable The number of supported schedule tables can be retrieved by a call of GetScheduleTableCount Up to 64 entries can be written in the schedule table The following structure is used which is...
Page 16: ...eue GetLINMsgQueueEntry out PL2C_LINMessage pLINMessage The function must be called to read out a message The following structure is filled struct DWORD dwTimeStamp BYTE bLINID BYTE pbData 8 BYTE bDat...
Page 17: ...LIN ID 07 Calculated checksum does not match the received checksum If the LIN2CAN GW is operating in LIN Spec 2 0 mode this error may occur due data collision or invalid CRC mode setting LIN ID 08 Rec...
Page 18: ...D on the bus The LIN ID must be between 0x00 and 0x3F SendLINIDandData in PL2C_LINMessage2 pLINMessage2 The function sends a complete LIN object to the bus The structure is described in 2 10 GetLINMsg...
Page 19: ...tartUpOpMode x x SetStartUpOpMode x x GetStandbyTime x x SetStandbyTime x x GetSystemTime x x SetSystemTime x x GetLinMessageConfig x x SetLinMessageConfig x x LoadSettingsFromFlash x x SaveSettingsTo...
Page 20: ...er is 0 SetDeviceName in PSTRING psDeviceName Name of the device pointer to a string with max 16 characters The last valid character must be 0 GetVersionInformation out PL2C_VersionInformation pVersio...
Page 21: ...ER 3 SetStartUpOpMode in L2C_OperationMode nOperationMode GetStandbyTime out PWORD pwStandbyTime Resolution in s 0xFFFF for never SetStandbyTime in WORD wStandbyTime GetSystemTime out PDWORD pdwSystem...
Page 22: ...PEED 1 SetCANConfig in PL2C_CAN_Config pCANConfig GetGatewayTranslation out PL2C_TranslationConfig2 pTranslationConfig2 struct L2C_IdentifierTranslation stLIN_IdentifierTranslation 64 L2C_IdentifierTr...
Page 23: ...N_IGNORE 4 define L2C_CAN_ACTION_SEND_LINDATA 5 SetLINIDAction in PL2C_ActionEntry pActionEntry 2 13 4 Interface ILIN2CAN_MasterConfig2 GetScheduleTable out PL2C_ScheduleEntry pScheduleTable out PBYTE...
Page 24: ...E bUsedEntries L2C_QueueStatus ResetLINMsgQueueOverrun GetLINMsgQueueEntry out PL2C_LINMessage2 pLIN Message2 struct DWORD dwTimeStamp BYTE bLINID BYTE pbData 8 BYTE bDataLen L2C_MessageCrcType nMsgCr...
Page 25: ...ILIN2CAN_Master_Slave2 SendLINID in BYTE bLINID bLINID LIN ID between 0x00 and 0x3F SendLINIDandData in PL2C_LINMessage2 pLINMessage2 pLINMessage dwTimeStamp not used SendWakeup in BYTE bSignalDurati...
Page 26: ...Modes define L2C_CAN_TRANSCEIVER_LOWSPEED 0 define L2C_CAN_TRANSCEIVER_HIGHSPEED 1 Gateway Mode Translation Direction define L2C_LIN_TO_CAN_TRANSLATION 0 define L2C_CAN_TO_LIN_TRANSLATION 1 Slave Mode...
Page 27: ...g Gateway Mode Standalone CAN Controller Configuration Structure typedef struct DWORD dwBaudrate CAN Baudrate in kBaud L2C_CANTransceiverMode nTransceiverMode Mode of CAN Transceiver High or Lowspeed...
Page 28: ...AddInfo 64 Additional Info for Action LIN Data for instance BYTE bAddInfoLen Length of pbAddInfo L2C_ActionEntry PL2C_ActionEntry Master Mode Standalone Schedule Table entry Structure typedef struct B...
Page 29: ...ABLE_ENTRY_COUNT 12 const L2C_LINErrorLookupTable L2C_k_stLINErrorLookupTable L2C_LIN_ERROR_LOOKUP_TABLE_ENTRY_COUNT FALSE 0x00 FALSE 0x01 Received data is not a valid sync field FALSE 0x02 Received d...
Page 30: ...this error may occur due data collision in LIN Spec 2 0 mode FALSE 0x09 UART error received byte was not like UART standard StopBit missing for instance FALSE 0x0A A dominant level was transmitted on...
Page 31: ...D field and at least one data byte detected before timeout 0x07 The calculated checksum does not match the received checksum If the LIN2CAN GW is operating in LIN Spec 2 0 mode this error may occur du...