/****************************************************************************/
/* Copyright 2016 MBARI                                                     */
/****************************************************************************/
/* Summary  : Definitions for ADC Routines for OASIS5 on PIC32MX470F512L    */
/* Filename : adc.h                                                         */
/* Author   : Robert Herlien (rah)                                          */
/* Project  : OASIS Mooring Replacement (OASIS5)                            */
/* Revision: 1.0                                                            */
/* Created  : 02/23/2016                                                    */
/*                                                                          */
/* 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:                                                    */
/* 23feb2016 rah - created                                                  */
/****************************************************************************/

#ifndef ADC_H
#define ADC_H

#include <GenericTypeDefs.h>


/********************************************/
/*      Typedefs and Constants              */
/********************************************/

typedef enum
{
    ADC_PRESS = 6, ADC_BATT, ADC_GF, ADC_TEMP, ADC_HUMID
} ADC_ChanNum;

#define ADC_CHANS       5
#define ADC_CHAN_MIN    ADC_PRESS
#define ADC_CHAN_MAX    ADC_HUMID


/********************************************/
/*      Function Prototypes                 */
/********************************************/

void    adcInit(void);
void    adcSetupSingle(int chan);
void    adcSetupMult(int chan, int nchans);
UINT16  adcConvertSingle(void);
void    adcConvertMult(void);
UINT16  adcGetResult(UINT16 chanOfs);
void    adcStop(void);

#endif
