Skip to content

Add Watchy board #6158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11099,3 +11099,74 @@ lionbit.menu.DebugLevel.verbose=Verbose
lionbit.menu.DebugLevel.verbose.build.code_debug=5

##############################################################

watchy.name=Watchy

watchy.upload.tool=esptool_py
watchy.upload.maximum_size=1310720
watchy.upload.maximum_data_size=327680
watchy.upload.flags=
watchy.upload.extra_flags=

watchy.serial.disableDTR=true
watchy.serial.disableRTS=true

watchy.build.tarch=xtensa
watchy.build.bootloader_addr=0x1000
watchy.build.target=esp32
watchy.build.mcu=esp32
watchy.build.core=esp32
watchy.build.variant=watchy
watchy.build.board=WATCHY

watchy.build.f_cpu=240000000L
watchy.build.flash_size=4MB
watchy.build.flash_freq=80m
watchy.build.flash_mode=dio
watchy.build.boot=qio
watchy.build.partitions=min_spiffs
watchy.build.defines=

watchy.menu.Revision.v10=Watchy v1.0
watchy.menu.Revision.v10.build.board=WATCHY_V10
watchy.menu.Revision.v15=Watchy v1.5
watchy.menu.Revision.v15.build.board=WATCHY_V15
watchy.menu.Revision.v20=Watchy v2.0
watchy.menu.Revision.v20.build.board=WATCHY_V20

watchy.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS)
watchy.menu.PartitionScheme.huge_app.build.partitions=huge_app
watchy.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
watchy.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)
watchy.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
watchy.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080

watchy.menu.UploadSpeed.921600=921600
watchy.menu.UploadSpeed.921600.upload.speed=921600
watchy.menu.UploadSpeed.115200=115200
watchy.menu.UploadSpeed.115200.upload.speed=115200
watchy.menu.UploadSpeed.256000.windows=256000
watchy.menu.UploadSpeed.256000.upload.speed=256000
watchy.menu.UploadSpeed.230400.windows.upload.speed=256000
watchy.menu.UploadSpeed.230400=230400
watchy.menu.UploadSpeed.230400.upload.speed=230400
watchy.menu.UploadSpeed.460800.linux=460800
watchy.menu.UploadSpeed.460800.macosx=460800
watchy.menu.UploadSpeed.460800.upload.speed=460800
watchy.menu.UploadSpeed.512000.windows=512000
watchy.menu.UploadSpeed.512000.upload.speed=512000

watchy.menu.DebugLevel.none=None
watchy.menu.DebugLevel.none.build.code_debug=0
watchy.menu.DebugLevel.error=Error
watchy.menu.DebugLevel.error.build.code_debug=1
watchy.menu.DebugLevel.warn=Warn
watchy.menu.DebugLevel.warn.build.code_debug=2
watchy.menu.DebugLevel.info=Info
watchy.menu.DebugLevel.info.build.code_debug=3
watchy.menu.DebugLevel.debug=Debug
watchy.menu.DebugLevel.debug.build.code_debug=4
watchy.menu.DebugLevel.verbose=Verbose
watchy.menu.DebugLevel.verbose.build.code_debug=5

##############################################################
60 changes: 60 additions & 0 deletions variants/watchy/pins_arduino.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h

#include <stdint.h>

#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 16

#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1)
#define digitalPinToInterrupt(p) (((p)<40)?(p):-1)
#define digitalPinHasPWM(p) (p < 34)

static const uint8_t TX = 1;
static const uint8_t RX = 3;

static const uint8_t SDA = 21;
static const uint8_t SCL = 22;

static const uint8_t SS = 5;
static const uint8_t MOSI = 23;
static const uint8_t MISO = 19;
static const uint8_t SCK = 18;

static const uint8_t MENU_BTN_PIN = 26;
static const uint8_t BACK_BTN_PIN = 25;
static const uint8_t DOWN_BTN_PIN = 4;
static const uint8_t DISPLAY_CS = 5;
static const uint8_t DISPLAY_RES = 9;
static const uint8_t DISPLAY_DC = 10;
static const uint8_t DISPLAY_BUSY = 19;
static const uint8_t ACC_INT_1_PIN = 14;
static const uint8_t ACC_INT_2_PIN = 12;
static const uint8_t VIB_MOTOR_PIN = 13;
static const uint8_t RTC_INT_PIN = 27;

#if defined (ARDUINO_WATCHY_V10)
static const uint8_t UP_BTN_PIN = 32;
static const uint8_t BATT_ADC_PIN = 33;
#define UP_BTN_MASK GPIO_SEL_32
#define RTC_TYPE 1 //DS3231
#elif defined (ARDUINO_WATCHY_V15)
static const uint8_t UP_BTN_PIN = 32;
static const uint8_t BATT_ADC_PIN = 35;
#define UP_BTN_MASK GPIO_SEL_32
#define RTC_TYPE 2 //PCF8563
#elif defined (ARDUINO_WATCHY_V20)
static const uint8_t UP_BTN_PIN = 35;
static const uint8_t BATT_ADC_PIN = 34;
#define UP_BTN_MASK GPIO_SEL_35
#define RTC_TYPE 2 //PCF8563
#endif

#define MENU_BTN_MASK GPIO_SEL_26
#define BACK_BTN_MASK GPIO_SEL_25
#define DOWN_BTN_MASK GPIO_SEL_4
#define ACC_INT_MASK GPIO_SEL_14
#define BTN_PIN_MASK MENU_BTN_MASK|BACK_BTN_MASK|UP_BTN_MASK|DOWN_BTN_MASK

#endif /* Pins_Arduino_h */