From 886d0044bc9bacc2d033320b3bccc427d90cf072 Mon Sep 17 00:00:00 2001 From: Nat Weerawan Date: Wed, 19 Oct 2016 16:28:05 +0700 Subject: [PATCH] Add Nano32 board. (#21) --- boards.txt | 40 ++++++++++++++++++++++++++++++++++ variants/nano32/pins_arduino.h | 35 +++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 variants/nano32/pins_arduino.h diff --git a/boards.txt b/boards.txt index c36330d3..23468105 100644 --- a/boards.txt +++ b/boards.txt @@ -80,3 +80,43 @@ esp320.menu.UploadSpeed.460800.macosx=460800 esp320.menu.UploadSpeed.460800.upload.speed=460800 esp320.menu.UploadSpeed.512000.windows=512000 esp320.menu.UploadSpeed.512000.upload.speed=512000 + +############################################################## +nano32.name=Nano32 + +nano32.upload.tool=esptool +nano32.upload.maximum_size=1044464 +nano32.upload.maximum_data_size=294912 +nano32.upload.wait_for_upload_port=true + +nano32.serial.disableDTR=true +nano32.serial.disableRTS=true + +nano32.build.mcu=esp32 +nano32.build.core=esp32 +nano32.build.variant=nano32 +nano32.build.board=NANO32 + +nano32.build.f_cpu=160000000L +nano32.build.flash_mode=dio +nano32.build.flash_size=4MB + +nano32.menu.FlashFreq.80=80MHz +nano32.menu.FlashFreq.80.build.flash_freq=80m +nano32.menu.FlashFreq.40=40MHz +nano32.menu.FlashFreq.40.build.flash_freq=40m + +nano32.menu.UploadSpeed.921600=921600 +nano32.menu.UploadSpeed.921600.upload.speed=921600 +nano32.menu.UploadSpeed.115200=115200 +nano32.menu.UploadSpeed.115200.upload.speed=115200 +nano32.menu.UploadSpeed.256000.windows=256000 +nano32.menu.UploadSpeed.256000.upload.speed=256000 +nano32.menu.UploadSpeed.230400.windows.upload.speed=256000 +nano32.menu.UploadSpeed.230400=230400 +nano32.menu.UploadSpeed.230400.upload.speed=230400 +nano32.menu.UploadSpeed.460800.linux=460800 +nano32.menu.UploadSpeed.460800.macosx=460800 +nano32.menu.UploadSpeed.460800.upload.speed=460800 +nano32.menu.UploadSpeed.512000.windows=512000 +nano32.menu.UploadSpeed.512000.upload.speed=512000 diff --git a/variants/nano32/pins_arduino.h b/variants/nano32/pins_arduino.h new file mode 100644 index 00000000..0c2dbc0d --- /dev/null +++ b/variants/nano32/pins_arduino.h @@ -0,0 +1,35 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + + +#define digitalPinToPort(pin) (0) +#define digitalPinToBitMask(pin) (1UL << (pin)) +#define digitalPinToTimer(pin) (0) +#define portOutputRegister(port) +#define portInputRegister(port) +#define portModeRegister(port) + +#define NOT_A_PIN -1 +#define NOT_A_PORT -1 +#define NOT_AN_INTERRUPT -1 +#define NOT_ON_TIMER 0 + +#define EXTERNAL_NUM_INTERRUPTS 16 +#define NUM_DIGITAL_PINS 38 +#define NUM_ANALOG_INPUTS 18 + +#define analogInputToDigitalPin(p) +#define digitalPinToInterrupt(p) +#define digitalPinHasPWM(p) + +#define LED_BUILTIN 16 + +static const uint8_t SDA = 21; +static const uint8_t SCL = 22; + +static const uint8_t SS = 2; +static const uint8_t MOSI = 23; +static const uint8_t MISO = 19; +static const uint8_t SCK = 18; + +#endif /* Pins_Arduino_h */ \ No newline at end of file