/************************************************************************/
/* Copyright 2009 MBARI													*/
/************************************************************************/
/* Summary	: ModBus Functions for Respirometer controller (O4)			*/
/* Filename : modbus.c													*/
/* Author	: Robert Herlien (rah)										*/
/* Project	: Respirometers												*/
/* Revision: 1.0														*/
/* Created	: 03/03/2009												*/
/*																			*/
/* MBARI provides this documentation and code "as is", with no warranty,	*/
/* express or implied, of its quality or consistency. It is provided without*/
/* support and without obligation on the part of the Monterey Bay Aquarium	*/
/* Research Institute to assist in its use, correction, modification, or	*/
/* enhancement. This information should not be published or distributed to	*/
/* third parties without specific written permission from MBARI.			*/
/*																			*/
/************************************************************************/
/* Modification History:												*/
/* 3mar2009 rah - created												*/
/************************************************************************/

#include <mbariTypes.h>					/* MBARI type definitions		*/
#include <oasis.h>						/* OASIS controller definitions */
#include <serial.h>						/* OASIS Serial I/O				*/		
#include <modbus.h>						/* Modbus protocol library		*/


Global Errno	modErrno = OK;

Global ModBusStruct		modBus[PIC_UARTS];


/************************************************************************/
/* Function	   : initModBus												*/
/* Purpose	   : Initialize this module									*/
/* Inputs	   : None													*/
/* Outputs	   : None													*/
/************************************************************************/
Void initModBus(Void)
{
} /* initModBus() */


/************************************************************************/
/* Function	   : modBusConfigure										*/
/* Purpose	   : Configure a ModBus bus									*/
/* Inputs	   : Serial port, baud rate, serial mode, surge delay, flags*/
/* Outputs	   : OK, ILLEGAL_PORT, or PORT_ERROR						*/
/************************************************************************/
Errno modBusConfigure(Nat16 port, Nat32 baud, Nat32 sermode,
					  Nat32 surgeDelay, Nat32 flags)
{
	return(OK);
}


/************************************************************************/
/* Function	   : modBusConfigured										*/
/* Purpose	   : Report whether modbus was configured					*/
/* Inputs	   : Serial port number										*/
/* Outputs	   : TRUE or FALSE											*/
/************************************************************************/
MBool modBusConfigured(Nat16 port)
{
	return(FALSE);

} /* modBusConfigured() */


/* From modbusio.c */
/************************************************************************/
/* Function	   : showModBus												*/
/* Purpose	   : Display ModBus configuration to screen					*/
/* Inputs	   : None													*/
/* Outputs	   : OK														*/
/************************************************************************/
CmdRtn showModBus(Void)
{
	return(OK);
}

/************************************************************************/
/* Function	   : usrModPower											*/
/* Purpose	   : User routine to turn on/off power to a ModBus			*/
/* Inputs	   : Parm mask, bus, on/off boolean							*/
/* Outputs	   : OK														*/
/************************************************************************/
CmdRtn usrModPower(Nat16 pmask, Parm_t port, Parm_t onoff)
{
	return(OK);
}
