2 This file is part of CanFestival, a library implementing CanOpen Stack.
4 Copyright (C): Edouard TISSERANT and Francis DUPIN
6 See COPYING file for copyrights details.
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.
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.
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
25 ** @author Luis Jimenez
26 ** @date Wed Sep 26 2007
28 ** @brief Declarations of the functions that manage EMCY (emergency) messages
40 * ----------------- */
41 typedef enum enum_errorState {
55 typedef void (*post_emcy_t)(CO_Data* d, UNS8 nodeID, UNS16 errCode, UNS8 errReg);
56 void _post_emcy(CO_Data* d, UNS8 nodeID, UNS16 errCode, UNS8 errReg);
58 /*************************************************************************
60 *************************************************************************/
62 /** Sets a new error with code errCode. Also sets corresponding bits in Error register (1001h)
64 UNS8 EMCY_setError(CO_Data* d, UNS16 errCode, UNS8 errRegMask, UNS16 addInfo);
66 /** Indicates it has recovered from error errCode. Also clears corresponding bits in Error register (1001h)
68 void EMCY_errorRecovered(CO_Data* d, UNS16 errCode);
70 /** Start EMCY consumer and producer
72 void emergencyInit(CO_Data* d);
74 /** Stop EMCY producer and consumer
76 void emergencyStop(CO_Data* d);
78 /** This function is responsible to process an EMCY canopen-message
79 * \param Message The CAN-message which has to be analysed.
81 void proceedEMCY(CO_Data* d, Message* m);
83 #endif /*__emcy_h__ */