Skip to content

Commit 82522f2

Browse files
committed
Merge pull request #173 from onkelfunny/esp8266
add nodemcu board
2 parents f567dde + bee67c3 commit 82522f2

File tree

2 files changed

+137
-0
lines changed

2 files changed

+137
-0
lines changed

boards.txt

+56
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,62 @@ generic.menu.FlashSize.2M.build.flash_size=2M
5656
generic.menu.FlashSize.4M=4M
5757
generic.menu.FlashSize.4M.build.flash_size=4M
5858

59+
##############################################################
60+
nodemcu.name=NODEMCU ESP8266 Module (v0.9)
61+
62+
nodemcu.upload.tool=esptool
63+
nodemcu.upload.speed=115200
64+
nodemcu.upload.resetmethod=ck
65+
nodemcu.upload.maximum_size=524288
66+
nodemcu.upload.wait_for_upload_port=true
67+
nodemcu.serial.disableDTR=true
68+
nodemcu.serial.disableRTS=true
69+
70+
nodemcu.build.mcu=esp8266
71+
nodemcu.build.f_cpu=80000000L
72+
nodemcu.build.board=ESP8266_ESP12
73+
nodemcu.build.core=esp8266
74+
nodemcu.build.variant=nodemcu
75+
nodemcu.build.flash_mode=qio
76+
nodemcu.build.flash_size=512K
77+
nodemcu.build.flash_freq=40
78+
79+
nodemcu.menu.CpuFrequency.80=80 MHz
80+
nodemcu.menu.CpuFrequency.80.build.f_cpu=80000000L
81+
nodemcu.menu.CpuFrequency.160=160 MHz
82+
nodemcu.menu.CpuFrequency.160.build.f_cpu=160000000L
83+
84+
nodemcu.menu.UploadSpeed.115200=115200
85+
nodemcu.menu.UploadSpeed.115200.upload.speed=115200
86+
nodemcu.menu.UploadSpeed.9600=9600
87+
nodemcu.menu.UploadSpeed.9600.upload.speed=9600
88+
nodemcu.menu.UploadSpeed.57600=57600
89+
nodemcu.menu.UploadSpeed.57600.upload.speed=57600
90+
nodemcu.menu.UploadSpeed.256000.windows=256000
91+
nodemcu.menu.UploadSpeed.256000.upload.speed=256000
92+
nodemcu.menu.UploadSpeed.230400.linux=230400
93+
nodemcu.menu.UploadSpeed.230400.macosx=230400
94+
nodemcu.menu.UploadSpeed.230400.macosx=230400
95+
nodemcu.menu.UploadSpeed.230400.upload.speed=230400
96+
nodemcu.menu.UploadSpeed.460800.linux=460800
97+
nodemcu.menu.UploadSpeed.460800.macosx=460800
98+
nodemcu.menu.UploadSpeed.460800.upload.speed=460800
99+
nodemcu.menu.UploadSpeed.512000.windows=512000
100+
nodemcu.menu.UploadSpeed.512000.upload.speed=512000
101+
nodemcu.menu.UploadSpeed.921600=921600
102+
nodemcu.menu.UploadSpeed.921600.upload.speed=921600
103+
104+
nodemcu.menu.FlashSize.512K=512K
105+
nodemcu.menu.FlashSize.512K.build.flash_size=512K
106+
nodemcu.menu.FlashSize.256K=256K
107+
nodemcu.menu.FlashSize.256K.build.flash_size=256K
108+
nodemcu.menu.FlashSize.1M=1M
109+
nodemcu.menu.FlashSize.1M.build.flash_size=1M
110+
nodemcu.menu.FlashSize.2M=2M
111+
nodemcu.menu.FlashSize.2M.build.flash_size=2M
112+
nodemcu.menu.FlashSize.4M=4M
113+
nodemcu.menu.FlashSize.4M.build.flash_size=4M
114+
59115
##############################################################
60116
# wifio.name=Wifio
61117
#

variants/nodemcu/pins_arduino.h

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*
2+
pins_arduino.h - Pin definition functions for Arduino
3+
Part of Arduino - http://www.arduino.cc/
4+
5+
Copyright (c) 2007 David A. Mellis
6+
Modified for ESP8266 platform by Ivan Grokhotkov, 2014-2015.
7+
8+
This library is free software; you can redistribute it and/or
9+
modify it under the terms of the GNU Lesser General Public
10+
License as published by the Free Software Foundation; either
11+
version 2.1 of the License, or (at your option) any later version.
12+
13+
This library is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
Lesser General Public License for more details.
17+
18+
You should have received a copy of the GNU Lesser General
19+
Public License along with this library; if not, write to the
20+
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
21+
Boston, MA 02111-1307 USA
22+
23+
$Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
24+
*/
25+
26+
#ifndef Pins_Arduino_h
27+
#define Pins_Arduino_h
28+
29+
#define EXTERNAL_NUM_INTERRUPTS 16
30+
#define NUM_DIGITAL_PINS 17
31+
#define NUM_ANALOG_INPUTS 1
32+
33+
#define analogInputToDigitalPin(p) ((p > 0)?NOT_A_PIN:0)
34+
#define digitalPinToInterrupt(p) (((p) < EXTERNAL_NUM_INTERRUPTS)?p:NOT_A_PIN)
35+
#define digitalPinHasPWM(p) (((p) < NUM_DIGITAL_PINS)?p:NOT_A_PIN)
36+
37+
static const uint8_t SDA = 4;
38+
static const uint8_t SCL = 5;
39+
40+
static const uint8_t SS = 15;
41+
static const uint8_t MOSI = 13;
42+
static const uint8_t MISO = 12;
43+
static const uint8_t SCK = 14;
44+
45+
static const uint8_t BUILTIN_LED = 1;
46+
47+
static const uint8_t A0 = 17;
48+
49+
static const uint8_t D0 = 16;
50+
static const uint8_t D1 = 5;
51+
static const uint8_t D2 = 4;
52+
static const uint8_t D3 = 0;
53+
static const uint8_t D4 = 2;
54+
static const uint8_t D5 = 14;
55+
static const uint8_t D6 = 12;
56+
static const uint8_t D7 = 13;
57+
static const uint8_t D8 = 15;
58+
static const uint8_t D9 = 3;
59+
static const uint8_t D10 = 1;
60+
61+
// These serial port names are intended to allow libraries and architecture-neutral
62+
// sketches to automatically default to the correct port name for a particular type
63+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
64+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
65+
//
66+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
67+
//
68+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
69+
//
70+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
71+
//
72+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
73+
//
74+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
75+
// pins are NOT connected to anything by default.
76+
#define SERIAL_PORT_MONITOR Serial
77+
#define SERIAL_PORT_USBVIRTUAL Serial
78+
#define SERIAL_PORT_HARDWARE Serial
79+
#define SERIAL_PORT_HARDWARE_OPEN Serial
80+
81+
#endif /* Pins_Arduino_h */

0 commit comments

Comments
 (0)