diff options
Diffstat (limited to 'src/drivers/include')
| -rw-r--r-- | src/drivers/include/display_init.hpp | 3 | ||||
| -rw-r--r-- | src/drivers/include/gpios.hpp | 9 | ||||
| -rw-r--r-- | src/drivers/include/haptics.hpp | 3 | ||||
| -rw-r--r-- | src/drivers/include/nvs.hpp | 8 |
4 files changed, 19 insertions, 4 deletions
diff --git a/src/drivers/include/display_init.hpp b/src/drivers/include/display_init.hpp index f6c28b54..9bf5b3f5 100644 --- a/src/drivers/include/display_init.hpp +++ b/src/drivers/include/display_init.hpp @@ -6,6 +6,7 @@ #pragma once +#include <stdint.h> #include <cstdint> namespace drivers { @@ -14,6 +15,8 @@ namespace displays { extern const uint8_t kDelayBit; struct InitialisationData { + uint16_t width; + uint16_t height; uint8_t num_sequences; const uint8_t* sequences[4]; }; diff --git a/src/drivers/include/gpios.hpp b/src/drivers/include/gpios.hpp index 55486be7..e27a3ade 100644 --- a/src/drivers/include/gpios.hpp +++ b/src/drivers/include/gpios.hpp @@ -79,12 +79,12 @@ class IGpios { */ virtual auto Get(Pin) const -> bool = 0; - virtual auto IsLocked() const -> bool { return Get(Pin::kKeyLock); } + virtual auto IsLocked() const -> bool = 0; }; class Gpios : public IGpios { public: - static auto Create() -> Gpios*; + static auto Create(bool invert_lock_switch) -> Gpios*; ~Gpios(); /* @@ -106,6 +106,8 @@ class Gpios : public IGpios { auto Get(Pin) const -> bool override; + auto IsLocked() const -> bool override; + /** * Reads from the GPIO expander, populating `inputs` with the most recent * values. @@ -118,10 +120,11 @@ class Gpios : public IGpios { Gpios& operator=(const Gpios&) = delete; private: - Gpios(); + Gpios(bool invert_lock); std::atomic<uint16_t> ports_; std::atomic<uint16_t> inputs_; + const bool invert_lock_switch_; }; } // namespace drivers diff --git a/src/drivers/include/haptics.hpp b/src/drivers/include/haptics.hpp index dfafa2eb..6cfcbb0d 100644 --- a/src/drivers/include/haptics.hpp +++ b/src/drivers/include/haptics.hpp @@ -6,10 +6,11 @@ #pragma once -#include <stdint.h> +#include <cstdint> #include <initializer_list> #include <mutex> #include <optional> +#include <string> namespace drivers { diff --git a/src/drivers/include/nvs.hpp b/src/drivers/include/nvs.hpp index 5bd825e5..f288f8e2 100644 --- a/src/drivers/include/nvs.hpp +++ b/src/drivers/include/nvs.hpp @@ -71,6 +71,11 @@ class NvsStorage { auto LockPolarity() -> bool; auto LockPolarity(bool) -> void; + auto DisplaySize() + -> std::pair<std::optional<uint16_t>, std::optional<uint16_t>>; + auto DisplaySize(std::pair<std::optional<uint16_t>, std::optional<uint16_t>>) + -> void; + auto PreferredBluetoothDevice() -> std::optional<bluetooth::MacAndName>; auto PreferredBluetoothDevice(std::optional<bluetooth::MacAndName>) -> void; @@ -120,6 +125,9 @@ class NvsStorage { nvs_handle_t handle_; Setting<uint8_t> lock_polarity_; + Setting<uint16_t> display_cols_; + Setting<uint16_t> display_rows_; + Setting<uint8_t> brightness_; Setting<uint8_t> sensitivity_; Setting<uint16_t> amp_max_vol_; |
