Skip to content

Add "WEMOS LoLin32" boards support. #35

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 2 commits into from
Nov 8, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
40 changes: 40 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,43 @@ 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

##############################################################
lolin32.name=WEMOS LoLin32

lolin32.upload.tool=esptool
lolin32.upload.maximum_size=1044464
lolin32.upload.maximum_data_size=294912
lolin32.upload.wait_for_upload_port=true

lolin32.serial.disableDTR=true
lolin32.serial.disableRTS=true

lolin32.build.mcu=esp32
lolin32.build.core=esp32
lolin32.build.variant=lolin32
lolin32.build.board=LoLin32

lolin32.build.f_cpu=160000000L
lolin32.build.flash_mode=dio
lolin32.build.flash_size=4MB

lolin32.menu.FlashFreq.80=80MHz
lolin32.menu.FlashFreq.80.build.flash_freq=80m
lolin32.menu.FlashFreq.40=40MHz
lolin32.menu.FlashFreq.40.build.flash_freq=40m

lolin32.menu.UploadSpeed.921600=921600
lolin32.menu.UploadSpeed.921600.upload.speed=921600
lolin32.menu.UploadSpeed.115200=115200
lolin32.menu.UploadSpeed.115200.upload.speed=115200
lolin32.menu.UploadSpeed.256000.windows=256000
lolin32.menu.UploadSpeed.256000.upload.speed=256000
lolin32.menu.UploadSpeed.230400.windows.upload.speed=256000
lolin32.menu.UploadSpeed.230400=230400
lolin32.menu.UploadSpeed.230400.upload.speed=230400
lolin32.menu.UploadSpeed.460800.linux=460800
lolin32.menu.UploadSpeed.460800.macosx=460800
lolin32.menu.UploadSpeed.460800.upload.speed=460800
lolin32.menu.UploadSpeed.512000.windows=512000
lolin32.menu.UploadSpeed.512000.upload.speed=512000
3 changes: 3 additions & 0 deletions package/package_esp32_index.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"boards": [
{
"name": "ESP32 Dev Module"
},
{
"name": "WEMOS LoLin32"
}
],
"toolsDependencies": [
Expand Down
23 changes: 23 additions & 0 deletions variants/lolin32/pins_arduino.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h

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

#define analogInputToDigitalPin(p)
#define digitalPinToInterrupt(p) (((p)<40)?(p):-1)
#define digitalPinHasPWM(p) (p < 34)

#define LED_BUILTIN 2
#define KEY_BUILTIN 0

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

static const uint8_t SS = 2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't SS be GPIO 5?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ESP32's "General purpose SPI" can be remap to any GPIO

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, but it will not work just by defining it here ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I'm merging this now and will make the necessary adjustments to make your SS pin work.
Keep in mind that GPIO2 is a bootstrap pin that is pulled down by default (like GPIO15 on ESP8266) and that does not make it a very good SS pin, because it will have the slave selected on boot.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you, changed the SS to GPIO5.
Thank you.

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

#endif /* Pins_Arduino_h */