summaryrefslogtreecommitdiff
path: root/src/drivers/include
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-04-21 15:27:57 +1000
committerjacqueline <me@jacqueline.id.au>2023-04-21 15:27:57 +1000
commit7083459cf3c62c32d0c039a4665e702d70a27bba (patch)
tree815757d591d8600469104398e95e80824bd94871 /src/drivers/include
parent130009eb142a5ce8bb6cf9cbb59d69a4d96ed5f9 (diff)
downloadtangara-fw-7083459cf3c62c32d0c039a4665e702d70a27bba.tar.gz
wrap driver instance ownership + di in a class
Diffstat (limited to 'src/drivers/include')
-rw-r--r--src/drivers/include/dac.hpp3
-rw-r--r--src/drivers/include/display.hpp3
-rw-r--r--src/drivers/include/storage.hpp7
3 files changed, 5 insertions, 8 deletions
diff --git a/src/drivers/include/dac.hpp b/src/drivers/include/dac.hpp
index acdd1743..4952c992 100644
--- a/src/drivers/include/dac.hpp
+++ b/src/drivers/include/dac.hpp
@@ -117,8 +117,7 @@ class AudioDac {
FAILED_TO_INSTALL_I2S,
};
- static auto create(GpioExpander* expander)
- -> cpp::result<std::unique_ptr<AudioDac>, Error>;
+ static auto create(GpioExpander* expander) -> cpp::result<AudioDac*, Error>;
AudioDac(GpioExpander* gpio, i2s_chan_handle_t i2s_handle);
~AudioDac();
diff --git a/src/drivers/include/display.hpp b/src/drivers/include/display.hpp
index 8157c3a5..9e4a0224 100644
--- a/src/drivers/include/display.hpp
+++ b/src/drivers/include/display.hpp
@@ -23,8 +23,7 @@ class Display {
* us back any kind of signal to tell us we're actually using them correctly.
*/
static auto create(GpioExpander* expander,
- const displays::InitialisationData& init_data)
- -> std::unique_ptr<Display>;
+ const displays::InitialisationData& init_data) -> Display*;
Display(GpioExpander* gpio, spi_device_handle_t handle);
~Display();
diff --git a/src/drivers/include/storage.hpp b/src/drivers/include/storage.hpp
index 64ce4782..c19ec935 100644
--- a/src/drivers/include/storage.hpp
+++ b/src/drivers/include/storage.hpp
@@ -25,14 +25,13 @@ class SdStorage {
FAILED_TO_MOUNT,
};
- static auto create(GpioExpander* gpio)
- -> cpp::result<std::shared_ptr<SdStorage>, Error>;
+ static auto create(GpioExpander* gpio) -> cpp::result<SdStorage*, Error>;
SdStorage(GpioExpander* gpio,
esp_err_t (*do_transaction)(sdspi_dev_handle_t, sdmmc_command_t*),
sdspi_dev_handle_t handle_,
- std::unique_ptr<sdmmc_host_t>& host_,
- std::unique_ptr<sdmmc_card_t>& card_,
+ std::unique_ptr<sdmmc_host_t> host_,
+ std::unique_ptr<sdmmc_card_t> card_,
FATFS* fs_);
~SdStorage();