2010-11-27 00:41:25 -04:00
|
|
|
#ifndef AP_ADC_ADS7844_H
|
|
|
|
#define AP_ADC_ADS7844_H
|
|
|
|
|
|
|
|
#define bit_set(p,m) ((p) |= ( 1<<m))
|
|
|
|
#define bit_clear(p,m) ((p) &= ~(1<<m))
|
|
|
|
|
|
|
|
// We use Serial Port 2 in SPI Mode
|
|
|
|
#define ADC_DATAOUT 51 // MOSI
|
|
|
|
#define ADC_DATAIN 50 // MISO
|
|
|
|
#define ADC_SPICLOCK 52 // SCK
|
|
|
|
#define ADC_CHIP_SELECT 33 // PC4 9 // PH6 Puerto:0x08 Bit mask : 0x40
|
2011-06-12 20:50:15 -03:00
|
|
|
#define ADC_FILTER_SIZE 6
|
2010-11-27 00:41:25 -04:00
|
|
|
|
|
|
|
#include "AP_ADC.h"
|
2011-06-12 20:50:15 -03:00
|
|
|
#include <inttypes.h>
|
2010-11-27 00:41:25 -04:00
|
|
|
|
|
|
|
class AP_ADC_ADS7844 : public AP_ADC
|
|
|
|
{
|
2011-06-12 20:50:15 -03:00
|
|
|
public:
|
2010-11-27 00:41:25 -04:00
|
|
|
AP_ADC_ADS7844(); // Constructor
|
2011-06-12 20:50:15 -03:00
|
|
|
void Init();
|
2011-07-30 17:33:45 -03:00
|
|
|
int Ch(unsigned char ch_num);
|
|
|
|
int Ch_raw(unsigned char ch_num);
|
2011-06-12 20:50:15 -03:00
|
|
|
|
|
|
|
private:
|
2010-11-27 00:41:25 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|