42 #include "lib/sensors.h"
43 #include "dev/z1-phidgets.h"
45 static uint8_t adc_on;
46 static uint8_t active;
49 sensors_activate(uint8_t type)
55 if(pre == 0 && adc_on > 0) {
62 ADC12CTL0 = REF2_5V + SHT0_6 + SHT1_6 + MSC;
63 ADC12CTL1 = SHP + CONSEQ_3 + CSTARTADD_0;
67 ADC12CTL0 |= ADC12ON + REFON;
74 sensors_deactivate(uint8_t type)
84 ADC12CTL1 &= ~CONSEQ_3;
86 while(ADC12CTL1 & ADC12BUSY);
127 configure(
int type,
int c)
132 if(!status(SENSORS_ACTIVE)) {
135 ADC12MCTL0 = (INCH_0 + SREF_0);
137 ADC12MCTL1 = (INCH_3 + SREF_0);
139 ADC12MCTL2 = (INCH_1 + SREF_0);
141 ADC12MCTL3 = (INCH_7 + SREF_0);
143 sensors_activate(0x0F);
147 sensors_deactivate(0x0F);
154 SENSORS_SENSOR(phidgets,
"Phidgets", value, configure, status);