1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\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
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
14 * -------------------------------- Arctic Core ------------------------------*/
\r
20 #if defined(USE_PDUR)
\r
24 #if defined(USE_COM)
\r
28 #define CANIF_VENDOR_ID 1
\r
29 #define CANIF_MODULE_ID MODULE_ID_CANIF
\r
30 #define CANIF_AR_MAJOR_VERSION 3
\r
31 #define CANIF_AR_MINOR_VERSION 0
\r
32 #define CANIF_AR_PATCH_VERSION 2
\r
34 #define CANIF_SW_MAJOR_VERSION 1
\r
35 #define CANIF_SW_MINOR_VERSION 3
\r
36 #define CANIF_SW_PATCH_VERSION 0
\r
39 #include "CanIf_Types.h"
\r
40 #include "CanIf_SpecialPdus.h"
\r
41 #include "CanIf_Cfg.h"
\r
45 #define CANIF_INIT_ID 0x01
\r
46 #define CANIF_INIT_CONTROLLER_ID 0x02
\r
47 #define CANIF_SET_CONTROLLER_MODE_ID 0x03
\r
48 #define CANIF_GET_CONTROLLER_MODE_ID 0x04
\r
49 #define CANIF_TRANSMIT_ID 0x05
\r
50 #define CANIF_READTXPDUDATA_ID 0x06
\r
51 #define CANIF_READTXNOTIFSTATUS_ID 0x07
\r
52 #define CANIF_READRXNOTIFSTATUS_ID 0x08
\r
53 #define CANIF_SETPDUMODE_ID 0x09
\r
54 #define CANIF_GETPDUMODE_ID 0x0A
\r
55 #define CANIF_SETDYNAMICTX_ID 0x0C
\r
56 #define CANIF_SET_TRANSCEIVERMODE_ID 0x0D
\r
57 #define CANIF_GET_TRANSCEIVERMODE_ID 0x0E
\r
58 #define CANIF_GET_TRCVMODEREASON_ID 0x0F
\r
59 #define CANIF_SET_TRANSCEIVERWAKEMODE_ID 0x10
\r
60 #define CANIF_CHECKWAKEUP_ID 0x11
\r
61 #define CANIF_CHECKVALIDATION_ID 0x12
\r
62 #define CANIF_TXCONFIRMATION_ID 0x13
\r
63 #define CANIF_RXINDICATION_ID 0x14
\r
64 #define CANIF_CANCELTXCONFIRMATION_ID 0x15
\r
65 #define CANIF_CONTROLLER_BUSOFF_ID 0x16
\r
67 #define CANIF_SETWAKEUPEVENT_ID 0x40
\r
68 #define CANIF_ARCERROR_ID 0x41
\r
70 void CanIf_Init(const CanIf_ConfigType *ConfigPtr);
\r
72 void CanIf_InitController(uint8 Controller,
\r
73 uint8 ConfigurationIndex);
\r
75 Std_ReturnType CanIf_SetControllerMode(uint8 Controller,
\r
76 CanIf_ControllerModeType ControllerMode);
\r
78 Std_ReturnType CanIf_GetControllerMode(uint8 Controller,
\r
79 CanIf_ControllerModeType *ControllerModePtr);
\r
81 Std_ReturnType CanIf_Transmit(PduIdType CanTxPduId,
\r
82 const PduInfoType *PduInfoPtr);
\r
84 #if ( CANIF_READRXPDU_DATA_API == STD_ON )
\r
85 Std_ReturnType CanIf_ReadRxPduData(PduIdType CanRxPduId,
\r
86 PduInfoType *PduInfoPtr);
\r
89 #if ( CANIF_READTXPDU_NOTIFY_STATUS_API == STD_ON )
\r
90 CanIf_NotifStatusType CanIf_ReadTxNotifStatus(PduIdType CanTxPduId);
\r
93 #if ( CANIF_READTXPDU_NOTIFY_STATUS_API == STD_ON )
\r
94 CanIf_NotifStatusType CanIf_ReadRxNotifStatus(PduIdType CanRxPduId);
\r
97 Std_ReturnType CanIf_SetPduMode( uint8 Controller, CanIf_ChannelSetModeType PduModeRequest );
\r
98 Std_ReturnType CanIf_GetPduMode( uint8 Controller, CanIf_ChannelGetModeType *PduModePtr );
\r
100 #if ( CANIF_ARC_RUNTIME_PDU_CONFIGURATION == STD_ON )
101 void CanIf_SetDynamicTxId( PduIdType CanTxPduId, Can_IdType CanId );
\r
102 CanIf_TxPduConfigType * CanIf_FindTxPduEntry(PduIdType id);
103 CanIf_RxPduConfigType * CanIf_FindRxPduEntry(PduIdType id);
104 const CanIf_HrhConfigType* CanIf_Arc_GetReceiveHandler(CanIf_Arc_ChannelIdType Channel);
105 const CanIf_HthConfigType* CanIf_Arc_GetTransmitHandler(CanIf_Arc_ChannelIdType Channel);
108 #if ( CANIF_TRANSCEIVER_API == STD_ON )
\r
109 Std_ReturnType CanIf_SetTransceiverMode( uint8 Transceiver, CanIf_TransceiverModeType TransceiverMode );
\r
110 Std_ReturnType CanIf_GetTransceiverMode( uint8 Transceiver, CanIf_TransceiverModeType *TransceiverModePtr );
\r
111 Std_ReturnType CanIf_GetTrcvWakeupReason( uint8 Transceiver, CanIf_TrcvWakeupReasonType *TrcvWuReasonPtr );
\r
112 Std_ReturnType CanIf_SetTransceiverWakeupMode( uint8 Transceiver, CanIf_TrcvWakeupModeType *TrcvWakeupMode );
\r
115 #if ( CANIF_WAKEUP_EVENT_API == STD_ON )
\r
116 Std_ReturnType CanIf_CheckWakeup( EcuM_WakeupSourceType WakeupSource );
\r
117 Std_ReturnType CanIf_CheckValidation( EcuM_WakeupSourceType WakeupSource );
\r
120 #if ( CANIF_VERSION_INFO_API == STD_ON )
\r
121 #define CanIf_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi,CANIF)
\r
124 uint8 CanIf_Arc_GetChannelDefaultConfIndex(CanIf_Arc_ChannelIdType Channel);
126 #endif /*CANIF_H_*/
\r