diff options
| author | hubmartin <hub.martin@gmail.com> | 2021-08-03 18:32:23 (GMT) |
|---|---|---|
| committer | hubmartin <hub.martin@gmail.com> | 2021-08-03 18:32:23 (GMT) |
| commit | b7aa04e1f55096d754a7cc291f02f3430f5a3cd9 (patch) | |
| tree | 6462cbd332cf813f9a173b0783521ef9714c45bb /src/drivers/Cst816s.cpp | |
| parent | 28abeae21bb370c45d26912bba4737a1cc6ddca7 (diff) | |
PinMap with namespace and constexpr
Diffstat (limited to 'src/drivers/Cst816s.cpp')
| -rw-r--r-- | src/drivers/Cst816s.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/drivers/Cst816s.cpp b/src/drivers/Cst816s.cpp index fd9792b..b039ab0 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 @@ -78,9 +79,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); |
