author | greg |
Sat, 17 Jan 2009 17:25:58 +0100 | |
changeset 528 | 0a30e161d63c |
parent 71 | 95cd3376cc9f |
child 529 | c171e11707c5 |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
This file is part of CanFestival, a library implementing CanOpen Stack. |
|
3 |
||
4 |
Copyright (C): Edouard TISSERANT and Francis DUPIN |
|
5 |
||
6 |
See COPYING file for copyrights details. |
|
7 |
||
8 |
This library is free software; you can redistribute it and/or |
|
9 |
modify it under the terms of the GNU Lesser General Public |
|
10 |
License as published by the Free Software Foundation; either |
|
11 |
version 2.1 of the License, or (at your option) any later version. |
|
12 |
||
13 |
This library is distributed in the hope that it will be useful, |
|
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
16 |
Lesser General Public License for more details. |
|
17 |
||
18 |
You should have received a copy of the GNU Lesser General Public |
|
19 |
License along with this library; if not, write to the Free Software |
|
20 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
*/ |
|
22 |
||
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
23 |
/** @defgroup networkmanagement Network Management |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
24 |
* @ingroup userapi |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
25 |
*/ |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
26 |
/** @defgroup nmtmaster NMT Master |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
27 |
* @ingroup networkmanagement |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
28 |
*/ |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
29 |
|
0 | 30 |
#ifndef __nmtMaster_h__ |
31 |
#define __nmtMaster_h__ |
|
32 |
||
33 |
#include "data.h" |
|
34 |
||
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
35 |
/** |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
36 |
* @ingroup nmtmaster |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
37 |
* @brief Transmit a NMT message on the bus number bus_id |
0 | 38 |
* to the slave whose node_id is ID |
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
39 |
* |
0 | 40 |
* bus_id is hardware dependant |
41 |
* cs represents the order of state changement: |
|
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
42 |
* - cs = NMT_Start_Node // Put the node in operational mode |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
43 |
* - cs = NMT_Stop_Node // Put the node in stopped mode |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
44 |
* - cs = NMT_Enter_PreOperational // Put the node in pre_operational mode |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
45 |
* - cs = NMT_Reset_Node // Put the node in initialization mode |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
46 |
* - cs = NMT_Reset_Comunication // Put the node in initialization mode |
0 | 47 |
* The mode is changed according to the slave state machine mode : |
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
48 |
* - initialisation ---> pre-operational (Automatic transition) |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
49 |
* - pre-operational <--> operational |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
50 |
* - pre-operational <--> stopped |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
51 |
* - pre-operational, operational, stopped -> initialisation |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
52 |
* @param *d Pointer on a CAN object data structure |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
53 |
* @param Node_ID Id of the slave node |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
54 |
* @param cs State changement |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
55 |
* @return canSend(bus_id,&m) |
0 | 56 |
*/ |
57 |
UNS8 masterSendNMTstateChange (CO_Data* d, UNS8 Node_ID, UNS8 cs); |
|
58 |
||
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
59 |
/** |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
60 |
* @ingroup nmtmaster |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
61 |
* @brief Transmit a Node_Guard message on the bus number bus_id |
0 | 62 |
* to the slave whose node_id is nodeId |
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
63 |
* |
0 | 64 |
* bus_id is hardware dependant |
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
65 |
* @param *d Pointer on a CAN object data structure |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
66 |
* @param nodeId Id of the slave node |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
67 |
* @return canSend(bus_id,&m) |
0 | 68 |
*/ |
69 |
UNS8 masterSendNMTnodeguard (CO_Data* d, UNS8 nodeId); |
|
70 |
||
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
71 |
/** |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
72 |
* @ingroup nmtmaster |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
73 |
* @brief Prepare a Node_Guard message transmission on the bus number bus_id |
0 | 74 |
* to the slave whose node_id is nodeId |
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
75 |
* |
0 | 76 |
* Put nodeId = 0 to send an NMT broadcast. |
77 |
* This message will ask for the slave, whose node_id is nodeId, its state |
|
78 |
* bus_id is hardware dependant |
|
528
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
79 |
* @param *d Pointer on a CAN object data structure |
0a30e161d63c
Re-write doxygen tags in headers files to generate User API documentation
greg
parents:
71
diff
changeset
|
80 |
* @param nodeId Id of the slave node |
0 | 81 |
*/ |
82 |
void masterRequestNodeState (CO_Data* d, UNS8 nodeId); |
|
83 |
||
84 |
||
71 | 85 |
#endif /* __nmtMaster_h__ */ |