-
Notifications
You must be signed in to change notification settings - Fork 289
Expand file tree
/
Copy pathOsekNm.h
More file actions
73 lines (61 loc) · 2.91 KB
/
OsekNm.h
File metadata and controls
73 lines (61 loc) · 2.91 KB
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
/**
* SSAS - Simple Smart Automotive Software
* Copyright (C) 2021 Parai Wang <[email protected]>
*
* ref: nm253
*/
#ifndef OSEK_NM_H
#define OSEK_NM_H
/* ================================ [ INCLUDES ] ============================================== */
#include "ComStack_Types.h"
#include "NmStack_Types.h"
/* ================================ [ MACROS ] ============================================== */
/* @ nm253.pdf 4.4.3.1 P98 */
#define OSEKNM_BUS_SLEEP ((OsekNm_ModeNameType)1)
#define OSEKNM_AWAKE ((OsekNm_ModeNameType)2)
/* ================================ [ TYPES ] ============================================== */
/* @ nm253.pdf 4.3 P89 */
typedef uint8_t OsekNm_NodeIdType;
/* @ nm253.pdf 4.4.5.3.1 P103 */
typedef uint8_t OsekNm_RingDataType[6];
typedef OsekNm_RingDataType *OsekNm_RingDataRefType;
typedef struct {
uint8_t Source;
uint8_t Destination;
uint8_t OpCode;
OsekNm_RingDataType RingData;
} OsekNm_PduType;
typedef uint8_t OsekNm_ModeNameType;
typedef enum {
OSEKNM_ROUTINE_BUS_INIT,
OSEKNM_ROUTINE_BUS_SHUTDOWN,
OSEKNM_ROUTINE_BUS_RESTART,
OSEKNM_ROUTINE_BUS_SLEEP,
OSEKNM_ROUTINE_BUS_AWAKE
} OsekNm_RoutineRefType;
typedef struct OsekNm_Config_s OsekNm_ConfigType;
/* ================================ [ DECLARES ] ============================================== */
/* ================================ [ DATAS ] ============================================== */
/* ================================ [ LOCALS ] ============================================== */
/* ================================ [ FUNCTIONS ] ============================================== */
void OsekNm_Init(const OsekNm_ConfigType *ConfigPtr);
Std_ReturnType OsekNm_Start(NetworkHandleType NetId);
Std_ReturnType OsekNm_Silent(NetworkHandleType NetId);
Std_ReturnType OsekNm_Talk(NetworkHandleType NetId);
Std_ReturnType OsekNm_GotoMode(NetworkHandleType NetId, OsekNm_ModeNameType NewMode);
Std_ReturnType OsekNm_Stop(NetworkHandleType NetId);
Std_ReturnType OsekNm_NetworkRequest(NetworkHandleType nmChannelHandle);
Std_ReturnType OsekNm_NetworkRelease(NetworkHandleType nmChannelHandle);
Std_ReturnType OsekNm_GetState(NetworkHandleType NetId, Nm_ModeType *nmModePtr);
void OsekNm_TxConfirmation(PduIdType NetId, Std_ReturnType result);
void OsekNm_RxIndication(PduIdType NetId, const PduInfoType *PduInfoPtr);
void OsekNm_WakeupIndication(NetworkHandleType NetId);
void OsekNm_BusErrorIndication(NetworkHandleType NetId);
void OsekNm_MainFunction(void);
void OsekNm_D_Init(NetworkHandleType NetId, OsekNm_RoutineRefType Routine);
void OsekNm_D_Offline(NetworkHandleType NetId);
void OsekNm_D_Online(NetworkHandleType NetId);
Std_ReturnType OsekNm_D_WindowDataReq(NetworkHandleType NetId, OsekNm_PduType *nmPdu,
uint8_t DataLengthTx);
void OsekNm_GetVersionInfo(Std_VersionInfoType *versionInfo);
#endif /* OSEK_NM_H */