summaryrefslogtreecommitdiff
path: root/src/drivers/samd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/samd.cpp')
-rw-r--r--src/drivers/samd.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/drivers/samd.cpp b/src/drivers/samd.cpp
index 455e9ce5..176da241 100644
--- a/src/drivers/samd.cpp
+++ b/src/drivers/samd.cpp
@@ -138,6 +138,15 @@ auto Samd::ResetToFlashSamd() -> void {
ESP_ERROR_CHECK(transaction.Execute());
}
+auto Samd::PowerDown() -> void {
+ I2CTransaction transaction;
+ transaction.start()
+ .write_addr(kAddress, I2C_MASTER_WRITE)
+ .write_ack(Registers::kPowerControl, 0b1)
+ .stop();
+ ESP_ERROR_CHECK(transaction.Execute());
+}
+
auto Samd::CreateReadPending() -> SemaphoreHandle_t {
sReadPending = xSemaphoreCreateBinary();
return sReadPending;