Merge branch 'espressif:master' into pycams3

This commit is contained in:
Limor "Ladyada" Fried 2023-09-16 14:58:39 -04:00 committed by GitHub
commit 09ae354372
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
48 changed files with 3092 additions and 373 deletions

View file

@ -41,6 +41,8 @@ body:
options:
- latest master (checkout manually)
- latest development Release Candidate (RC-X)
- v2.0.13
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9

View file

@ -32,7 +32,11 @@ jobs:
test-chunks: ${{ steps['set-test-chunks'].outputs['test-chunks'] }}
steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.branch }}
- run: npm install
- name: Setup jq
uses: dcarbone/install-jq-action@v1.0.1
@ -63,6 +67,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.branch }}
- name: Echo FQBNS to file
run:

2067
boards.txt

File diff suppressed because it is too large Load diff

View file

@ -173,9 +173,18 @@ void HWCDC::begin(unsigned long baud)
if(tx_lock == NULL) {
tx_lock = xSemaphoreCreateMutex();
}
setRxBufferSize(256);//default if not preset
setTxBufferSize(256);//default if not preset
//RX Buffer default has 256 bytes if not preset
if(rx_queue == NULL) {
if (!setRxBufferSize(256)) {
log_e("HW CDC RX Buffer error");
}
}
//TX Buffer default has 256 bytes if not preset
if (tx_ring_buf == NULL) {
if (!setTxBufferSize(256)) {
log_e("HW CDC TX Buffer error");
}
}
usb_serial_jtag_ll_disable_intr_mask(USB_SERIAL_JTAG_LL_INTR_MASK);
usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_LL_INTR_MASK);
usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT | USB_SERIAL_JTAG_INTR_BUS_RESET);

View file

@ -446,7 +446,7 @@ void HardwareSerial::end(bool fullyTerminate)
_rxPin = _txPin = _ctsPin = _rtsPin = -1;
}
delay(10);
uartEnd(_uart);
_uart = 0;
_destroyEventTask();

View file

@ -16,8 +16,12 @@
#ifdef CONFIG_BT_ENABLED
#if CONFIG_IDF_TARGET_ESP32
bool btInUse(){ return true; }
#else
// user may want to change it to free resources
__attribute__((weak)) bool btInUse(){ return true; }
#endif
#include "esp_bt.h"

View file

@ -51,7 +51,7 @@ extern "C" {
#define PULLDOWN 0x08
#define INPUT_PULLDOWN 0x09
#define OPEN_DRAIN 0x10
#define OUTPUT_OPEN_DRAIN 0x12
#define OUTPUT_OPEN_DRAIN 0x13
#define ANALOG 0xC0
//Interrupt Modes

View file

@ -234,13 +234,13 @@ void analogWrite(uint8_t pin, int value) {
return;
}
ledcAttachPin(pin, channel);
pin_to_channel[pin] = channel;
pin_to_channel[pin] = channel + 1;
ledcWrite(channel, value);
}
}
int8_t analogGetChannel(uint8_t pin) {
return pin_to_channel[pin];
return pin_to_channel[pin] - 1;
}
void analogWriteFrequency(uint32_t freq) {

View file

@ -209,9 +209,15 @@ bool verifyRollbackLater() { return false; }
#endif
#ifdef CONFIG_BT_ENABLED
#if CONFIG_IDF_TARGET_ESP32
//overwritten in esp32-hal-bt.c
bool btInUse() __attribute__((weak));
bool btInUse(){ return false; }
#else
//from esp32-hal-bt.c
extern bool btInUse();
#endif
#endif
void initArduino()
{

View file

@ -48,8 +48,8 @@ This function will return analog value in millivolts.
analogReadResolution
^^^^^^^^^^^^^^^^^^^^
This function is used to set the resolution of ``analogRead`` return value. Default is 12 bits (range from 0 to 4096)
for all chips except ESP32S3 where default is 13 bits (range from 0 to 8192).
This function is used to set the resolution of ``analogRead`` return value. Default is 12 bits (range from 0 to 4095)
for all chips except ESP32S3 where default is 13 bits (range from 0 to 8191).
When different resolution is set, the values read will be shifted to match the given resolution.
Range is 1 - 16 .The default value will be used, if this function is not used.
@ -205,4 +205,4 @@ Here is an example of how to use the ADC.
.. literalinclude:: ../../../libraries/ESP32/examples/AnalogRead/AnalogRead.ino
:language: arduino
Or you can run Arduino example 01.Basics -> AnalogReadSerial.
Or you can run Arduino example 01.Basics -> AnalogReadSerial.

View file

@ -14,21 +14,4 @@ Note that modifying ``sdkconfig`` or ``sdkconfig.h`` files found in the arduino-
How to compile libs with different debug level?
-----------------------------------------------
The short answer is ``esp32-arduino-lib-builder/configs/defconfig.common:44``. A guide explaining the process can be found here <guides/core_debug>
SPIFFS mount failed
-------------------
When you come across and error like this:
.. code-block:: shell
E (588) SPIFFS: mount failed, -10025
[E][SPIFFS.cpp:47] begin(): Mounting SPIFFS failed! Error: -1
Try enforcing format on fail in your code by adding ``true`` in the ``begin`` method such as this:
.. code-block:: c++
SPIFFS.begin(true);
See the method prototype for reference: ``bool begin(bool formatOnFail=false, const char * basePath="/spiffs", uint8_t maxOpenFiles=10, const char * partitionLabel=NULL);``
The short answer is ``esp32-arduino-lib-builder/configs/defconfig.common:44``. A guide explaining the process can be found here <guides/core_debug>

View file

@ -33,7 +33,7 @@ Solution
To avoid this error, you can install the ``python-is-python3`` package to create the symbolic links.
.. code-block:: bash
sudo apt install python-is-python3
If you are not using Ubuntu, you can check if you have the Python correctly installed or the presence of the symbolic links/environment variables.
@ -44,7 +44,7 @@ Flashing
Why is my board not flashing/uploading when I try to upload my sketch?
**********************************************************************
To be able to upload the sketch via serial interface, the ESP32 must be in the download mode. The download mode allows you to upload the sketch over the serial port and to get into it, you need to keep the **GPIO0** in LOW while a resetting (**EN** pin) cycle.
To be able to upload the sketch via the serial interface, the ESP32 must be in the download mode. The download mode allows you to upload the sketch over the serial port, and to get into it, you need to keep the **GPIO0** in LOW while resetting (**EN** pin) the cycle.
If you are trying to upload a new sketch and your board is not responding, there are some possible reasons.
Possible fatal error message from the Arduino IDE:
@ -54,23 +54,26 @@ Possible fatal error message from the Arduino IDE:
Solution
^^^^^^^^
Here are some steps that you can try to:
Here are some steps that you can try:
* Check your USB cable and try a new one.
* Change the USB port.
* Check your USB cable and try a new one (some cables are only for charging and there is no data connection).
* Change the USB port - prefer direct connection to the computer and avoid USB hubs. Some USB ports may share the power source with other ports used, for example, for charging a phone.
* Check your power supply.
* Make sure that nothing is connected to pins labeled **TX** and **RX**. Please refer to the pin layout table - some TX and RX pins may not be labeled on the dev board.
* In some instances, you must keep **GPIO0** LOW during the uploading process via the serial interface.
* Hold down the **“BOOT”** button in your ESP32 board while uploading/flashing.
* Hold down the **“BOOT”** button on your ESP32 board while uploading/flashing.
* Solder a **10uF** capacitor in parallel with **RST** and **GND**.
* If you are using external power connected to pins, it is easy to confuse pins **CMD** (which is usually next to the 5V pin) and **GND**.
In some development boards, you can try adding the reset delay circuit, as described in the *Power-on Sequence* section on the `ESP32 Hardware Design Guidelines <https://www.espressif.com/sites/default/files/documentation/esp32_hardware_design_guidelines_en.pdf>`_ in order to get into the download mode automatically.
In some development boards, you can try adding the reset delay circuit, as described in the *Power-on Sequence* section on the `ESP32 Hardware Design Guidelines <https://www.espressif.com/sites/default/files/documentation/esp32_hardware_design_guidelines_en.pdf>`_ to get into the download mode automatically.
Hardware
--------
Why is my computer not detecting my board?
**************************************************
******************************************
If your board is not being detected after connecting to the USB, you can try to:
If your board is not being detected after connecting to the USB, you can try the following:
Solution
^^^^^^^^
@ -87,8 +90,8 @@ Wi-Fi
Why does the board not connect to WEP/WPA-"encrypted" Wi-Fi?
************************************************************
Please note that WEP/WPA has significant security vulnerabilities and its use is strongly discouraged.
The support may therefore be removed in the future. Please migrate to WPA2 or newer.
Please note that WEP/WPA has significant security vulnerabilities, and its use is strongly discouraged.
The support may, therefore, be removed in the future. Please migrate to WPA2 or newer.
Solution
^^^^^^^^
@ -104,7 +107,7 @@ Nevertheless, it may be necessary to connect to insecure networks. To do this, t
Why does the board not connect to WPA3-encrypted Wi-Fi?
*******************************************************
WPA3 support is resource intensive and may not be compiled into the used SDK.
WPA3 support is resource-intensive and may not be compiled into the used SDK.
Solution
^^^^^^^^
@ -119,3 +122,120 @@ Sample code to check SDK WPA3 support at compile time:
#ifndef CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE
#warning "No WPA3 support."
#endif
SPIFFS mount failed
-------------------
When you come across an error like this:
.. code-block:: shell
E (588) SPIFFS: mount failed, -10025
[E][SPIFFS.cpp:47] begin(): Mounting SPIFFS failed! Error: -1
Try enforcing format on fail in your code by adding ``true`` in the ``begin`` method such as this:
.. code-block:: c++
SPIFFS.begin(true);
See the method prototype for reference: ``bool begin(bool formatOnFail=false, const char * basePath="/spiffs", uint8_t maxOpenFiles=10, const char * partitionLabel=NULL);``
SD card mount fail
------------------
Even though you made sure that the pins are correctly connected, and not using restricted pins, you may still get an error such as this:
.. code-block:: shell
[ 1065][E][sd_diskio.cpp:807] sdcard_mount(): f_mount failed: (3) The physical drive cannot work
Most of the problems originate from a poor connection caused by prototyping cables/wires, and one of the best solutions is to **solder all the connections** or use good quality connectors.
Note that with SD_MMC lib all the data pins need to be pulled up with an external 10k to 3.3V. This applies especially to card's D3 which needs to be pulled up even when using 1-bit line connection and the D3 is not used.
If you want to try the software approach before soldering, try manually specifying SPI pins, like this:
.. code-block:: c++
int SD_CS_PIN = 19;
SPI.begin(18, 36, 26, SD_CS_PIN);
SPI.setDataMode(SPI_MODE0);
SD.begin(SD_CS_PIN);
ESP32-S3 is rebooting even with a bare minimum sketch
*****************************************************
Some ESP32-S3 boards are equipped with Quad SPI (QSPI) or Octal SPI (OPI) PSRAM. If you upload such a board with default settings for ESP32-S3, it will result in rebooting with a message similar to this:
https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/flash_psram_config.html
.. code-block:: bash
E (124) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0
Rebooting...
⸮⸮⸮ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x18 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40376af0
SPIWP:0xee
Octal Flash Mode Enabled
For OPI Flash, Use Default Flash Boot Mode
mode:SLOW_RD, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbec
load:0x403cc700,len:0x2920
entry 0x403c98d8
assert failed: do_core_init startup.c:326 (flash_ret == ESP_OK)
To fix the issue, you will need to find out the precise module you are using and set **PSRAM** in the Arduino IDE Tools according to the following table.
How to determine the module version:
------------------------------------
* First determine if you have a `WROOM-1 <https://www.espressif.com/sites/default/files/documentation/esp32-s3-wroom-1_wroom-1u_datasheet_en.pdf>`_ or `WROOM-2 <https://www.espressif.com/sites/default/files/documentation/esp32-s3-wroom-2_datasheet_en.pdf>`_ module - this is written on the module shielding almost at the top, right under the ESP logo and company name (Espresif) right after the ESP32-S3 - for example ESP32-S3-WROOM-2.
* Then locate the version code on left bottom corner on the module shielding. The markings are very small and it might be really difficult to read with naked eyes - try using a camera with careful lighting.
With this knowledge find your module in the table and note what is written in the **PSRAM** column.
- If the results is empty (-) you don't need to change anything
- For QSPI go to Tools > PSRAM > QSPI PSRAM
- For OPI go to Tools > PSRAM > OPI PSRAM
Note that WROOM-2 has always OPI.
+---------+--------+------------+-------+
| Module | Code | Flash Mode | PSRAM |
+=========+========+============+=======+
| WROOM-1 | N4 | QSPI | - |
+---------+--------+------------+-------+
| WROOM-1 | N8 | QSPI | - |
+---------+--------+------------+-------+
| WROOM-1 | N16 | QSPI | - |
+---------+--------+------------+-------+
| WROOM-1 | H4 | QSPI | - |
+---------+--------+------------+-------+
| WROOM-1 | N4R2 | QSPI | QSPI |
+---------+--------+------------+-------+
| WROOM-1 | N8R2 | QSPI | QSPI |
+---------+--------+------------+-------+
| WROOM-1 | N16R2 | QSPI | QSPI |
+---------+--------+------------+-------+
| WROOM-1 | N4R8 | QSPI | OPI |
+---------+--------+------------+-------+
| WROOM-1 | N8R8 | QSPI | OPI |
+---------+--------+------------+-------+
| WROOM-1 | N16R8 | QSPI | OPI |
+---------+--------+------------+-------+
| WROOM-2 | N16R8V | OPI | OPI |
+---------+--------+------------+-------+
| WROOM-2 | N16R8V | OPI | OPI |
+---------+--------+------------+-------+
| WROOM-2 | N32R8V | OPI | OPI |
+---------+--------+------------+-------+
Further Help
------------
If you encounter any other issues or need further assistance, please consult the `ESP32 Arduino Core <https://github.com/espressif/arduino-esp32>`_ documentation or seek help from the `ESP32 community forums <https://esp32.com>`_.

View file

@ -23,7 +23,7 @@ ESP32-S3 CDC and DFU
It's important that your board includes the USB connector attached to the embedded USB from the SoC. If your board doesn't have the USB connector, you can attach an external one to the USB pins.
These instructions it will only work on the supported devices with the embedded USB peripheral. This tutorial will not work if you are using an external USB-to-serial converter like FTDI, CP2102, CH340, etc.
These instructions will only work on the supported devices with the embedded USB peripheral. This tutorial will not work if you are using an external USB-to-serial converter like FTDI, CP210x, CH340, etc.
For a complete reference to the Arduino IDE tools menu, please see the `Tools Menus <../guides/tools_menu.html>`_ reference guide.

View file

@ -35,6 +35,7 @@ To use this functionality, we must be aware of some precautions:
* Some of the GPIOs are **INPUT** only.
* Some peripherals have output signals and must be used on GPIO's capable to be configured as **OUTPUT**.
* Some peripherals, mostly the high speed ones, ADC, DAC, Touch, and JTAG use dedicated GPIOs pins.
* Some pins are used to connect flash memory on the module - this prevents them from any other use - if a peripheral is routed to one of these pins the device will not be able to boot.
.. warning::
Before assigning the peripheral pins in your design, double check if the pins you're using are appropriate.

View file

@ -131,7 +131,21 @@ Here is an example you can use for a custom partition table:
This partition will use about 12MB of the 16MB flash. The offset will be automatically calculated after the first application partition and the units are in K and M.
A alternative is to create the new partition table as a new file in the `tools/partitions <https://github.com/espressif/arduino-esp32/tree/master/tools/partitions>`_ folder and edit the `boards.txt <https://github.com/espressif/arduino-esp32/tree/master/boards.txt>`_ file to add your custom partition table.
An alternative is to create the new partition table as a new file in the `tools/partitions <https://github.com/espressif/arduino-esp32/tree/master/tools/partitions>`_ folder and edit the `boards.txt <https://github.com/espressif/arduino-esp32/tree/master/boards.txt>`_ file to add your custom partition table.
Another alternative is to create the new partition table as a new file, and place it in the `variants <https://github.com/espressif/arduino-esp32/tree/master/variants>`_ folder under your boards folder, and edit the `boards.txt <https://github.com/espressif/arduino-esp32/tree/master/boards.txt>`_ file to add your custom partition table, noting that in order for the compiler to find your custom partition table file you must use the '.build.custom_partitions=' option in the boards.txt file, rather than the standard '.build.partitions=' option. The '.build.variant=' option has the name of the folder holding your custom partition table in the variants folder.
An example of the PartitionScheme listing using the ESP32S3 Dev Module as a reference, would be to have the following:
**Custom Partition - CSV file in /variants/custom_esp32s3/ folder**
.. code-block::
esp32s3.build.variant=custom_esp32s3
--
esp32s3.menu.PartitionScheme.huge_app=Custom Huge APP (3MB No OTA/1MB SPIFFS)
esp32s3.menu.PartitionScheme.huge_app.build.custom_partitions=custom_huge_app
esp32s3.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
Examples
--------

View file

@ -1,42 +1,52 @@
# SD library
This library provides the integration of ESP32 and SD (Secure Digital) cards without additional modules.
This library provides the integration of ESP32 and SD (Secure Digital) and MMC (Multi Media Card) cards without additional modules. This library is using SPI to interface with the cards. Please note that SPI mode is slower than the intended SD or MMC mode, however, provides more flexibility as the SPI module is available on all ESP SoCs and can be routed to any GPIO through GPIO matrix.
## Sample wiring diagram:
![Connections](http://i.imgur.com/4CoXOuR.png)
![SD card pins](http://i.imgur.com/4CoXOuR.png)
For others SD formats:
For other SD formats:
![Other SD card formats](https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/MMC-SD-miniSD-microSD-Color-Numbers-Names.gif/330px-MMC-SD-miniSD-microSD-Color-Numbers-Names.gif)
Image source: [Wikipedia](https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/MMC-SD-miniSD-microSD-Color-Numbers-Names.gif/330px-MMC-SD-miniSD-microSD-Color-Numbers-Names.gif)
```diff
- Warning: Some ESP32 modules have different pinouts!
```
> **Warning**
Some ESP32 modules have different pin outs!
## Default SPI pins:
Note that SPI pins can be configured by using `SPI.begin(sck, miso, mosi, cs);` alternatively, you can change only the CS pin with `SD.begin(CSpin)`
+--------------+---------+-------+----------+----------+----------+
| SPI Pin Name | ESP8266 | ESP32 | ESP32-S2 | ESP32-C3 | ESP32-S3 |
+==============+=========+=======+==========+==========+==========+
| CS (SS) | GPIO15 | GPIO5 | GPIO5 | GPIO13 | GPIO13 |
+--------------+---------+-------+----------+----------+----------+
| DI (MOSI) | GPIO13 | GPIO23| GPIO24 | GPIO14 | GPIO14 |
+--------------+---------+-------+----------+----------+----------+
| DO (MISO) | GPIO12 | GPIO19| GPIO25 | GPIO15 | GPIO15 |
+--------------+---------+-------+----------+----------+----------+
| SCK (SCLK) | GPIO14 | GPIO18| GPIO19 | GPIO16 | GPIO16 |
+--------------+---------+-------+----------+----------+----------+
## FAQ:
**Do I need any additional modules, like Arduino SD module?**
**Do I need any additional modules**, like **the **Arduino**** SD module**?**
No, just wire your SD card directly to ESP32.
Tip: If you are using a microSD card and have a spare adapter to full-sized SD, you can solder Dupont pins on the adapter.
**What is the difference between SD and SD_MMC libraries?**
SD runs on SPI, and SD_MMC uses the SDMMC hardware bus on the ESP32.
The SPI uses 4 communication pins + 2 power connections and operates on up to 80MHz. The SPI option offers flexibility on pin connection because the data connections can be routed through GPIO matrix to any data pin.
SD-SPI speed is approximately half of the SD-MMC even when used on 1-bit line.
You can read more about SD SPI in the [documentation](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/sdspi_host.html)
**Can I change the CS pin?**
Yes, just use: `SD.begin(CSpin)`
SD_MMC is supported only by ESP32 and ESP32-S3 and can be connected only to dedicated pins. SD_MMC allows to use of 1, 4 or 8 data pins + 2 additional communication pins and 2 power pins. The data pins need to be pulled up externally.
You can read more about SD_MMC in the [documentation](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/sdmmc_host.html)
1-bit: SD_MMC_ speed is approximately two-times faster than SPI mode
4-bit: SD_MMC speed is approximately three-times faster than SPI mode.

View file

@ -95,8 +95,9 @@ uint64_t SDFS::totalBytes()
{
FATFS* fsinfo;
DWORD fre_clust;
if(f_getfree("0:",&fre_clust,&fsinfo)!= 0) return 0;
uint64_t size = ((uint64_t)(fsinfo->csize))*(fsinfo->n_fatent - 2)
char drv[3] = {(char)(48+_pdrv), ':', 0};
if(f_getfree(drv,&fre_clust,&fsinfo)!= 0) return 0;
uint64_t size = ((uint64_t)(fsinfo->csize))*(fsinfo->n_fatent - 2)
#if _MAX_SS != 512
*(fsinfo->ssize);
#else
@ -109,7 +110,8 @@ uint64_t SDFS::usedBytes()
{
FATFS* fsinfo;
DWORD fre_clust;
if(f_getfree("0:",&fre_clust,&fsinfo)!= 0) return 0;
char drv[3] = {(char)(48+_pdrv), ':', 0};
if(f_getfree(drv,&fre_clust,&fsinfo)!= 0) return 0;
uint64_t size = ((uint64_t)(fsinfo->csize))*((fsinfo->n_fatent - 2) - (fsinfo->free_clst))
#if _MAX_SS != 512
*(fsinfo->ssize);

View file

@ -616,6 +616,9 @@ unknown_card:
DSTATUS ff_sd_status(uint8_t pdrv)
{
ardu_sdcard_t * card = s_cards[pdrv];
AcquireSPI lock(card);
if(sdTransaction(pdrv, SEND_STATUS, 0, NULL))
{
log_e("Check status failed");

112
libraries/SD_MMC/README.md Normal file
View file

@ -0,0 +1,112 @@
# SD_MMC library
This library provides the integration of ESP32 and ESP32-S3 with SD (Secure Digital) and MMC (Multi Media Card) cards using a built-in SDMMC module.
Please note that SD_MMC is only available for ESP32 and ESP32-S3. For other SoCs please use the SD library based on SPI.
## Wiring:
![SD cards pins](https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/MMC-SD-miniSD-microSD-Color-Numbers-Names.gif/330px-MMC-SD-miniSD-microSD-Color-Numbers-Names.gif)
Image source: [Wikipedia](https://upload.wikimedia.org/wikipedia/commons/thumb/a/ab/MMC-SD-miniSD-microSD-Color-Numbers-Names.gif/330px-MMC-SD-miniSD-microSD-Color-Numbers-Names.gif)
![SD and MMC pins](https://upload.wikimedia.org/wikipedia/commons/f/ff/15-04-29-MMC-Karte-dscf4734-e.jpg)
Image source: [Wikipedia](https://commons.wikimedia.org/wiki/File:15-04-29-MMC-Karte-dscf4734-e.jpg)
pin number (refer to the picture) | micro SD - SD mode | micro SD - SPI mode | mini SD - SD mode | mini SD - SPI mode | SD - SD mode | SD - SPI mode | MMC (MMC3) - MMC mode | MMC (MMC3) - SPI mode | MMCplus / MMCmobile (MMC4) - MMC mode | MMCplus / MMCmobile (MMC4) - SPI mode
----------------------------------|--------------------|---------------------|-------------------|--------------------|--------------|---------------|-----------------------|-----------------------|---------------------------------------|
1 | D2 | not used | D3 | CS | D3 | CS | RES | CS | D3 | CS
2 | D3 | CS | CMD | DI | CMD | DI | CMD | DI | CMD | DI
3 | CMD | DI | VSS1 (GND) | VSS1 (GND) | VSS1 (GND) | VSS1 (GND) | VSS1 (GND) | VSS1 (GND) | VSS1 (GND) | VSS1 (GND)
4 | VDD (3.3V) | VDD (3.3V) | VDD (3.3V) | VDD (3.3V) | VDD (3.3V) | VDD (3.3V) | VDD (3.3V) | VDD (3.3V) | VDD (3.3V) | VDD (3.3V)
5 | CLK | SCLK | CLK | SCLK | CLK | SCLK | CLK | SCLK | CLK | SCLK
6 | VSS (GND) | VSS (GND) | VSS2 (GND) | VSS2 (GND) | VSS2 (GND) | VSS2 (GND) | VSS2 (GND) | VSS2 (GND) | VSS2 (GND) | VSS2 (GND)
7 | D0 | DO | D0 | DO | D0 | DO | DAT | DO | D0 | DO
8 | D1 | not used | D1 | not used | D1 | not used | - | - | D1 | not used
9 | - | - | D2 | not used | D2 | not used | - | - | D2 | not used
10 | - | - | For future use | For future use | - | - | - | - | D3 | not used
11 | - | - | For future use | For future use | - | - | - | - | D4 | not used
12 | - | - | - | - | - | - | - | - | D5 | not used
13 | - | - | - | - | - | - | - | - | D6 | not used
### Pin assignments for ESP32
On ESP32, SD_MMC peripheral is connected to specific GPIO pins and cannot be changed (rerouted). Please see the table below for the pin connections.
When using an ESP-WROVER-KIT board, this example runs without any extra modifications required. Only an SD card needs to be inserted into the slot.
ESP32 pin | SD card pin | Notes
--------------|-------------|------------
GPIO14 (MTMS) | CLK | 10k pullup in SD mode
GPIO15 (MTDO) | CMD | 10k pullup in SD mode
GPIO2 | D0 | 10k pullup in SD mode, pull low to go into download mode (see Note about GPIO2 below!)
GPIO4 | D1 | not used in 1-line SD mode; 10k pullup in 4-line SD mode
GPIO12 (MTDI) | D2 | not used in 1-line SD mode; 10k pullup in 4-line SD mode (see Note about GPIO12 below!)
GPIO13 (MTCK) | D3 | not used in 1-line SD mode, but card's D3 pin must have a 10k pullup
### Pin assignments for ESP32-S3
On ESP32-S3, SDMMC peripheral is connected to GPIO pins using GPIO matrix. This allows arbitrary GPIOs to be used to connect an SD card or MMC. The GPIOs can be configured with the following commands:
```
setPins(int clk, int cmd, int d0))
setPins(int clk, int cmd, int d0, int d1, int d2, int d3))
```
The table below lists the default pin assignments.
When using an ESP32-S3-USB-OTG board, this example runs without any extra modifications required. Only an SD card needs to be inserted into the slot.
ESP32-S3 pin | SD card pin | Notes
--------------|-------------|------------
GPIO36 | CLK | 10k pullup
GPIO35 | CMD | 10k pullup
GPIO37 | D0 | 10k pullup
GPIO38 | D1 | not used in 1-line SD mode; 10k pullup in 4-line mode
GPIO33 | D2 | not used in 1-line SD mode; 10k pullup in 4-line mode
GPIO34 | D3 | not used in 1-line SD mode, but card's D3 pin must have a 10k pullup
Warning: ESP32-S3-WROOM-2 is using most of the default GPIOs (33-37) to interface with on-board OPI flash. If the SD_MMC is initialized with default pins it will result in rebooting loop - please reassign the pins elsewhere using the mentioned command `setPins`.
> **Note:** ESP32-S3-DevKitC-1 v1.1 does NOT have GPIOs 33 and 34 broken out, so it will be necessary to change at least the pin for D2 and D3.
### 4-line and 1-line SD modes
By default, this library uses 4-bit line mode, utilizing 6 pins: CLK, CMD, D0 - D3 and 2 power lines (3.3V and GND). It is possible to use 1-bit line mode (CLK, CMD, D0, 3.3V, GND) by passing the second argument `mode1bit==true`:
```
SD_MMC.begin("/sdcard", true);
```
> **Note:** Even if card's D3 line is not connected to the ESP chip, it still has to be pulled up, otherwise the card will go into SPI protocol mode.
### Note about GPIO2 (ESP32 only)
GPIO2 pin is used as a bootstrapping pin, and should be low to enter UART download mode. One way to do this is to connect GPIO0 and GPIO2 using a jumper, and then the auto-reset circuit on most development boards will pull GPIO2 low along with GPIO0, when entering download mode.
- Some boards have pulldown and/or LED on GPIO2. LED is usually ok, but pulldown will interfere with D0 signals and must be removed. Check the schematic of your development board for anything connected to GPIO2.
### Note about GPIO12 (ESP32 only)
GPIO12 is used as a bootstrapping pin to select output voltage of an internal regulator which powers the flash chip (VDD_SDIO). This pin has an internal pulldown so if left unconnected it will read low at reset (selecting default 3.3V operation). When adding a pullup to this pin for SD card operation, consider the following:
## FAQ:
#### Do I need any additional modules, like the Arduino SD module?
No, just wire your SD card directly to ESP32.
Tip: If you are using a microSD card and have a spare adapter to full-sized SD, you can solder Dupont pins on the adapter.
#### What is the difference between SD and SD_MMC libraries?
SD runs on SPI, and SD_MMC uses the SDMMC hardware bus on the ESP32.
The SPI uses 4 communication pins + 2 power connections and operates on up to 80MHz. The SPI option offers flexibility on pin connection because the data connections can be routed through GPIO matrix to any data pin.
SD-SPI speed is approximately half of the SD-MMC even when used on 1-bit line.
You can read more about SD SPI in the [documentation](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/sdspi_host.html)
SD_MMC is supported only by ESP32 and ESP32-S3 and can be connected only to dedicated pins. SD_MMC allows to use of 1, 4 or 8 data pins + 2 additional communication pins and 2 power pins. The data pins need to be pulled up externally.
You can read more about SD_MMC in the [documentation](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/sdmmc_host.html)
1-bit: SD_MMC_ speed is approximately two-times faster than SPI mode
4-bit: SD_MMC speed is approximately three-times faster than SPI mode.

View file

@ -11,11 +11,27 @@
* VSS GND
* D0 2 (add 1K pull up after flashing)
* D1 4
*
* For more info see file README.md in this library or on URL:
* https://github.com/espressif/arduino-esp32/tree/master/libraries/SD_MMC
*/
#include "FS.h"
#include "SD_MMC.h"
// Default pins for ESP-S3
// Warning: ESP32-S3-WROOM-2 is using most of the default GPIOs (33-37) to interface with on-board OPI flash.
// If the SD_MMC is initialized with default pins it will result in rebooting loop - please
// reassign the pins elsewhere using the mentioned command `setPins`.
// Note: ESP32-S3-WROOM-1 does not have GPIO 33 and 34 broken out.
// Note: if it's ok to use default pins, you do not need to call the setPins
int clk = 36;
int cmd = 35;
int d0 = 37;
int d1 = 38;
int d2 = 33;
int d3 = 39; // GPIO 34 is not broken-out on ESP32-S3-DevKitC-1 v1.1
void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
Serial.printf("Listing directory: %s\n", dirname);
@ -172,6 +188,17 @@ void testFileIO(fs::FS &fs, const char * path){
void setup(){
Serial.begin(115200);
/*
// If you want to change the pin assigment on ESP32-S3 uncomment this block and the appropriate
// line depending if you want to use 1-bit or 4-bit line.
// Please note that ESP32 does not allow pin change and will always fail.
//if(! setPins(clk, cmd, d0)){
//if(! setPins(clk, cmd, d0, d1, d2, d3)){
Serial.println("Pin change failed!");
return;
}
*/
if(!SD_MMC.begin()){
Serial.println("Card Mount Failed");
return;

View file

@ -93,7 +93,7 @@ bool SDMMCFS::begin(const char * mountpoint, bool mode1bit, bool format_if_mount
sdmmc_slot_config_t slot_config = SDMMC_SLOT_CONFIG_DEFAULT();
#ifdef SOC_SDMMC_USE_GPIO_MATRIX
// SoC supports SDMMC pin configuration via GPIO matrix.
// Chech that the pins have been set either in the constructor or setPins function.
// Check that the pins have been set either in the constructor or setPins function.
if (_pin_cmd == -1 || _pin_clk == -1 || _pin_d0 == -1
|| (!mode1bit && (_pin_d1 == -1 || _pin_d2 == -1 || _pin_d3 == -1))) {
log_e("SDMMCFS: some SD pins are not set");

View file

@ -190,6 +190,8 @@ class UpdateClass {
uint8_t _ledOn;
};
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_UPDATE)
extern UpdateClass Update;
#endif
#endif

View file

@ -414,4 +414,6 @@ bool UpdateClass::_chkDataInBlock(const uint8_t *data, size_t len) const {
return false;
}
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_UPDATE)
UpdateClass Update;
#endif

View file

@ -153,6 +153,13 @@ public:
size_t available(){
return _fill - _pos + r_available();
}
void flush(){
if(r_available()){
fillBuffer();
}
_pos = _fill;
}
};
class WiFiClientSocketHandle {
@ -501,26 +508,7 @@ int WiFiClient::available()
// Though flushing means to send all pending data,
// seems that in Arduino it also means to clear RX
void WiFiClient::flush() {
int res;
size_t a = available(), toRead = 0;
if(!a){
return;//nothing to flush
}
uint8_t * buf = (uint8_t *)malloc(WIFI_CLIENT_FLUSH_BUFFER_SIZE);
if(!buf){
return;//memory error
}
while(a){
toRead = (a>WIFI_CLIENT_FLUSH_BUFFER_SIZE)?WIFI_CLIENT_FLUSH_BUFFER_SIZE:a;
res = recv(fd(), buf, toRead, MSG_DONTWAIT);
if(res < 0) {
log_e("fail on fd %d, errno: %d, \"%s\"", fd(), errno, strerror(errno));
stop();
break;
}
a -= res;
}
free(buf);
_rxBuffer->flush();
}
uint8_t WiFiClient::connected()

View file

@ -0,0 +1,7 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x480000,
app1, app, ota_1, 0x490000,0x480000,
ffat, data, fat, 0x910000,0x16E0000,
coredump, data, coredump,0x1FF0000,0x10000,
1 # Name Type SubType Offset Size Flags
2 nvs data nvs 0x9000 0x5000
3 otadata data ota 0xe000 0x2000
4 app0 app ota_0 0x10000 0x480000
5 app1 app ota_1 0x490000 0x480000
6 ffat data fat 0x910000 0x16E0000
7 coredump data coredump 0x1FF0000 0x10000

View file

@ -0,0 +1,7 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x480000,
app1, app, ota_1, 0x490000,0x480000,
spiffs, data, spiffs, 0x910000,0x16E0000,
coredump, data, coredump,0x1FF0000,0x10000,
1 # Name Type SubType Offset Size Flags
2 nvs data nvs 0x9000 0x5000
3 otadata data ota 0xe000 0x2000
4 app0 app ota_0 0x10000 0x480000
5 app1 app ota_1 0x490000 0x480000
6 spiffs data spiffs 0x910000 0x16E0000
7 coredump data coredump 0x1FF0000 0x10000

View file

@ -0,0 +1,71 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#include "soc/soc_caps.h"
#define USB_VID 0x303a
#define USB_PID 0x1001
#define USB_MANUFACTURER "Aventen"
#define USB_PRODUCT "Aventen S3 Sync"
#define USB_SERIAL ""
#define NUM_DIGITAL_PINS SOC_GPIO_PIN_COUNT // GPIO 0..48
#define NUM_ANALOG_INPUTS 20 // GPIO 1..20
#define EXTERNAL_NUM_INTERRUPTS NUM_DIGITAL_PINS // All GPIOs
#define analogInputToDigitalPin(p) (((p)<NUM_ANALOG_INPUTS)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<NUM_DIGITAL_PINS)?(p):NOT_AN_INTERRUPT)
#define digitalPinHasPWM(p) (p < NUM_DIGITAL_PINS)
static const uint8_t TX = 43;
static const uint8_t RX = 44;
static const uint8_t SDA = 2;
static const uint8_t SCL = 3;
static const uint8_t SCL_1 = 21;
static const uint8_t SDA_1 = 20;
static const uint8_t SS = 10;
static const uint8_t MOSI = 11;
static const uint8_t MISO = 13;
static const uint8_t SCK = 12;
static const uint8_t ALS = 17;
static const uint8_t RGB_DI = 38;
static const uint8_t RF_SW = 37;
static const uint8_t A0 = 1;
static const uint8_t A1 = 2;
static const uint8_t A2 = 3;
static const uint8_t A3 = 4;
static const uint8_t A4 = 5;
static const uint8_t A5 = 6;
static const uint8_t A6 = 7;
static const uint8_t A7 = 8;
static const uint8_t A8 = 9;
static const uint8_t A9 = 10;
static const uint8_t A10 = 11;
static const uint8_t A11 = 12;
static const uint8_t A12 = 13;
static const uint8_t A13 = 14;
static const uint8_t A14 = 15;
static const uint8_t A15 = 16;
static const uint8_t T1 = 1;
static const uint8_t T2 = 2;
static const uint8_t T3 = 3;
static const uint8_t T4 = 4;
static const uint8_t T5 = 5;
static const uint8_t T6 = 6;
static const uint8_t T7 = 7;
static const uint8_t T8 = 8;
static const uint8_t T9 = 9;
static const uint8_t T10 = 10;
static const uint8_t T11 = 11;
static const uint8_t T12 = 12;
static const uint8_t T13 = 13;
static const uint8_t T14 = 14;
static const uint8_t T15 = 15;
#endif /* Pins_Arduino_h */

Binary file not shown.

View file

@ -0,0 +1,10 @@
# 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, app, ota_0, 0x10000, 2048K,
ota_1, app, ota_1, 0x210000, 2048K,
uf2, app, factory,0x410000, 256K,
ffat, data, fat, 0x450000, 11968K,
1 # ESP-IDF Partition Table
2 # Name, Type, SubType, Offset, Size, Flags
3 # bootloader.bin,, 0x1000, 32K
4 # partition table,, 0x8000, 4K
5 nvs, data, nvs, 0x9000, 20K,
6 otadata, data, ota, 0xe000, 8K,
7 ota_0, app, ota_0, 0x10000, 2048K,
8 ota_1, app, ota_1, 0x210000, 2048K,
9 uf2, app, factory,0x410000, 256K,
10 ffat, data, fat, 0x450000, 11968K,

View file

@ -0,0 +1,78 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#define USB_VID 0x239A
#define USB_PID 0x8145
#define USB_MANUFACTURER "Adafruit"
#define USB_PRODUCT "Metro ESP32-S3"
#define USB_SERIAL "" // Empty string for MAC adddress
#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 LED_BUILTIN 13
#define PIN_NEOPIXEL 45
#define NEOPIXEL_PIN 45
#define NEOPIXEL_NUM 1
#define PIN_BUTTON1 0 // BOOT0 switch
static const uint8_t TX = 40;
static const uint8_t RX = 41;
#define TX1 TX
#define RX1 RX
static const uint8_t SDA = 47;
static const uint8_t SCL = 48;
static const uint8_t SS = 21;
static const uint8_t MOSI = 35;
static const uint8_t SCK = 36;
static const uint8_t MISO = 37;
static const uint8_t A0 = 14;
static const uint8_t A1 = 15;
static const uint8_t A2 = 16;
static const uint8_t A3 = 17;
static const uint8_t A4 = 18;
static const uint8_t A5 = 1;
static const uint8_t A6 = 40;
static const uint8_t A7 = 41;
static const uint8_t A8 = 2;
static const uint8_t A9 = 3;
static const uint8_t A10 = 4;
static const uint8_t A11 = 5;
static const uint8_t A12 = 6;
static const uint8_t A13 = 7;
static const uint8_t A14 = 8;
static const uint8_t A15 = 9;
static const uint8_t A16 = 10;
static const uint8_t A17 = 11;
static const uint8_t A18 = 12;
static const uint8_t A19 = 13;
static const uint8_t T1 = 1;
static const uint8_t T2 = 2;
static const uint8_t T3 = 3;
static const uint8_t T4 = 4;
static const uint8_t T5 = 5;
static const uint8_t T6 = 6;
static const uint8_t T7 = 7;
static const uint8_t T8 = 8;
static const uint8_t T9 = 9;
static const uint8_t T10 = 10;
static const uint8_t T11 = 11;
static const uint8_t T12 = 12;
static const uint8_t T13 = 13;
static const uint8_t T14 = 14;
#endif /* Pins_Arduino_h */

Binary file not shown.

View file

@ -0,0 +1,37 @@
/*
* 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) {
// default SD_CS to input pullup
pinMode(SS, INPUT_PULLUP);
}
}

View file

@ -0,0 +1,5 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0xFE0000,
coredump, data,coredump, 0xFF0000, 0x10000,
1 # Name Type SubType Offset Size Flags
2 nvs data nvs 0x9000 0x5000
3 otadata data ota 0xe000 0x2000
4 app0 app ota_0 0x10000 0xFE0000
5 coredump data coredump 0xFF0000 0x10000

View file

@ -0,0 +1,7 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000,0x200000,
app1, app, ota_1, 0x210000,0x200000,
spiffs, data, spiffs, 0x410000,0xBE0000,
coredump, data, coredump,0xFF0000,0x10000,
1 # Name Type SubType Offset Size Flags
2 nvs data nvs 0x9000 0x5000
3 otadata data ota 0xe000 0x2000
4 app0 app ota_0 0x10000 0x200000
5 app1 app ota_1 0x210000 0x200000
6 spiffs data spiffs 0x410000 0xBE0000
7 coredump data coredump 0xFF0000 0x10000

View file

@ -0,0 +1,7 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x480000,
app1, app, ota_1, 0x490000,0x480000,
spiffs, data, spiffs, 0x910000,0x6E0000,
coredump, data, coredump,0xFF0000,0x10000,
1 # Name Type SubType Offset Size Flags
2 nvs data nvs 0x9000 0x5000
3 otadata data ota 0xe000 0x2000
4 app0 app ota_0 0x10000 0x480000
5 app1 app ota_1 0x490000 0x480000
6 spiffs data spiffs 0x910000 0x6E0000
7 coredump data coredump 0xFF0000 0x10000

View file

@ -0,0 +1,6 @@
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000,0x7F0000,
app1, app, ota_1, 0x800000,0x7F0000,
coredump, data,coredump, 0xFF0000, 0x10000,
1 # Name Type SubType Offset Size Flags
2 nvs data nvs 0x9000 0x5000
3 otadata data ota 0xe000 0x2000
4 app0 app ota_0 0x10000 0x7F0000
5 app1 app ota_1 0x800000 0x7F0000
6 coredump data coredump 0xFF0000 0x10000

View file

@ -0,0 +1,32 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#include "soc/soc_caps.h"
#define USB_VID 0x303a
#define USB_PID 0x1001
#define USB_MANUFACTURER "4D Systems Pty Ltd"
#define USB_PRODUCT "4D Systems gen4-ESP32 16MB Modules (ESP32-S3R8n16)"
//#define USB_CLASS 2
#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)
static const uint8_t TX = 43;
static const uint8_t RX = 44;
static const uint8_t SDA = 17;
static const uint8_t SCL = 18;
static const uint8_t SS = -1; // Modified elsewhere
static const uint8_t MOSI = -1; // Modified elsewhere
static const uint8_t MISO = -1; // Modified elsewhere
static const uint8_t SCK = -1; // Modified elsewhere
#endif /* Pins_Arduino_h */

View file

@ -0,0 +1,67 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#define USB_VID 0x1A86
#define USB_PID 0x55D4
#define USB_MANUFACTURER "Lilygo"
#define USB_PRODUCT "T-Display"
#define USB_SERIAL ""
#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 16
#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1)
#define digitalPinToInterrupt(p) (((p)<40)?(p):-1)
#define digitalPinHasPWM(p) (p < 34)
static const uint8_t TX = 1;
static const uint8_t RX = 3;
static const uint8_t SDA = 21;
static const uint8_t SCL = 22;
static const uint8_t SS = 5;
static const uint8_t MOSI = 23;
static const uint8_t MISO = 19;
static const uint8_t SCK = 18;
static const uint8_t A0 = 36;
static const uint8_t A3 = 39;
static const uint8_t A4 = 32;
static const uint8_t A5 = 33;
static const uint8_t A6 = 34;
static const uint8_t A7 = 35;
static const uint8_t A10 = 4;
static const uint8_t A11 = 0;
static const uint8_t A12 = 2;
static const uint8_t A13 = 15;
static const uint8_t A14 = 13;
static const uint8_t A15 = 12;
static const uint8_t A16 = 14;
static const uint8_t A17 = 27;
static const uint8_t A18 = 25;
static const uint8_t A19 = 26;
static const uint8_t T0 = 4;
static const uint8_t T1 = 0;
static const uint8_t T2 = 2;
static const uint8_t T3 = 15;
static const uint8_t T4 = 13;
static const uint8_t T5 = 12;
static const uint8_t T6 = 14;
static const uint8_t T7 = 27;
static const uint8_t T8 = 33;
static const uint8_t T9 = 32;
static const uint8_t DAC1 = 25;
static const uint8_t DAC2 = 26;
static const uint8_t VBAT = 34;
static const uint8_t RIGHT_BUTTON = 35;
static const uint8_t LEFT_BUTTON = 0;
#endif /* Pins_Arduino_h */

View file

@ -0,0 +1,99 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 16
#define analogInputToDigitalPin(p) (((p) < 20) ? (analogChannelToDigitalPin(p)) : -1)
#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1)
#define digitalPinHasPWM(p) (p < 34)
static const uint8_t LED_BUILTIN = 0; //GPIO0,
static const uint8_t SWITCH_A = 46; //GPIO46,
static const uint8_t SWITCH_B = 47; //GPIO47,
//Wifi and Bluetooth LEDs
static const uint8_t WIFI_LED = 38;
static const uint8_t BT_LED = 37;
static const uint8_t TX = 1;
static const uint8_t RX = 3;
//-------------------------------------------------------------------
static const uint8_t U1RX = 9; //IO,GPIO9
static const uint8_t U1TX = 10;//IO,GPIO10
/* LionBits3 pin setup */
static const uint8_t D0 = 3; //RX,GPIO3,MCPWM
static const uint8_t D1 = 1; //TX,GPIO1,ADC1_CH0,MCPWM
static const uint8_t D2 = 9; //IO,GPIO9,ADC1_CH8,TOUCH9,MCPWM
static const uint8_t D3 = 10; //IO,GPIO10,ADC1_CH9,TOUCH10,MCPWM
static const uint8_t D4 = 11; //IO,GPIO11,ADC2_CH0,TOUCH11,MCPWM
static const uint8_t D5 = 12; //IO,GPIO12,ADC2_CH1,TOUCH12,MCPWM
static const uint8_t D6 = 13; //IO,GPIO13,ADC2_CH2,TOUCH13,MCPWM
static const uint8_t D7 = 14; //IO,GPIO14,ADC2_CH3,TOUCH14,MCPWM
static const uint8_t D8 = 15; //IO,GPIO15,ADC2_CH4,MCPWM
static const uint8_t D9 = 16; //IO,GPIO16,ADC2_CH5,MCPWM
static const uint8_t D10 = 17; //IO,GPIO17,ADC2_CH6,MCPWM
static const uint8_t D11 = 18; //IO,GPIO18,ADC2_CH7,MCPWM
static const uint8_t D12 = 8; //IO,GPIO8,ADC1_CH7,MCPWM
static const uint8_t D13 = 39; //IO,GPIO39,MCPWM
static const uint8_t D14 = 40; //IO,GPIO40,MCPWM
static const uint8_t D15 = 41; //IO,GPIO41,MCPWM
static const uint8_t D16 = 48; //IO,GPIO48,MCPWM
static const uint8_t D17 = 21; //IO,GPIO21,MCPWM
//Other pins.
static const uint8_t BUZZER = 21;
static const uint8_t LDR = 7;
static const uint8_t RGBLED = 48;
// Analog to Digital Converter (Support 5V) ADC2 pins not recommended while using Wifi
static const uint8_t A0 = 2; //IO,GPIO2,ADC1_CH1,TOUCH2,MCPWM
static const uint8_t A1 = 1; //IO,GPIO1,ADC1_CH0,TOUCH1,MCPWM
static const uint8_t A2 = 3; //IO,GPIO3,ADC1_CH2,TOUCH3,MCPWM
static const uint8_t A3 = 4; //IO,GPIO4,ADC1_CH3,TOUCH4,MCPWM
static const uint8_t A4 = 5; //IO,GPIO5,ADC1_CH4,TOUCH5,MCPWM
static const uint8_t A5 = 6; //IO,GPIO6,ADC1_CH5,TOUCH6,MCPWM
static const uint8_t A6 = 7; //IO,GPIO7,ADC1_CH6,TOUCH7,MCPWM
static const uint8_t AD1 = 7; //IO,GPIO7,ADC1_CH6,TOUCH7,MCPWM
// Inbuilt Display Unit 128*128 ST7735 Driver New
static const uint8_t SDA = 40; //GPIO40;
static const uint8_t SCL = 41; //GPIO41;
/* Hardware HSPI */
static const uint8_t MOSI = 35; //GPIO35;
static const uint8_t MISO = 37; //GPIO37;
static const uint8_t SCK = 36; //GPIO36;
static const uint8_t SS = 34; //GPIO34;
static const uint8_t SDO = 35; //GPIO35;
static const uint8_t SDI = 37; //GPIO37;
//----------------------------------
static const uint8_t TFT_RST = 38; //GPIO38;
static const uint8_t TFT_SCLK = 35; //GPIO35;
static const uint8_t TFT_CS = 42; //GPIO42;
static const uint8_t TFT_DC = 37; //GPIO37;
static const uint8_t TFT_MOSI = 36; //GPIO36;
static const uint8_t LCD_A0 = 37; //GPIO37,
static const uint8_t LCD_BACK_LIGHT = 45; //GPIO45,
static const uint8_t DAC1 = 21; //GPIO21,
//LCD aditional pins
//Adafruit 128*128 ST7735 Driver New
static const uint8_t rst = 38;
static const uint8_t sclk = 35;
static const uint8_t cs = 42;
static const uint8_t dc = 37;
static const uint8_t mosi = 36;
#define VP 36 //GPIO36,
#define VN 39 //GPIO39,
#endif /* Pins_Arduino_h */

View file

@ -0,0 +1,11 @@
## 4 Apps + Factory
## Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x9000, 0x5000
otadata, data, ota, 0xe000, 0x2000
ota_0, 0, ota_0, 0x10000, 0x300000
ota_1, 0, ota_1, 0x310000, 0x300000
ota_2, 0, ota_2, 0x610000, 0x300000
ota_3, 0, ota_3, 0x910000, 0x300000
firmware, app, factory, 0xC10000, 0x0F0000
spiffs, data, spiffs, 0xD00000, 0x2F0000
coredump, data, coredump, 0xFF0000, 0x10000
1 ## 4 Apps + Factory
2 ## Name, Type, SubType, Offset, Size
3 nvs, data, nvs, 0x9000, 0x5000
4 otadata, data, ota, 0xe000, 0x2000
5 ota_0, 0, ota_0, 0x10000, 0x300000
6 ota_1, 0, ota_1, 0x310000, 0x300000
7 ota_2, 0, ota_2, 0x610000, 0x300000
8 ota_3, 0, ota_3, 0x910000, 0x300000
9 firmware, app, factory, 0xC10000, 0x0F0000
10 spiffs, data, spiffs, 0xD00000, 0x2F0000
11 coredump, data, coredump, 0xFF0000, 0x10000

View file

@ -0,0 +1,14 @@
# 6 Apps + Factory
# Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x9000, 0x5000
otadata, data, ota, 0xe000, 0x2000
ota_0, 0, ota_0, 0x10000, 0x200000
ota_1, 0, ota_1, 0x210000, 0x200000
ota_2, 0, ota_2, 0x410000, 0x200000
ota_3, 0, ota_3, 0x610000, 0x200000
ota_4, 0, ota_4, 0x810000, 0x200000
ota_5, 0, ota_5, 0xA10000, 0x200000
firmware, app, factory, 0xC10000, 0x0F0000
spiffs, data, spiffs, 0xD00000, 0x2F0000
coredump, data, coredump, 0xFF0000, 0x10000
1 # 6 Apps + Factory
2 # Name, Type, SubType, Offset, Size
3 nvs, data, nvs, 0x9000, 0x5000
4 otadata, data, ota, 0xe000, 0x2000
5 ota_0, 0, ota_0, 0x10000, 0x200000
6 ota_1, 0, ota_1, 0x210000, 0x200000
7 ota_2, 0, ota_2, 0x410000, 0x200000
8 ota_3, 0, ota_3, 0x610000, 0x200000
9 ota_4, 0, ota_4, 0x810000, 0x200000
10 ota_5, 0, ota_5, 0xA10000, 0x200000
11 firmware, app, factory, 0xC10000, 0x0F0000
12 spiffs, data, spiffs, 0xD00000, 0x2F0000
13 coredump, data, coredump, 0xFF0000, 0x10000

View file

@ -22,6 +22,11 @@ static const uint8_t RX = 44;
static const uint8_t TXD2 = 1;
static const uint8_t RXD2 = 2;
static const uint8_t SS = 7;
static const uint8_t MOSI = 6;
static const uint8_t MISO = 5;
static const uint8_t SCK = 4;
static const uint8_t SDA = 13;
static const uint8_t SCL = 15;

View file

@ -0,0 +1,205 @@
//
// Copyright (c) 2023 Namino Team, version: 1.0.19 @ 2023-07-24
//
//
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#include "soc/soc_caps.h"
#define USB_VID 0x303a
#define USB_PID 0x1001
#define NAMINO_ARANCIO_BOARD
#define NUM_DIGITAL_PINS SOC_GPIO_PIN_COUNT // GPIO 0..48
#define NUM_ANALOG_INPUTS 20 // GPIO 1..20
#define EXTERNAL_NUM_INTERRUPTS NUM_DIGITAL_PINS // All GPIOs
#define analogInputToDigitalPin(p) (((p)<NUM_ANALOG_INPUTS)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<NUM_DIGITAL_PINS)?(p):NOT_AN_INTERRUPT)
#define digitalPinHasPWM(p) (p < NUM_DIGITAL_PINS)
/* Begin Pins on ESP32-S3-WROOM-1U-N4R8 */
static const uint8_t GPIO4 = 4;
static const uint8_t GPIO5 = 5;
static const uint8_t GPIO6 = 6;
static const uint8_t GPIO7 = 7;
static const uint8_t GPIO15 = 15;
static const uint8_t GPIO16 = 16;
static const uint8_t GPIO17 = 17;
static const uint8_t GPIO18 = 18;
static const uint8_t GPIO8 = 8;
static const uint8_t GPIO19 = 19;
static const uint8_t GPIO20 = 20;
static const uint8_t GPIO3 = 3;
static const uint8_t GPIO46 = 46;
static const uint8_t GPIO9 = 9;
static const uint8_t GPIO10 = 10;
static const uint8_t GPIO11 = 11;
static const uint8_t GPIO12 = 12;
static const uint8_t GPIO13 = 13;
static const uint8_t GPIO14 = 14;
static const uint8_t GPIO21 = 21;
static const uint8_t GPIO47 = 47;
static const uint8_t GPIO48 = 48;
static const uint8_t GPIO45 = 45;
static const uint8_t GPIO0 = 0;
static const uint8_t GPIO35 = 35;
static const uint8_t GPIO36 = 36;
static const uint8_t GPIO37 = 37;
static const uint8_t GPIO38 = 38;
static const uint8_t GPIO39 = 39;
static const uint8_t GPIO40 = 40;
static const uint8_t GPIO41 = 41;
static const uint8_t GPIO42 = 42;
static const uint8_t GPIO44 = 44;
static const uint8_t GPIO43 = 43;
static const uint8_t GPIO2 = 2;
static const uint8_t GPIO1 = 1;
static const uint8_t RESET_ADD_ON = GPIO46;
static const uint8_t SS = GPIO10;
static const uint8_t MOSI = GPIO11;
static const uint8_t MISO = GPIO13;
static const uint8_t SCK = GPIO12;
// SPI SD CARD
static const uint8_t CS_SDCARD = GPIO2;
// prog pins
static const uint8_t BOOT_MODE = GPIO47;
static const uint8_t ISP_TX = GPIO17;
static const uint8_t ISP_RX = GPIO18;
static const uint8_t NM_RESET = GPIO48;
/* End Pins on ESP32-S3-WROOM-1U-N4R8 */
/* Begin Analog Pins on ESP32-S3-WROOM-1U-N4R8 */
static const uint8_t ADC1_CH3 = GPIO4;
static const uint8_t ADC1_CH4 = GPIO5;
static const uint8_t ADC1_CH5 = GPIO6;
static const uint8_t ADC1_CH6 = GPIO7;
static const uint8_t ADC2_CH4 = GPIO15;
static const uint8_t ADC2_CH5 = GPIO16;
static const uint8_t ADC2_CH6 = GPIO17;
static const uint8_t ADC2_CH7 = GPIO18;
static const uint8_t ADC1_CH7 = GPIO8;
static const uint8_t ADC2_CH8 = GPIO19;
static const uint8_t ADC2_CH9 = GPIO20;
static const uint8_t ADC1_CH2 = GPIO3;
static const uint8_t ADC1_CH8 = GPIO9;
static const uint8_t ADC1_CH9 = GPIO10;
static const uint8_t ADC2_CH0 = GPIO11;
static const uint8_t ADC2_CH1 = GPIO12;
static const uint8_t ADC2_CH2 = GPIO13;
static const uint8_t ADC2_CH3 = GPIO14;
static const uint8_t ADC1_CH1 = GPIO2;
static const uint8_t ADC1_CH0 = GPIO1;
/* End Analog Pins on ESP32-S3-WROOM-1U-N4R8 */
/* Begin Touch Pins on ESP32-S3-WROOM-1U-N4R8 */
static const uint8_t TOUCH4 = GPIO4;
static const uint8_t TOUCH5 = GPIO5;
static const uint8_t TOUCH6 = GPIO6;
static const uint8_t TOUCH7 = GPIO7;
static const uint8_t TOUCH8 = GPIO8;
static const uint8_t TOUCH3 = GPIO3;
static const uint8_t TOUCH9 = GPIO9;
static const uint8_t TOUCH10 = GPIO10;
static const uint8_t TOUCH11 = GPIO11;
static const uint8_t TOUCH12 = GPIO12;
static const uint8_t TOUCH13 = GPIO13;
static const uint8_t TOUCH14 = GPIO14;
static const uint8_t TOUCH2 = GPIO2;
static const uint8_t TOUCH1 = GPIO1;
/* End Touch Pins on ESP32-S3-WROOM-1U-N4R8 */
static const uint8_t TX = GPIO17;
static const uint8_t RX = GPIO18;
static const uint8_t SDA = GPIO1;
static const uint8_t SCL = GPIO0;
static const uint8_t NAMINO_ARANCIO_I2C_SDA = SDA;
static const uint8_t NAMINO_ARANCIO_I2C_SCL = SCL;
static const uint8_t NM_I2C_SDA = SDA;
static const uint8_t NM_I2C_SCL = SCL;
static const uint8_t A0 = ADC1_CH0;
static const uint8_t A1 = ADC1_CH1;
static const uint8_t A2 = ADC1_CH2;
static const uint8_t A3 = ADC1_CH3;
static const uint8_t A4 = ADC1_CH4;
static const uint8_t A5 = ADC1_CH5;
static const uint8_t A6 = ADC1_CH6;
static const uint8_t A7 = ADC1_CH7;
static const uint8_t A8 = ADC2_CH0;
static const uint8_t A9 = ADC2_CH1;
static const uint8_t A10 = ADC2_CH2;
static const uint8_t A11 = ADC2_CH3;
static const uint8_t A12 = ADC2_CH4;
static const uint8_t A13 = ADC2_CH5;
static const uint8_t A14 = ADC2_CH6;
static const uint8_t A15 = ADC2_CH7;
static const uint8_t DAC1 = 0;
static const uint8_t DAC2 = 0;
/* Begin Arduino naming */
static const uint8_t RESET_ARDUINO = GPIO46;
static const uint8_t PC0 = GPIO3;
static const uint8_t PC1 = GPIO4;
static const uint8_t PC2 = GPIO5;
static const uint8_t PC3 = GPIO6;
static const uint8_t PC4 = GPIO7;
static const uint8_t PC5 = GPIO8;
static const uint8_t PB5 = GPIO35;
static const uint8_t PB4 = GPIO36;
static const uint8_t PB3 = GPIO37;
static const uint8_t PB2 = GPIO38;
static const uint8_t PB1 = GPIO39;
static const uint8_t PB0 = GPIO40;
static const uint8_t PD7 = GPIO41;
static const uint8_t PD6 = GPIO42;
static const uint8_t PD5 = GPIO21;
static const uint8_t PD4 = GPIO16;
static const uint8_t PD3 = GPIO14;
static const uint8_t PD2 = GPIO9;
static const uint8_t PD1 = GPIO17;
static const uint8_t PD0 = GPIO18;
/* End Arduino naming */
/* Begin alternate naming */
static const uint8_t J1_io0 = SCL;
static const uint8_t J2_35 = PB5;
static const uint8_t J2_36 = PB4;
static const uint8_t J2_37 = PB3;
static const uint8_t J2_38 = PB2;
static const uint8_t J2_39 = PB1;
static const uint8_t J2_40 = PB0;
static const uint8_t J3_io8 = PD7;
static const uint8_t J3_7 = PD6;
static const uint8_t J3_21 = PD5;
static const uint8_t J3_16 = PD4;
static const uint8_t J3_14 = PD3;
static const uint8_t J3_9 = PD2;
static const uint8_t J3_17 = TX;
static const uint8_t J3_18 = RX;
static const uint8_t J4_cs_io2 = CS_SDCARD;
static const uint8_t J4_sclk = SCK;
static const uint8_t J4_mosi = MOSI;
static const uint8_t J4_miso = MISO;
static const uint8_t J9_io3 = PC0;
static const uint8_t J9_4 = PC1;
static const uint8_t J9_5 = PC2;
static const uint8_t J9_6 = PC3;
static const uint8_t J9_7 = PC4;
static const uint8_t J9_8 = PC5;
static const uint8_t J10_enc_A = 0;
static const uint8_t J10_enc_B = 0;
static const uint8_t J10_sw = 0;
/* End alternate naming */
#endif /* Pins_Arduino_h */

View file

@ -0,0 +1,205 @@
//
// Copyright (c) 2023 Namino Team, version: 1.0.19 @ 2023-07-24
//
//
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#include "soc/soc_caps.h"
#define USB_VID 0x303a
#define USB_PID 0x1001
#define NAMINO_ROSSO_BOARD
#define NUM_DIGITAL_PINS SOC_GPIO_PIN_COUNT // GPIO 0..48
#define NUM_ANALOG_INPUTS 20 // GPIO 1..20
#define EXTERNAL_NUM_INTERRUPTS NUM_DIGITAL_PINS // All GPIOs
#define analogInputToDigitalPin(p) (((p)<NUM_ANALOG_INPUTS)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<NUM_DIGITAL_PINS)?(p):NOT_AN_INTERRUPT)
#define digitalPinHasPWM(p) (p < NUM_DIGITAL_PINS)
/* Begin Pins on ESP32-S3-WROOM-1U-N4R8 */
static const uint8_t GPIO4 = 4;
static const uint8_t GPIO5 = 5;
static const uint8_t GPIO6 = 6;
static const uint8_t GPIO7 = 7;
static const uint8_t GPIO15 = 15;
static const uint8_t GPIO16 = 16;
static const uint8_t GPIO17 = 17;
static const uint8_t GPIO18 = 18;
static const uint8_t GPIO8 = 8;
static const uint8_t GPIO19 = 19;
static const uint8_t GPIO20 = 20;
static const uint8_t GPIO3 = 3;
static const uint8_t GPIO46 = 46;
static const uint8_t GPIO9 = 9;
static const uint8_t GPIO10 = 10;
static const uint8_t GPIO11 = 11;
static const uint8_t GPIO12 = 12;
static const uint8_t GPIO13 = 13;
static const uint8_t GPIO14 = 14;
static const uint8_t GPIO21 = 21;
static const uint8_t GPIO47 = 47;
static const uint8_t GPIO48 = 48;
static const uint8_t GPIO45 = 45;
static const uint8_t GPIO0 = 0;
static const uint8_t GPIO35 = 35;
static const uint8_t GPIO36 = 36;
static const uint8_t GPIO37 = 37;
static const uint8_t GPIO38 = 38;
static const uint8_t GPIO39 = 39;
static const uint8_t GPIO40 = 40;
static const uint8_t GPIO41 = 41;
static const uint8_t GPIO42 = 42;
static const uint8_t GPIO44 = 44;
static const uint8_t GPIO43 = 43;
static const uint8_t GPIO2 = 2;
static const uint8_t GPIO1 = 1;
static const uint8_t RESET_ADD_ON = GPIO46;
static const uint8_t SS = GPIO10;
static const uint8_t MOSI = GPIO11;
static const uint8_t MISO = GPIO13;
static const uint8_t SCK = GPIO12;
// SPI SD CARD
static const uint8_t CS_SDCARD = GPIO2;
// prog pins
static const uint8_t BOOT_MODE = GPIO47;
static const uint8_t ISP_TX = GPIO17;
static const uint8_t ISP_RX = GPIO18;
static const uint8_t NM_RESET = GPIO48;
/* End Pins on ESP32-S3-WROOM-1U-N4R8 */
/* Begin Analog Pins on ESP32-S3-WROOM-1U-N4R8 */
static const uint8_t ADC1_CH3 = GPIO4;
static const uint8_t ADC1_CH4 = GPIO5;
static const uint8_t ADC1_CH5 = GPIO6;
static const uint8_t ADC1_CH6 = GPIO7;
static const uint8_t ADC2_CH4 = GPIO15;
static const uint8_t ADC2_CH5 = GPIO16;
static const uint8_t ADC2_CH6 = GPIO17;
static const uint8_t ADC2_CH7 = GPIO18;
static const uint8_t ADC1_CH7 = GPIO8;
static const uint8_t ADC2_CH8 = GPIO19;
static const uint8_t ADC2_CH9 = GPIO20;
static const uint8_t ADC1_CH2 = GPIO3;
static const uint8_t ADC1_CH8 = GPIO9;
static const uint8_t ADC1_CH9 = GPIO10;
static const uint8_t ADC2_CH0 = GPIO11;
static const uint8_t ADC2_CH1 = GPIO12;
static const uint8_t ADC2_CH2 = GPIO13;
static const uint8_t ADC2_CH3 = GPIO14;
static const uint8_t ADC1_CH1 = GPIO2;
static const uint8_t ADC1_CH0 = GPIO1;
/* End Analog Pins on ESP32-S3-WROOM-1U-N4R8 */
/* Begin Touch Pins on ESP32-S3-WROOM-1U-N4R8 */
static const uint8_t TOUCH4 = GPIO4;
static const uint8_t TOUCH5 = GPIO5;
static const uint8_t TOUCH6 = GPIO6;
static const uint8_t TOUCH7 = GPIO7;
static const uint8_t TOUCH8 = GPIO8;
static const uint8_t TOUCH3 = GPIO3;
static const uint8_t TOUCH9 = GPIO9;
static const uint8_t TOUCH10 = GPIO10;
static const uint8_t TOUCH11 = GPIO11;
static const uint8_t TOUCH12 = GPIO12;
static const uint8_t TOUCH13 = GPIO13;
static const uint8_t TOUCH14 = GPIO14;
static const uint8_t TOUCH2 = GPIO2;
static const uint8_t TOUCH1 = GPIO1;
/* End Touch Pins on ESP32-S3-WROOM-1U-N4R8 */
static const uint8_t TX = GPIO17;
static const uint8_t RX = GPIO18;
static const uint8_t SDA = GPIO1;
static const uint8_t SCL = GPIO0;
static const uint8_t NAMINO_ARANCIO_I2C_SDA = SDA;
static const uint8_t NAMINO_ARANCIO_I2C_SCL = SCL;
static const uint8_t NM_I2C_SDA = SDA;
static const uint8_t NM_I2C_SCL = SCL;
static const uint8_t A0 = ADC1_CH0;
static const uint8_t A1 = ADC1_CH1;
static const uint8_t A2 = ADC1_CH2;
static const uint8_t A3 = ADC1_CH3;
static const uint8_t A4 = ADC1_CH4;
static const uint8_t A5 = ADC1_CH5;
static const uint8_t A6 = ADC1_CH6;
static const uint8_t A7 = ADC1_CH7;
static const uint8_t A8 = ADC2_CH0;
static const uint8_t A9 = ADC2_CH1;
static const uint8_t A10 = ADC2_CH2;
static const uint8_t A11 = ADC2_CH3;
static const uint8_t A12 = ADC2_CH4;
static const uint8_t A13 = ADC2_CH5;
static const uint8_t A14 = ADC2_CH6;
static const uint8_t A15 = ADC2_CH7;
static const uint8_t DAC1 = 0;
static const uint8_t DAC2 = 0;
/* Begin Arduino naming */
static const uint8_t RESET_ARDUINO = GPIO46;
static const uint8_t PC0 = GPIO3;
static const uint8_t PC1 = GPIO4;
static const uint8_t PC2 = GPIO5;
static const uint8_t PC3 = GPIO6;
static const uint8_t PC4 = GPIO7;
static const uint8_t PC5 = GPIO8;
static const uint8_t PB5 = GPIO35;
static const uint8_t PB4 = GPIO36;
static const uint8_t PB3 = GPIO37;
static const uint8_t PB2 = GPIO38;
static const uint8_t PB1 = GPIO39;
static const uint8_t PB0 = GPIO40;
static const uint8_t PD7 = GPIO41;
static const uint8_t PD6 = GPIO42;
static const uint8_t PD5 = GPIO21;
static const uint8_t PD4 = GPIO16;
static const uint8_t PD3 = GPIO14;
static const uint8_t PD2 = GPIO9;
static const uint8_t PD1 = GPIO17;
static const uint8_t PD0 = GPIO18;
/* End Arduino naming */
/* Begin alternate naming */
static const uint8_t J1_io0 = SCL;
static const uint8_t J2_35 = PB5;
static const uint8_t J2_36 = PB4;
static const uint8_t J2_37 = PB3;
static const uint8_t J2_38 = PB2;
static const uint8_t J2_39 = PB1;
static const uint8_t J2_40 = PB0;
static const uint8_t J3_io8 = PD7;
static const uint8_t J3_7 = PD6;
static const uint8_t J3_21 = PD5;
static const uint8_t J3_16 = PD4;
static const uint8_t J3_14 = PD3;
static const uint8_t J3_9 = PD2;
static const uint8_t J3_17 = TX;
static const uint8_t J3_18 = RX;
static const uint8_t J4_cs_io2 = CS_SDCARD;
static const uint8_t J4_sclk = SCK;
static const uint8_t J4_mosi = MOSI;
static const uint8_t J4_miso = MISO;
static const uint8_t J9_io3 = PC0;
static const uint8_t J9_4 = PC1;
static const uint8_t J9_5 = PC2;
static const uint8_t J9_6 = PC3;
static const uint8_t J9_7 = PC4;
static const uint8_t J9_8 = PC5;
static const uint8_t J10_enc_A = 0;
static const uint8_t J10_enc_B = 0;
static const uint8_t J10_sw = 0;
/* End alternate naming */
#endif /* Pins_Arduino_h */

Binary file not shown.

View file

@ -0,0 +1,10 @@
# 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, 2048K,
ota_1, 0, ota_1, 0x210000, 2048K,
uf2, app, factory,0x410000, 256K,
ffat, data, fat, 0x450000, 3776K,
1 # ESP-IDF Partition Table
2 # Name, Type, SubType, Offset, Size, Flags
3 # bootloader.bin,, 0x1000, 32K
4 # partition table,, 0x8000, 4K
5 nvs, data, nvs, 0x9000, 20K,
6 otadata, data, ota, 0xe000, 8K,
7 ota_0, 0, ota_0, 0x10000, 2048K,
8 ota_1, 0, ota_1, 0x210000, 2048K,
9 uf2, app, factory,0x410000, 256K,
10 ffat, data, fat, 0x450000, 3776K,

View file

@ -0,0 +1,56 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#define USB_VID 0x303A
#define USB_PID 0x8179
#define USB_MANUFACTURER "Unexpected Maker"
#define USB_PRODUCT "Nanos3"
#define USB_SERIAL ""
#define EXTERNAL_NUM_INTERRUPTS 46
#define NUM_DIGITAL_PINS 17
#define NUM_ANALOG_INPUTS 9
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
#define digitalPinHasPWM(p) (p < 46)
static const uint8_t TX = 43;
static const uint8_t RX = 44;
static const uint8_t SDA = 8;
static const uint8_t SCL = 9;
static const uint8_t SS = 34;
static const uint8_t MOSI = 35;
static const uint8_t MISO = 37;
static const uint8_t SDO = 35;
static const uint8_t SDI = 37;
static const uint8_t SCK = 36;
static const uint8_t A0 = 1;
static const uint8_t A1 = 2;
static const uint8_t A2 = 3;
static const uint8_t A3 = 4;
static const uint8_t A4 = 5;
static const uint8_t A5 = 6;
static const uint8_t A6 = 7;
static const uint8_t A7 = 8;
static const uint8_t A8 = 9;
static const uint8_t T1 = 1;
static const uint8_t T2 = 2;
static const uint8_t T3 = 3;
static const uint8_t T4 = 4;
static const uint8_t T5 = 5;
static const uint8_t T6 = 6;
static const uint8_t T7 = 7;
static const uint8_t T8 = 8;
static const uint8_t T9 = 9;
static const uint8_t RGB_DATA = 41;
static const uint8_t RGB_PWR = 42;
#endif /* Pins_Arduino_h */

Binary file not shown.