2 #include "mountainsensing/common/ms-io.h"
4 #include "dev/battery-sensor.h"
7 #include "dev/reset-sensor.h"
16 static int16_t get_acc(
enum ADXL345_AXIS axis);
22 void ms_sense_on(
void) {
26 void ms_sense_off(
void) {
30 bool ms_get_temp(
float *temp) {
31 SENSORS_ACTIVATE(sht25);
32 *temp = ((float) sht25.value(SHT25_VAL_TEMP)) / 100;
33 SENSORS_DEACTIVATE(sht25);
37 bool ms_get_humid(
float *humid) {
38 SENSORS_ACTIVATE(sht25);
39 *humid = ((float) sht25.value(SHT25_VAL_HUM)) / 100;
40 SENSORS_DEACTIVATE(sht25);
44 bool ms_get_batt(
float *batt) {
45 SENSORS_ACTIVATE(battery_sensor);
46 *batt = (float) battery_sensor.value(0);
47 SENSORS_DEACTIVATE(battery_sensor);
51 bool ms_get_time(uint32_t *seconds) {
56 bool ms_set_time(uint32_t seconds) {
61 bool ms_get_acc(int32_t *x, int32_t *y, int32_t *z) {
68 int16_t get_acc(
enum ADXL345_AXIS axis) {
70 int16_t acc = accm_read_axis(axis);
75 bool ms_get_adc1(uint32_t *adc1) {
79 bool ms_get_adc2(uint32_t *adc2) {
83 bool ms_get_rain(uint32_t *rain) {
87 bool ms_get_reboot(uint16_t *reboot) {
89 *reboot = reset_sensor.value(0);
93 bool ms_reset_reboot(
void) {
94 reset_counter_reset();
void i2c_disable(void)
Configure serial controller in disabled mode.
void i2c_enable(void)
Configure serial controller in I2C mode and set I2C speed.
CCIF unsigned long clock_seconds(void)
Get the current value of the platform seconds.
void clock_set_seconds(unsigned long sec)
Set the value of the platform seconds.