mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-08 14:42:33 -04:00
I2cDev_PPmod periodic sensor query (#2315)
* Add more data tx from esp * command enum rework. +1 for JT * filter 0 query interval * i2c timeouts and sanity check on ppmod
This commit is contained in:
parent
7a38b04192
commit
c90f0944b1
5 changed files with 181 additions and 10 deletions
|
@ -30,6 +30,8 @@
|
|||
#include "standalone_app.hpp"
|
||||
#include "i2cdevmanager.hpp"
|
||||
|
||||
#include "i2cdev_ppmod_helper.hpp"
|
||||
|
||||
namespace i2cdev {
|
||||
|
||||
class I2cDev_PPmod : public I2cDev {
|
||||
|
@ -38,13 +40,22 @@ class I2cDev_PPmod : public I2cDev {
|
|||
COMMAND_NONE = 0,
|
||||
|
||||
// will respond with device_info
|
||||
COMMAND_INFO = 0x18F0,
|
||||
COMMAND_INFO = 1,
|
||||
|
||||
// will respond with info of application
|
||||
COMMAND_APP_INFO = 0xA90B,
|
||||
COMMAND_APP_INFO,
|
||||
|
||||
// will respond with application data
|
||||
COMMAND_APP_TRANSFER = 0x4183,
|
||||
COMMAND_APP_TRANSFER,
|
||||
|
||||
// Feature specific commands
|
||||
COMMAND_GETFEATURE_MASK,
|
||||
// Feature data getter commands
|
||||
COMMAND_GETFEAT_DATA_GPS,
|
||||
COMMAND_GETFEAT_DATA_ORIENTATION,
|
||||
COMMAND_GETFEAT_DATA_ENVIRONMENT,
|
||||
COMMAND_GETFEAT_DATA_LIGHT,
|
||||
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
|
@ -66,9 +77,14 @@ class I2cDev_PPmod : public I2cDev {
|
|||
bool init(uint8_t addr_) override;
|
||||
void update() override;
|
||||
|
||||
std::optional<device_info> readDeviceInfo();
|
||||
std::optional<standalone_app_info> getStandaloneAppInfo(uint32_t index);
|
||||
std::vector<uint8_t> downloadStandaloneApp(uint32_t index, size_t offset);
|
||||
uint64_t get_features_mask();
|
||||
std::optional<device_info> readDeviceInfo();
|
||||
std::optional<gpssmall_t> get_gps_data();
|
||||
std::optional<orientation_t> get_orientation_data();
|
||||
std::optional<environment_t> get_environment_data();
|
||||
std::optional<uint16_t> get_light_data();
|
||||
};
|
||||
|
||||
} /* namespace i2cdev */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue