Skip to content
Snippets Groups Projects
Clock_Protocol.prot 3.17 KiB
Newer Older
//#  ClockControl_Protocol.prot: Protocol definition for the ClockController
//#
//#  Copyright (C) 2009
//#  ASTRON (Netherlands Foundation for Research in Astronomy)
//#  P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
//#
//#  This program is free software; you can redistribute it and/or modify
//#  it under the terms of the GNU General Public License as published by
//#  the Free Software Foundation; either version 2 of the License, or
//#  (at your option) any later version.
//#
//#  This program is distributed in the hope that it will be useful,
//#  but WITHOUT ANY WARRANTY; without even the implied warranty of
//#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//#  GNU General Public License for more details.
//#
//#  You should have received a copy of the GNU General Public License
//#  along with this program; if not, write to the Free Software
//#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//#
//#  $Id: Controller_Protocol.prot 11042 2008-03-21 08:35:15Z overeem $


autogen definitions protocol;

description = "Protocol for the ClockController of the station";
prefix = "CLKCTRL"; // for the signal names
id = "(LOFAR::MACIO::F_APL_PROTOCOL+1)";

// specify extra include files
// e.g.
// include = '<sys/time.h>';
include = '<Common/lofar_bitset.h>';
include = '<Common/LofarConstants.h>';
include = '<APL/APLCommon/ControllerDefines.h>';

prelude = << PRELUDE_END

// The following messages are defined in the Controller protocol:
//
// GET_CLOCK 	 ()
// GET_CLOCK_ACK (int	clock)
// SET_CLOCK	 (int	clock)
// SET_CLOCK_ACK (int	status)
//
// GET_SPLITTERS 	 ()
// GET_SPLITTERS_ACK (bitset	splitters)
// SET_SPLITTERS	 (bool		splittersOn)
// SET_SPLITTERS_ACK (int		status,	bitset splitters)
//

PRELUDE_END;

error = {
	id  = NO;
	msg = "No errors";
};
error = {
	id  = CLOCKFREQ;
	msg = "Invalid clock frequency specified, only 160 and 200 MHz are allowed";
};
error = {
	id  = SPLITTERS;
	msg = "Trouble setting the splitters";
};

//
// An "event" has a "signal" and a "dir" (direction)
// and zero or more "param"s.
// "dir" can be one of "IN" or "OUT".
// A "param" has a "name" and a "type".
//

//
// GET_CLOCK
//
event = {
	signal = GET_CLOCK;
	dir = IN; // from client to server
};

//
// GET_CLOCK_ACK
//
event = {
	signal = GET_CLOCK_ACK;
	dir = OUT;
	param  = {
		name = "clock";
		type = "uint32";
	};
};

//
// SET_CLOCK
//
event = {
	signal = SET_CLOCK;
	dir = IN; 
	param  = {
		name = "clock";
		type = "uint32";
	};
};

//
// SET_CLOCK_ACK
//
event = {
	signal = SET_CLOCK_ACK;
	dir = OUT; 
	param  = {
		name = "status";
		type = "uint32";
	};
};

//
// GET_SPLITTERS
//
event = {
	signal = GET_SPLITTERS;
	dir = IN; // from client to server
};

//
// GET_SPLITTERS_ACK
//
event = {
	signal = GET_SPLITTERS_ACK;
	dir = OUT;
	param  = {
		name = "splitters";
		type = "bitset<MAX_RSPBOARDS>";
	};
};

//
// SET_SPLITTERS
//
event = {
	signal = SET_SPLITTERS;
	dir = IN; 
	param  = {
		name = "splittersOn";
		type = "bool";
	};
};

//
// SET_SPLITTERS_ACK
//
event = {
	signal = SET_SPLITTERS_ACK;
	dir = OUT; 
	param  = {
		name = "status";
		type = "uint32";
	};
	param = {
		name = "splitters";
		type = "bitset<MAX_RSPBOARDS>";
	};
};