]> rtime.felk.cvut.cz Git - arc.git/blob - include/Nm.h
regenerated configs for all mpc560x targets so they build again. Although bug for...
[arc.git] / include / Nm.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 \r
17 #ifndef NM_H_\r
18 #define NM_H_\r
19 \r
20 /** @req NM117.partially */\r
21 #include "Std_Types.h"\r
22 #include "ComStack_Types.h"\r
23 #include "NmStack_Types.h"\r
24 #include "Nm_ConfigTypes.h"\r
25 #include "ComM_Nm.h"\r
26 \r
27 #define NM_AR_MAJOR_VERSION     1\r
28 #define NM_AR_MINOR_VERSION     0\r
29 #define NM_AR_PATCH_VERSION     1\r
30 \r
31 #define NM_SW_MAJOR_VERSION     1\r
32 #define NM_SW_MINOR_VERSION     0\r
33 #define NM_SW_PATCH_VERSION     0\r
34 \r
35 #include "Nm_Cfg.h"\r
36 \r
37 /** Initializes the NM Interface. */\r
38 /** @req NM030 */\r
39 void Nm_Init( const Nm_ConfigType * const nmConfigPtr );\r
40 \r
41 /** This service returns the version information of this module */\r
42 /** @req NM044 */\r
43 void Nm_GetVersionInfo( Std_VersionInfoType* nmVerInfoPtr );\r
44 \r
45 /** This function calls the <BusNm>_PassiveStartUp function\r
46   * (e.g. CanNm_PassiveStartUp function is called if channel is configured as CAN). */\r
47 /** @req NM031 */\r
48 Nm_ReturnType Nm_PassiveStartUp( const NetworkHandleType NetworkHandle );\r
49 \r
50 /** This function calls the <BusNm>_NetworkRequest\r
51   * (e.g. CanNm_NetworkRequest function is called if channel is configured as CAN). */\r
52 /** @req NM032 */\r
53 Nm_ReturnType Nm_NetworkRequest( const NetworkHandleType NetworkHandle );\r
54 \r
55 /** This function calls the <BusNm>_NetworkRelease bus specific function\r
56   * (e.g. CanNm_NetworkRelease function is called if channel is configured as CAN). */\r
57 /** @req NM046 */\r
58 Nm_ReturnType Nm_NetworkRelease( const NetworkHandleType NetworkHandle );\r
59 \r
60 /** This function calls the CanNm_NetworkRelease bus specific function, to disable\r
61   * the NM PDU transmission ability due to a ISO14229 Communication Control (28hex) service */\r
62 /** @req NM033 */\r
63 Nm_ReturnType Nm_DisableCommunication( const NetworkHandleType NetworkHandle );\r
64 \r
65 /** This function calls the CanNm_NetworkRequest bus specific function, to enable\r
66   * the NM PDU transmission ability due to a ISO14229 Communication Control (28hex) service */\r
67 /** @req NM034 */\r
68 Nm_ReturnType Nm_EnableCommunication( const NetworkHandleType NetworkHandle );\r
69 \r
70 /** Set user data for NM messages transmitted next on the bus.\r
71   * For that purpose <BusNm>_SetUserData shall be called\r
72   * (e.g. CanNm_SetUserData function is called if channel is configured as CAN). */\r
73 /** @req NM035 */\r
74 Nm_ReturnType Nm_SetUserData( const NetworkHandleType NetworkHandle, const uint8 * const nmUserDataPtr );\r
75 \r
76 /** Get user data out of the last successfully received NM message.\r
77   * For that purpose <BusNm>_GetUserData shall be called\r
78   * (e.g. CanNm_GetUserData function is called if channel is configured as CAN). */\r
79 /** @req NM036 */\r
80 Nm_ReturnType Nm_GetUserData( const NetworkHandleType NetworkHandle, uint8 * const nmUserDataPtr, uint8 * const nmNodeIdPtr );\r
81 \r
82 /** Get the whole PDU data out of the most recently received NM message.\r
83   * For that purpose CanNm_GetPduData shall be called. */\r
84 /** @req NM037 */\r
85 Nm_ReturnType Nm_GetPduData( const NetworkHandleType NetworkHandle, uint8 * const nmPduData );\r
86 \r
87 /** Set Repeat Message Request Bit for NM messages transmitted next on the bus.\r
88   * For that purpose <BusNm>_RepeatMessageRequest shall be called\r
89   * (e.g. CanNm_RepeatMessageRequest function is called if channel is configured as CAN) */\r
90 /** @req NM038 */\r
91 Nm_ReturnType Nm_RepeatMessageRequest( const NetworkHandleType NetworkHandle );\r
92 \r
93 /** Get node identifier out of the last successfully received NM-message.\r
94   * The function <BusNm>_GetNodeIdentifier shall be called. */\r
95 /** @req NM039 */\r
96 Nm_ReturnType Nm_GetNodeIdentifier( const NetworkHandleType NetworkHandle, uint8 * const nmNodeIdPtr );\r
97 \r
98 /** Get node identifier configured for the local node.\r
99   * For that purpose <BusNm>_GetLocalNodeIdentifier shall be called\r
100   * (e.g. CanNm_GetLocalNodeIdentifier function is called if channel is configured as CAN). */\r
101 /** @req NM040 */\r
102 Nm_ReturnType Nm_GetLocalNodeIdentifier( const NetworkHandleType NetworkHandle, uint8 * const nmNodeIdPtr );\r
103 \r
104 /** Check if remote sleep indication takes place or not. This in turn calls the\r
105   * <BusNm>_CheckRemoteSleepIndication for the bus specific NM layer\r
106   * (e.g. CanNm_CheckRemoteSleepIndication function is called if channel is configured as CAN). */\r
107 /** @req NM042 */\r
108 Nm_ReturnType Nm_CheckRemoteSleepIndication( const NetworkHandleType nmNetworkHandle, boolean * const nmRemoteSleepIndPtr );\r
109 \r
110 /** Returns the state of the network management. This function in turn calls the\r
111   * <BusNm>_GetState function (e.g. CanNm_GetState function is called if channel is configured as CAN). */\r
112 /** @req NM043 */\r
113 Nm_ReturnType Nm_GetState( const NetworkHandleType nmNetworkHandle, Nm_StateType* const nmStatePtr, Nm_ModeType* const nmModePtr );\r
114 \r
115 /** Notification that a NM-message has been received in the Bus-Sleep Mode, what\r
116   * indicates that some nodes in the network have already entered the Network Mode.\r
117   * The callback function shall start the network management state machine. */\r
118 /** @req NM104 */\r
119 void Nm_NetworkStartIndication( const NetworkHandleType nmNetworkHandle );\r
120 \r
121 /** Notification that the network management has entered Network Mode. The\r
122   * callback function shall enable transmission of application messages. */\r
123 /** @req NM105 */\r
124 void Nm_NetworkMode( const NetworkHandleType nmNetworkHandle );\r
125 \r
126 /** Notification that the network management has entered Prepare Bus-Sleep Mode.\r
127   * The callback function shall disable transmission of application messages. */\r
128 /** @req NM106 */\r
129 void Nm_PrepareBusSleepMode( const NetworkHandleType nmNetworkHandle );\r
130 \r
131 /** Notification that the network management has entered Bus-Sleep Mode. */\r
132 /** @req NM107 */\r
133 void Nm_BusSleepMode( const NetworkHandleType nmNetworkHandle );\r
134 \r
135 /** Notification that a NM message has been received. */\r
136 /** @req NM112 */\r
137 void Nm_PduRxIndication( const NetworkHandleType nmNetworkHandle );\r
138 \r
139 /** Notification that the CAN Generic NM state has changed. */\r
140 /** @req NM114 */\r
141 void Nm_StateChangeNotification(\r
142                 const NetworkHandleType nmNetworkHandle,\r
143                 const Nm_StateType nmPreviousState,\r
144                 const Nm_StateType nmCurrentState );\r
145 \r
146 /** This function implements the processes of the NM Interface, which need a fix\r
147   * cyclic scheduling. This function is supplied for the NM coordinator functionality\r
148   * (Nm020). However, specific implementation may not need it (Nm093) */\r
149 /** @req NM118 */\r
150 void Nm_MainFunction(void);\r
151 \r
152 \r
153 #endif /* NM_H_ */\r