Skip to content

Commit 393ecbb

Browse files
author
ficeto
committed
Merge pull request #11 from esp8266/esp8266
pull latest changes
2 parents d5a59e7 + 82522f2 commit 393ecbb

File tree

9 files changed

+174
-7
lines changed

9 files changed

+174
-7
lines changed

README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ This project brings support for ESP8266 chip to the Arduino environment. ESP8266
55

66
### Downloads ###
77

8-
| OS | Build status | Latest release |
9-
| --- | ------------ | -------------- |
10-
| Linux | [![Linux build status](http://img.shields.io/travis/igrr/Arduino.svg)](https://travis-ci.org/igrr/Arduino) | [arduino-1.6.1-linux64.tar.xz](../../releases/download/1.6.1-esp8266-1/arduino-1.6.1-linux64.tar.xz) |
11-
| Windows | [![Windows build status](http://img.shields.io/appveyor/ci/igrr/Arduino.svg)](https://ci.appveyor.com/project/igrr/Arduino) | [arduino-1.6.1-p1-windows.zip](https://github.com/igrr/Arduino/releases/download/1.6.1-esp8266-1/arduino-1.6.1-p1-windows.zip) |
12-
| OS X | | [arduino-1.6.1-macosx-java-latest-signed.zip](../../releases/download/1.6.1-esp8266-1/arduino-1.6.1-macosx-java-latest-signed.zip) |
8+
| OS | Build status | Latest release | Alpha Version |
9+
| --- | ------------ | -------------- | --------------- |
10+
| Linux | [![Linux build status](http://img.shields.io/travis/igrr/Arduino.svg)](https://travis-ci.org/igrr/Arduino) | [arduino-1.6.1-linux64.tar.xz](../../releases/download/1.6.1-esp8266-1/arduino-1.6.1-linux64.tar.xz) | |
11+
| Windows | [![Windows build status](http://img.shields.io/appveyor/ci/igrr/Arduino.svg)](https://ci.appveyor.com/project/igrr/Arduino) | [arduino-1.6.1-p1-windows.zip](https://github.com/igrr/Arduino/releases/download/1.6.1-esp8266-1/arduino-1.6.1-p1-windows.zip) | [appveyor Build](https://ci.appveyor.com/project/igrr/Arduino/build/artifacts) |
12+
| OS X | | [arduino-1.6.1-macosx-java-latest-signed.zip](../../releases/download/1.6.1-esp8266-1/arduino-1.6.1-macosx-java-latest-signed.zip) | |
1313

1414

1515
### Building from source ###
@@ -44,6 +44,10 @@ Pin interrupts are supported through ```attachInterrupt```, ```detachInterrupt``
4444
Interrupts may be attached to any GPIO pin, except GPIO16. Standard Arduino interrupt
4545
types are supported: ```CHANGE```, ```RISING```, ```FALLING```.
4646

47+
#### Pin Functions ####
48+
49+
![Pin Functions](https://raw.githubusercontent.com/Links2004/Arduino/esp8266/docs/pin_functions.png)
50+
4751
#### Timing and delays ####
4852
```millis``` and ```micros``` return the number of milliseconds and microseconds elapsed after reset, respectively.
4953

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
#

cores/esp8266/Esp.h

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ typedef enum {
4242
#define wdt_disable() ESP.wdtDisable()
4343
#define wdt_reset() ESP.wdtFeed()
4444

45+
#define cli() ets_intr_lock() // IRQ Disable
46+
#define sei() ets_intr_unlock() // IRQ Enable
47+
4548
enum WakeMode {
4649
WAKE_RF_DEFAULT = 0, // RF_CAL or not after deep-sleep wake up, depends on init data byte 108.
4750
WAKE_RFCAL = 1, // RF_CAL after deep-sleep wake up, there will be large current.

doc/ESP01_connect.jpg

39.5 KB
Loading

doc/pin_functions.png

174 KB
Loading

libraries/OneWire/OneWire.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ sample code bearing this copyright.
119119

120120
OneWire::OneWire(uint8_t pin)
121121
{
122-
pinMode(pin, INPUT);
122+
pinMode(pin, INPUT_PULLUP);
123123
bitmask = PIN_TO_BITMASK(pin);
124124
baseReg = PIN_TO_BASEREG(pin);
125125
#if ONEWIRE_SEARCH

libraries/SPI/SPI.cpp

+23-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void SPIClass::setDataMode(uint8_t dataMode) {
5757
}
5858

5959
void SPIClass::setBitOrder(uint8_t bitOrder) {
60-
if (bitOrder == MSBFIRST){
60+
if (bitOrder == MSBFIRST) {
6161
SPI1C &= ~(SPICWBO | SPICRBO);
6262
} else {
6363
SPI1C |= (SPICWBO | SPICRBO);
@@ -76,3 +76,25 @@ uint8_t SPIClass::transfer(uint8_t data) {
7676
return (uint8_t)(SPI1W0 & 0xff);
7777
}
7878

79+
uint16_t SPIClass::transfer16(uint16_t data) {
80+
union {
81+
uint16_t val;
82+
struct {
83+
uint8_t lsb;
84+
uint8_t msb;
85+
};
86+
} in, out;
87+
in.val = data;
88+
89+
if((SPI1C & (SPICWBO | SPICRBO))) {
90+
//MSBFIRST
91+
out.msb = transfer(in.msb);
92+
out.lsb = transfer(in.lsb);
93+
} else {
94+
//LSBFIRST
95+
out.lsb = transfer(in.lsb);
96+
out.msb = transfer(in.msb);
97+
}
98+
return out.val;
99+
}
100+

libraries/SPI/SPI.h

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class SPIClass {
8080
void setClockDivider(uint32_t clockDiv);
8181
void beginTransaction(SPISettings settings);
8282
uint8_t transfer(uint8_t data);
83+
uint16_t transfer16(uint16_t data);
8384
void endTransaction(void);
8485
};
8586

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)