]> rtime.felk.cvut.cz Git - arc.git/blob - include/LinIf.h
Added example of CAN communication for the TMS570LS31x HDK
[arc.git] / include / LinIf.h
1 /* -------------------------------- Arctic Core ------------------------------\r
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
3  *\r
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
5  *\r
6  * This source code is free software; you can redistribute it and/or modify it\r
7  * under the terms of the GNU General Public License version 2 as published by the\r
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
9  *\r
10  * This program is distributed in the hope that it will be useful, but\r
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
13  * for more details.\r
14  * -------------------------------- Arctic Core ------------------------------*/\r
15 \r
16 /** @addtogroup LinIf LIN Interface\r
17  *  @{ */\r
18 \r
19 /** @file LinIf.h\r
20  * API and type definitions for LIN Interface.\r
21  */\r
22 \r
23 #ifndef LINIF_H_\r
24 #define LINIF_H_\r
25 \r
26 #define LINIF_SW_MAJOR_VERSION    1\r
27 #define LINIF_SW_MINOR_VERSION    0\r
28 #define LINIF_SW_PATCH_VERSION    0\r
29 #define LINIF_AR_MAJOR_VERSION    2\r
30 #define LINIF_AR_MINOR_VERSION    0\r
31 #define LINIF_AR_PATCH_VERSION    1\r
32 \r
33 #include "Std_Types.h"\r
34 #include "LinIf_Cfg.h"\r
35 #include "LinIf_Types.h"\r
36 #include "ComStack_Types.h"\r
37 #include "ComM_Types.h"\r
38 \r
39 \r
40 /** @name Service id's */\r
41 //@{\r
42 #define LINIF_INIT_SERVICE_ID               0x00\r
43 #define LINIF_GETVERSIONINFO_SERVICE_ID     0x03\r
44 #define LINIF_SCHEDULEREQUEST_SERVICE_ID    0x05\r
45 #define LINIF_GOTOSLEEP_SERVICE_ID              0x06\r
46 #define LINIF_WAKEUP_SERVICE_ID                 0x07\r
47 #define LINIF_MAINFUNCTION_SERVICE_ID       0x80\r
48 //@}\r
49 \r
50 /** @name Error Codes */\r
51 //@{\r
52 #define LINIF_E_UNINIT 0x00\r
53 #define LINIF_E_ALREADY_INITIALIZED 0x10\r
54 #define LINIF_E_NONEXISTENT_CHANNEL 0x20\r
55 #define LINIF_E_PARAMETER 0x30\r
56 #define LINIF_E_PARAMETER_POINTER 0x40\r
57 #define LINIF_E_SCHEDULE_OVERFLOW 0x50\r
58 #define LINIF_E_SCHEDULE_REQUEST_ERROR 0x51\r
59 //@}\r
60 \r
61 #if (LINIF_VERSION_INFO_API == STD_ON)\r
62 void LinIf_GetVersionInfo( Std_VersionInfoType *versionInfo );\r
63 #define LinIf_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi,LINIF)\r
64 #endif\r
65 \r
66 void LinIf_Init( const void* ConfigPtr );\r
67 \r
68 void LinIf_DeInit();\r
69 \r
70 Std_ReturnType LinIf_Transmit(PduIdType LinTxPduId,const PduInfoType* PduInfoPtr);\r
71 \r
72 Std_ReturnType LinIf_ScheduleRequest(NetworkHandleType Channel,LinIf_SchHandleType Schedule);\r
73 \r
74 Std_ReturnType LinIf_GotoSleep(NetworkHandleType Channel);\r
75 \r
76 Std_ReturnType LinIf_WakeUp(NetworkHandleType Channel);\r
77 \r
78 void LinIf_MainFunction();\r
79 \r
80 #endif\r
81 /** @} */\r