-
Notifications
You must be signed in to change notification settings - Fork 2
/
CanIf_CanTrcv.h
194 lines (169 loc) · 9.19 KB
/
CanIf_CanTrcv.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
/*
* CanIf_CanTrcv.h
*
* Created on: 2 Feb 2020
* Author: Yahia
*/
#ifndef CANIF_CANTRCV_H_
#define CANIF_CANTRCV_H_
/* Module Version 1.0.0 */
#define CANIF_CANTRCV_SW_MAJOR_VERSION (1U)
#define CANIF_CANTRCV_SW_MINOR_VERSION (0U)
#define CANIF_CANTRCV_SW_PATCH_VERSION (0U)
/* AUTOSAR Version 4.3.1 */
#define CANIF_CANTRCV_AR_RELEASE_MAJOR_VERSION (4U)
#define CANIF_CANTRCV_AR_RELEASE_MINOR_VERSION (3U)
#define CANIF_CANTRCV_AR_RELEASE_PATCH_VERSION (1U)
#include "ComStack_Types.h"
/* AUTOSAR checking between ComStack_Types and CanIf_CanTrcv Modules */
#if ((COMSTACK_TYPES_AR_RELEASE_MAJOR_VERSION != CANIF_CANTRCV_AR_RELEASE_MAJOR_VERSION)\
|| (COMSTACK_TYPES_AR_RELEASE_MINOR_VERSION != CANIF_CANTRCV_AR_RELEASE_MINOR_VERSION)\
|| (COMSTACK_TYPES_AR_RELEASE_PATCH_VERSION != CANIF_CANTRCV_AR_RELEASE_PATCH_VERSION))
#error "The AR version of ComStack_Types.h does not match the expected version"
#endif
#include "BitHelper.h"
//************************************************************************
// Function Callback Prototype
//************************************************************************
//************************************************************************
// CanIf_ConfirmPnAvailability
//
// Function Description : This service indicates that the transceiver is running in PN
// communication mode referring to the corresponding CAN transceiver
// with the abstract CanIf TransceiverId.
// Parameter in : uint8 TransceiverId
// (Abstract CanIf TransceiverId, which is assigned to a CAN transceiver,
// which was checked for PN availability.)
// Parameter inout : none
// Parameter out : none
// Return value : none
// Requirment : SWS_CANIF_00815
// Sync/Async : Synchronous
// Reentrancy : Reentrant
// the same PduId.
// Notes :*If CanIf_ConfirmPnAvailability() is called, CanIf calls
// <User_ConfirmPnAvailability>().
// *CanIf passes the delivered parameter TransceiverId to the upper
// layer module.
// *If parameter TransceiverId of CanIf_ConfirmPnAvailability() has an
// invalid value, CanIf shall report development error code
// CANIF_E_PARAM_TRCV to the Det_ReportError service of the DET module,
// when CanIf_ConfirmPnAvailability() is called.
// *If CanIf was not initialized before calling CanIf_ConfirmPnAvailability(),
// CanIf shall not execute notification, when CanIf_ConfirmPnAvailability()
// is called.
// *The call context of CanIf_ConfirmPnAvailability() is either on interrupt
// level (interrupt mode) or on task level (polling mode).
// *Configuration of CanIf_ConfirmPnAvailability(): This function shall be
// pre compile time configurable ON/OFF by the configuration parameter
// CanIfPublicPnSupport.
//************************************************************************
extern void CanIf_ConfirmPnAvailability(uint8 TransceiverId);
//************************************************************************
//************************************************************************
// CanIf_ClearTrcvWufFlagIndication
//
// Function Description : This service indicates that the transceiver has cleared the WufFlag
// referring to the corresponding CAN transceiver with the abstract
// CanIf TransceiverId.
// Parameter in : uint8 TransceiverId
// (Abstract CanIf TransceiverId, which is assigned to a CAN transceiver,
// which this function was called.)
// Parameter inout : none
// Parameter out : none
// Return value : none
// Requirment : SWS_CANIF_00762
// Sync/Async : Synchronous
// Reentrancy : Reentrant
// the same PduId.
// Notes :*If CanIf_ClearTrcvWufFlagIndication() is called, CanIf calls
// <User_ClearTrcvWufFlagIndication>().
// *CanIf passes the delivered parameter TransceiverId to the upper
// layer module.
// *If parameter TransceiverId of CanIf_ClearTrcvWufFlagIndication() has an
// invalid value, CanIf shall report development error code
// CANIF_E_PARAM_TRCV to the Det_ReportError service of the DET module,
// when CanIf_ClearTrcvWufFlagIndication() is called.
// *If CanIf was not initialized before calling
// CanIf_ClearTrcvWufFlagIndication(), CanIf shall not execute notification,
// when CanIf_ClearTrcvWufFlagIndication() is called.
// *The call context of CanIf_ClearTrcvWufFlagIndication() is either on
// interrupt level (interrupt mode) or on task level (polling mode).
// *Configuration of CanIf_ClearTrcvWufFlagIndication (): This function shall
// be pre compile time configurable ON/OFF by the configuration parameter
// CanIfPublicPnSupport.
//************************************************************************
extern void CanIf_ClearTrcvWufFlagIndication(uint8 TransceiverId);
//************************************************************************
//************************************************************************
// CanIf_CheckTrcvWakeFlagIndication
//
// Function Description : This service indicates that the check of the transceiver’s wake-up flag
// has been finished by the corresponding CAN transceiver with the abstract
// CanIf TransceiverId. This indication is used to cope with the asynchronous
// transceiver communication.
// Parameter in : uint8 TransceiverId
// (Abstract CanIf TransceiverId, which is assigned to a CAN transceiver,
// which this function was called.)
// Parameter inout : none
// Parameter out : none
// Return value : none
// Requirment : SWS_CANIF_00763
// Sync/Async : Synchronous
// Reentrancy : Reentrant
// the same PduId.
// Notes :*If CanIf_CheckTrcvWakeFlagIndication() is called, CanIf calls
// <User_CheckTrcvWakeFlagIndication>().
// *CanIf passes the delivered parameter TransceiverId to the upper
// layer module.
// *If parameter TransceiverId of CanIf_CheckTrcvWakeFlagIndication() has an
// invalid value, CanIf shall report development error code
// CANIF_E_PARAM_TRCV to the Det_ReportError service of the DET module,
// when CanIf_CheckTrcvWufFlagIndication() is called.
// *If CanIf was not initialized before calling
// CanIf_CheckTrcvWufFlagIndication(), CanIf shall not execute notification,
// when CanIf_CheckTrcvWufFlagIndication() is called.
// *The call context of CanIf_CheckTrcvWufFlagIndication() is either on
// interrupt level (interrupt mode) or on task level (polling mode).
// *Configuration of CanIf_CheckTrcvWufFlagIndication (): This function shall
// be pre compile time configurable ON/OFF by the configuration parameter
// CanIfPublicPnSupport.
//************************************************************************
extern void CanIf_CheckTrcvWakeFlagIndication(uint8 TransceiverId);
//************************************************************************
//************************************************************************
// CanIf_TrcvModeIndication
//
// Function Description : This service indicates a transceiver state transition referring to the
// corresponding CAN transceiver with the abstract CanIf TransceiverId.
// Parameter in : uint8 TransceiverId
// (Abstract CanIf TransceiverId, which is assigned to a CAN transceiver,
// which state has been transitioned.)
// CanTrcv_TrcvModeType TransceiverMode
// (Mode to which the CAN transceiver transitioned)
// Parameter inout : none
// Parameter out : none
// Return value : none
// Requirment : SWS_CANIF_00764
// Sync/Async : Synchronous
// Reentrancy : Reentrant
// the same PduId.
// Notes :*The callback service CanIf_TrcvModeIndication() is called by CanDrv and
// implemented in CanIf. It is called in case of a state transition
// notification of the CanDrv.
// *If parameter TransceiverId of CanIf_TrcvModeIndication() has an
// invalid value, CanIf shall report development error code
// CANIF_E_PARAM_TRCV to the Det_ReportError service of the DET module,
// when CanIf_TrcvModeIndication() is called.
// *If CanIf was not initialized before calling
// CanIf_TrcvModeIndication(), CanIf shall not execute notification,
// when CanIf_TrcvModeIndication() is called.
// *The call context of CanIf_TrcvModeIndication() is either on
// interrupt level (interrupt mode) or on task level (polling mode).
// *Configuration of CanIf_TrcvModeIndication(): If transceivers are not
// supported (CanIfTrcvDrvCfg is not configured, see CanIfTrcvDrvCfg),
// CanIf_TrcvModeIndication() shall not be provided by CanIf.
//************************************************************************
extern void CanIf_TrcvModeIndication(uint8 TransceiverId, CanTrcv_TrcvModeType TransceiverMode);
//************************************************************************
#endif /* CANIF_CANTRCV_H_ */