#ifndef __SENSOR_MCF52259_PRV_H__
#define __SENSOR_MCF52259_PRV_H__
/**HEADER********************************************************************
* 
* Copyright (c) 2010 Avnet Japan Co.,Ltd (NIKE Borad Project.)
* All Rights Reserved
*
*************************************************************************** 
*
* $FileName: sensor_mcf522xx_prv.h$
* $Version : 0.1.0.0$
* $Date    : Jan-29-2010$
*
* Comments:
*
*   CPU specific Sensor driver header file
*
*END************************************************************************/
#include "sensor.h"
#include "sensor_prv.h"

/*----------------------------------------------------------------------*/
/*
**                          CONSTANT DEFINITIONS
*/

#ifdef __cplusplus
extern "C" {
#endif

/* Structure to hold time values */
typedef struct sensor_adc_precomputed_timer_value {
    uint_16  prescaler;
    uint_16  preset;
    uint_64  time;
} SENSOR_ADC_PRECOMPUTED_VALUE;

/* Structure holding ADC driver settings */
typedef struct sensor_adc {
   SENSOR_ADC_GENERIC           g; /* this must be included as the first member at the beginning of structure */
   /* below, CPU specific members are used */
   _mqx_int              shift; /* this is the radix we can shift to get from (prescaler+preset) scale to the lowest time */
   uint_32               results[SENSOR_ADC_SOURCE_MAX + 1]; /* here we will store raw results from AD conversion */
} SENSOR_ADC, _PTR_ SENSOR_ADC_PTR;

/* Structure holding ADC driver channel settings */
typedef struct sensor_adc_channel {
   SENSOR_ADC_CHANNEL_GENERIC   g; /* this must be included as the first member at the beginning of structure */
   /* below, CPU specific members are used */
} SENSOR_ADC_CHANNEL, _PTR_ SENSOR_ADC_CHANNEL_PTR;


_mqx_int _sensor_adc_hw_init( SENSOR_ADC_PTR pSensorAdc);
_mqx_int _sensor_adc_hw_deinit( void);
_mqx_int _sensor_adc_hw_channel_init( _mqx_uint nr);
_mqx_int _sensor_adc_hw_channel_deinit( SENSOR_ADC_CHANNEL_PTR pChannel);
void _sensor_adc_hw_measure( SENSOR_ADC_HW_CHANNEL_MASK mask);
_mqx_int _sensor_adc_hw_run( void);
_mqx_int _sensor_adc_hw_stop( void);
void _sensor_adc_hw_set_wait(uint_32 time);
uint_32 _sensor_adc_hw_get_time( void);

_mqx_int _sensor_port_hw_init(SENSOR_ADC_PTR pSensorAdc);

#ifdef __cplusplus
}
#endif

#endif

/* EOF */
