2010-05-28 11:38:51 -03:00
|
|
|
#ifndef APM_ADC_h
|
|
|
|
#define APM_ADC_h
|
|
|
|
|
2010-09-10 17:41:41 -03:00
|
|
|
#define bit_set(p,m) ((p) |= ( 1<<m))
|
2010-05-28 11:38:51 -03:00
|
|
|
#define bit_clear(p,m) ((p) &= ~(1<<m))
|
|
|
|
|
|
|
|
// We use Serial Port 2 in SPI Mode
|
2010-09-10 17:41:41 -03:00
|
|
|
#define ADC_DATAOUT 51 // MOSI
|
|
|
|
#define ADC_DATAIN 50 // MISO
|
|
|
|
#define ADC_SPICLOCK 52 // SCK
|
2010-05-28 11:38:51 -03:00
|
|
|
#define ADC_CHIP_SELECT 33 // PC4 9 // PH6 Puerto:0x08 Bit mask : 0x40
|
|
|
|
|
|
|
|
class APM_ADC_Class
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
public:
|
|
|
|
APM_ADC_Class(); // Constructor
|
|
|
|
void Init();
|
2010-09-10 20:58:19 -03:00
|
|
|
int Ch(unsigned char ch_num);
|
2010-05-28 11:38:51 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
extern APM_ADC_Class APM_ADC;
|
|
|
|
|
|
|
|
#endif
|