Skip to content

Commit 59525bd

Browse files
committed
fixup! boards: add Wemos D1 R32 board (ESPDuino-32)
1 parent d1e1ff3 commit 59525bd

File tree

4 files changed

+23
-62
lines changed

4 files changed

+23
-62
lines changed

boards/esp32-wemos-d1-r32/doc.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,24 @@ according to the defined functionality of GPIOs.
6161
<center>
6262
Function | GPIOs | Arduino Pin |Configuration
6363
:---------------|:-------|:------------|:----------------------------------
64-
BUTTON0 | GPIO0 | - | -
6564
ADC_LINE(0) | GPIO2 | A0 | \ref esp32_adc_channels "ADC Channels"
6665
ADC_LINE(1) | GPIO4 | A1 | \ref esp32_adc_channels "ADC Channels"
6766
ADC_LINE(2) | GPIO35 | A2 | \ref esp32_adc_channels "ADC Channels"
6867
ADC_LINE(3) | GPIO34 | A3 | \ref esp32_adc_channels "ADC Channels"
6968
ADC_LINE(4) | GPIO36 | A4 | \ref esp32_adc_channels "ADC Channels"
7069
ADC_LINE(5) | GPIO39 | A5 | \ref esp32_adc_channels "ADC Channels"
7170
DAC_LINE(0) | GPIO25 | D2 | \ref esp32_pwm_channels "DAC Channels"
72-
DAC_LINE(1) | GPIO25 | D3 | \ref esp32_pwm_channels "DAC Channels"
71+
DAC_LINE(1) | GPIO26 | D3 | \ref esp32_pwm_channels "DAC Channels"
7372
I2C_DEV(0):SDA | GPIO21 | SDA | \ref esp32_i2c_interfaces "I2C Interfaces"
7473
I2C_DEV(0):SCL | GPIO22 | SCL | \ref esp32_i2c_interfaces "I2C Interfaces"
7574
LED | GPIO2 | A0 | -
7675
PWM_DEV(0):0 | GPIO25 | D3 | \ref esp32_pwm_channels "PWM Channels"
7776
PWM_DEV(0):1 | GPIO16 | D5 | \ref esp32_pwm_channels "PWM Channels"
7877
PWM_DEV(0):2 | GPIO27 | D6 | \ref esp32_pwm_channels "PWM Channels"
7978
PWM_DEV(0):3 | GPIO13 | D9 | \ref esp32_pwm_channels "PWM Channels"
80-
PWM_DEV(0):4 | GPIO5 | D10 | \ref esp32_pwm_channels "PWM Channels"
81-
PWM_DEV(0):5 | GPIO23 | D11 | \ref esp32_pwm_channels "PWM Channels"
82-
PWM_DEV(1):0 | GPIO2 | A0 | \ref esp32_pwm_channels "PWM Channels"
79+
PWM_DEV(0):4 | GPIO2 | A0 | \ref esp32_pwm_channels "PWM Channels"
80+
PWM_DEV(1):0 | GPIO5 | D10 | \ref esp32_pwm_channels "PWM Channels"
81+
PWM_DEV(1):1 | GPIO23 | D11 | \ref esp32_pwm_channels "PWM Channels"
8382
SPI_DEV(0):CLK | GPIO18 | D13 | \ref esp32_spi_interfaces "SPI Interfaces"
8483
SPI_DEV(0):MISO | GPIO19 | D12 | \ref esp32_spi_interfaces "SPI Interfaces"
8584
SPI_DEV(0):MOSI | GPIO23 | D11 | \ref esp32_spi_interfaces "SPI Interfaces"

boards/esp32-wemos-d1-r32/include/arduino_iomap.h

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ extern "C" {
5252
#define ARDUINO_PIN_13 GPIO18 /**< Arduino pin 13 (SCK) */
5353

5454
/* analog pins as digital pin: */
55-
#define ARDUINO_PIN_14 GPIO2 /**< Arduino pin 14 is A0 */
56-
#define ARDUINO_PIN_15 GPIO4 /**< Arduino pin 15 is A1 */
57-
#define ARDUINO_PIN_16 GPIO35 /**< Arduino pin 16 is A2 */
58-
#define ARDUINO_PIN_17 GPIO34 /**< Arduino pin 17 is A3 */
59-
#define ARDUINO_PIN_18 GPIO36 /**< Arduino pin 18 is A4 */
60-
#define ARDUINO_PIN_19 GPIO39 /**< Arduino pin 19 is A5 */
55+
#define ARDUINO_PIN_14 GPIO2 /**< Arduino pin 14 (A0 / LED) */
56+
#define ARDUINO_PIN_15 GPIO4 /**< Arduino pin 15 (A1) */
57+
#define ARDUINO_PIN_16 GPIO35 /**< Arduino pin 16 (A2), input only! */
58+
#define ARDUINO_PIN_17 GPIO34 /**< Arduino pin 17 (A3), input only! */
59+
#define ARDUINO_PIN_18 GPIO36 /**< Arduino pin 18 (A4), input only! */
60+
#define ARDUINO_PIN_19 GPIO39 /**< Arduino pin 19 (A5), input only! */
6161

6262
/* I2C pins as digital pins */
6363
#define ARDUINO_PIN_20 GPIO21 /**< Arduino pin 20 (SDA) */
@@ -120,14 +120,11 @@ extern "C" {
120120
#define ARDUINO_PIN_9_PWM_DEV PWM_DEV(0) /**< PWM device for Arduino pin 9 */
121121
#define ARDUINO_PIN_9_PWM_CHAN 3 /**< PWM channel for Arduino pin 9 */
122122

123-
#define ARDUINO_PIN_10_PWM_DEV PWM_DEV(0) /**< PWM device for Arduino pin 10 */
124-
#define ARDUINO_PIN_10_PWM_CHAN 4 /**< PWM channel for Arduino pin 10 */
123+
#define ARDUINO_PIN_10_PWM_DEV PWM_DEV(1) /**< PWM device for Arduino pin 10 */
124+
#define ARDUINO_PIN_10_PWM_CHAN 0 /**< PWM channel for Arduino pin 10 */
125125

126-
#define ARDUINO_PIN_11_PWM_DEV PWM_DEV(0) /**< PWM device for Arduino pin 11 */
127-
#define ARDUINO_PIN_11_PWM_CHAN 6 /**< PWM channel for Arduino pin 11 */
128-
129-
#define ARDUINO_PIN_14_PWM_DEV PWM_DEV(1) /**< PWM device for Arduino pin 11 */
130-
#define ARDUINO_PIN_14_PWM_CHAN 0 /**< PWM channel for Arduino pin 11 */
126+
#define ARDUINO_PIN_11_PWM_DEV PWM_DEV(1) /**< PWM device for Arduino pin 11 */
127+
#define ARDUINO_PIN_11_PWM_CHAN 1 /**< PWM channel for Arduino pin 11 */
131128
/** @} */
132129

133130
#ifdef __cplusplus

boards/esp32-wemos-d1-r32/include/board.h

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,48 +22,12 @@
2222

2323
#include <stdint.h>
2424

25-
/**
26-
* @name Button pin definitions
27-
* @{
28-
*/
29-
30-
/**
31-
* @brief Default button GPIO pin definition
32-
*
33-
* The Wemos D1 R32 board which is exactly the same as the ESPDuino-32 board
34-
* has a BOOT button connected to GPIO0, which can be used as button during
35-
* normal operation.
36-
*/
37-
#define BTN0_PIN GPIO0
38-
39-
/**
40-
* @brief Default button GPIO mode definition
41-
*/
42-
#define BTN0_MODE GPIO_IN_PU
43-
44-
/**
45-
* @brief Default interrupt flank definition for the button GPIO
46-
*
47-
* Since the GPIO of the button is pulled up with an external resistor, the
48-
* mode for the GPIO pin has to be GPIO_IN.
49-
*/
50-
#ifndef BTN0_INT_FLANK
51-
#define BTN0_INT_FLANK GPIO_FALLING
52-
#endif
53-
54-
/**
55-
* @brief Definition for compatibility with previous versions
56-
*/
57-
#define BUTTON0_PIN BTN0_PIN
58-
59-
/** @} */
60-
6125
/**
6226
* @name LED (on-board) configuration
6327
* @{
6428
*/
6529
#define LED0_PIN GPIO2 /**< LED is connected to GPIO2 */
66-
#define LED0_ACTIVE 1 /**< LED is high active */
30+
#define LED0_ACTIVE 1 /**< LED is HIGH active */
6731
/** @} */
6832

6933
/* include common board definitions as last step */

boards/esp32-wemos-d1-r32/include/periph_conf.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @{
1515
*
1616
* The peripheral configuration corresponds to the Arduino Uno pinout and
17-
* guaranties the compatibility with Arduino Uno Shields.
17+
* guarantees the compatibility with Arduino Uno Shields.
1818
*
1919
* For detailed information about the configuration of ESP32 boards, see
2020
* section \ref esp32_peripherals "Common Peripherals".
@@ -60,16 +60,17 @@ extern "C" {
6060
*/
6161

6262
/**
63-
* @brief Declaration of the channels for device PWM_DEV(0),
64-
* at maximum six channels.
63+
* @brief Declaration of PWM_DEV(0) channels, at maximum six channels.
6564
*/
66-
#define PWM0_GPIOS { GPIO25, GPIO16, GPIO27, GPIO13, GPIO5, GPIO23 }
65+
#define PWM0_GPIOS { GPIO25, GPIO16, GPIO27, GPIO13, GPIO2 }
6766

6867
/**
69-
* @brief Declaration of the channels for device PWM_DEV(1),
70-
* at maximum six channels.
68+
* @brief Declaration of PWM_DEV(1) channels, at maximum six channels.
69+
*
70+
* GPIO5 and GPIO23 are also used for SPI_DEV(0) an can only be used as
71+
* PWM channels if SPI_DEV(0) is not used an vice versa.
7172
*/
72-
#define PWM1_GPIOS { GPIO2 }
73+
#define PWM1_GPIOS { GPIO5, GPIO23 }
7374
/** @} */
7475

7576
/**

0 commit comments

Comments
 (0)