micrOSDevToolKit 2.9.1__py3-none-any.whl → 2.26.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- env/driver_cp210x/macOS_VCP_Driver/SiLabsUSBDriverDisk.dmg +0 -0
- env/driver_cp210x/macOS_VCP_Driver/macOS_VCP_Driver_Release_Notes.txt +17 -1
- micrOS/micropython/esp32-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/esp32c3-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/esp32c6-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/esp32s2-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/esp32s2-LOLIN_MINI-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/{esp32s3-20241129-v1.24.1.bin → esp32s3-4MBflash-20241129-v1.24.1.bin} +0 -0
- micrOS/micropython/esp32s3-8MBflash-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/esp32s3_spiram_oct-20251209-v1.27.0.bin +0 -0
- micrOS/micropython/rpi-pico-w-20251209-v1.27.0.uf2 +0 -0
- micrOS/micropython/tinypico-20251209-v1.27.0.bin +0 -0
- micrOS/release_info/micrOS_ReleaseInfo/system_analysis_sum.json +167 -163
- micrOS/source/Auth.py +37 -0
- micrOS/source/Common.py +361 -116
- micrOS/source/Config.py +32 -22
- micrOS/source/Debug.py +50 -94
- micrOS/source/Espnow.py +377 -100
- micrOS/source/Files.py +207 -0
- micrOS/source/Hooks.py +48 -20
- micrOS/source/InterConnect.py +126 -42
- micrOS/source/Interrupts.py +6 -6
- micrOS/source/Logger.py +63 -26
- micrOS/source/Network.py +41 -21
- micrOS/source/Notify.py +48 -22
- micrOS/source/Pacman.py +326 -0
- micrOS/source/Scheduler.py +14 -54
- micrOS/source/Server.py +67 -69
- micrOS/source/Shell.py +99 -91
- micrOS/source/Tasks.py +141 -95
- micrOS/source/Time.py +19 -18
- micrOS/source/Types.py +53 -9
- micrOS/source/Web.py +381 -76
- micrOS/source/__pycache__/Common.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Debug.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Files.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Logger.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Scheduler.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Server.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/Shell.cpython-312.pyc +0 -0
- micrOS/source/__pycache__/replhelper.cpython-312.pyc +0 -0
- micrOS/source/config/_git.keep +0 -0
- micrOS/source/helpers.py +132 -0
- micrOS/source/micrOS.py +17 -7
- micrOS/source/micrOSloader.py +5 -12
- micrOS/source/microIO.py +44 -20
- micrOS/source/modules/IO_esp32c6.py +38 -0
- micrOS/source/{IO_esp32s3.py → modules/IO_esp32s3.py} +37 -1
- micrOS/source/{IO_m5stamp.py → modules/IO_m5stamp.py} +35 -1
- micrOS/source/{IO_qtpy.py → modules/IO_qtpy.py} +22 -17
- micrOS/source/{IO_tinypico.py → modules/IO_tinypico.py} +38 -0
- micrOS/source/modules/LM_L298N.py +161 -0
- {toolkit/workspace/precompiled → micrOS/source/modules}/LM_L9110_DCmotor.py +3 -3
- micrOS/source/{LM_OV2640.py → modules/LM_OV2640.py} +45 -27
- micrOS/source/{LM_VL53L0X.py → modules/LM_VL53L0X.py} +3 -3
- micrOS/source/{LM_aht10.py → modules/LM_aht10.py} +2 -2
- micrOS/source/{LM_bme280.py → modules/LM_bme280.py} +3 -3
- micrOS/source/{LM_buzzer.py → modules/LM_buzzer.py} +18 -25
- micrOS/source/{LM_cct.py → modules/LM_cct.py} +17 -21
- micrOS/source/modules/LM_cluster.py +255 -0
- micrOS/source/{LM_co2.py → modules/LM_co2.py} +3 -3
- micrOS/source/{LM_dht11.py → modules/LM_dht11.py} +2 -2
- micrOS/source/{LM_dht22.py → modules/LM_dht22.py} +2 -2
- micrOS/source/{LM_dimmer.py → modules/LM_dimmer.py} +9 -9
- micrOS/source/{LM_distance.py → modules/LM_distance.py} +4 -6
- micrOS/source/{LM_ds18.py → modules/LM_ds18.py} +2 -2
- micrOS/source/{LM_esp32.py → modules/LM_esp32.py} +5 -0
- micrOS/source/modules/LM_espnow.py +53 -0
- micrOS/source/modules/LM_fileserver.py +265 -0
- micrOS/source/{LM_genIO.py → modules/LM_genIO.py} +52 -37
- micrOS/source/{LM_haptic.py → modules/LM_haptic.py} +2 -2
- {toolkit/workspace/precompiled → micrOS/source/modules}/LM_i2c.py +5 -4
- micrOS/source/{LM_i2s_mic.py → modules/LM_i2s_mic.py} +6 -7
- micrOS/source/{LM_ld2410.py → modules/LM_ld2410.py} +2 -2
- micrOS/source/{LM_light_sensor.py → modules/LM_light_sensor.py} +10 -21
- micrOS/source/modules/LM_mh_z19c.py +198 -0
- micrOS/source/modules/LM_neoeffects.py +284 -0
- micrOS/source/{LM_neopixel.py → modules/LM_neopixel.py} +19 -23
- micrOS/source/{LM_oled.py → modules/LM_oled.py} +2 -2
- micrOS/source/{LM_oled_sh1106.py → modules/LM_oled_sh1106.py} +3 -3
- micrOS/source/{LM_oled_ui.py → modules/LM_oled_ui.py} +72 -64
- micrOS/source/modules/LM_pacman.py +320 -0
- micrOS/source/{LM_presence.py → modules/LM_presence.py} +11 -15
- micrOS/source/modules/LM_qmi8658.py +204 -0
- micrOS/source/{LM_rencoder.py → modules/LM_rencoder.py} +2 -2
- micrOS/source/{LM_rest.py → modules/LM_rest.py} +4 -6
- micrOS/source/{LM_rgb.py → modules/LM_rgb.py} +21 -29
- micrOS/source/{LM_roboarm.py → modules/LM_roboarm.py} +8 -8
- micrOS/source/modules/LM_robustness.py +137 -0
- micrOS/source/{LM_servo.py → modules/LM_servo.py} +3 -3
- micrOS/source/{LM_stepper.py → modules/LM_stepper.py} +5 -5
- micrOS/source/{LM_switch.py → modules/LM_switch.py} +11 -9
- micrOS/source/{LM_system.py → modules/LM_system.py} +38 -32
- micrOS/source/modules/LM_tcs3472.py +187 -0
- micrOS/source/{LM_telegram.py → modules/LM_telegram.py} +164 -116
- micrOS/source/{LM_trackball.py → modules/LM_trackball.py} +3 -3
- micrOS/source/{LM_veml7700.py → modules/LM_veml7700.py} +2 -2
- micrOS/source/modules/LM_web.py +38 -0
- micrOS/source/urequests.py +39 -15
- {toolkit/workspace/precompiled → micrOS/source/web}/dashboard.html +4 -0
- micrOS/source/web/editor.js +440 -0
- micrOS/source/web/filesui.html +178 -0
- micrOS/source/web/filesui.js +338 -0
- {toolkit/workspace/precompiled → micrOS/source/web}/index.html +44 -2
- micrOS/source/{uapi.js → web/uapi.js} +48 -7
- micrOS/source/{ustyle.css → web/ustyle.css} +6 -3
- micrOS/utests/__init__.py +0 -0
- micrOS/utests/test_scheduler.py +435 -0
- {micrOSDevToolKit-2.9.1.data → microsdevtoolkit-2.26.1.data}/scripts/devToolKit.py +33 -3
- {micrOSDevToolKit-2.9.1.dist-info → microsdevtoolkit-2.26.1.dist-info}/METADATA +327 -268
- microsdevtoolkit-2.26.1.dist-info/RECORD +396 -0
- {micrOSDevToolKit-2.9.1.dist-info → microsdevtoolkit-2.26.1.dist-info}/WHEEL +1 -1
- toolkit/DevEnvCompile.py +63 -33
- toolkit/DevEnvOTA.py +58 -22
- toolkit/DevEnvUSB.py +110 -55
- toolkit/Gateway.py +6 -6
- toolkit/LM_to_compile.dat +6 -4
- toolkit/MicrOSDevEnv.py +127 -57
- toolkit/WebRepl.py +73 -0
- toolkit/dashboard_apps/BackupRestore.py +20 -35
- toolkit/dashboard_apps/CCTDemo.py +12 -17
- toolkit/dashboard_apps/CCTTest.py +20 -24
- toolkit/dashboard_apps/CamStream.py +2 -6
- toolkit/dashboard_apps/CatGame.py +14 -16
- toolkit/dashboard_apps/Dimmer.py +11 -21
- toolkit/dashboard_apps/GetVersion.py +11 -19
- toolkit/dashboard_apps/MicrophoneTest.py +1 -6
- toolkit/dashboard_apps/NeoEffectsDemo.py +22 -35
- toolkit/dashboard_apps/NeopixelTest.py +20 -25
- toolkit/dashboard_apps/PresenceTest.py +2 -8
- toolkit/dashboard_apps/QMI8685_GYRO.py +68 -0
- toolkit/dashboard_apps/RGBTest.py +20 -24
- toolkit/dashboard_apps/RoboArm.py +24 -32
- toolkit/dashboard_apps/SED_test.py +10 -14
- toolkit/dashboard_apps/SensorsTest.py +61 -0
- toolkit/dashboard_apps/SystemTest.py +202 -105
- toolkit/dashboard_apps/Template_app.py +11 -23
- toolkit/dashboard_apps/_app_base.py +34 -0
- toolkit/dashboard_apps/_gyro_visualizer.py +78 -0
- toolkit/dashboard_apps/uLightDemo.py +15 -24
- toolkit/index.html +4 -4
- toolkit/lib/LocalMachine.py +6 -1
- toolkit/lib/MicrosFiles.py +46 -0
- toolkit/lib/Repository.py +64 -0
- toolkit/lib/TerminalColors.py +4 -0
- toolkit/lib/macroScript.py +6 -0
- toolkit/lib/micrOSClient.py +123 -50
- toolkit/lib/micrOSClientHistory.py +156 -0
- toolkit/lib/pip_package_installer.py +5 -2
- toolkit/micrOSdashboard.py +12 -17
- toolkit/micrOSlint.py +20 -8
- toolkit/simulator_lib/__pycache__/IO_darwin.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/aioespnow.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/framebuf.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/machine.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/micropython.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/mip.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/neopixel.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/network.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/sim_common.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/simgc.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/simulator.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/uasyncio.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/uos.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/urandom.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/usocket.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/ussl.cpython-312.pyc +0 -0
- toolkit/simulator_lib/aioespnow.py +28 -0
- toolkit/simulator_lib/dht.py +1 -1
- toolkit/simulator_lib/framebuf.py +49 -1
- toolkit/simulator_lib/machine.py +17 -2
- toolkit/simulator_lib/micropython.py +3 -3
- toolkit/simulator_lib/mip.py +165 -0
- toolkit/simulator_lib/neopixel.py +3 -2
- toolkit/simulator_lib/network.py +2 -1
- toolkit/simulator_lib/node_config.json +2 -3
- toolkit/simulator_lib/ntptime.py +1 -1
- toolkit/simulator_lib/{sim_console.py → sim_common.py} +2 -3
- toolkit/simulator_lib/simgc.py +6 -2
- toolkit/simulator_lib/simulator.py +137 -59
- toolkit/simulator_lib/uasyncio.py +33 -2
- toolkit/simulator_lib/uos.py +147 -0
- toolkit/simulator_lib/urandom.py +4 -0
- toolkit/socketClient.py +43 -23
- toolkit/user_data/webhooks/generic.py +1 -1
- toolkit/user_data/webhooks/macro.py +1 -1
- toolkit/user_data/webhooks/template.py +1 -1
- toolkit/workspace/precompiled/Auth.mpy +0 -0
- toolkit/workspace/precompiled/Common.mpy +0 -0
- toolkit/workspace/precompiled/Config.mpy +0 -0
- toolkit/workspace/precompiled/Debug.mpy +0 -0
- toolkit/workspace/precompiled/Espnow.mpy +0 -0
- toolkit/workspace/precompiled/Files.mpy +0 -0
- toolkit/workspace/precompiled/Hooks.mpy +0 -0
- toolkit/workspace/precompiled/InterConnect.mpy +0 -0
- toolkit/workspace/precompiled/Interrupts.mpy +0 -0
- toolkit/workspace/precompiled/Logger.mpy +0 -0
- toolkit/workspace/precompiled/Network.mpy +0 -0
- toolkit/workspace/precompiled/Notify.mpy +0 -0
- toolkit/workspace/precompiled/Pacman.mpy +0 -0
- toolkit/workspace/precompiled/Scheduler.mpy +0 -0
- toolkit/workspace/precompiled/Server.mpy +0 -0
- toolkit/workspace/precompiled/Shell.mpy +0 -0
- toolkit/workspace/precompiled/Tasks.mpy +0 -0
- toolkit/workspace/precompiled/Time.mpy +0 -0
- toolkit/workspace/precompiled/Types.mpy +0 -0
- toolkit/workspace/precompiled/Web.mpy +0 -0
- toolkit/workspace/precompiled/_mpy.version +1 -1
- toolkit/workspace/precompiled/config/_git.keep +0 -0
- toolkit/workspace/precompiled/helpers.mpy +0 -0
- toolkit/workspace/precompiled/micrOS.mpy +0 -0
- toolkit/workspace/precompiled/micrOSloader.mpy +0 -0
- toolkit/workspace/precompiled/microIO.mpy +0 -0
- toolkit/workspace/precompiled/{IO_esp32.mpy → modules/IO_esp32.mpy} +0 -0
- toolkit/workspace/precompiled/{IO_esp32c3.mpy → modules/IO_esp32c3.mpy} +0 -0
- toolkit/workspace/precompiled/modules/IO_esp32c6.mpy +0 -0
- toolkit/workspace/precompiled/{IO_esp32s2.mpy → modules/IO_esp32s2.mpy} +0 -0
- toolkit/workspace/precompiled/modules/IO_esp32s3.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_m5stamp.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_qtpy.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_rp2.mpy +0 -0
- toolkit/workspace/precompiled/modules/IO_tinypico.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_L298N.mpy +0 -0
- {micrOS/source → toolkit/workspace/precompiled/modules}/LM_L9110_DCmotor.py +3 -3
- toolkit/workspace/precompiled/modules/LM_OV2640.mpy +0 -0
- toolkit/workspace/precompiled/{LM_VL53L0X.py → modules/LM_VL53L0X.py} +3 -3
- toolkit/workspace/precompiled/{LM_aht10.mpy → modules/LM_aht10.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_bme280.mpy → modules/LM_bme280.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_buzzer.mpy → modules/LM_buzzer.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_cct.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_cluster.mpy +0 -0
- toolkit/workspace/precompiled/{LM_co2.mpy → modules/LM_co2.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_dht11.mpy → modules/LM_dht11.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_dht22.mpy → modules/LM_dht22.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_dimmer.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_distance.mpy +0 -0
- toolkit/workspace/precompiled/{LM_ds18.mpy → modules/LM_ds18.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_esp32.py → modules/LM_esp32.py} +5 -0
- toolkit/workspace/precompiled/modules/LM_espnow.py +53 -0
- toolkit/workspace/precompiled/modules/LM_fileserver.mpy +0 -0
- toolkit/workspace/precompiled/{LM_gameOfLife.mpy → modules/LM_gameOfLife.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_genIO.mpy +0 -0
- toolkit/workspace/precompiled/{LM_haptic.mpy → modules/LM_haptic.mpy} +0 -0
- {micrOS/source → toolkit/workspace/precompiled/modules}/LM_i2c.py +5 -4
- toolkit/workspace/precompiled/modules/LM_i2s_mic.mpy +0 -0
- toolkit/workspace/precompiled/{LM_ld2410.mpy → modules/LM_ld2410.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_light_sensor.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_mh_z19c.py +198 -0
- toolkit/workspace/precompiled/modules/LM_neoeffects.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_neopixel.mpy +0 -0
- toolkit/workspace/precompiled/{LM_oled.mpy → modules/LM_oled.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_oled_sh1106.mpy → modules/LM_oled_sh1106.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_oled_ui.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_pacman.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_presence.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_qmi8658.py +204 -0
- toolkit/workspace/precompiled/{LM_rencoder.py → modules/LM_rencoder.py} +2 -2
- toolkit/workspace/precompiled/modules/LM_rest.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_rgb.mpy +0 -0
- toolkit/workspace/precompiled/{LM_rgbcct.mpy → modules/LM_rgbcct.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_roboarm.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_robustness.py +137 -0
- toolkit/workspace/precompiled/{LM_servo.mpy → modules/LM_servo.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_sound_event.mpy → modules/LM_sound_event.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_stepper.mpy → modules/LM_stepper.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_switch.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_system.mpy +0 -0
- toolkit/workspace/precompiled/modules/LM_tcs3472.py +187 -0
- toolkit/workspace/precompiled/modules/LM_telegram.mpy +0 -0
- toolkit/workspace/precompiled/{LM_tinyrgb.mpy → modules/LM_tinyrgb.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_trackball.mpy → modules/LM_trackball.mpy} +0 -0
- toolkit/workspace/precompiled/{LM_veml7700.mpy → modules/LM_veml7700.mpy} +0 -0
- toolkit/workspace/precompiled/modules/LM_web.mpy +0 -0
- toolkit/workspace/precompiled/urequests.mpy +0 -0
- {micrOS/source → toolkit/workspace/precompiled/web}/dashboard.html +4 -0
- toolkit/workspace/precompiled/web/editor.js +440 -0
- toolkit/workspace/precompiled/web/filesui.html +178 -0
- toolkit/workspace/precompiled/web/filesui.js +338 -0
- {micrOS/source → toolkit/workspace/precompiled/web}/index.html +44 -2
- toolkit/workspace/precompiled/{uapi.js → web/uapi.js} +48 -7
- toolkit/workspace/precompiled/{ustyle.css → web/ustyle.css} +6 -3
- micrOS/micropython/esp32-20241129-v1.24.1.bin +0 -0
- micrOS/micropython/esp32c3-20240222-v1.22.2.bin +0 -0
- micrOS/micropython/esp32s2-20240602-v1.23.0.bin +0 -0
- micrOS/micropython/esp32s2-LOLIN_MINI-20220618-v1.19.1.bin +0 -0
- micrOS/micropython/esp32s2-LOLIN_MINI-20240602-v1.23.0.bin +0 -0
- micrOS/micropython/esp32s3-20240105-v1.22.1.bin +0 -0
- micrOS/micropython/esp32s3_spiram_oct-20231005-v1.21.0.bin +0 -0
- micrOS/micropython/esp32s3_spiram_oct-20241129-v1.24.1.bin +0 -0
- micrOS/micropython/rpi-pico-w-20241129-v1.24.1.uf2 +0 -0
- micrOS/micropython/tinypico-20241129-v1.24.1.bin +0 -0
- micrOS/source/LM_L298N_DCmotor.py +0 -86
- micrOS/source/LM_catgame.py +0 -75
- micrOS/source/LM_dashboard_be.py +0 -37
- micrOS/source/LM_demo.py +0 -97
- micrOS/source/LM_espnow.py +0 -23
- micrOS/source/LM_intercon.py +0 -57
- micrOS/source/LM_keychain.py +0 -322
- micrOS/source/LM_lmpacman.py +0 -126
- micrOS/source/LM_neoeffects.py +0 -331
- micrOS/source/LM_oledui.py +0 -972
- micrOS/source/LM_pet_feeder.py +0 -78
- micrOS/source/LM_ph_sensor.py +0 -51
- micrOS/source/LM_robustness.py +0 -74
- micrOS/source/reset.py +0 -11
- micrOSDevToolKit-2.9.1.dist-info/RECORD +0 -365
- toolkit/dashboard_apps/AirQualityBME280.py +0 -36
- toolkit/dashboard_apps/AirQualityDHT22_CO2.py +0 -36
- toolkit/lib/file_extensions.py +0 -16
- toolkit/simulator_lib/__pycache__/sim_console.cpython-312.pyc +0 -0
- toolkit/simulator_lib/__pycache__/sim_console.cpython-38.pyc +0 -0
- toolkit/simulator_lib/__pycache__/sim_console.cpython-39.pyc +0 -0
- toolkit/workspace/precompiled/IO_esp32s3.mpy +0 -0
- toolkit/workspace/precompiled/IO_m5stamp.mpy +0 -0
- toolkit/workspace/precompiled/IO_qtpy.mpy +0 -0
- toolkit/workspace/precompiled/IO_rp2.mpy +0 -0
- toolkit/workspace/precompiled/IO_tinypico.mpy +0 -0
- toolkit/workspace/precompiled/LM_L298N_DCmotor.mpy +0 -0
- toolkit/workspace/precompiled/LM_OV2640.mpy +0 -0
- toolkit/workspace/precompiled/LM_catgame.py +0 -75
- toolkit/workspace/precompiled/LM_cct.mpy +0 -0
- toolkit/workspace/precompiled/LM_dashboard_be.py +0 -37
- toolkit/workspace/precompiled/LM_demo.py +0 -97
- toolkit/workspace/precompiled/LM_dimmer.mpy +0 -0
- toolkit/workspace/precompiled/LM_distance.mpy +0 -0
- toolkit/workspace/precompiled/LM_espnow.py +0 -23
- toolkit/workspace/precompiled/LM_genIO.mpy +0 -0
- toolkit/workspace/precompiled/LM_i2s_mic.mpy +0 -0
- toolkit/workspace/precompiled/LM_intercon.mpy +0 -0
- toolkit/workspace/precompiled/LM_keychain.mpy +0 -0
- toolkit/workspace/precompiled/LM_light_sensor.mpy +0 -0
- toolkit/workspace/precompiled/LM_lmpacman.mpy +0 -0
- toolkit/workspace/precompiled/LM_neoeffects.mpy +0 -0
- toolkit/workspace/precompiled/LM_neopixel.mpy +0 -0
- toolkit/workspace/precompiled/LM_oled_ui.mpy +0 -0
- toolkit/workspace/precompiled/LM_oledui.mpy +0 -0
- toolkit/workspace/precompiled/LM_pet_feeder.py +0 -78
- toolkit/workspace/precompiled/LM_ph_sensor.py +0 -51
- toolkit/workspace/precompiled/LM_presence.mpy +0 -0
- toolkit/workspace/precompiled/LM_rest.mpy +0 -0
- toolkit/workspace/precompiled/LM_rgb.mpy +0 -0
- toolkit/workspace/precompiled/LM_roboarm.mpy +0 -0
- toolkit/workspace/precompiled/LM_robustness.py +0 -74
- toolkit/workspace/precompiled/LM_switch.mpy +0 -0
- toolkit/workspace/precompiled/LM_system.mpy +0 -0
- toolkit/workspace/precompiled/LM_telegram.mpy +0 -0
- toolkit/workspace/precompiled/node_config.json +0 -1
- toolkit/workspace/precompiled/reset.mpy +0 -0
- /micrOS/source/{IO_esp32.py → modules/IO_esp32.py} +0 -0
- /micrOS/source/{IO_esp32c3.py → modules/IO_esp32c3.py} +0 -0
- /micrOS/source/{IO_esp32s2.py → modules/IO_esp32s2.py} +0 -0
- /micrOS/source/{IO_rp2.py → modules/IO_rp2.py} +0 -0
- /micrOS/source/{LM_gameOfLife.py → modules/LM_gameOfLife.py} +0 -0
- /micrOS/source/{LM_rgbcct.py → modules/LM_rgbcct.py} +0 -0
- /micrOS/source/{LM_rp2w.py → modules/LM_rp2w.py} +0 -0
- /micrOS/source/{LM_sdcard.py → modules/LM_sdcard.py} +0 -0
- /micrOS/source/{LM_sound_event.py → modules/LM_sound_event.py} +0 -0
- /micrOS/source/{LM_tinyrgb.py → modules/LM_tinyrgb.py} +0 -0
- /micrOS/source/{udashboard.js → web/udashboard.js} +0 -0
- /micrOS/source/{uwidgets.js → web/uwidgets.js} +0 -0
- /micrOS/source/{uwidgets_pro.js → web/uwidgets_pro.js} +0 -0
- {micrOSDevToolKit-2.9.1.dist-info → microsdevtoolkit-2.26.1.dist-info/licenses}/LICENSE +0 -0
- {micrOSDevToolKit-2.9.1.dist-info → microsdevtoolkit-2.26.1.dist-info}/top_level.txt +0 -0
- /toolkit/workspace/precompiled/{LM_rp2w.py → modules/LM_rp2w.py} +0 -0
- /toolkit/workspace/precompiled/{LM_sdcard.py → modules/LM_sdcard.py} +0 -0
- /toolkit/workspace/precompiled/{udashboard.js → web/udashboard.js} +0 -0
- /toolkit/workspace/precompiled/{uwidgets.js → web/uwidgets.js} +0 -0
- /toolkit/workspace/precompiled/{uwidgets_pro.js → web/uwidgets_pro.js} +0 -0
micrOS/source/helpers.py
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"""
|
|
2
|
+
MICROPYTHON REPL micrOS Cli over UART
|
|
3
|
+
- reset() - reboot board
|
|
4
|
+
- shell() - start async micrOS shell (same as ShellCli)
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from time import sleep
|
|
8
|
+
from uos import listdir
|
|
9
|
+
from machine import soft_reset, reset as hard_reset
|
|
10
|
+
|
|
11
|
+
try:
|
|
12
|
+
from Shell import Shell
|
|
13
|
+
from Tasks import Manager
|
|
14
|
+
from Common import micro_task
|
|
15
|
+
# --- nonblocking stdin line reader (USB serial REPL) ---
|
|
16
|
+
import sys, uselect
|
|
17
|
+
_poll = uselect.poll()
|
|
18
|
+
_poll.register(sys.stdin, uselect.POLLIN)
|
|
19
|
+
_buf = []
|
|
20
|
+
except ImportError as e:
|
|
21
|
+
print(f"!!!Cannot import shell: {e}")
|
|
22
|
+
Shell = None
|
|
23
|
+
|
|
24
|
+
#############################################
|
|
25
|
+
# REBOOT DEVICE #
|
|
26
|
+
#############################################
|
|
27
|
+
|
|
28
|
+
def reset():
|
|
29
|
+
"""
|
|
30
|
+
[HELPER] Reboot board
|
|
31
|
+
"""
|
|
32
|
+
print('Device reboot now, boot micrOSloader...')
|
|
33
|
+
sleep(1)
|
|
34
|
+
|
|
35
|
+
if "main.py" in listdir():
|
|
36
|
+
soft_reset()
|
|
37
|
+
else:
|
|
38
|
+
hard_reset()
|
|
39
|
+
|
|
40
|
+
#############################################
|
|
41
|
+
# SHELL in REPL #
|
|
42
|
+
#############################################
|
|
43
|
+
|
|
44
|
+
def _read_line_nb(echo=True):
|
|
45
|
+
"""
|
|
46
|
+
Non-blocking:
|
|
47
|
+
- returns a full line (str, without trailing newline) when '\n' received
|
|
48
|
+
- returns None if no complete line yet
|
|
49
|
+
Echoes typed characters and supports backspace locally.
|
|
50
|
+
"""
|
|
51
|
+
while _poll.poll(0): # check without waiting
|
|
52
|
+
ch = sys.stdin.read(1)
|
|
53
|
+
if not ch:
|
|
54
|
+
break
|
|
55
|
+
|
|
56
|
+
if ch == '\n': # end-of-line (LF)
|
|
57
|
+
line = ''.join(_buf)
|
|
58
|
+
_buf.clear()
|
|
59
|
+
return line # NOTE: we do NOT print a newline
|
|
60
|
+
if ch == '\r': # ignore CR
|
|
61
|
+
continue
|
|
62
|
+
|
|
63
|
+
# backspace / delete
|
|
64
|
+
if ch in ('\x08', '\x7f'):
|
|
65
|
+
if _buf and echo:
|
|
66
|
+
_buf.pop()
|
|
67
|
+
sys.stdout.write('\x08 \x08') # erase last char visually
|
|
68
|
+
elif _buf:
|
|
69
|
+
_buf.pop()
|
|
70
|
+
continue
|
|
71
|
+
|
|
72
|
+
# regular char
|
|
73
|
+
_buf.append(ch)
|
|
74
|
+
if echo:
|
|
75
|
+
sys.stdout.write(ch)
|
|
76
|
+
return None
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
async def _shell_task(task_id):
|
|
80
|
+
|
|
81
|
+
class ReplShell(Shell):
|
|
82
|
+
async def a_send(self, msg):
|
|
83
|
+
print(f"\n{msg}", end='')
|
|
84
|
+
|
|
85
|
+
shell_inst = ReplShell()
|
|
86
|
+
with micro_task(task_id) as my_task:
|
|
87
|
+
# Init shell welcome msg in repl mode
|
|
88
|
+
await shell_inst.shell("help")
|
|
89
|
+
# Run shell interpreter
|
|
90
|
+
while True:
|
|
91
|
+
my_task.out = "ShellCli in REPL"
|
|
92
|
+
_msg = _read_line_nb() # NoN Blocking ...
|
|
93
|
+
#_msg = input() # Blocking input handling
|
|
94
|
+
if _msg is not None:
|
|
95
|
+
state = await shell_inst.shell(_msg)
|
|
96
|
+
if not state or _msg.strip() == "exit":
|
|
97
|
+
print(f"\nEXIT SHELL: {_msg} ({state}) [Ctrl-C to return micropython repl]")
|
|
98
|
+
break
|
|
99
|
+
await my_task.feed(sleep_ms=10)
|
|
100
|
+
return f"Shell in REPL stopped...({state})"
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def shell():
|
|
104
|
+
"""
|
|
105
|
+
[HELPER] Run Shell in REPL
|
|
106
|
+
"""
|
|
107
|
+
if Shell is None:
|
|
108
|
+
return "Cannot run Shell in REPL, import error"
|
|
109
|
+
# Prepare micrOS Task manager
|
|
110
|
+
aio = Manager()
|
|
111
|
+
# Initiate Shell as repl task
|
|
112
|
+
task_id = "repl.shell"
|
|
113
|
+
aio.create_task(callback=_shell_task(task_id), tag=task_id)
|
|
114
|
+
# Run async main event loop
|
|
115
|
+
aio.run_forever()
|
|
116
|
+
return "Async Main Event Loop Stopped"
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
if __name__ == "helpers":
|
|
120
|
+
# COMMAND LINE INTERFACE
|
|
121
|
+
print("\nmicrOS REPL Tools\n-----------------")
|
|
122
|
+
print("\t[0] helpers.reset() - reboot board")
|
|
123
|
+
if Shell: print("\t[1] helpers.shell() - Start Shell in REPL")
|
|
124
|
+
CHOICES = (reset, shell)
|
|
125
|
+
CHOICE = None
|
|
126
|
+
try:
|
|
127
|
+
CHOICE = input("Select option: ").strip()
|
|
128
|
+
CHOICE = int(CHOICE)
|
|
129
|
+
# EXEC COMMAND
|
|
130
|
+
CHOICES[CHOICE]()
|
|
131
|
+
except Exception as e:
|
|
132
|
+
print(f"Invalid input {CHOICE}: {e}")
|
micrOS/source/micrOS.py
CHANGED
|
@@ -4,16 +4,23 @@ dedicated to micrOS framework.
|
|
|
4
4
|
|
|
5
5
|
Designed by Marcell Ban aka BxNxM
|
|
6
6
|
"""
|
|
7
|
+
|
|
8
|
+
#################################################################
|
|
9
|
+
# INIT FS #
|
|
10
|
+
#################################################################
|
|
11
|
+
from Files import init_micros_dirs
|
|
12
|
+
init_micros_dirs()
|
|
13
|
+
|
|
7
14
|
#################################################################
|
|
8
15
|
# IMPORTS #
|
|
9
16
|
#################################################################
|
|
10
17
|
from Time import ntp_time, suntime
|
|
11
18
|
from Tasks import Manager
|
|
12
|
-
from Hooks import bootup, profiling_info
|
|
19
|
+
from Hooks import bootup, profiling_info, enableESPNow
|
|
13
20
|
from Network import auto_nw_config
|
|
14
21
|
from Server import Server
|
|
15
22
|
from Interrupts import enableInterrupt, enableCron, initEventIRQs
|
|
16
|
-
from Debug import
|
|
23
|
+
from Debug import syslog
|
|
17
24
|
|
|
18
25
|
|
|
19
26
|
#################################################################
|
|
@@ -26,7 +33,7 @@ def irq_handler():
|
|
|
26
33
|
enableCron()
|
|
27
34
|
except Exception as e:
|
|
28
35
|
print(f"[micrOS main] InterruptHandler.enableInterrupt/CronInterrupt error: {e}")
|
|
29
|
-
|
|
36
|
+
syslog(f"[ERR] irq_handler error: {e}")
|
|
30
37
|
|
|
31
38
|
|
|
32
39
|
def external_irq_handler():
|
|
@@ -34,7 +41,7 @@ def external_irq_handler():
|
|
|
34
41
|
initEventIRQs()
|
|
35
42
|
except Exception as e:
|
|
36
43
|
print(f"[micrOS main] InterruptHandler.initEventIRQs error: {e}")
|
|
37
|
-
|
|
44
|
+
syslog(f"[ERR] external_irq_handler error: {e}")
|
|
38
45
|
|
|
39
46
|
|
|
40
47
|
#################################################################
|
|
@@ -53,7 +60,7 @@ def micrOS():
|
|
|
53
60
|
bootup()
|
|
54
61
|
except Exception as e:
|
|
55
62
|
print(f"[micrOS main] Hooks.boot() error: {e}")
|
|
56
|
-
|
|
63
|
+
syslog(f"[ERR] safe_boot: {e}")
|
|
57
64
|
|
|
58
65
|
# NETWORK setup
|
|
59
66
|
nwmd = auto_nw_config()
|
|
@@ -74,10 +81,13 @@ def micrOS():
|
|
|
74
81
|
|
|
75
82
|
# [Server] as async task
|
|
76
83
|
aio.create_task(Server().run_server(), tag='server')
|
|
77
|
-
|
|
84
|
+
|
|
85
|
+
# [ESPNow] server as async task
|
|
86
|
+
enableESPNow()
|
|
87
|
+
profiling_info(label='[memUsage] SYSTEM IS UP AND RUNNING')
|
|
78
88
|
|
|
79
89
|
# [EVENT LOOP] Start async event loop
|
|
80
90
|
aio.run_forever()
|
|
81
91
|
|
|
82
92
|
# UNEXPECTED RESTART ???
|
|
83
|
-
|
|
93
|
+
syslog("[ERR] !!! Unexpected micrOS restart")
|
micrOS/source/micrOSloader.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Module is responsible for invoke micrOS or recovery webrepl mode
|
|
3
|
+
[IMPORTANT] This module must never use any micrOS specific functions in main scope.
|
|
3
4
|
|
|
4
5
|
Designed by Marcell Ban aka BxNxM
|
|
5
6
|
"""
|
|
@@ -11,11 +12,6 @@ try:
|
|
|
11
12
|
import traceback
|
|
12
13
|
except:
|
|
13
14
|
traceback = None
|
|
14
|
-
try:
|
|
15
|
-
from Debug import errlog_add
|
|
16
|
-
except Exception as e:
|
|
17
|
-
print(f"[loader] Import error: {e}")
|
|
18
|
-
errlog_add = None
|
|
19
15
|
from machine import reset
|
|
20
16
|
|
|
21
17
|
|
|
@@ -59,6 +55,8 @@ def _is_micrOS():
|
|
|
59
55
|
|
|
60
56
|
def __recovery_mode():
|
|
61
57
|
# Recovery/Update mode (webrepl) - dependencies: Network, ConfigHandler
|
|
58
|
+
from sys import path
|
|
59
|
+
path.insert(0, "/modules")
|
|
62
60
|
from Network import auto_nw_config
|
|
63
61
|
from Config import cfgget
|
|
64
62
|
pwd = cfgget('appwd') # Get pwd from config
|
|
@@ -70,16 +68,13 @@ def __recovery_mode():
|
|
|
70
68
|
import webrepl
|
|
71
69
|
webrepl.start(password=pwd)
|
|
72
70
|
except Exception as e:
|
|
73
|
-
|
|
74
|
-
errlog_add(f"[ERR][micrOSloader] webrepl failed: {e}")
|
|
75
|
-
print("[loader] Reset .if_mode to micros and reboot")
|
|
71
|
+
print(f"[loader] webrepl failed: {e} - Reset .if_mode to micros and reboot")
|
|
76
72
|
with open('.if_mode', 'w') as f:
|
|
77
73
|
f.write("micros")
|
|
78
74
|
# Reboot machine
|
|
79
75
|
reset()
|
|
80
76
|
|
|
81
77
|
|
|
82
|
-
|
|
83
78
|
def __auto_restart_event():
|
|
84
79
|
"""
|
|
85
80
|
Poll .if_mode value main loop in case of webrepl (background) mode:
|
|
@@ -107,7 +102,7 @@ def __auto_restart_event():
|
|
|
107
102
|
if trigger_is_active and _is_micrOS():
|
|
108
103
|
print("[loader][ota-rebooter][micros][trigger: True] OTA was finished - reboot")
|
|
109
104
|
# Create cleanup indicator file for ConfigHandler
|
|
110
|
-
with open('cleanup
|
|
105
|
+
with open('.cleanup', 'w') as f:
|
|
111
106
|
f.write('')
|
|
112
107
|
# Reboot machine
|
|
113
108
|
reset()
|
|
@@ -127,8 +122,6 @@ def main():
|
|
|
127
122
|
# Handle micrOS system crash (never happened...but) -> webrepl mode default pwd: ADmin123
|
|
128
123
|
print(f"[loader][main mode] micrOS start failed: {e}")
|
|
129
124
|
print("[loader][main mode] -> [recovery mode]")
|
|
130
|
-
if callable(errlog_add):
|
|
131
|
-
errlog_add(f"[ERR][micrOSloader] start failed: {e}")
|
|
132
125
|
# Recovery aka webrepl mode
|
|
133
126
|
__recovery_mode()
|
|
134
127
|
__auto_restart_event()
|
micrOS/source/microIO.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"""
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
This module manages board-independent input and output operations
|
|
3
|
+
for the micrOS framework, ensuring compatibility across different
|
|
4
|
+
microcontrollers.
|
|
5
|
+
- Handles hardware-based pin configurations.
|
|
5
6
|
|
|
6
7
|
Designed by Marcell Ban aka BxNxM
|
|
7
8
|
"""
|
|
@@ -9,7 +10,8 @@ Designed by Marcell Ban aka BxNxM
|
|
|
9
10
|
# IMPORTS #
|
|
10
11
|
#################################################################
|
|
11
12
|
from sys import platform
|
|
12
|
-
from
|
|
13
|
+
from uos import uname
|
|
14
|
+
from Files import ilist_fs, OSPath
|
|
13
15
|
from Logger import syslog
|
|
14
16
|
|
|
15
17
|
#################################################################
|
|
@@ -28,24 +30,25 @@ def detect_platform():
|
|
|
28
30
|
"""
|
|
29
31
|
Unified platform detection for micrOS
|
|
30
32
|
"""
|
|
31
|
-
if 'esp32' in platform:
|
|
32
|
-
from os import uname
|
|
33
|
+
if 'esp32' in platform: # esp32 family
|
|
33
34
|
board = str(uname()[-1]).lower()
|
|
34
35
|
if 'tinypico' in board:
|
|
35
|
-
return 'tinypico'
|
|
36
|
+
return 'tinypico'
|
|
36
37
|
if 'esp32s2' in board:
|
|
37
|
-
return 'esp32s2'
|
|
38
|
+
return 'esp32s2'
|
|
38
39
|
if 'esp32s3' in board:
|
|
39
|
-
return 'esp32s3'
|
|
40
|
+
return 'esp32s3'
|
|
40
41
|
if 'esp32c3' in board:
|
|
41
|
-
return 'esp32c3'
|
|
42
|
-
|
|
42
|
+
return 'esp32c3'
|
|
43
|
+
if 'esp32c6' in board:
|
|
44
|
+
return 'esp32c6'
|
|
45
|
+
return 'esp32' # esp32 family: general
|
|
43
46
|
return platform # esp8266 or something else
|
|
44
47
|
|
|
45
48
|
|
|
46
49
|
def set_pinmap(map_data=None):
|
|
47
50
|
"""
|
|
48
|
-
Select pin map on device (init from ConfigHandler)
|
|
51
|
+
!Select pin map on device (init from ConfigHandler!!!)
|
|
49
52
|
- map_data: default None (n/a), platform detection, like: esp32 -> IO_esp32.mpy
|
|
50
53
|
- map_data: string input, like: my_pinmap -> IO_my_pinmap.mpy
|
|
51
54
|
Parse map_data use cases:
|
|
@@ -65,18 +68,19 @@ def set_pinmap(map_data=None):
|
|
|
65
68
|
|
|
66
69
|
# SELECT LOOKUP TABLE BASED ON PLATFORM / User input
|
|
67
70
|
if isinstance(io_file, str) and io_file != 'n/a':
|
|
68
|
-
if f"IO_{io_file}" in [io.split('.')[0] for io in
|
|
71
|
+
if f"IO_{io_file}" in [io.split('.')[0] for io in ilist_fs(OSPath.MODULES, type_filter='f', select="IO")]:
|
|
69
72
|
PinMap.MAPPING_LUT = io_file
|
|
70
73
|
return PinMap.MAPPING_LUT
|
|
71
74
|
PinMap.MAPPING_LUT = detect_platform()
|
|
72
75
|
return PinMap.MAPPING_LUT
|
|
73
76
|
|
|
74
77
|
|
|
75
|
-
def resolve_pin(tag):
|
|
78
|
+
def resolve_pin(tag:str) -> int:
|
|
76
79
|
"""
|
|
77
|
-
|
|
78
|
-
tag - resolve pin name by logical name (like: switch_1)
|
|
80
|
+
DEPRECATED IN LoadModules - USE bind_pin(tag) wrapper instead
|
|
79
81
|
This function implements IO allocation/booking (with overload protection)
|
|
82
|
+
- based on platform/custom IO_.py lookup table file
|
|
83
|
+
:parm tag: resolve pin name by logical name (like: switch_1)
|
|
80
84
|
return: integer (pin number)
|
|
81
85
|
"""
|
|
82
86
|
# Get pin number on platform by pin key/name
|
|
@@ -94,8 +98,9 @@ def resolve_pin(tag):
|
|
|
94
98
|
return pin_num
|
|
95
99
|
|
|
96
100
|
|
|
97
|
-
def register_pin(tag, number):
|
|
101
|
+
def register_pin(tag:str, number:int) -> int:
|
|
98
102
|
"""
|
|
103
|
+
DEPRECATED IN LoadModules - USE bind_pin(tag, number) wrapper instead
|
|
99
104
|
Book pin (with overload protection) without IO_platform.py file editing
|
|
100
105
|
:param tag: associated pin name for pin number
|
|
101
106
|
:param number: pin number as integer
|
|
@@ -114,11 +119,30 @@ def register_pin(tag, number):
|
|
|
114
119
|
return number
|
|
115
120
|
|
|
116
121
|
|
|
117
|
-
def
|
|
122
|
+
def bind_pin(tag, number=None) -> int:
|
|
123
|
+
"""
|
|
124
|
+
Universal pin handler - assign+lock pin for a tag -> application
|
|
125
|
+
:param tag: tag for application pin booking with built-in tag detection from IO_<device>.py
|
|
126
|
+
:param number: optional parameter to overwrite default tag:pin relation
|
|
127
|
+
DO NOT HANDLE ERROR HERE - SUB ELEMENTS HAVE TO THROUGH ERROR INFO FOR LOAD MODULES
|
|
128
|
+
"""
|
|
129
|
+
if number is None:
|
|
130
|
+
return resolve_pin(tag)
|
|
131
|
+
if isinstance(number, int):
|
|
132
|
+
return register_pin(tag, number)
|
|
133
|
+
raise Exception("microIO.allocate_pin number parameter must be integer!")
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def pinmap_info(show_all=False) -> dict:
|
|
118
137
|
"""
|
|
119
138
|
Debug info function to get active pinmap and booked IO-s
|
|
120
139
|
"""
|
|
121
|
-
|
|
140
|
+
inf = {'map': PinMap.MAPPING_LUT, 'booked': PinMap.IO_USE_DICT, 'custom': PinMap.MAPPING}
|
|
141
|
+
if show_all:
|
|
142
|
+
iomaps = list([iomap.replace("IO_", "").split(".")[0]
|
|
143
|
+
for iomap in ilist_fs(OSPath.MODULES, type_filter='f', select="IO")])
|
|
144
|
+
inf.update({"known_maps": iomaps})
|
|
145
|
+
return inf
|
|
122
146
|
|
|
123
147
|
|
|
124
148
|
def pinmap_search(keys):
|
|
@@ -138,7 +162,7 @@ def pinmap_search(keys):
|
|
|
138
162
|
return pins_cache
|
|
139
163
|
|
|
140
164
|
|
|
141
|
-
def __resolve_pin(name):
|
|
165
|
+
def __resolve_pin(name:str):
|
|
142
166
|
"""
|
|
143
167
|
Dynamic const lookup table handling by var name
|
|
144
168
|
:param name: logical pin name, example: neop, dht, etc.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from micropython import const
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Seeed Studio XIAO ESP32-C6
|
|
5
|
+
|
|
6
|
+
BOARD MICROPYTHON
|
|
7
|
+
D0/A0 - GPIO 0
|
|
8
|
+
D1/A1 - GPIO 1
|
|
9
|
+
D2/A2 - GPIO 2
|
|
10
|
+
D3 - GPIO 21
|
|
11
|
+
D4 SDA - GPIO 22
|
|
12
|
+
D5 SCL - GPIO 23
|
|
13
|
+
D6 TX0 - GPIO 16
|
|
14
|
+
D7 RX0 - GPIO 17
|
|
15
|
+
D8 SCK - GPIO 19
|
|
16
|
+
D9 MISO - GPIO 20
|
|
17
|
+
D10 MOSI - GPIO 18
|
|
18
|
+
BUILTIN LED - GPIO 15
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
# BUILTIN LED
|
|
22
|
+
builtin = const(-15) # BUILT IN LED - progress_led
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# I2C BUS
|
|
26
|
+
i2c_sda = const(22) # D4 - data
|
|
27
|
+
i2c_scl = const(23) # D5 - clock
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# EXTERNAL EVENT IRQ
|
|
31
|
+
irq1 = const(21) # D3 - event irq1 pin
|
|
32
|
+
irq2 = const(2) # D2 - event irq2 pin
|
|
33
|
+
irq3 = const(1) # D1 - event irq3 pin
|
|
34
|
+
irq4 = const(0) # D0 - event irq4 pin
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
neop = const(18) # D10 - neopixel OneWire bus [PWM]
|
|
38
|
+
|
|
@@ -1,7 +1,43 @@
|
|
|
1
1
|
from micropython import const
|
|
2
2
|
|
|
3
|
+
#### DEFINE CUSTOM PROGRESS LED LOGIC ####
|
|
4
|
+
class WS2812:
|
|
5
|
+
NEOPIXEL = None
|
|
6
|
+
WHEEL = None
|
|
7
|
+
PIN = const(38) # BUILT IN LED - progress_led
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
# init ws2812
|
|
11
|
+
from machine import Pin
|
|
12
|
+
from neopixel import NeoPixel
|
|
13
|
+
WS2812.NEOPIXEL = NeoPixel(Pin(WS2812.PIN), 1)
|
|
14
|
+
except Exception as e:
|
|
15
|
+
print(f"[Error] IO error, esp21se ws2812: {e}")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _step_ws2812(pin=False):
|
|
19
|
+
if pin:
|
|
20
|
+
return WS2812.PIN
|
|
21
|
+
|
|
22
|
+
def _color_wheel():
|
|
23
|
+
while True:
|
|
24
|
+
yield 10, 0, 0
|
|
25
|
+
yield 5, 5, 0
|
|
26
|
+
yield 0, 10, 0
|
|
27
|
+
yield 0, 5, 5
|
|
28
|
+
yield 0, 0, 10
|
|
29
|
+
yield 5, 0, 5
|
|
30
|
+
|
|
31
|
+
if WS2812.WHEEL is None:
|
|
32
|
+
WS2812.WHEEL = _color_wheel()
|
|
33
|
+
WS2812.NEOPIXEL[0] = next(WS2812.WHEEL)
|
|
34
|
+
WS2812.NEOPIXEL.write()
|
|
35
|
+
return True # No double-blink
|
|
36
|
+
|
|
37
|
+
#######################################
|
|
38
|
+
|
|
3
39
|
# BUILTIN LED
|
|
4
|
-
builtin =
|
|
40
|
+
builtin = _step_ws2812 # BUILT IN LED - progress_led
|
|
5
41
|
|
|
6
42
|
# ANALOG RGB + WW + CW
|
|
7
43
|
redgb = const(37) # - rgb red channel [PWM]
|
|
@@ -1,7 +1,41 @@
|
|
|
1
1
|
from micropython import const
|
|
2
2
|
|
|
3
|
+
#### DEFINE CUSTOM PROGRESS LED LOGIC ####
|
|
4
|
+
class WS2812:
|
|
5
|
+
NEOPIXEL = None
|
|
6
|
+
WHEEL = None
|
|
7
|
+
PIN = const(21) # BUILT IN LED - progress_led
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
# init ws2812
|
|
11
|
+
from machine import Pin
|
|
12
|
+
from neopixel import NeoPixel
|
|
13
|
+
WS2812.NEOPIXEL = NeoPixel(Pin(WS2812.PIN), 1)
|
|
14
|
+
except Exception as e:
|
|
15
|
+
print(f"[Error] IO error, esp21se ws2812: {e}")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _step_ws2812(pin=False):
|
|
19
|
+
if pin:
|
|
20
|
+
return WS2812.PIN
|
|
21
|
+
|
|
22
|
+
def _color_wheel():
|
|
23
|
+
while True:
|
|
24
|
+
yield 10, 0, 0
|
|
25
|
+
yield 5, 5, 0
|
|
26
|
+
yield 0, 10, 0
|
|
27
|
+
yield 0, 5, 5
|
|
28
|
+
yield 0, 0, 10
|
|
29
|
+
yield 5, 0, 5
|
|
30
|
+
|
|
31
|
+
if WS2812.WHEEL is None:
|
|
32
|
+
WS2812.WHEEL = _color_wheel()
|
|
33
|
+
WS2812.NEOPIXEL[0] = next(WS2812.WHEEL)
|
|
34
|
+
WS2812.NEOPIXEL.write()
|
|
35
|
+
return True # No double-blink
|
|
36
|
+
|
|
3
37
|
# BUILTIN LED
|
|
4
|
-
builtin =
|
|
38
|
+
builtin = _step_ws2812 # BUILT IN LED - progress_led
|
|
5
39
|
|
|
6
40
|
# ANALOG RGB + WW + CW
|
|
7
41
|
redgb = const(43) # - rgb red channel [PWM]
|
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
from micropython import const
|
|
2
|
-
from machine import Pin
|
|
3
|
-
|
|
4
2
|
|
|
5
3
|
#### DEFINE CUSTOM PROGRESS LED LOGIC ####
|
|
4
|
+
class WS2812:
|
|
5
|
+
NEOPIXEL = None
|
|
6
|
+
WHEEL = None
|
|
7
|
+
PIN = const(5) # BUILT IN LED - progress_led
|
|
8
|
+
PIN_ENABLE = const(8) # Power ON LED
|
|
9
|
+
|
|
6
10
|
try:
|
|
11
|
+
# init ws2812
|
|
7
12
|
from neopixel import NeoPixel
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
from machine import Pin
|
|
14
|
+
Pin(WS2812.PIN_ENABLE, Pin.OUT).value(1) # Power ON LED
|
|
15
|
+
WS2812.NEOPIXEL = NeoPixel(Pin(WS2812.PIN), 1) # BUILT IN LED - progress_led
|
|
11
16
|
except Exception as e:
|
|
12
|
-
print(f"[
|
|
13
|
-
|
|
17
|
+
print(f"[Error] IO error, esp21se ws2812: {e}")
|
|
18
|
+
|
|
14
19
|
|
|
20
|
+
def _step_ws2812(pin=False):
|
|
21
|
+
if pin:
|
|
22
|
+
return WS2812.PIN
|
|
15
23
|
|
|
16
|
-
def _step_ws2812():
|
|
17
|
-
global PLED_OBJ, NEO_WHEEL
|
|
18
24
|
def _color_wheel():
|
|
19
25
|
while True:
|
|
20
26
|
yield 10, 0, 0
|
|
@@ -23,15 +29,14 @@ def _step_ws2812():
|
|
|
23
29
|
yield 0, 5, 5
|
|
24
30
|
yield 0, 0, 10
|
|
25
31
|
yield 5, 0, 5
|
|
26
|
-
if PLED_OBJ is None:
|
|
27
|
-
return False
|
|
28
|
-
if NEO_WHEEL is None:
|
|
29
|
-
NEO_WHEEL = _color_wheel()
|
|
30
|
-
PLED_OBJ[0] = next(NEO_WHEEL)
|
|
31
|
-
PLED_OBJ.write()
|
|
32
|
-
return True
|
|
33
|
-
###########################################
|
|
34
32
|
|
|
33
|
+
if WS2812.WHEEL is None:
|
|
34
|
+
WS2812.WHEEL = _color_wheel()
|
|
35
|
+
WS2812.NEOPIXEL[0] = next(WS2812.WHEEL)
|
|
36
|
+
WS2812.NEOPIXEL.write()
|
|
37
|
+
return True # No double-blink
|
|
38
|
+
|
|
39
|
+
###########################################
|
|
35
40
|
|
|
36
41
|
# BUILTIN LED
|
|
37
42
|
builtin = _step_ws2812
|
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
from micropython import const
|
|
2
2
|
|
|
3
|
+
#### DEFINE CUSTOM PROGRESS LED LOGIC ####
|
|
4
|
+
class APA102:
|
|
5
|
+
DOTSTAR = None
|
|
6
|
+
COLOR_WHEEL = None
|
|
7
|
+
COLOR_INDEX:int = 0
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
# init apa102
|
|
11
|
+
from machine import Pin
|
|
12
|
+
from machine import SoftSPI
|
|
13
|
+
from dotstar import DotStar
|
|
14
|
+
from tinypico import DOTSTAR_CLK, DOTSTAR_DATA, SPI_MISO, set_dotstar_power, dotstar_color_wheel
|
|
15
|
+
spi = SoftSPI(sck=Pin(DOTSTAR_CLK), mosi=Pin(DOTSTAR_DATA), miso=Pin(SPI_MISO))
|
|
16
|
+
# Create a DotStar instance
|
|
17
|
+
APA102.DOTSTAR = DotStar(spi, 1, brightness=0.4) # Just one DotStar, half brightness
|
|
18
|
+
# Turn on the power to the DotStar
|
|
19
|
+
set_dotstar_power(True)
|
|
20
|
+
APA102.COLOR_WHEEL = dotstar_color_wheel
|
|
21
|
+
except Exception as e:
|
|
22
|
+
print(f"[Error] IO error, tinypico apa102: {e}")
|
|
23
|
+
|
|
24
|
+
def _step_apa102(pin=False):
|
|
25
|
+
if pin:
|
|
26
|
+
return None
|
|
27
|
+
# Get the R,G,B values of the next colour
|
|
28
|
+
r, g, b = APA102.COLOR_WHEEL(APA102.COLOR_INDEX*2)
|
|
29
|
+
# Set the colour on the DOTSTAR
|
|
30
|
+
APA102.DOTSTAR[0] = (int(r * 0.6), g, b, 0.4)
|
|
31
|
+
# Increase the wheel index
|
|
32
|
+
APA102.COLOR_INDEX = 0 if APA102.COLOR_INDEX > 1000 else APA102.COLOR_INDEX + 2
|
|
33
|
+
return True # No double-blink
|
|
34
|
+
|
|
35
|
+
###################################################
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# BUILTIN LED
|
|
39
|
+
builtin = _step_apa102
|
|
40
|
+
|
|
3
41
|
# ANALOG RGB + WW + CW
|
|
4
42
|
redgb = const(25) # D25 - rgb red channel [PWM CH1]
|
|
5
43
|
rgreenb = const(26) # D26 - rgb green channel [PWM CH2]
|