From 4e29a05bc635d3177bb84df9e5c143de8b00a452 Mon Sep 17 00:00:00 2001 From: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com> Date: Wed, 8 Feb 2023 11:32:49 +0100 Subject: [PATCH] Add Roboheart Hercules development board to the esp32-core (#7672) * added Roboheart Hercules pin definitions and board.txt entries * added package_roboheat.json for prototyping * Roboheart Hercules pins * Updated the pins * Delete package_roboheart.json * Requested changes --------- Co-authored-by: renebohne --- boards.txt | 133 ++++++++++++++++++++- variants/roboheart_hercules/pins_arduino.h | 104 ++++++++++++++++ 2 files changed, 236 insertions(+), 1 deletion(-) create mode 100644 variants/roboheart_hercules/pins_arduino.h diff --git a/boards.txt b/boards.txt index 791c0d8e3..5fd2b4f64 100644 --- a/boards.txt +++ b/boards.txt @@ -20943,6 +20943,137 @@ esp32c3m1IKit.menu.EraseFlash.all.upload.erase_cmd=-e ############################################################## +roboheart_hercules.name=RoboHeart Hercules + +roboheart_hercules.upload.tool=esptool_py +roboheart_hercules.upload.maximum_size=1310720 +roboheart_hercules.upload.maximum_data_size=327680 +roboheart_hercules.upload.wait_for_upload_port=true +roboheart_hercules.upload.flags= +roboheart_hercules.upload.extra_flags= + +roboheart_hercules.serial.disableDTR=true +roboheart_hercules.serial.disableRTS=true + +roboheart_hercules.build.tarch=xtensa +roboheart_hercules.build.bootloader_addr=0x1000 +roboheart_hercules.build.target=esp32 +roboheart_hercules.build.mcu=esp32 +roboheart_hercules.build.core=esp32 +roboheart_hercules.build.variant=roboheart_hercules +roboheart_hercules.build.board=roboheart_hercules + +roboheart_hercules.build.f_cpu=240000000L +roboheart_hercules.build.flash_size=4MB +roboheart_hercules.build.flash_freq=40m +roboheart_hercules.build.flash_mode=dio +roboheart_hercules.build.boot=dio +roboheart_hercules.build.partitions=default +roboheart_hercules.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw +roboheart_hercules.build.extra_libs= + +roboheart_hercules.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +roboheart_hercules.menu.PartitionScheme.default.build.partitions=default +roboheart_hercules.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +roboheart_hercules.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +roboheart_hercules.menu.PartitionScheme.default_8MB=8M Flash (3MB APP/1.5MB FAT) +roboheart_hercules.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +roboheart_hercules.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 +roboheart_hercules.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +roboheart_hercules.menu.PartitionScheme.minimal.build.partitions=minimal +roboheart_hercules.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +roboheart_hercules.menu.PartitionScheme.no_ota.build.partitions=no_ota +roboheart_hercules.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +roboheart_hercules.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +roboheart_hercules.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +roboheart_hercules.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +roboheart_hercules.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +roboheart_hercules.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +roboheart_hercules.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +roboheart_hercules.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +roboheart_hercules.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +roboheart_hercules.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +roboheart_hercules.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +roboheart_hercules.menu.PartitionScheme.huge_app.build.partitions=huge_app +roboheart_hercules.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +roboheart_hercules.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +roboheart_hercules.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +roboheart_hercules.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 +roboheart_hercules.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FAT) +roboheart_hercules.menu.PartitionScheme.fatflash.build.partitions=ffat +roboheart_hercules.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 +roboheart_hercules.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9MB FATFS) +roboheart_hercules.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +roboheart_hercules.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 +roboheart_hercules.menu.PartitionScheme.rainmaker=RainMaker +roboheart_hercules.menu.PartitionScheme.rainmaker.build.partitions=rainmaker +roboheart_hercules.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728 + +roboheart_hercules.menu.CPUFreq.240=240MHz (WiFi/BT) +roboheart_hercules.menu.CPUFreq.240.build.f_cpu=240000000L +roboheart_hercules.menu.CPUFreq.160=160MHz (WiFi/BT) +roboheart_hercules.menu.CPUFreq.160.build.f_cpu=160000000L +roboheart_hercules.menu.CPUFreq.80=80MHz (WiFi/BT) +roboheart_hercules.menu.CPUFreq.80.build.f_cpu=80000000L +roboheart_hercules.menu.CPUFreq.40=40MHz +roboheart_hercules.menu.CPUFreq.40.build.f_cpu=40000000L +roboheart_hercules.menu.CPUFreq.20=20MHz +roboheart_hercules.menu.CPUFreq.20.build.f_cpu=20000000L +roboheart_hercules.menu.CPUFreq.10=10MHz +roboheart_hercules.menu.CPUFreq.10.build.f_cpu=10000000L + +roboheart_hercules.menu.FlashMode.qio=QIO +roboheart_hercules.menu.FlashMode.qio.build.flash_mode=dio +roboheart_hercules.menu.FlashMode.qio.build.boot=qio +roboheart_hercules.menu.FlashMode.dio=DIO +roboheart_hercules.menu.FlashMode.dio.build.flash_mode=dio +roboheart_hercules.menu.FlashMode.dio.build.boot=dio +roboheart_hercules.menu.FlashMode.qout=QOUT +roboheart_hercules.menu.FlashMode.qout.build.flash_mode=dout +roboheart_hercules.menu.FlashMode.qout.build.boot=qout +roboheart_hercules.menu.FlashMode.dout=DOUT +roboheart_hercules.menu.FlashMode.dout.build.flash_mode=dout +roboheart_hercules.menu.FlashMode.dout.build.boot=dout + +roboheart_hercules.menu.FlashFreq.80=80MHz +roboheart_hercules.menu.FlashFreq.80.build.flash_freq=80m +roboheart_hercules.menu.FlashFreq.40=40MHz +roboheart_hercules.menu.FlashFreq.40.build.flash_freq=40m + +roboheart_hercules.menu.UploadSpeed.921600=921600 +roboheart_hercules.menu.UploadSpeed.921600.upload.speed=921600 +roboheart_hercules.menu.UploadSpeed.115200=115200 +roboheart_hercules.menu.UploadSpeed.115200.upload.speed=115200 +roboheart_hercules.menu.UploadSpeed.256000.windows=256000 +roboheart_hercules.menu.UploadSpeed.256000.upload.speed=256000 +roboheart_hercules.menu.UploadSpeed.230400.windows.upload.speed=256000 +roboheart_hercules.menu.UploadSpeed.230400=230400 +roboheart_hercules.menu.UploadSpeed.230400.upload.speed=230400 +roboheart_hercules.menu.UploadSpeed.460800.linux=460800 +roboheart_hercules.menu.UploadSpeed.460800.macosx=460800 +roboheart_hercules.menu.UploadSpeed.460800.upload.speed=460800 +roboheart_hercules.menu.UploadSpeed.512000.windows=512000 +roboheart_hercules.menu.UploadSpeed.512000.upload.speed=512000 + +roboheart_hercules.menu.DebugLevel.none=None +roboheart_hercules.menu.DebugLevel.none.build.code_debug=0 +roboheart_hercules.menu.DebugLevel.error=Error +roboheart_hercules.menu.DebugLevel.error.build.code_debug=1 +roboheart_hercules.menu.DebugLevel.warn=Warn +roboheart_hercules.menu.DebugLevel.warn.build.code_debug=2 +roboheart_hercules.menu.DebugLevel.info=Info +roboheart_hercules.menu.DebugLevel.info.build.code_debug=3 +roboheart_hercules.menu.DebugLevel.debug=Debug +roboheart_hercules.menu.DebugLevel.debug.build.code_debug=4 +roboheart_hercules.menu.DebugLevel.verbose=Verbose +roboheart_hercules.menu.DebugLevel.verbose.build.code_debug=5 + +roboheart_hercules.menu.EraseFlash.none=Disabled +roboheart_hercules.menu.EraseFlash.none.upload.erase_cmd= +roboheart_hercules.menu.EraseFlash.all=Enabled +roboheart_hercules.menu.EraseFlash.all.upload.erase_cmd=-e + +############################################################## VALTRACK_V4_VTS_ESP32_C3.name=VALTRACK_V4_VTS_ESP32_C3 VALTRACK_V4_VTS_ESP32_C3.vid.0=0x303a VALTRACK_V4_VTS_ESP32_C3.pid.0=0x1001 @@ -21604,4 +21735,4 @@ crabik_slot_esp32_s3.menu.EraseFlash.none.upload.erase_cmd= crabik_slot_esp32_s3.menu.EraseFlash.all=Enabled crabik_slot_esp32_s3.menu.EraseFlash.all.upload.erase_cmd=-e -############################################################## \ No newline at end of file +############################################################## diff --git a/variants/roboheart_hercules/pins_arduino.h b/variants/roboheart_hercules/pins_arduino.h new file mode 100644 index 000000000..17a595177 --- /dev/null +++ b/variants/roboheart_hercules/pins_arduino.h @@ -0,0 +1,104 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define EXTERNAL_NUM_INTERRUPTS 16 +#define NUM_DIGITAL_PINS 20 +#define NUM_ANALOG_INPUTS 16 + +#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) +#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) +#define digitalPinHasPWM(p) (p < 34) + + +// Motor driver pins +#define MOTOR_A_IN1 25 // PHASE/IN1 +#define MOTOR_A_IN2 26 // ENABLE/IN2 + +#define MOTOR_B_IN1 27 // PHASE/IN1 +#define MOTOR_B_IN2 32 // ENABLE/IN2 + +#define MOTOR_C_IN1 33 // PHASE/IN1 +#define MOTOR_C_IN2 4 // ENABLE/IN2 + +#define SLEEP_MOTOR_ABC 2 // nSLEEP + +#define LED_ROBOHEART 14 // Built in LED +#define BUILTIN_LED LED_ROBOHEART // backward compatibility +#define LED_BUILTIN LED_ROBOHEART + +#define BUTTON_ROBOHEART 0 // Button + +// I2C IMU sensor +#define IMU_SDA 21 +#define IMU_SCL 22 + +#define RXD1 16 +#define TXD1 17 + +// GSM Vela connector board pins +#define GSM_PWRKEY 12 +#define GSM_DTR 13 +#define GSM_CTS 15 +#define GSM_RTS 14 +#define GSM_TX TXD1 +#define GSM_RX RXD1 +#define BATTERY_PIN 36 // Battery ADC pin + +static const uint8_t TX = 35; +static const uint8_t RX = 34; + +static const uint8_t TXD2 = 17; +static const uint8_t RXD2 = 16; + +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 G23 = 23; +static const uint8_t G19 = 19; +static const uint8_t G18 = 18; +static const uint8_t G3 = 3; +static const uint8_t G16 = 16; +static const uint8_t G21 = 21; +static const uint8_t G2 = 2; +static const uint8_t G12 = 12; +static const uint8_t G15 = 15; +static const uint8_t G35 = 35; +static const uint8_t G36 = 36; +static const uint8_t G25 = 25; +static const uint8_t G26 = 26; +static const uint8_t G1 = 1; +static const uint8_t G17 = 17; +static const uint8_t G22 = 22; +static const uint8_t G5 = 5; +static const uint8_t G13 = 13; +static const uint8_t G0 = 0; +static const uint8_t G34 = 34; + +static const uint8_t DAC1 = 25; +static const uint8_t DAC2 = 26; + +static const uint8_t A0 = 36; +static const uint8_t A3 = 39; +static const uint8_t A4 = 32; +static const uint8_t A5 = 33; +static const uint8_t A6 = 34; +static const uint8_t A7 = 35; +static const uint8_t A10 = 4; +static const uint8_t A11 = 0; +static const uint8_t A12 = 2; +static const uint8_t A13 = 15; +static const uint8_t A14 = 13; +static const uint8_t A15 = 12; +static const uint8_t A16 = 14; +static const uint8_t A17 = 27; +static const uint8_t A18 = 25; +static const uint8_t A19 = 26; + +#endif /* Pins_Arduino_h */ -- GitLab