etisserant@0: /* etisserant@0: This file is part of CanFestival, a library implementing CanOpen Stack. etisserant@0: etisserant@0: Copyright (C): Edouard TISSERANT and Francis DUPIN etisserant@0: etisserant@0: See COPYING file for copyrights details. etisserant@0: etisserant@0: This library is free software; you can redistribute it and/or etisserant@0: modify it under the terms of the GNU Lesser General Public etisserant@0: License as published by the Free Software Foundation; either etisserant@0: version 2.1 of the License, or (at your option) any later version. etisserant@0: etisserant@0: This library is distributed in the hope that it will be useful, etisserant@0: but WITHOUT ANY WARRANTY; without even the implied warranty of etisserant@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU etisserant@0: Lesser General Public License for more details. etisserant@0: etisserant@0: You should have received a copy of the GNU Lesser General Public etisserant@0: License along with this library; if not, write to the Free Software etisserant@0: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA etisserant@0: */ etisserant@0: etisserant@0: #ifndef __nmtMaster_h__ etisserant@0: #define __nmtMaster_h__ etisserant@0: etisserant@0: #include "data.h" etisserant@0: etisserant@0: /** Transmit a NMT message on the bus number bus_id etisserant@0: * to the slave whose node_id is ID etisserant@0: * bus_id is hardware dependant etisserant@0: * cs represents the order of state changement: etisserant@0: * cs = NMT_Start_Node // Put the node in operational mode etisserant@0: * cs = NMT_Stop_Node // Put the node in stopped mode etisserant@0: * cs = NMT_Enter_PreOperational // Put the node in pre_operational mode etisserant@0: * cs = NMT_Reset_Node // Put the node in initialization mode etisserant@0: * cs = NMT_Reset_Comunication // Put the node in initialization mode etisserant@0: * The mode is changed according to the slave state machine mode : etisserant@0: * initialisation ---> pre-operational (Automatic transition) etisserant@0: * pre-operational <--> operational etisserant@0: * pre-operational <--> stopped etisserant@0: * pre-operational, operational, stopped -> initialisation etisserant@0: * etisserant@0: * return canSend(bus_id,&m) etisserant@0: */ etisserant@0: UNS8 masterSendNMTstateChange (CO_Data* d, UNS8 Node_ID, UNS8 cs); etisserant@0: etisserant@0: /** Transmit a Node_Guard message on the bus number bus_id etisserant@0: * to the slave whose node_id is nodeId etisserant@0: * bus_id is hardware dependant etisserant@0: * return canSend(bus_id,&m) etisserant@0: */ etisserant@0: UNS8 masterSendNMTnodeguard (CO_Data* d, UNS8 nodeId); etisserant@0: etisserant@0: etisserant@0: /** Prepare a Node_Guard message transmission on the bus number bus_id etisserant@0: * to the slave whose node_id is nodeId etisserant@0: * Put nodeId = 0 to send an NMT broadcast. etisserant@0: * This message will ask for the slave, whose node_id is nodeId, its state etisserant@0: * bus_id is hardware dependant etisserant@0: */ etisserant@0: void masterRequestNodeState (CO_Data* d, UNS8 nodeId); etisserant@0: etisserant@0: frdupin@71: #endif /* __nmtMaster_h__ */