-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add senseBox MCU-S2 #9263
Merged
Merged
add senseBox MCU-S2 #9263
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# ESP-IDF Partition Table | ||
# Name, Type, SubType, Offset, Size, Flags | ||
# bootloader.bin,, 0x1000, 32K | ||
# partition table, 0x8000, 4K | ||
|
||
nvs, data, nvs, 0x9000, 20K, | ||
otadata, data, ota, 0xe000, 8K, | ||
ota_0, 0, ota_0, 0x10000, 1408K, | ||
ota_1, 0, ota_1, 0x170000, 1408K, | ||
uf2, app, factory,0x2d0000, 256K, | ||
ffat, data, fat, 0x310000, 960K, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
#ifndef Pins_Arduino_h | ||
#define Pins_Arduino_h | ||
|
||
#include <stdint.h> | ||
|
||
#define USB_VID 0x303A | ||
#define USB_PID 0x81B8 | ||
#define USB_MANUFACTURER "senseBox" | ||
#define USB_PRODUCT "MCU-S2 ESP32S2" | ||
#define USB_SERIAL "" // Empty string for MAC adddress | ||
|
||
// Default USB FirmwareMSC Settings | ||
#define USB_FW_MSC_VENDOR_ID "senseBox" // max 8 chars | ||
#define USB_FW_MSC_PRODUCT_ID "MCU-S2 ESP32S2" // max 16 chars | ||
#define USB_FW_MSC_PRODUCT_REVISION "1.00" // max 4 chars | ||
#define USB_FW_MSC_VOLUME_NAME "senseBox" // max 11 chars | ||
#define USB_FW_MSC_SERIAL_NUMBER 0x00000000 | ||
|
||
#define EXTERNAL_NUM_INTERRUPTS 46 | ||
#define NUM_DIGITAL_PINS 48 | ||
#define NUM_ANALOG_INPUTS 20 | ||
|
||
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1) | ||
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) | ||
#define digitalPinHasPWM(p) (p < 46) | ||
|
||
#define PIN_NEOPIXEL 1 // NeoPixel LED | ||
#define NEOPIXEL_PIN 1 // NeoPixel LED | ||
#define NEOPIXEL_NUM 1 // number of neopixels | ||
|
||
// Default I2C QWIIC-Ports | ||
static const uint8_t SDA = 39; | ||
static const uint8_t SCL = 40; | ||
#define PIN_QWIIC_SDA 39 | ||
#define PIN_QWIIC_SCL 40 | ||
|
||
// Secondary I2C MPU6050 | ||
#define WIRE1_PIN_DEFINED 1 // See Wire.cpp at bool TwoWire::initPins(int sdaPin, int sclPin) | ||
static const uint8_t SCL1 = 42; | ||
static const uint8_t SDA1 = 45; | ||
#define PIN_I2C_SCL 42 | ||
#define PIN_I2C_SDA 45 | ||
#define PIN_I2C_INT 46 | ||
|
||
// SPI | ||
static const uint8_t SS = 42; | ||
static const uint8_t MOSI = 35; | ||
static const uint8_t SCK = 36; | ||
static const uint8_t MISO = 37; | ||
|
||
// XBEE Pins | ||
#define PIN_XBEE_ENABLE 41 | ||
#define PIN_XBEE_INT 33 | ||
#define PIN_XBEE_CS 34 | ||
#define PIN_XBEE_MOSI 35 | ||
#define PIN_XBEE_SCLK 36 | ||
#define PIN_XBEE_MISO 37 | ||
#define PIN_XBEE_RESET 38 | ||
#define PIN_XBEE_TXD 17 | ||
#define PIN_XBEE_RXD 18 | ||
|
||
// Alias XB1 | ||
#define PIN_XB1_ENABLE 41 | ||
#define PIN_XB1_INT 33 | ||
#define PIN_XB1_CS 34 | ||
#define PIN_XB1_MOSI 35 | ||
#define PIN_XB1_SCLK 36 | ||
#define PIN_XB1_MISO 37 | ||
#define PIN_XB1_RESET 38 | ||
#define PIN_XB1_TXD 17 | ||
#define PIN_XB1_RXD 18 | ||
|
||
// IO Pins | ||
#define PIN_LED 1 | ||
#define PIN_IO2 2 | ||
#define PIN_IO3 3 | ||
#define PIN_IO4 4 | ||
#define PIN_IO5 5 | ||
#define PIN_IO6 6 | ||
#define PIN_IO7 7 | ||
#define IO_ENABLE 8 | ||
|
||
static const uint8_t A2 = PIN_IO2; | ||
static const uint8_t A3 = PIN_IO3; | ||
static const uint8_t A4 = PIN_IO4; | ||
static const uint8_t A5 = PIN_IO5; | ||
static const uint8_t A6 = PIN_IO6; | ||
static const uint8_t A7 = PIN_IO7; | ||
|
||
static const uint8_t D2 = PIN_IO2; | ||
static const uint8_t D3 = PIN_IO3; | ||
static const uint8_t D4 = PIN_IO4; | ||
static const uint8_t D5 = PIN_IO5; | ||
static const uint8_t D6 = PIN_IO6; | ||
static const uint8_t D7 = PIN_IO7; | ||
|
||
// UART Port | ||
static const uint8_t TX = 43; | ||
static const uint8_t RX = 44; | ||
#define PIN_UART_TXD 43 | ||
#define PIN_UART_RXD 44 | ||
#define PIN_UART_ENABLE 26 | ||
|
||
// UART XBee | ||
static const uint8_t TX1 = 17; | ||
static const uint8_t RX1 = 18; | ||
|
||
// PD-Sensor | ||
#define PD_SENSE 14 | ||
#define PD_ENABLE 21 | ||
#define PIN_PD_ENABLE 21 | ||
|
||
// SD-Card | ||
#define VSPI_MISO 13 | ||
#define VSPI_MOSI 11 | ||
#define VSPI_SCLK 12 | ||
#define VSPI_SS 10 | ||
#define SD_ENABLE 9 | ||
|
||
#define PIN_SD_ENABLE 9 | ||
#define PIN_SD_CS 10 | ||
#define PIN_SD_MOSI 11 | ||
#define PIN_SD_SCLK 12 | ||
#define PIN_SD_MISO 13 | ||
|
||
// USB | ||
#define PIN_USB_DM 19 | ||
#define PIN_USB_DP 20 | ||
|
||
// Touch Pins | ||
static const uint8_t T2 = PIN_IO2; | ||
static const uint8_t T3 = PIN_IO3; | ||
static const uint8_t T4 = PIN_IO4; | ||
static const uint8_t T5 = PIN_IO5; | ||
static const uint8_t T6 = PIN_IO6; | ||
static const uint8_t T7 = PIN_IO7; | ||
|
||
|
||
static const uint8_t DAC1 = 17; | ||
static const uint8_t DAC2 = 18; | ||
|
||
|
||
#endif /* Pins_Arduino_h */ |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2021 Ha Thach (tinyusb.org) for Adafruit Industries | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
|
||
#include "esp32-hal-gpio.h" | ||
#include "pins_arduino.h" | ||
|
||
extern "C" { | ||
|
||
// Initialize variant/board, called before setup() | ||
void initVariant(void) | ||
{ | ||
//enable IO Pins by default | ||
pinMode(IO_ENABLE, OUTPUT); | ||
digitalWrite(IO_ENABLE,LOW); | ||
|
||
//reset RGB | ||
pinMode(PIN_NEOPIXEL, OUTPUT); | ||
digitalWrite(PIN_NEOPIXEL, LOW); | ||
|
||
//enable XBEE by default | ||
pinMode(PIN_XB1_ENABLE, OUTPUT); | ||
digitalWrite(PIN_XB1_ENABLE, LOW); | ||
|
||
//enable UART by default | ||
pinMode(PIN_UART_ENABLE, OUTPUT); | ||
digitalWrite(PIN_UART_ENABLE, LOW); | ||
|
||
//enable PD-Sensor by default | ||
pinMode(PD_ENABLE, OUTPUT); | ||
digitalWrite(PD_ENABLE, HIGH); | ||
|
||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As its 2.x branch, you are missing this part:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@P-R-O-C-H-Y thank you! Just added the missing stuff.