From b320a6a863cf1c10dc79254af41f573730935564 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 18 May 2023 18:17:14 +1000 Subject: Add basic samd class --- src/main/main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/main') diff --git a/src/main/main.cpp b/src/main/main.cpp index 07547713..29ac2c7f 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -31,6 +31,7 @@ #include "gpio_expander.hpp" #include "i2c.hpp" #include "lvgl_task.hpp" +#include "samd.hpp" #include "spi.hpp" #include "storage.hpp" #include "touchwheel.hpp" @@ -48,6 +49,16 @@ extern "C" void app_main(void) { ESP_LOGI(TAG, "Init GPIOs"); drivers::GpioExpander* expander = drivers->AcquireGpios(); + ESP_LOGI(TAG, "Init SAMD comms"); + drivers::Samd samd; + ESP_LOGI(TAG, "It might have worked? Let's read something!"); + auto res = samd.ReadChargeStatus(); + if (res) { + ESP_LOGI(TAG, "Charge status is %d", static_cast(*res)); + } else { + ESP_LOGI(TAG, "no charge status?"); + } + ESP_LOGI(TAG, "Enable power rails for development"); expander->with( [&](auto& gpio) { gpio.set_pin(drivers::GpioExpander::AMP_EN, 1); }); -- cgit v1.2.3