2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
20 #include "config/parameter_group.h"
22 #define TEMPERATURE_LABEL_LEN 4
23 #define MAX_TEMP_SENSORS 8
25 #define TEMPERATURE_INVALID_VALUE -1250
34 tempSensorType_e type
;
39 char label
[TEMPERATURE_LABEL_LEN
];
42 PG_DECLARE_ARRAY(tempSensorConfig_t
, MAX_TEMP_SENSORS
, tempSensorConfig
);
44 // Temperature is returned in degC*10
45 bool getIMUTemperature(int16_t *temperature
);
46 bool getBaroTemperature(int16_t *temperature
);
47 void temperatureUpdate(void);
49 #ifdef USE_TEMPERATURE_SENSOR
50 void temperatureInit(void);
52 bool getSensorTemperature(uint8_t sensorIndex
, int16_t *temperature
);
54 void tempSensorAddressToString(uint64_t address
, char *hex_address
);
55 bool tempSensorStringToAddress(const char *hex_address
, uint64_t *address
);
58 void resetTempSensorConfig(void);