summaryrefslogtreecommitdiff
path: root/src/drivers/Cst816s.cpp
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2021-09-26 09:16:55 (GMT)
committerGitea <gitea@fake.local>2021-09-26 09:16:55 (GMT)
commit6652ec6f71967f4a8eea1f159aa500a1a21a5902 (patch)
treecdbbf9afede8ea74258867ba41905a3fe0d784f4 /src/drivers/Cst816s.cpp
parent6c3d6fb2575888e582e7ef3004a0bc3bf6c588b6 (diff)
parentd03db14129b4f8cc2e691dd6f9e8d8d1ed52b7a1 (diff)
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/drivers/Cst816s.cpp')
-rw-r--r--src/drivers/Cst816s.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/drivers/Cst816s.cpp b/src/drivers/Cst816s.cpp
index b8f8e45..1ff163b 100644
--- a/src/drivers/Cst816s.cpp
+++ b/src/drivers/Cst816s.cpp
@@ -3,6 +3,7 @@
#include <legacy/nrf_drv_gpiote.h>
#include <nrfx_log.h>
#include <task.h>
+#include "drivers/PinMap.h"
using namespace Pinetime::Drivers;
@@ -18,12 +19,12 @@ Cst816S::Cst816S(TwiMaster& twiMaster, uint8_t twiAddress) : twiMaster {twiMaste
}
void Cst816S::Init() {
- nrf_gpio_cfg_output(pinReset);
- nrf_gpio_pin_set(pinReset);
+ nrf_gpio_cfg_output(PinMap::Cst816sReset);
+ nrf_gpio_pin_set(PinMap::Cst816sReset);
vTaskDelay(50);
- nrf_gpio_pin_clear(pinReset);
+ nrf_gpio_pin_clear(PinMap::Cst816sReset);
vTaskDelay(5);
- nrf_gpio_pin_set(pinReset);
+ nrf_gpio_pin_set(PinMap::Cst816sReset);
vTaskDelay(50);
// Wake the touchpanel up
@@ -80,9 +81,9 @@ Cst816S::TouchInfos Cst816S::GetTouchInfo() {
}
void Cst816S::Sleep() {
- nrf_gpio_pin_clear(pinReset);
+ nrf_gpio_pin_clear(PinMap::Cst816sReset);
vTaskDelay(5);
- nrf_gpio_pin_set(pinReset);
+ nrf_gpio_pin_set(PinMap::Cst816sReset);
vTaskDelay(50);
static constexpr uint8_t sleepValue = 0x03;
twiMaster.Write(twiAddress, 0xA5, &sleepValue, 1);