diff options
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/Cst816s.cpp | 13 | ||||
-rw-r--r-- | src/drivers/Cst816s.h | 3 | ||||
-rw-r--r-- | src/drivers/PinMap.h | 38 |
3 files changed, 9 insertions, 45 deletions
diff --git a/src/drivers/Cst816s.cpp b/src/drivers/Cst816s.cpp index 1ff163b0..b8f8e45d 100644 --- a/src/drivers/Cst816s.cpp +++ b/src/drivers/Cst816s.cpp @@ -3,7 +3,6 @@ #include <legacy/nrf_drv_gpiote.h> #include <nrfx_log.h> #include <task.h> -#include "drivers/PinMap.h" using namespace Pinetime::Drivers; @@ -19,12 +18,12 @@ Cst816S::Cst816S(TwiMaster& twiMaster, uint8_t twiAddress) : twiMaster {twiMaste } void Cst816S::Init() { - nrf_gpio_cfg_output(PinMap::Cst816sReset); - nrf_gpio_pin_set(PinMap::Cst816sReset); + nrf_gpio_cfg_output(pinReset); + nrf_gpio_pin_set(pinReset); vTaskDelay(50); - nrf_gpio_pin_clear(PinMap::Cst816sReset); + nrf_gpio_pin_clear(pinReset); vTaskDelay(5); - nrf_gpio_pin_set(PinMap::Cst816sReset); + nrf_gpio_pin_set(pinReset); vTaskDelay(50); // Wake the touchpanel up @@ -81,9 +80,9 @@ Cst816S::TouchInfos Cst816S::GetTouchInfo() { } void Cst816S::Sleep() { - nrf_gpio_pin_clear(PinMap::Cst816sReset); + nrf_gpio_pin_clear(pinReset); vTaskDelay(5); - nrf_gpio_pin_set(PinMap::Cst816sReset); + nrf_gpio_pin_set(pinReset); vTaskDelay(50); static constexpr uint8_t sleepValue = 0x03; twiMaster.Write(twiAddress, 0xA5, &sleepValue, 1); diff --git a/src/drivers/Cst816s.h b/src/drivers/Cst816s.h index 7b46c5d5..d4c17bb8 100644 --- a/src/drivers/Cst816s.h +++ b/src/drivers/Cst816s.h @@ -36,6 +36,9 @@ namespace Pinetime { void Wakeup(); private: + static constexpr uint8_t pinIrq = 28; + static constexpr uint8_t pinReset = 10; + // Unused/Unavailable commented out static constexpr uint8_t gestureIndex = 1; static constexpr uint8_t touchPointNumIndex = 2; diff --git a/src/drivers/PinMap.h b/src/drivers/PinMap.h deleted file mode 100644 index 57964020..00000000 --- a/src/drivers/PinMap.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -namespace Pinetime { - namespace PinMap { - - #ifdef WATCH_P8 - // COLMI P8 - static constexpr uint8_t Charging = 19; - static constexpr uint8_t Cst816sReset = 13; - static constexpr uint8_t Button = 17; - #else - // Pinetime - static constexpr uint8_t Charging = 12; - static constexpr uint8_t Cst816sReset = 10; - static constexpr uint8_t Button = 13; - #endif - - static constexpr uint8_t Cst816sIrq = 28; - static constexpr uint8_t PowerPresent = 19; - - static constexpr uint8_t Motor = 16; - - static constexpr uint8_t LcdBacklightLow = 14; - static constexpr uint8_t LcdBacklightMedium = 22; - static constexpr uint8_t LcdBacklightHigh = 23; - - static constexpr uint8_t SpiSck = 2; - static constexpr uint8_t SpiMosi = 3; - static constexpr uint8_t SpiMiso = 4; - - static constexpr uint8_t SpiFlashCsn = 5; - static constexpr uint8_t SpiLcdCsn = 25; - static constexpr uint8_t LcdDataCommand = 18; - - static constexpr uint8_t TwiScl = 7; - static constexpr uint8_t TwiSda = 6; - } -} |