diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-05-18 18:17:14 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-05-18 18:17:14 +1000 |
| commit | b320a6a863cf1c10dc79254af41f573730935564 (patch) | |
| tree | 00e0624eb34b5347dcf14bde26d708ffb216f834 /src/main | |
| parent | d71f726c42963d55809605b4dc4144970ca0f230 (diff) | |
| download | tangara-fw-b320a6a863cf1c10dc79254af41f573730935564.tar.gz | |
Add basic samd class
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/main.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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<uint8_t>(*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); }); |
