Skip to content

Commit 8f6709f

Browse files
committed
boards: Add support for FoBE Quill ESP32S3 Mesh
This commit introduces the board configuration files for the FoBE Quill ESP32S3 Mesh, including the necessary JSON, markdown, and CMake files. It also adds pin assignments and SDK configurations to support various features such as BLE, battery charging, and USB-C. Signed-off-by: Chiho Sin <[email protected]>
1 parent 593ae04 commit 8f6709f

File tree

9 files changed

+139
-0
lines changed

9 files changed

+139
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"deploy": [
3+
"../deploy_flashmode.md",
4+
"../deploy_nativeusb.md"
5+
],
6+
"deploy_options": {
7+
"flash_offset": "0"
8+
},
9+
"docs": "",
10+
"features": [
11+
"BLE",
12+
"Battery Charging",
13+
"External Flash",
14+
"External RAM",
15+
"Feather",
16+
"JST-SH",
17+
"USB-C",
18+
"WiFi"
19+
],
20+
"features_non_filterable": [],
21+
"images": [
22+
"fobe-quill-esp32s3-mesh.png"
23+
],
24+
"mcu": "esp32s3",
25+
"product": "FoBE Quill ESP32S3 Mesh",
26+
"thumbnail": "",
27+
"url": "https://docs.fobestudio.com/product/f1102",
28+
"vendor": "FoBE Studio"
29+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The following files are firmware for the FoBE Quill ESP32S3 Mesh.
462 KB
Loading
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include("$(PORT_DIR)/boards/manifest.py")
2+
freeze("modules")
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Import required libraries
2+
from micropython import const
3+
from machine import Pin, ADC
4+
import time
5+
6+
# Hardware Pin Assignments
7+
8+
# Power Management
9+
OLED_EN = const(12) # Power for peripherals, controlled by GPIO1
10+
PERI_EN = const(1) # Detects if VBUS (5V
11+
12+
# Sense Pins
13+
VBAT_SENSE = const(10)
14+
LED = const(11)
15+
16+
# SPI
17+
SPI_MOSI = const(41)
18+
SPI_MISO = const(39)
19+
SPI_CLK = const(40)
20+
21+
# I2C
22+
I2C_SDA = const(14)
23+
I2C_SCL = const(13)
24+
25+
# Helper functions
26+
27+
# LED & Ambient Light Sensor control
28+
def led_set(state):
29+
"""Set the state of the BLUE LED on IO11"""
30+
l = Pin(LED, Pin.OUT)
31+
l.value(state)
32+
33+
34+
def led_blink():
35+
"""Toggle the BLUE LED on IO11"""
36+
l = Pin(LED, Pin.OUT)
37+
l.value(not l.value())
38+
39+
40+
def set_peri_power(state):
41+
"""Enable or Disable power to the peripherals"""
42+
Pin(PERI_EN, Pin.OUT).value(state)
43+
44+
def set_oled_power(state):
45+
"""Enable or Disable power to the OLED display"""
46+
Pin(OLED_EN, Pin.OUT).value(not state)
47+
48+
49+
def get_battery_voltage():
50+
"""
51+
Returns the current battery voltage. If no battery is connected, returns 4.2V which is the charge voltage
52+
This is an approximation only, but useful to detect if the charge state of the battery is getting low.
53+
"""
54+
adc = ADC(Pin(VBAT_SENSE)) # Assign the ADC pin to read
55+
adc.atten(ADC.ATTN_11DB) # Set attenuation to 11dB for full range (0-3.3V)
56+
# Use read_uv() to get ADC reading as this will use the on-chip calibration data
57+
measuredvbat = adc.read_uv() / 1000000 # Read micovolts and convert to volts
58+
measuredvbat *= 1.72 # Multiply by ratio of battery voltage to ADC pin voltage
59+
return round(measuredvbat, 2)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
set(IDF_TARGET esp32s3)
2+
3+
set(SDKCONFIG_DEFAULTS
4+
boards/sdkconfig.base
5+
boards/sdkconfig.usb
6+
boards/sdkconfig.ble
7+
boards/sdkconfig.240mhz
8+
boards/sdkconfig.spiram_sx
9+
boards/FOBE_QUILL_ESP32S3_MESH/sdkconfig.board
10+
)
11+
12+
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#define MICROPY_HW_BOARD_NAME "FoBE Quill ESP32S3 Mesh"
2+
#define MICROPY_HW_MCU_NAME "ESP32-S3"
3+
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "Quill-ESP32S3"
4+
5+
#define MICROPY_HW_I2C0_SDA (35)
6+
#define MICROPY_HW_I2C0_SCL (36)
7+
8+
#define MICROPY_HW_SPI1_MOSI (33)
9+
#define MICROPY_HW_SPI1_MISO (34)
10+
#define MICROPY_HW_SPI1_SCK (47)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
I2C_SCL,GPIO13
2+
I2C_SDA,GPIO14
3+
OLED_EN,GPIO12
4+
PERI_EN,GPIO1
5+
LED_USR,GPIO11
6+
SPI_MOSI,GPIO41
7+
SPI_SCK,GPIO40
8+
SPI_MISO,GPIO39
9+
UART1_TX,GPIO9
10+
UART1_RX,GPIO8
11+
VBAT_SENSE,GPIO10
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
2+
CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
3+
4+
CONFIG_SPIRAM_MEMTEST=
5+
6+
CONFIG_LWIP_LOCAL_HOSTNAME="quill-esp32s3"
7+
8+
CONFIG_TINYUSB_DESC_CUSTOM_VID=0x303A
9+
CONFIG_TINYUSB_DESC_CUSTOM_PID=0x82F5
10+
CONFIG_TINYUSB_DESC_BCD_DEVICE=0x0100
11+
CONFIG_TINYUSB_DESC_USE_ESPRESSIF_VID=n
12+
CONFIG_TINYUSB_DESC_USE_DEFAULT_PID=n
13+
CONFIG_TINYUSB_DESC_MANUFACTURER_STRING="FoBE Studio"
14+
CONFIG_TINYUSB_DESC_PRODUCT_STRING="FoBE Quill ESP32S3 Mesh"
15+
CONFIG_TINYUSB_DESC_SERIAL_STRING="_quill_esp32s3_"

0 commit comments

Comments
 (0)