diff options
| author | cooljqln <cooljqln@noreply.codeberg.org> | 2025-03-19 03:31:18 +0000 |
|---|---|---|
| committer | cooljqln <cooljqln@noreply.codeberg.org> | 2025-03-19 03:31:18 +0000 |
| commit | 34e7ce869b8d451e0586e96cc4dabbff8efb56d3 (patch) | |
| tree | cca0de0ededc0ec001028c64f2424294f6c7e029 /src/drivers/include | |
| parent | fe38a57120145f73abf170400fe4a0eb0fd2714a (diff) | |
| parent | 4ddeeee0f2ca1bfd70b7045446fc719afe357431 (diff) | |
| download | tangara-fw-34e7ce869b8d451e0586e96cc4dabbff8efb56d3.tar.gz | |
Merge pull request 'Support padding the left side of the display with black columns' (#302) from display_padding into main
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/302
Diffstat (limited to 'src/drivers/include')
| -rw-r--r-- | src/drivers/include/drivers/display.hpp | 4 | ||||
| -rw-r--r-- | src/drivers/include/drivers/display_init.hpp | 1 | ||||
| -rw-r--r-- | src/drivers/include/drivers/nvs.hpp | 4 |
3 files changed, 8 insertions, 1 deletions
diff --git a/src/drivers/include/drivers/display.hpp b/src/drivers/include/drivers/display.hpp index e5001c48..88bb07c4 100644 --- a/src/drivers/include/drivers/display.hpp +++ b/src/drivers/include/drivers/display.hpp @@ -34,7 +34,7 @@ class Display { static auto Create(IGpios& expander, const displays::InitialisationData& init_data) -> Display*; - Display(IGpios& gpio, spi_device_handle_t handle); + Display(IGpios& gpio, spi_device_handle_t handle, uint_fast8_t pad); ~Display(); auto SetDisplayOn(bool) -> void; @@ -54,6 +54,7 @@ class Display { bool first_flush_finished_; bool display_on_; uint_fast8_t brightness_; + uint_fast8_t pad_; lv_display_t* display_ = nullptr; @@ -63,6 +64,7 @@ class Display { }; void SendInitialisationSequence(const uint8_t* data); + void WriteLeftPad(uint8_t *buffer); void SendCommandWithData(uint8_t command, const uint8_t* data, size_t length); diff --git a/src/drivers/include/drivers/display_init.hpp b/src/drivers/include/drivers/display_init.hpp index 9bf5b3f5..6ccdb417 100644 --- a/src/drivers/include/drivers/display_init.hpp +++ b/src/drivers/include/drivers/display_init.hpp @@ -17,6 +17,7 @@ extern const uint8_t kDelayBit; struct InitialisationData { uint16_t width; uint16_t height; + uint8_t pad; uint8_t num_sequences; const uint8_t* sequences[4]; }; diff --git a/src/drivers/include/drivers/nvs.hpp b/src/drivers/include/drivers/nvs.hpp index 21d32f42..7ef1fbf7 100644 --- a/src/drivers/include/drivers/nvs.hpp +++ b/src/drivers/include/drivers/nvs.hpp @@ -93,6 +93,9 @@ class NvsStorage { auto FastCharge() -> bool; auto FastCharge(bool) -> void; + auto DisplayLeftPadding() -> uint8_t; + auto DisplayLeftPadding(uint8_t) -> void; + auto PreferredBluetoothDevice() -> std::optional<bluetooth::MacAndName>; auto PreferredBluetoothDevice(std::optional<bluetooth::MacAndName>) -> void; @@ -177,6 +180,7 @@ class NvsStorage { Setting<uint8_t> lock_polarity_; Setting<uint16_t> display_cols_; Setting<uint16_t> display_rows_; + Setting<uint8_t> display_left_padding_; Setting<uint8_t> haptic_motor_type_; Setting<LraData> lra_calibration_; Setting<uint8_t> fast_charge_; |
