Skip to content

Commit b6291e4

Browse files
authored
Merge branch 'master' into build_default
2 parents 35c44f9 + 03e2ad9 commit b6291e4

File tree

17 files changed

+541
-6
lines changed

17 files changed

+541
-6
lines changed

Diff for: boards.txt

+301-3
Large diffs are not rendered by default.

Diff for: cores/esp32/esp32-hal-i2c.c

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ esp_err_t i2cInit(uint8_t i2c_num, int8_t sda, int8_t scl, uint32_t frequency){
7272
} else if(frequency > 1000000UL){
7373
frequency = 1000000UL;
7474
}
75+
log_i("Initialising I2C Master: sda=%d scl=%d freq=%d", sda, scl, frequency);
7576

7677
i2c_config_t conf = { };
7778
conf.mode = I2C_MODE_MASTER;

Diff for: cores/esp32/esp32-hal-ledc.c

+4
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,7 @@ void analogWrite(uint8_t pin, int value) {
226226
ledcWrite(pin_to_channel[pin] - 1, value);
227227
}
228228
}
229+
230+
int8_t analogGetChannel(uint8_t pin) {
231+
return pin_to_channel[pin] - 1;
232+
}

Diff for: cores/esp32/esp32-hal.h

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ void yield(void);
9292
#include "esp32-hal-cpu.h"
9393

9494
void analogWrite(uint8_t pin, int value);
95+
int8_t analogGetChannel(uint8_t pin);
9596

9697
//returns chip temperature in Celsius
9798
float temperatureRead();

Diff for: docs/source/faq.rst

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
##########################
22
Frequently Asked Questions
33
##########################
4+
5+
How to modify an sdkconfig option in Arduino?
6+
---------------------------------------------
7+
8+
Arduino-esp32 project is based on ESP-IDF. While ESP-IDF supports configuration of various compile-time options (known as "Kconfig options" or "sdkconfig options") via a "menuconfig" tool, this feature is not available in Arduino IDE.
9+
10+
To use the arduino-esp32 core with a modified sdkconfig option, you need to use ESP-IDF to compile Arduino libraries. Please see :doc:`esp-idf_component` and :doc:`lib_builder` for the two solutions available.
11+
12+
Note that modifying ``sdkconfig`` or ``sdkconfig.h`` files found in the arduino-esp32 project tree **does not** result in changes to these options. This is because ESP-IDF libraries are included into the arduino-esp32 project tree as pre-built libraries.
13+

Diff for: libraries/BLE/src/BLEAdvertisedDevice.h

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <esp_gattc_api.h>
1313

1414
#include <map>
15+
#include <vector>
1516

1617
#include "BLEAddress.h"
1718
#include "BLEScan.h"

Diff for: libraries/ESP32/keywords.txt

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#######################################
2+
# Syntax Coloring Map
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
9+
#######################################
10+
# Methods and Functions (KEYWORD2)
11+
#######################################
12+
13+
#######################################
14+
# Constants (LITERAL1)
15+
#######################################
16+
17+
RGB_BUILTIN LITERAL1

Diff for: libraries/Wire/src/Wire.h

+15-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,21 @@ class TwoWire: public Stream
7676
//call setPins() first, so that begin() can be called without arguments from libraries
7777
bool setPins(int sda, int scl);
7878

79-
bool begin(int sda=-1, int scl=-1, uint32_t frequency=0); // returns true, if successful init of i2c bus
80-
bool begin(uint8_t slaveAddr, int sda=-1, int scl=-1, uint32_t frequency=0);
79+
bool begin(int sda, int scl, uint32_t frequency=0); // returns true, if successful init of i2c bus
80+
bool begin(uint8_t slaveAddr, int sda, int scl, uint32_t frequency);
81+
// Explicit Overload for Arduino MainStream API compatibility
82+
inline bool begin()
83+
{
84+
return begin(-1, -1, static_cast<uint32_t>(0));
85+
}
86+
inline bool begin(uint8_t addr)
87+
{
88+
return begin(addr, -1, -1, 0);
89+
}
90+
inline bool begin(int addr)
91+
{
92+
return begin(static_cast<uint8_t>(addr), -1, -1, 0);
93+
}
8194
bool end();
8295

8396
void setTimeOut(uint16_t timeOutMillis); // default timeout of i2c transactions is 50ms
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ESP-IDF Partition Table
2+
# Name, Type, SubType, Offset, Size, Flags
3+
# bootloader.bin,, 0x1000, 32K
4+
# partition table, 0x8000, 4K
5+
6+
nvs, data, nvs, 0x9000, 20K,
7+
otadata, data, ota, 0xe000, 8K,
8+
ota_0, 0, ota_0, 0x10000, 1408K,
9+
ota_1, 0, ota_1, 0x170000, 1408K,
10+
uf2, app, factory,0x2d0000, 256K,
11+
ffat, data, fat, 0x310000, 960K,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#ifndef Pins_Arduino_h
2+
#define Pins_Arduino_h
3+
4+
#include <stdint.h>
5+
6+
7+
#define USB_VID 0x303a
8+
#define USB_PID 0x80FF
9+
#define USB_MANUFACTURER "Department of Alchemy"
10+
#define USB_PRODUCT "MiniMain ESP32-S2"
11+
#define USB_SERIAL "" // Empty string for MAC adddress
12+
13+
14+
#define EXTERNAL_NUM_INTERRUPTS 46
15+
#define NUM_DIGITAL_PINS 48
16+
#define NUM_ANALOG_INPUTS 20
17+
18+
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
19+
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
20+
#define digitalPinHasPWM(p) (p < 46)
21+
22+
#define LED_BUILTIN 13
23+
24+
#define PIN_NEOPIXEL 33
25+
#define NEOPIXEL_NUM 1 // number of neopixels
26+
#define NEOPIXEL_POWER 21 // power pin
27+
#define NEOPIXEL_POWER_ON HIGH // power pin state when on
28+
#define PIN_SERVO 2 // servo pin
29+
#define PIN_ISOLATED_INPUT 40 // optocoupled input
30+
31+
static const uint8_t SDA = 3;
32+
static const uint8_t SCL = 4;
33+
34+
static const uint8_t SS = 42;
35+
static const uint8_t MOSI = 35;
36+
static const uint8_t SCK = 36;
37+
static const uint8_t MISO = 37;
38+
39+
static const uint8_t A0 = 18;
40+
static const uint8_t A1 = 17;
41+
static const uint8_t A2 = 16;
42+
static const uint8_t A3 = 15;
43+
static const uint8_t A4 = 14;
44+
static const uint8_t A5 = 8;
45+
46+
47+
static const uint8_t TX = 39;
48+
static const uint8_t RX = 38;
49+
#define TX1 TX
50+
#define RX1 RX
51+
52+
static const uint8_t T2 = 2;
53+
static const uint8_t T5 = 5;
54+
static const uint8_t T6 = 6;
55+
static const uint8_t T8 = 8;
56+
static const uint8_t T9 = 9;
57+
static const uint8_t T10 = 10;
58+
static const uint8_t T11 = 11;
59+
static const uint8_t T12 = 12;
60+
static const uint8_t T13 = 13;
61+
static const uint8_t T14 = 14;
62+
63+
static const uint8_t DAC1 = 17;
64+
static const uint8_t DAC2 = 18;
65+
66+
#endif /* Pins_Arduino_h */
144 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2021 Ha Thach (tinyusb.org) for Adafruit Industries
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
26+
#include "esp32-hal-gpio.h"
27+
#include "pins_arduino.h"
28+
29+
extern "C" {
30+
31+
// Initialize variant/board, called before setup()
32+
void initVariant(void)
33+
{
34+
// This board has a power control pin, and we must set it to output and high
35+
// in order to enable the NeoPixels.
36+
pinMode(NEOPIXEL_POWER, OUTPUT);
37+
digitalWrite(NEOPIXEL_POWER, HIGH);
38+
}
39+
}

Diff for: variants/esp32thing_plus_c/pins_arduino.h

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#ifndef Pins_Arduino_h
2+
#define Pins_Arduino_h
3+
4+
#include <stdint.h>
5+
#include "soc/soc_caps.h"
6+
7+
#define EXTERNAL_NUM_INTERRUPTS 16
8+
#define NUM_DIGITAL_PINS 40
9+
#define NUM_ANALOG_INPUTS 16
10+
11+
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
12+
#define digitalPinToInterrupt(p) (((p)<40)?(p):-1)
13+
#define digitalPinHasPWM(p) (p < 34)
14+
15+
static const uint8_t LED_BUILTIN = 13;
16+
#define BUILTIN_LED LED_BUILTIN // backward compatibility
17+
#define LED_BUILTIN LED_BUILTIN
18+
19+
static const uint8_t RGB_BUILTIN = SOC_GPIO_PIN_COUNT+2;
20+
#define RGB_BUILTIN RGB_BUILTIN
21+
#define RGB_BRIGHTNESS 64
22+
23+
static const uint8_t TX = 17;
24+
static const uint8_t RX = 16;
25+
26+
#define TX1 TX
27+
#define RX1 RX
28+
29+
static const uint8_t SDA = 21;
30+
static const uint8_t SCL = 22;
31+
32+
static const uint8_t SS = 15;
33+
static const uint8_t MOSI = 23;
34+
static const uint8_t MISO = 19;
35+
static const uint8_t SCK = 18;
36+
37+
static const uint8_t A0 = 26;
38+
static const uint8_t A1 = 25;
39+
static const uint8_t A2 = 34;
40+
static const uint8_t A3 = 39;
41+
static const uint8_t A4 = 36;
42+
static const uint8_t A5 = 35;
43+
static const uint8_t A6 = 14;
44+
static const uint8_t A7 = 32;
45+
static const uint8_t A8 = 15;
46+
static const uint8_t A9 = 33;
47+
static const uint8_t A10 = 27;
48+
static const uint8_t A11 = 12;
49+
static const uint8_t A12 = 13;
50+
51+
52+
static const uint8_t T0 = 4;
53+
static const uint8_t T1 = 0;
54+
static const uint8_t T2 = 2;
55+
static const uint8_t T3 = 15;
56+
static const uint8_t T4 = 13;
57+
static const uint8_t T5 = 12;
58+
static const uint8_t T6 = 14;
59+
static const uint8_t T7 = 27;
60+
static const uint8_t T8 = 33;
61+
static const uint8_t T9 = 32;
62+
63+
static const uint8_t DAC1 = 25;
64+
static const uint8_t DAC2 = 26;
65+
66+
#endif /* Pins_Arduino_h */

Diff for: variants/m5stack_atom/pins_arduino.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
static const uint8_t TX = 1;
1515
static const uint8_t RX = 3;
1616

17+
static const uint8_t TXD2 = 32;
18+
static const uint8_t RXD2 = 26;
19+
1720
static const uint8_t SDA = 26;
1821
static const uint8_t SCL = 32;
1922

20-
2123
static const uint8_t G12 = 12;
2224
static const uint8_t G19 = 19;
2325
static const uint8_t G21 = 21;

Diff for: variants/m5stack_fire/pins_arduino.h

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
static const uint8_t TX = 1;
1515
static const uint8_t RX = 3;
1616

17+
static const uint8_t TXD2 = 17;
18+
static const uint8_t RXD2 = 16;
19+
1720
static const uint8_t SDA = 21;
1821
static const uint8_t SCL = 22;
1922

Diff for: variants/m5stick_c/pins_arduino.h

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
static const uint8_t TX = 1;
1515
static const uint8_t RX = 3;
1616

17+
static const uint8_t TXD2 = 33;
18+
static const uint8_t RXD2 = 32;
19+
1720
static const uint8_t SDA = 32;
1821
static const uint8_t SCL = 33;
1922

0 commit comments

Comments
 (0)