summaryrefslogtreecommitdiff
path: root/src/driver/nrf24l01.cc
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2019-06-25 15:23:09 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2019-06-25 15:23:09 +0200
commita73f21f7aa05638203ca0b928849f956cd4269ee (patch)
treeae68525167b8e78a73c5b9a45230995f1203e6cc /src/driver/nrf24l01.cc
parente50587344e4977fcc04c04df53caee9b6ebf85f6 (diff)
implement powerDown function
Diffstat (limited to 'src/driver/nrf24l01.cc')
-rw-r--r--src/driver/nrf24l01.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/driver/nrf24l01.cc b/src/driver/nrf24l01.cc
index 0bb4656..194b1b7 100644
--- a/src/driver/nrf24l01.cc
+++ b/src/driver/nrf24l01.cc
@@ -95,6 +95,12 @@ void Nrf24l01::powerUp(void)
}
}
+void Nrf24l01::powerDown(void)
+{
+ gpio.write(NRF24L01_EN_PIN, 0);
+ writeRegister(NRF_CONFIG, readRegister(NRF_CONFIG) & ~(1 << PWR_UP));
+}
+
void Nrf24l01::setRetries(uint8_t delay, uint8_t count)
{
writeRegister(SETUP_RETR, (delay & 0xf) << ARD | (count & 0xf) << ARC);