Update(boards): xpython板卡执行 build:prod

This commit is contained in:
王立帮
2025-01-13 14:39:16 +08:00
parent cd53d4873a
commit 3a3fc5c8bf
26 changed files with 248 additions and 71 deletions

View File

@@ -45,6 +45,27 @@
"__size__": 3175,
"__name__": "mixgo_nova_voice.py"
},
"mixgo_sant": {
"__require__": [
"machine",
"time",
"gc",
"st7789_cf",
"math",
"ws2812",
"music",
"sc7a20",
"mk_pb4023",
"shtc3",
"mmc5603",
"spl06_001",
"sant_bot",
"ci130x"
],
"__file__": true,
"__size__": 6779,
"__name__": "mixgo_sant.py"
},
"mixgo_zero": {
"__require__": [
"machine",
@@ -101,6 +122,26 @@
"__size__": 3269,
"__name__": "nova_g1.py"
},
"sant_bot": {
"__require__": [
"time",
"micropython"
],
"__file__": true,
"__size__": 3237,
"__name__": "sant_bot.py"
},
"sant_g2": {
"__require__": [
"gc",
"machine",
"rc522",
"cbr817"
],
"__file__": true,
"__size__": 729,
"__name__": "sant_g2.py"
},
"sdcard": {
"__require__": [
"time",
@@ -121,5 +162,16 @@
"__file__": true,
"__size__": 3191,
"__name__": "st7789_bf.py"
},
"st7789_cf": {
"__require__": [
"time",
"uframebuf",
"machine",
"micropython"
],
"__file__": true,
"__size__": 3421,
"__name__": "st7789_cf.py"
}
}

View File

@@ -1,23 +0,0 @@
"""
MINI G2 -MixGo MINI EXT G2
MicroPython library for the MINI G2 (Expansion board for MixGo MINI)
=======================================================
@dahanzimin From the Mixly Team
"""
import gc
from machine import Pin, SoftI2C
'''i2c-extboard'''
ext_i2c = SoftI2C(scl=Pin(7), sda=Pin(8), freq=400000)
'''RFID_Sensor'''
try :
import rc522
ext_rfid = rc522.RC522(ext_i2c)
except Exception as e:
print("Warning: Failed to communicate with SI522A (RFID) or",e)
'''Reclaim memory'''
gc.collect()

View File

@@ -19,16 +19,9 @@ onboard_i2c = SoftI2C(scl=Pin(47), sda=Pin(48), freq=400000)
'''SPI-onboard'''
onboard_spi = SPI(1, baudrate=50000000, polarity=0, phase=0)
'''TFT/320*240'''
'''TFT/240*240'''
onboard_tft = st7789_cf.ST7789(onboard_spi, 240, 240, dc_pin=40, cs_pin=None, bl_pin=None, font_address=0xE00000)
'''BOT035-Sensor'''
try :
import sant_bot
onboard_bot = sant_bot.BOT035(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with BOT035 (Coprocessor) or",e)
'''ACC-Sensor'''
try :
import sc7a20
@@ -50,13 +43,6 @@ try :
except Exception as e:
print("Warning: Failed to communicate with GXHTC3 (THS) or",e)
'''ASR-Sensor'''
try :
import ci130x
onboard_asr = ci130x.CI130X(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with CI130X (ASR) or",e)
'''MGS-Sensor'''
try :
import mmc5603
@@ -71,6 +57,20 @@ try :
except Exception as e:
print("Warning: Failed to communicate with SPL06-001 (BPS) or",e)
'''BOT035-Sensor'''
try :
import sant_bot
onboard_bot = sant_bot.BOT035(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with BOT035 (Coprocessor) or",e)
'''ASR-Sensor'''
try :
import ci130x
onboard_asr = ci130x.CI130X(onboard_i2c)
except Exception as e:
print("Warning: Failed to communicate with CI130X (ASR) or",e)
'''2RGB_WS2812'''
from ws2812 import NeoPixel
onboard_rgb = NeoPixel(Pin(21), 4)

View File

@@ -5,6 +5,9 @@ Micropython library for the SANT_WCH(---)
=======================================================
@dahanzimin From the Mixly Team
"""
import time
from micropython import const
_BOT035_ADDRESS = const(0x13)
_BOT5_TOUCH = const(0x01)
_BOT035_ADC = const(0x05)
@@ -17,6 +20,7 @@ _BOT035_STR = const(0x18)
class BOT035:
def __init__(self, i2c_bus):
self._i2c = i2c_bus
self._touchs = [self.touch(0), self.touch(1)]
def _wreg(self, reg, val):
'''Write memory address'''
@@ -38,10 +42,10 @@ class BOT035:
def touched(self, index, value=600):
return self.touch(index, value)
def touch_slide(self):
def touch_slide(self, comp=1.2):
values = []
for i in range(30):
values.append((self.touch(1) - self._touchs[1]) - (self.touch(0) - self._touchs[0]))
values.append((self.touch(1) - self._touchs[1]) * comp - (self.touch(0) - self._touchs[0]))
return round(sorted(values)[15] / 10)
def usben(self, index=1, duty=None, freq=None):

View File

@@ -41,7 +41,7 @@ class ST7789(uframebuf.FrameBuffer_Uincode):
self.font(font_address)
self._init()
self.show()
time.sleep_ms(100)
time.sleep_ms(200)
self._brightness = 0.6
self.bl_led = PWM(Pin(bl_pin), duty_u16=int(self._brightness * 60000)) if bl_pin is not None else None

View File

@@ -7,8 +7,8 @@
"burn": {
"type": "command",
"portSelect": "all",
"micropython:esp32s3:mixgo_zero": {
"command": "\"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --before default_reset --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --after hard_reset write_flash 0x0 \"{indexPath}/build/Mixgo_Zero-v1.21.0.bin\" 0xE00000 \"{indexPath}/../micropython/build/HZK16.bin\""
"micropython:esp32s3:mixgo_sant": {
"command": "\"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --before default_reset --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --after hard_reset write_flash 0x0 \"{indexPath}/build/Mixgo_Sant-v1.23.0.bin\" 0xE00000 \"{indexPath}/../micropython/build/HZK16.bin\""
},
"micropython:esp32s3:mixgo_nova": {
"command": "\"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --before default_reset --after=no_reset_stub erase_flash && \"{esptool}\" --chip esp32s3 --port {com} --baud 460800 --after hard_reset write_flash 0x0 \"{indexPath}/build/Mixgo_Nova-v1.21.0.bin\" 0x700000 \"{indexPath}/../micropython/build/HZK12.bin\""
@@ -61,11 +61,11 @@
"com": "serial",
"burn": {
"erase": true,
"micropython:esp32s3:mixgo_zero": {
"micropython:esp32s3:mixgo_sant": {
"binFile": [
{
"offset": "0x0000",
"path": "./build/Mixgo_Zero_lib-v1.21.0.bin"
"path": "./build/Mixgo_Sant_lib-v1.23.0.bin"
}, {
"offset": "0xE00000",
"path": "../micropython/build/HZK16.bin"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long