mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-06 05:34:50 -04:00
I2C device manager (#2282)
* message on dev list change * dc detect * added sht3x sensor. * separete environment data from light * max17055 moved to i2c dev * sht fix, goterror detection fix * fix ext sensor app display for a lot of devices. * added bh1750 driver * autoscan on main view * added devlist mutex * better timing * fix h2 sw8 on poweron by usb
This commit is contained in:
parent
d4edb5f5f9
commit
83b65ba6ce
35 changed files with 1459 additions and 472 deletions
|
@ -126,6 +126,8 @@ class Message {
|
|||
BatteryStateData = 68,
|
||||
ProtoViewData = 69,
|
||||
FreqChangeCommand = 70,
|
||||
I2CDevListChanged = 71,
|
||||
LightData = 72,
|
||||
MAX
|
||||
};
|
||||
|
||||
|
@ -1330,18 +1332,26 @@ class EnvironmentDataMessage : public Message {
|
|||
constexpr EnvironmentDataMessage(
|
||||
float temperature = 0,
|
||||
float humidity = 0,
|
||||
float pressure = 0,
|
||||
uint16_t light = 0)
|
||||
float pressure = 0)
|
||||
: Message{ID::EnvironmentData},
|
||||
temperature{temperature},
|
||||
humidity{humidity},
|
||||
pressure{pressure},
|
||||
light{light} {
|
||||
pressure{pressure} {
|
||||
}
|
||||
float temperature = 0; // celsius
|
||||
float humidity = 0; // percent (rh)
|
||||
float pressure = 0; // hpa
|
||||
uint16_t light = 0; // lux
|
||||
};
|
||||
|
||||
class LightDataMessage : public Message {
|
||||
public:
|
||||
constexpr LightDataMessage(
|
||||
|
||||
uint16_t light = 0)
|
||||
: Message{ID::LightData},
|
||||
light{light} {
|
||||
}
|
||||
uint16_t light = 0; // lux
|
||||
};
|
||||
|
||||
class AudioBeepMessage : public Message {
|
||||
|
@ -1423,4 +1433,10 @@ class FreqChangeCommandMessage : public Message {
|
|||
int64_t freq = 0;
|
||||
};
|
||||
|
||||
class I2CDevListChangedMessage : public Message {
|
||||
public:
|
||||
constexpr I2CDevListChangedMessage()
|
||||
: Message{ID::I2CDevListChanged} {}
|
||||
};
|
||||
|
||||
#endif /*__MESSAGE_H__*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue