/*
  Michael Simmons
  Master Project: gRAPI: an indoor four-wheeled robot API for a gumstix connex
  
  Last Modified: 17 Feb 2009
  
  Header file for the Cmps03 class
*/

#ifndef CMPS03_H
#define CMPS03_H

#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/i2c.h>
#include <unistd.h>
#include <inttypes.h>

class Cmps03
{
  private:
    int i2cHandle;  // file handle from open of I2C
    int i2cAddr;  // address on I2C bus
    uint8_t readBuf[2];  // result value
    uint8_t readReg;  // value of 2 is register to read from
    int i2cBusWait;

  public:
    Cmps03(int handle);
    double readC();  // read stored register value
    int calibrate();  // sets direction for North, East, South, West

}; // Cmps03

#endif
