Move from has_* to capabilities bits

This commit is contained in:
Pim van Pelt
2018-04-22 09:42:47 +02:00
parent 0f933dda31
commit 1b3d8ac7ca
5 changed files with 17 additions and 11 deletions

View File

@ -29,13 +29,17 @@ typedef bool (*mgos_barometer_mag_create_fn)(struct mgos_barometer *dev);
typedef bool (*mgos_barometer_mag_destroy_fn)(struct mgos_barometer *dev);
typedef bool (*mgos_barometer_mag_read_fn)(struct mgos_barometer *dev);
#define MGOS_BAROMETER_CAP_BAROMETER (0x01)
#define MGOS_BAROMETER_CAP_THERMOMETER (0x02)
#define MGOS_BAROMETER_CAP_HYGROMETER (0x04)
struct mgos_barometer {
struct mgos_i2c * i2c;
uint8_t i2caddr;
uint16_t cache_ttl_ms;
enum mgos_barometer_type type;
bool has_thermometer;
bool has_barometer;
uint8_t capabilities;
mgos_barometer_mag_detect_fn detect;
mgos_barometer_mag_create_fn create;