Browse Source

esp32/boards: Add LOLIN_S2_MINI ESP32-S2 board.

To support Lolin S2 Mini ESP32-S2 Variant board.  More information about
this board can be found at https://www.wemos.cc/en/latest/s2/s2_mini.html
pull/7841/head
Stewart Bonnick 3 years ago
committed by Damien George
parent
commit
0d9429f44c
  1. 2
      ports/esp32/boards/LOLIN_S2_MINI/manifest.py
  2. 31
      ports/esp32/boards/LOLIN_S2_MINI/modules/s2mini.py
  3. 11
      ports/esp32/boards/LOLIN_S2_MINI/mpconfigboard.cmake
  4. 12
      ports/esp32/boards/LOLIN_S2_MINI/mpconfigboard.h
  5. 6
      ports/esp32/boards/LOLIN_S2_MINI/sdkconfig.board

2
ports/esp32/boards/LOLIN_S2_MINI/manifest.py

@ -0,0 +1,2 @@
include("$(PORT_DIR)/boards/manifest.py")
freeze("./modules")

31
ports/esp32/boards/LOLIN_S2_MINI/modules/s2mini.py

@ -0,0 +1,31 @@
# LOLIN S2 MINI MicroPython Helper Library
from micropython import const
from machine import Pin
# Pin Assignments
# SPI
SPI_MOSI = const(11)
SPI_MISO = const(9)
SPI_CLK = const(7)
# I2C
I2C_SDA = const(33)
I2C_SCL = const(35)
# DAC
DAC1 = const(17)
DAC2 = const(18)
# LED
LED = const(15)
# BUTTON
BUTTON = const(0)
# Helper methods for built in sensors
led = Pin(LED, Pin.OUT, value=0)
button = Pin(BUTTON, Pin.IN, Pin.PULL_UP)

11
ports/esp32/boards/LOLIN_S2_MINI/mpconfigboard.cmake

@ -0,0 +1,11 @@
set(IDF_TARGET esp32s2)
set(SDKCONFIG_DEFAULTS
boards/sdkconfig.base
boards/sdkconfig.spiram_sx
boards/sdkconfig.usb
)
if(NOT MICROPY_FROZEN_MANIFEST)
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
endif()

12
ports/esp32/boards/LOLIN_S2_MINI/mpconfigboard.h

@ -0,0 +1,12 @@
#define MICROPY_HW_BOARD_NAME "LOLIN_S2_MINI"
#define MICROPY_HW_MCU_NAME "ESP32-S2FN4R2"
#define MICROPY_PY_BLUETOOTH (0)
#define MICROPY_HW_ENABLE_SDCARD (0)
#define MICROPY_HW_I2C0_SCL (35)
#define MICROPY_HW_I2C0_SDA (33)
#define MICROPY_HW_SPI1_MOSI (11)
#define MICROPY_HW_SPI1_MISO (9)
#define MICROPY_HW_SPI1_SCK (7)

6
ports/esp32/boards/LOLIN_S2_MINI/sdkconfig.board

@ -0,0 +1,6 @@
CONFIG_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
CONFIG_USB_AND_UART=y
# LWIP
CONFIG_LWIP_LOCAL_HOSTNAME="LOLIN_S2_MINI"
# end of LWIP
Loading…
Cancel
Save