Skip to content

Commit 7497c44

Browse files
authored
Merge branch 'espressif:release/v2.x' into release/v2.x
2 parents 225e3f6 + 622ddc5 commit 7497c44

File tree

7 files changed

+682
-0
lines changed

7 files changed

+682
-0
lines changed

boards.txt

Lines changed: 393 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#ifndef Pins_Arduino_h
2+
#define Pins_Arduino_h
3+
4+
#include <stdint.h>
5+
6+
#include "soc/soc_caps.h"
7+
8+
#define USB_VID 0x303A
9+
#define USB_PID 0x1001
10+
11+
#define NUM_DIGITAL_PINS 6
12+
#define NUM_ANALOG_INPUTS 1
13+
14+
#define analogInputToDigitalPin(p) \
15+
(((p) < 20) ? (analogChannelToDigitalPin(p)) : -1)
16+
#define digitalPinToInterrupt(p) (((p) < 48) ? (p) : -1)
17+
#define digitalPinHasPWM(p) (p < 46)
18+
19+
// A flag to indicate a GPIO pin is not set
20+
#define MOTORGO_GPIO_NOT_SET 0xFF
21+
22+
// Built-in LED available to user
23+
static const uint8_t LED_BUILTIN = 38;
24+
25+
// Status LED
26+
static const uint8_t LED_STATUS = 47;
27+
#define BUILTIN_LED LED_BUILTIN // backward compatibility
28+
#define LED_BUILTIN LED_BUILTIN
29+
30+
static const uint8_t TX = 43;
31+
static const uint8_t RX = 44;
32+
33+
static const uint8_t SDA = 38;
34+
static const uint8_t SCL = 39;
35+
static const uint8_t QWIIC_SDA = SDA;
36+
static const uint8_t QWIIC_SCL = SCL;
37+
38+
static const uint8_t ENC_SDA = 35;
39+
static const uint8_t ENC_SCL = 36;
40+
// Encoder uses SSI, but we still need to define MOSI
41+
// Pin 45 is not connected to anything, so we can use it
42+
static const uint8_t ENC_MOSI = 45;
43+
44+
// ch0 Motor and Encoder pins
45+
static const uint8_t CH0_ENC_CS = 37;
46+
static const uint8_t CH0_UH = 18;
47+
static const uint8_t CH0_UL = 15;
48+
static const uint8_t CH0_VH = 17;
49+
static const uint8_t CH0_VL = 5;
50+
static const uint8_t CH0_WH = 16;
51+
static const uint8_t CH0_WL = 6;
52+
static const uint8_t CH0_CURRENT_U = 7;
53+
static const uint8_t CH0_CURRENT_V = MOTORGO_GPIO_NOT_SET;
54+
static const uint8_t CH0_CURRENT_W = 4;
55+
56+
// ch1 Motor and Encoder pins
57+
static const uint8_t CH1_ENC_CS = 48;
58+
static const uint8_t CH1_UH = 9;
59+
static const uint8_t CH1_UL = 13;
60+
static const uint8_t CH1_VH = 10;
61+
static const uint8_t CH1_VL = 21;
62+
static const uint8_t CH1_WH = 11;
63+
static const uint8_t CH1_WL = 14;
64+
static const uint8_t CH1_CURRENT_U = 8;
65+
static const uint8_t CH1_CURRENT_V = MOTORGO_GPIO_NOT_SET;
66+
static const uint8_t CH1_CURRENT_W = 12;
67+
68+
static const uint8_t CURRENT_SENSE_AMP_GAIN = 200;
69+
static const uint8_t CURRENT_SENSE_RESISTANCE_mOHM = 3;
70+
71+
static const uint8_t SS = 10;
72+
static const uint8_t MOSI = 11;
73+
static const uint8_t MISO = 13;
74+
static const uint8_t SCK = 12;
75+
76+
// The MotorGo Mini 1 exposes 1 GPIO pin connected to an ADC
77+
static const uint8_t A8 = 8;
78+
79+
#endif /* Pins_Arduino_h */
Binary file not shown.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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,
12+
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
#ifndef Pins_Arduino_h
2+
#define Pins_Arduino_h
3+
4+
#include <stdint.h>
5+
6+
#define USB_VID 0x303A
7+
#define USB_PID 0x81B8
8+
#define USB_MANUFACTURER "senseBox"
9+
#define USB_PRODUCT "MCU-S2 ESP32S2"
10+
#define USB_SERIAL "" // Empty string for MAC adddress
11+
12+
// Default USB FirmwareMSC Settings
13+
#define USB_FW_MSC_VENDOR_ID "senseBox" // max 8 chars
14+
#define USB_FW_MSC_PRODUCT_ID "MCU-S2 ESP32S2" // max 16 chars
15+
#define USB_FW_MSC_PRODUCT_REVISION "1.00" // max 4 chars
16+
#define USB_FW_MSC_VOLUME_NAME "senseBox" // max 11 chars
17+
#define USB_FW_MSC_SERIAL_NUMBER 0x00000000
18+
19+
#define EXTERNAL_NUM_INTERRUPTS 46
20+
#define NUM_DIGITAL_PINS 48
21+
#define NUM_ANALOG_INPUTS 20
22+
23+
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
24+
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
25+
#define digitalPinHasPWM(p) (p < 46)
26+
27+
#define PIN_NEOPIXEL 1 // NeoPixel LED
28+
#define NEOPIXEL_PIN 1 // NeoPixel LED
29+
#define NEOPIXEL_NUM 1 // number of neopixels
30+
31+
// Default I2C QWIIC-Ports
32+
static const uint8_t SDA = 39;
33+
static const uint8_t SCL = 40;
34+
#define PIN_QWIIC_SDA 39
35+
#define PIN_QWIIC_SCL 40
36+
37+
// Secondary I2C MPU6050
38+
#define WIRE1_PIN_DEFINED 1 // See Wire.cpp at bool TwoWire::initPins(int sdaPin, int sclPin)
39+
static const uint8_t SCL1 = 42;
40+
static const uint8_t SDA1 = 45;
41+
#define PIN_I2C_SCL 42
42+
#define PIN_I2C_SDA 45
43+
#define PIN_I2C_INT 46
44+
45+
// SPI
46+
static const uint8_t SS = 42;
47+
static const uint8_t MOSI = 35;
48+
static const uint8_t SCK = 36;
49+
static const uint8_t MISO = 37;
50+
51+
// XBEE Pins
52+
#define PIN_XBEE_ENABLE 41
53+
#define PIN_XBEE_INT 33
54+
#define PIN_XBEE_CS 34
55+
#define PIN_XBEE_MOSI 35
56+
#define PIN_XBEE_SCLK 36
57+
#define PIN_XBEE_MISO 37
58+
#define PIN_XBEE_RESET 38
59+
#define PIN_XBEE_TXD 17
60+
#define PIN_XBEE_RXD 18
61+
62+
// Alias XB1
63+
#define PIN_XB1_ENABLE 41
64+
#define PIN_XB1_INT 33
65+
#define PIN_XB1_CS 34
66+
#define PIN_XB1_MOSI 35
67+
#define PIN_XB1_SCLK 36
68+
#define PIN_XB1_MISO 37
69+
#define PIN_XB1_RESET 38
70+
#define PIN_XB1_TXD 17
71+
#define PIN_XB1_RXD 18
72+
73+
// IO Pins
74+
#define PIN_LED 1
75+
#define PIN_IO2 2
76+
#define PIN_IO3 3
77+
#define PIN_IO4 4
78+
#define PIN_IO5 5
79+
#define PIN_IO6 6
80+
#define PIN_IO7 7
81+
#define IO_ENABLE 8
82+
83+
static const uint8_t A2 = PIN_IO2;
84+
static const uint8_t A3 = PIN_IO3;
85+
static const uint8_t A4 = PIN_IO4;
86+
static const uint8_t A5 = PIN_IO5;
87+
static const uint8_t A6 = PIN_IO6;
88+
static const uint8_t A7 = PIN_IO7;
89+
90+
static const uint8_t D2 = PIN_IO2;
91+
static const uint8_t D3 = PIN_IO3;
92+
static const uint8_t D4 = PIN_IO4;
93+
static const uint8_t D5 = PIN_IO5;
94+
static const uint8_t D6 = PIN_IO6;
95+
static const uint8_t D7 = PIN_IO7;
96+
97+
// UART Port
98+
static const uint8_t TX = 43;
99+
static const uint8_t RX = 44;
100+
#define PIN_UART_TXD 43
101+
#define PIN_UART_RXD 44
102+
#define PIN_UART_ENABLE 26
103+
104+
// UART XBee
105+
static const uint8_t TX1 = 17;
106+
static const uint8_t RX1 = 18;
107+
108+
// PD-Sensor
109+
#define PD_SENSE 14
110+
#define PD_ENABLE 21
111+
#define PIN_PD_ENABLE 21
112+
113+
// SD-Card
114+
#define VSPI_MISO 13
115+
#define VSPI_MOSI 11
116+
#define VSPI_SCLK 12
117+
#define VSPI_SS 10
118+
#define SD_ENABLE 9
119+
120+
#define PIN_SD_ENABLE 9
121+
#define PIN_SD_CS 10
122+
#define PIN_SD_MOSI 11
123+
#define PIN_SD_SCLK 12
124+
#define PIN_SD_MISO 13
125+
126+
// USB
127+
#define PIN_USB_DM 19
128+
#define PIN_USB_DP 20
129+
130+
// Touch Pins
131+
static const uint8_t T2 = PIN_IO2;
132+
static const uint8_t T3 = PIN_IO3;
133+
static const uint8_t T4 = PIN_IO4;
134+
static const uint8_t T5 = PIN_IO5;
135+
static const uint8_t T6 = PIN_IO6;
136+
static const uint8_t T7 = PIN_IO7;
137+
138+
139+
static const uint8_t DAC1 = 17;
140+
static const uint8_t DAC2 = 18;
141+
142+
143+
#endif /* Pins_Arduino_h */
151 KB
Binary file not shown.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
//enable IO Pins by default
35+
pinMode(IO_ENABLE, OUTPUT);
36+
digitalWrite(IO_ENABLE,LOW);
37+
38+
//reset RGB
39+
pinMode(PIN_NEOPIXEL, OUTPUT);
40+
digitalWrite(PIN_NEOPIXEL, LOW);
41+
42+
//enable XBEE by default
43+
pinMode(PIN_XB1_ENABLE, OUTPUT);
44+
digitalWrite(PIN_XB1_ENABLE, LOW);
45+
46+
//enable UART by default
47+
pinMode(PIN_UART_ENABLE, OUTPUT);
48+
digitalWrite(PIN_UART_ENABLE, LOW);
49+
50+
//enable PD-Sensor by default
51+
pinMode(PD_ENABLE, OUTPUT);
52+
digitalWrite(PD_ENABLE, HIGH);
53+
54+
}
55+
}

0 commit comments

Comments
 (0)