5 Wire.beginTransmission(sensorAddr);
8 Wire.endTransmission();
11 Wire.beginTransmission(sensorAddr);
12 Wire.write((uint8_t)0x00);
13 Wire.endTransmission();
18 Wire.requestFrom(sensorAddr, (uint8_t)2);
19 uint8_t msb = Wire.read();
20 uint8_t lsb = Wire.read();
23 int16_t tempRaw = ((msb << 8) | lsb) >> 4;
24 float temp = tempRaw * 0.0625f;
30 ADMUX = _BV(REFS1) | _BV(REFS0) | _BV(MUX3);
32 ADCSRA |= _BV(ADEN) | _BV(ADSC);
34 while (bit_is_set(ADCSRA, ADSC));
36 uint16_t raw = ADCL | (ADCH << 8);
45 return((analogRead(pin) * 3.3) / 1023.0);
59 FOSSASAT_DEBUG_PRINTLN(F(
"Rst"));
63 LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
void Pin_Interface_Set_Temp_Resolution(uint8_t sensorAddr, uint8_t res)
This function sets the resolution of the TMP100.
#define MCU_TEMP_COEFFICIENT
#define DIGITAL_OUT_WATCHDOG_HEARTBEAT
#define TEMP_SENSOR_REG_CONFIG
bool Power_Control_Check_Battery_Limit()
Checks whether battery voltage is below low power limit. Will enable low power mode if that is the ca...
void Pin_Interface_Watchdog_Heartbeat(bool manageBattery=false)
This function toggles the signal to the watchdog and writes it to the pin.
float Pin_Interface_Read_Temperature(uint8_t sensorAddr)
This function reads the TMP100's value from its wire address.
#define WATCHDOG_RESET_NUM_SLEEP_CYCLES
float Pin_Interface_Read_Voltage(uint8_t pin)
Read the voltage of a given pin.
This module controls access to the components connect to via pins.
void Pin_Interface_Watchdog_Restart()
Restarts the watchdog.
int8_t Pin_Interface_Read_Temperature_Internal()
This function reads the MCU's internal temperature.