diff --git a/boards/ESP32.py b/boards/ESP32.py index 10fcca2e8..25ea5be96 100755 --- a/boards/ESP32.py +++ b/boards/ESP32.py @@ -184,10 +184,19 @@ def get_pins(): pinutils.findpin(pins, "PD0", True)["functions"]["NEGATED"]=0; # BTN1 negate - pinutils.findpin(pins, "PD10", True)["functions"]["USART0_TX"]=0; - pinutils.findpin(pins, "PD16", True)["functions"]["USART2_RX"]=0; - pinutils.findpin(pins, "PD17", True)["functions"]["USART2_TX"]=0; - pinutils.findpin(pins, "PD32", True)["functions"]["USART0_RX"]=0; + pinutils.findpin(pins, "PD10", True)["functions"]["USART1_TX"]=0; # doesn't match jshardwareUart? + pinutils.findpin(pins, "PD32", True)["functions"]["USART1_RX"]=0; # doesn't match jshardwareUart? + pinutils.findpin(pins, "PD16", True)["functions"]["USART3_RX"]=0; + pinutils.findpin(pins, "PD17", True)["functions"]["USART3_TX"]=0; + + pinutils.findpin(pins, "PD21", True)["functions"]["I2C1_SCL"]=0; + pinutils.findpin(pins, "PD22", True)["functions"]["I2C1_SDA"]=0; + pinutils.findpin(pins, "PD14", True)["functions"]["SPI1_SCLK"]=0; + pinutils.findpin(pins, "PD12", True)["functions"]["SPI1_MISO"]=0; + pinutils.findpin(pins, "PD13", True)["functions"]["SPI1_MOSI"]=0; + pinutils.findpin(pins, "PD18", True)["functions"]["SPI2_SCLK"]=0; + pinutils.findpin(pins, "PD19", True)["functions"]["SPI2_MISO"]=0; + pinutils.findpin(pins, "PD23", True)["functions"]["SPI2_MOSI"]=0; # everything is non-5v tolerant #for pin in pins: diff --git a/boards/ESP32C3_IDF4.py b/boards/ESP32C3_IDF4.py index 7f11c7ca5..602557f0c 100644 --- a/boards/ESP32C3_IDF4.py +++ b/boards/ESP32C3_IDF4.py @@ -158,9 +158,14 @@ def get_pins(): # On supermini D9 is (inverted) Button # D12-D17 are SPI (internal SPI) - not sure they should even be exposed?? - #18/19 are USB - pinutils.findpin(pins, "PD20", True)["functions"]["USART0_RX"]=0; - pinutils.findpin(pins, "PD21", True)["functions"]["USART0_TX"]=0; + pinutils.findpin(pins, "PD18", True)["functions"]["USB"]=0; # D- + pinutils.findpin(pins, "PD19", True)["functions"]["USB"]=0; # D+ + pinutils.findpin(pins, "PD20", True)["functions"]["USART1_RX"]=0; + pinutils.findpin(pins, "PD21", True)["functions"]["USART1_TX"]=0; + pinutils.findpin(pins, "PD9", True)["functions"]["I2C1_SCL"]=0; + pinutils.findpin(pins, "PD8", True)["functions"]["I2C1_SDA"]=0; + # SPI1_SCLK/etc? + # everything is non-5v tolerant for pin in pins: diff --git a/boards/ESP32S3_IDF4.py b/boards/ESP32S3_IDF4.py index 7463b34cf..6c75aedec 100644 --- a/boards/ESP32S3_IDF4.py +++ b/boards/ESP32S3_IDF4.py @@ -148,6 +148,11 @@ def get_pins(): pins = pinutils.generate_pins(0,39) # 40 General Purpose I/O Pins. + + pinutils.findpin(pins, "PD11", True)["functions"]["I2C1_SCL"]=0; + pinutils.findpin(pins, "PD10", True)["functions"]["I2C1_SDA"]=0; + # SPI1_SCLK/etc? + # everything is non-5v tolerant #for pin in pins: # pin["functions"]["3.3"]=0; diff --git a/boards/ESP32_CYD.py b/boards/ESP32_CYD.py index ce205dd82..453acc2a2 100755 --- a/boards/ESP32_CYD.py +++ b/boards/ESP32_CYD.py @@ -230,17 +230,19 @@ def get_pins(): pinutils.findpin(pins, "PD17", True)["functions"]["NEGATED"]=0; pinutils.findpin(pins, "PD0", True)["functions"]["NEGATED"]=0; # BTN1 - pinutils.findpin(pins, "PD10", True)["functions"]["USART0_TX"]=0; - pinutils.findpin(pins, "PD16", True)["functions"]["USART2_RX"]=0; - pinutils.findpin(pins, "PD17", True)["functions"]["USART2_TX"]=0; - pinutils.findpin(pins, "PD32", True)["functions"]["USART0_RX"]=0; + pinutils.findpin(pins, "PD10", True)["functions"]["USART1_TX"]=0; # doesn't match jshardwareUart? + pinutils.findpin(pins, "PD32", True)["functions"]["USART1_RX"]=0; # doesn't match jshardwareUart? + pinutils.findpin(pins, "PD16", True)["functions"]["USART3_RX"]=0; + pinutils.findpin(pins, "PD17", True)["functions"]["USART3_TX"]=0; - pinutils.findpin(pins, "PD13", True)["functions"]["SPI1_MOSI"]=0; - pinutils.findpin(pins, "PD12", True)["functions"]["SPI1_MISO"]=0; + pinutils.findpin(pins, "PD21", True)["functions"]["I2C1_SCL"]=0; + pinutils.findpin(pins, "PD22", True)["functions"]["I2C1_SDA"]=0; pinutils.findpin(pins, "PD14", True)["functions"]["SPI1_SCLK"]=0; - pinutils.findpin(pins, "PD23", True)["functions"]["SPI2_MOSI"]=0; - pinutils.findpin(pins, "PD19", True)["functions"]["SPI2_MISO"]=0; + pinutils.findpin(pins, "PD12", True)["functions"]["SPI1_MISO"]=0; + pinutils.findpin(pins, "PD13", True)["functions"]["SPI1_MOSI"]=0; pinutils.findpin(pins, "PD18", True)["functions"]["SPI2_SCLK"]=0; + pinutils.findpin(pins, "PD19", True)["functions"]["SPI2_MISO"]=0; + pinutils.findpin(pins, "PD23", True)["functions"]["SPI2_MOSI"]=0; # everything is non-5v tolerant diff --git a/boards/ESP32_IDF4.py b/boards/ESP32_IDF4.py index 5ae4e38ea..21b37c0a3 100755 --- a/boards/ESP32_IDF4.py +++ b/boards/ESP32_IDF4.py @@ -187,10 +187,19 @@ def get_pins(): pinutils.findpin(pins, "PD0", True)["functions"]["LED_1"]=0; - pinutils.findpin(pins, "PD10", True)["functions"]["USART0_TX"]=0; - pinutils.findpin(pins, "PD16", True)["functions"]["USART2_RX"]=0; - pinutils.findpin(pins, "PD17", True)["functions"]["USART2_TX"]=0; - pinutils.findpin(pins, "PD32", True)["functions"]["USART0_RX"]=0; + pinutils.findpin(pins, "PD10", True)["functions"]["USART1_TX"]=0; # doesn't match jshardwareUart? + pinutils.findpin(pins, "PD32", True)["functions"]["USART1_RX"]=0; # doesn't match jshardwareUart? + pinutils.findpin(pins, "PD16", True)["functions"]["USART3_RX"]=0; + pinutils.findpin(pins, "PD17", True)["functions"]["USART3_TX"]=0; + + pinutils.findpin(pins, "PD21", True)["functions"]["I2C1_SCL"]=0; + pinutils.findpin(pins, "PD22", True)["functions"]["I2C1_SDA"]=0; + pinutils.findpin(pins, "PD14", True)["functions"]["SPI1_SCLK"]=0; + pinutils.findpin(pins, "PD12", True)["functions"]["SPI1_MISO"]=0; + pinutils.findpin(pins, "PD13", True)["functions"]["SPI1_MOSI"]=0; + pinutils.findpin(pins, "PD18", True)["functions"]["SPI2_SCLK"]=0; + pinutils.findpin(pins, "PD19", True)["functions"]["SPI2_MISO"]=0; + pinutils.findpin(pins, "PD23", True)["functions"]["SPI2_MOSI"]=0; # everything is non-5v tolerant #for pin in pins: diff --git a/targets/esp32/jshardwareSpi.c b/targets/esp32/jshardwareSpi.c index e499a7760..bc3f94cf4 100644 --- a/targets/esp32/jshardwareSpi.c +++ b/targets/esp32/jshardwareSpi.c @@ -117,7 +117,7 @@ void jshSPISetup( } else { dma_chan = 2; - sck = inf->pinSCK != PIN_UNDEFINED ? inf->pinSCK : 5; + sck = inf->pinSCK != PIN_UNDEFINED ? inf->pinSCK : 18; miso = inf->pinMISO != PIN_UNDEFINED ? inf->pinMISO : 19; mosi = inf->pinMOSI != PIN_UNDEFINED ? inf->pinMOSI : 23; }