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
33 /** @defgroup emcyo Emergency Object
34 * Emergency Object is used to communicate device and application failures.
45 * ----------------- */
46 typedef enum enum_errorState {
60 typedef void (*post_emcy_t)(CO_Data* d, UNS8 nodeID, UNS16 errCode, UNS8 errReg);
61 void _post_emcy(CO_Data* d, UNS8 nodeID, UNS16 errCode, UNS8 errReg);
63 /*************************************************************************
65 *************************************************************************/
69 * @brief Sets a new error with code errCode. Also sets corresponding bits in Error register (1001h)
70 * @param *d Pointer on a CAN object data structure
71 * @param errCode The error code
76 UNS8 EMCY_setError(CO_Data* d, UNS16 errCode, UNS8 errRegMask, UNS16 addInfo);
80 * @brief Indicates it has recovered from error errCode. Also clears corresponding bits in Error register (1001h)
81 * @param *d Pointer on a CAN object data structure
82 * @param errCode The error code
84 void EMCY_errorRecovered(CO_Data* d, UNS16 errCode);
88 * @brief Start EMCY consumer and producer
89 * @param *d Pointer on a CAN object data structure
91 void emergencyInit(CO_Data* d);
95 * @brief Stop EMCY producer and consumer
96 * @param *d Pointer on a CAN object data structure
98 void emergencyStop(CO_Data* d);
102 * @brief This function is responsible to process an EMCY canopen-message
103 * @param *d Pointer on a CAN object data structure
104 * @param *m Pointer on the CAN-message which has to be analysed.
106 void proceedEMCY(CO_Data* d, Message* m);
108 #endif /*__emcy_h__ */