/****************************************************************************/
/* Copyright 2012 MBARI							    */
/****************************************************************************/
/* Summary  : Definitions for Persistor emulation of AVR twim (I2C) module  */
/* Filename : twim.h							    */
/* Author   : Robert Herlien (rah)					    */
/* Project  : Benthic Event Detection System (BEDS)			    */
/* Revision : 1.0							    */
/* Created  : 04/30/2012						    */
/*									    */
/* 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:						    */
/* 30apr2012 rah - created						    */
/* $Log$
 */
/****************************************************************************/

#ifndef INCtwimh
#define INCtwimh	1

#include <mbariTypes.h>
#include <mbariConst.h>
#include <stddef.h>
#include <stdint.h>

#define STATUS_OK	0
#define STATUS_ERR	-1
#define DEVADDR_ERR	-1
#define DEV2ADDR_ERR	-2
#define REGADDR_ERR	-3
#define DATA_ERR	-4

void	twimInit(void);
void	twimSetSafe(void);
void	twimPwrOffState(void);
int16_t twim_read(uint16_t dev, uint8_t reg, Byte *datap, size_t count);
int16_t twim_write(uint16_t dev, uint8_t reg, const Byte *datap, size_t count);

#endif /* INCtwimh */
