├── .github └── workflows │ └── main.yml ├── .gitignore ├── .gitmodules ├── CNAME ├── LICENSE ├── README.md ├── docs ├── .nojekyll ├── CNAME ├── _images │ ├── adafruit_products_pinoutstop.jpg │ ├── bitmap.png │ ├── camera.jpg │ ├── collision.png │ ├── ek_ra6m2_board.jpg │ ├── esp32.jpg │ ├── fading_leds_breadboard_fritzing.png │ ├── itsybitsy_m4_express.jpg │ ├── linprob.png │ ├── mem32_gpio_output.jpg │ ├── pico_pinout.png │ ├── pinout-openmv-ae3-pag7936.png │ ├── pinout-openmv-cam-h7-ov7725.png │ ├── pinout-openmv-cam-h7-ov77251.png │ ├── pinout-openmv-cam-h7-plus-ov5640.png │ ├── pinout-openmv-cam-h7-plus-ov56401.png │ ├── pinout-openmv-cam-m4-ov2640.png │ ├── pinout-openmv-cam-m4-ov26401.png │ ├── pinout-openmv-cam-m4-ov7725.png │ ├── pinout-openmv-cam-m4-ov77251.png │ ├── pinout-openmv-cam-m7-ov7725.png │ ├── pinout-openmv-cam-m7-ov77251.png │ ├── pinout-openmv-cam-rt1062-ov5640.png │ ├── pinout-openmv-n6-pag7936.png │ ├── pyboard_servo.jpg │ ├── pyboard_usb_micro.jpg │ ├── skin_amp_1.jpg │ ├── skin_amp_2.jpg │ ├── skin_lcd_1.jpg │ ├── skin_lcd_2.jpg │ └── teensy_4.1.jpg ├── _sources │ ├── develop │ │ ├── cmodules.rst.txt │ │ ├── compiler.rst.txt │ │ ├── extendingmicropython.rst.txt │ │ ├── gettingstarted.rst.txt │ │ ├── index.rst.txt │ │ ├── library.rst.txt │ │ ├── maps.rst.txt │ │ ├── memorymgt.rst.txt │ │ ├── natmod.rst.txt │ │ ├── optimizations.rst.txt │ │ ├── porting.rst.txt │ │ ├── publiccapi.rst.txt │ │ ├── qstr.rst.txt │ │ └── writingtests.rst.txt │ ├── differences │ │ ├── python_310.rst.txt │ │ ├── python_35.rst.txt │ │ ├── python_36.rst.txt │ │ ├── python_37.rst.txt │ │ ├── python_38.rst.txt │ │ └── python_39.rst.txt │ ├── esp32 │ │ ├── general.rst.txt │ │ ├── quickref.rst.txt │ │ └── tutorial │ │ │ ├── index.rst.txt │ │ │ ├── intro.rst.txt │ │ │ ├── peripheral_access.rst.txt │ │ │ └── pwm.rst.txt │ ├── esp8266 │ │ ├── general.rst.txt │ │ ├── quickref.rst.txt │ │ └── tutorial │ │ │ ├── adc.rst.txt │ │ │ ├── apa102.rst.txt │ │ │ ├── dht.rst.txt │ │ │ ├── filesystem.rst.txt │ │ │ ├── index.rst.txt │ │ │ ├── intro.rst.txt │ │ │ ├── neopixel.rst.txt │ │ │ ├── network_basics.rst.txt │ │ │ ├── network_tcp.rst.txt │ │ │ ├── nextsteps.rst.txt │ │ │ ├── onewire.rst.txt │ │ │ ├── pins.rst.txt │ │ │ ├── powerctrl.rst.txt │ │ │ ├── pwm.rst.txt │ │ │ ├── repl.rst.txt │ │ │ └── ssd1306.rst.txt │ ├── genrst │ │ ├── builtin_types.rst.txt │ │ ├── core_language.rst.txt │ │ ├── index.rst.txt │ │ ├── modules.rst.txt │ │ └── syntax.rst.txt │ ├── index.rst.txt │ ├── library │ │ ├── _thread.rst.txt │ │ ├── array.rst.txt │ │ ├── asyncio.rst.txt │ │ ├── binascii.rst.txt │ │ ├── bluetooth.rst.txt │ │ ├── btree.rst.txt │ │ ├── builtins.rst.txt │ │ ├── cmath.rst.txt │ │ ├── collections.rst.txt │ │ ├── cryptolib.rst.txt │ │ ├── deflate.rst.txt │ │ ├── errno.rst.txt │ │ ├── esp.rst.txt │ │ ├── esp32.rst.txt │ │ ├── espnow.rst.txt │ │ ├── framebuf.rst.txt │ │ ├── gc.rst.txt │ │ ├── gzip.rst.txt │ │ ├── hashlib.rst.txt │ │ ├── heapq.rst.txt │ │ ├── index.rst.txt │ │ ├── io.rst.txt │ │ ├── json.rst.txt │ │ ├── lcd160cr.rst.txt │ │ ├── machine.ADC.rst.txt │ │ ├── machine.ADCBlock.rst.txt │ │ ├── machine.ADCWiPy.rst.txt │ │ ├── machine.CAN.rst.txt │ │ ├── machine.I2C.rst.txt │ │ ├── machine.I2S.rst.txt │ │ ├── machine.LED.rst.txt │ │ ├── machine.PWM.rst.txt │ │ ├── machine.Pin.rst.txt │ │ ├── machine.RTC.rst.txt │ │ ├── machine.SD.rst.txt │ │ ├── machine.SDCard.rst.txt │ │ ├── machine.SPI.rst.txt │ │ ├── machine.Signal.rst.txt │ │ ├── machine.Timer.rst.txt │ │ ├── machine.TimerWiPy.rst.txt │ │ ├── machine.UART.rst.txt │ │ ├── machine.WDT.rst.txt │ │ ├── machine.rst.txt │ │ ├── marshal.rst.txt │ │ ├── math.rst.txt │ │ ├── micropython.rst.txt │ │ ├── mutex.rst.txt │ │ ├── neopixel.rst.txt │ │ ├── network.LAN.rst.txt │ │ ├── network.PPP.rst.txt │ │ ├── network.WINC.rst.txt │ │ ├── network.WIZNET5K.rst.txt │ │ ├── network.WLAN.rst.txt │ │ ├── network.WLANWiPy.rst.txt │ │ ├── network.rst.txt │ │ ├── omv.audio.rst.txt │ │ ├── omv.buzzer.rst.txt │ │ ├── omv.cpufreq.rst.txt │ │ ├── omv.display.DACBacklight.rst.txt │ │ ├── omv.display.PWMBacklight.rst.txt │ │ ├── omv.display.ST7701.rst.txt │ │ ├── omv.display.displaydata.rst.txt │ │ ├── omv.display.dsidisplay.rst.txt │ │ ├── omv.display.rgbdisplay.rst.txt │ │ ├── omv.display.rst.txt │ │ ├── omv.display.spidisplay.rst.txt │ │ ├── omv.fir.rst.txt │ │ ├── omv.ft5x06.rst.txt │ │ ├── omv.gif.rst.txt │ │ ├── omv.gt911.rst.txt │ │ ├── omv.image.rst.txt │ │ ├── omv.imu.rst.txt │ │ ├── omv.lcd.rst.txt │ │ ├── omv.micro_speech.rst.txt │ │ ├── omv.mjpeg.rst.txt │ │ ├── omv.ml.apps.rst.txt │ │ ├── omv.ml.postprocessing.rst.txt │ │ ├── omv.ml.preprocessing.rst.txt │ │ ├── omv.ml.rst.txt │ │ ├── omv.ml.utils.rst.txt │ │ ├── omv.omv.rst.txt │ │ ├── omv.rpc.rst.txt │ │ ├── omv.rtsp.rst.txt │ │ ├── omv.sensor.rst.txt │ │ ├── omv.tf.rst.txt │ │ ├── omv.tfp410.rst.txt │ │ ├── omv.tof.rst.txt │ │ ├── omv.tv.rst.txt │ │ ├── openamp.rst.txt │ │ ├── os.rst.txt │ │ ├── platform.rst.txt │ │ ├── pyb.ADC.rst.txt │ │ ├── pyb.Accel.rst.txt │ │ ├── pyb.CAN.rst.txt │ │ ├── pyb.DAC.rst.txt │ │ ├── pyb.ExtInt.rst.txt │ │ ├── pyb.Flash.rst.txt │ │ ├── pyb.I2C.rst.txt │ │ ├── pyb.LCD.rst.txt │ │ ├── pyb.LED.rst.txt │ │ ├── pyb.Pin.rst.txt │ │ ├── pyb.RTC.rst.txt │ │ ├── pyb.SPI.rst.txt │ │ ├── pyb.Servo.rst.txt │ │ ├── pyb.Switch.rst.txt │ │ ├── pyb.Timer.rst.txt │ │ ├── pyb.UART.rst.txt │ │ ├── pyb.USB_HID.rst.txt │ │ ├── pyb.USB_VCP.rst.txt │ │ ├── pyb.rst.txt │ │ ├── random.rst.txt │ │ ├── re.rst.txt │ │ ├── requests.rst.txt │ │ ├── rp2.Flash.rst.txt │ │ ├── rp2.PIO.rst.txt │ │ ├── rp2.StateMachine.rst.txt │ │ ├── rp2.rst.txt │ │ ├── select.rst.txt │ │ ├── socket.rst.txt │ │ ├── ssl.rst.txt │ │ ├── stm.rst.txt │ │ ├── struct.rst.txt │ │ ├── sys.rst.txt │ │ ├── time.rst.txt │ │ ├── uasyncio.rst.txt │ │ ├── uctypes.rst.txt │ │ ├── uping.rst.txt │ │ ├── urequests.rst.txt │ │ ├── vfs.rst.txt │ │ ├── wipy.rst.txt │ │ ├── wm8960.rst.txt │ │ ├── zephyr.DiskAccess.rst.txt │ │ ├── zephyr.FlashArea.rst.txt │ │ ├── zephyr.rst.txt │ │ ├── zephyr.zsensor.rst.txt │ │ └── zlib.rst.txt │ ├── license.rst.txt │ ├── mimxrt │ │ ├── general.rst.txt │ │ ├── pinout.rst.txt │ │ ├── quickref.rst.txt │ │ └── tutorial │ │ │ └── intro.rst.txt │ ├── openmvcam │ │ ├── general.rst.txt │ │ ├── quickref.rst.txt │ │ └── tutorial │ │ │ ├── analog_io.rst.txt │ │ │ ├── gpio_control.rst.txt │ │ │ ├── hardware_setup.rst.txt │ │ │ ├── index.rst.txt │ │ │ ├── io_tutorial.rst.txt │ │ │ ├── led_control.rst.txt │ │ │ ├── more_information.rst.txt │ │ │ ├── openmvide_overview.rst.txt │ │ │ ├── overview.rst.txt │ │ │ ├── production.rst.txt │ │ │ ├── script_structure.rst.txt │ │ │ ├── software_setup.rst.txt │ │ │ ├── system_architecture.rst.txt │ │ │ └── uart_control.rst.txt │ ├── pyboard │ │ ├── general.rst.txt │ │ ├── hardware │ │ │ └── index.rst.txt │ │ ├── quickref.rst.txt │ │ └── tutorial │ │ │ ├── accel.rst.txt │ │ │ ├── amp_skin.rst.txt │ │ │ ├── assembler.rst.txt │ │ │ ├── debounce.rst.txt │ │ │ ├── fading_led.rst.txt │ │ │ ├── index.rst.txt │ │ │ ├── intro.rst.txt │ │ │ ├── lcd160cr_skin.rst.txt │ │ │ ├── lcd_skin.rst.txt │ │ │ ├── leds.rst.txt │ │ │ ├── pass_through.rst.txt │ │ │ ├── power_ctrl.rst.txt │ │ │ ├── repl.rst.txt │ │ │ ├── reset.rst.txt │ │ │ ├── script.rst.txt │ │ │ ├── servo.rst.txt │ │ │ ├── switch.rst.txt │ │ │ ├── timer.rst.txt │ │ │ └── usb_mouse.rst.txt │ ├── reference │ │ ├── asm_thumb2_arith.rst.txt │ │ ├── asm_thumb2_compare.rst.txt │ │ ├── asm_thumb2_directives.rst.txt │ │ ├── asm_thumb2_float.rst.txt │ │ ├── asm_thumb2_hints_tips.rst.txt │ │ ├── asm_thumb2_index.rst.txt │ │ ├── asm_thumb2_label_branch.rst.txt │ │ ├── asm_thumb2_ldr.rst.txt │ │ ├── asm_thumb2_logical_bit.rst.txt │ │ ├── asm_thumb2_misc.rst.txt │ │ ├── asm_thumb2_mov.rst.txt │ │ ├── asm_thumb2_stack.rst.txt │ │ ├── asm_thumb2_str.rst.txt │ │ ├── constrained.rst.txt │ │ ├── filesystem.rst.txt │ │ ├── glossary.rst.txt │ │ ├── index.rst.txt │ │ ├── isr_rules.rst.txt │ │ ├── manifest.rst.txt │ │ ├── micropython2_migration.rst.txt │ │ ├── mpremote.rst.txt │ │ ├── mpyfiles.rst.txt │ │ ├── packages.rst.txt │ │ ├── pyboard.py.rst.txt │ │ ├── repl.rst.txt │ │ ├── reset_boot.rst.txt │ │ └── speed_python.rst.txt │ ├── renesas-ra │ │ ├── general.rst.txt │ │ ├── quickref.rst.txt │ │ └── tutorial │ │ │ ├── index.rst.txt │ │ │ ├── intro.rst.txt │ │ │ ├── program_in_flash.rst.txt │ │ │ ├── reset.rst.txt │ │ │ ├── troubleshooting.rst.txt │ │ │ └── using_peripheral.rst.txt │ ├── rp2 │ │ ├── general.rst.txt │ │ ├── quickref.rst.txt │ │ └── tutorial │ │ │ ├── intro.rst.txt │ │ │ └── pio.rst.txt │ ├── samd │ │ ├── general.rst.txt │ │ ├── pinout.rst.txt │ │ ├── quickref.rst.txt │ │ └── tutorial │ │ │ └── intro.rst.txt │ ├── unix │ │ └── quickref.rst.txt │ ├── wipy │ │ ├── general.rst.txt │ │ ├── quickref.rst.txt │ │ └── tutorial │ │ │ ├── blynk.rst.txt │ │ │ ├── index.rst.txt │ │ │ ├── intro.rst.txt │ │ │ ├── repl.rst.txt │ │ │ ├── reset.rst.txt │ │ │ ├── timer.rst.txt │ │ │ └── wlan.rst.txt │ └── zephyr │ │ ├── general.rst.txt │ │ ├── quickref.rst.txt │ │ └── tutorial │ │ ├── index.rst.txt │ │ ├── intro.rst.txt │ │ ├── pins.rst.txt │ │ ├── repl.rst.txt │ │ └── storage.rst.txt ├── _static │ ├── _sphinx_javascript_frameworks_compat.js │ ├── basic.css │ ├── classic.css │ ├── css │ │ ├── badge_only.css │ │ ├── fonts │ │ │ ├── Roboto-Slab-Bold.woff │ │ │ ├── Roboto-Slab-Bold.woff2 │ │ │ ├── Roboto-Slab-Regular.woff │ │ │ ├── Roboto-Slab-Regular.woff2 │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ ├── fontawesome-webfont.woff2 │ │ │ ├── lato-bold-italic.woff │ │ │ ├── lato-bold-italic.woff2 │ │ │ ├── lato-bold.woff │ │ │ ├── lato-bold.woff2 │ │ │ ├── lato-normal-italic.woff │ │ │ ├── lato-normal-italic.woff2 │ │ │ ├── lato-normal.woff │ │ │ └── lato-normal.woff2 │ │ └── theme.css │ ├── custom.css │ ├── customstyle.css │ ├── default.css │ ├── doctools.js │ ├── documentation_options.js │ ├── favicon.ico │ ├── file.png │ ├── fonts │ │ ├── Lato │ │ │ ├── lato-bold.eot │ │ │ ├── lato-bold.ttf │ │ │ ├── lato-bold.woff │ │ │ ├── lato-bold.woff2 │ │ │ ├── lato-bolditalic.eot │ │ │ ├── lato-bolditalic.ttf │ │ │ ├── lato-bolditalic.woff │ │ │ ├── lato-bolditalic.woff2 │ │ │ ├── lato-italic.eot │ │ │ ├── lato-italic.ttf │ │ │ ├── lato-italic.woff │ │ │ ├── lato-italic.woff2 │ │ │ ├── lato-regular.eot │ │ │ ├── lato-regular.ttf │ │ │ ├── lato-regular.woff │ │ │ └── lato-regular.woff2 │ │ └── RobotoSlab │ │ │ ├── roboto-slab-v7-bold.eot │ │ │ ├── roboto-slab-v7-bold.ttf │ │ │ ├── roboto-slab-v7-bold.woff │ │ │ ├── roboto-slab-v7-bold.woff2 │ │ │ ├── roboto-slab-v7-regular.eot │ │ │ ├── roboto-slab-v7-regular.ttf │ │ │ ├── roboto-slab-v7-regular.woff │ │ │ └── roboto-slab-v7-regular.woff2 │ ├── jquery-3.4.1.js │ ├── jquery.js │ ├── js │ │ ├── badge_only.js │ │ ├── html5shiv-printshiv.min.js │ │ ├── html5shiv.min.js │ │ ├── theme.js │ │ └── versions.js │ ├── language_data.js │ ├── minus.png │ ├── openmv.ico │ ├── plus.png │ ├── pygments.css │ ├── searchtools.js │ ├── sidebar.js │ ├── sphinx_highlight.js │ ├── underscore-1.3.1.js │ ├── underscore.js │ └── web-logo-sticky.png ├── develop │ ├── cmodules.html │ ├── compiler.html │ ├── extendingmicropython.html │ ├── gettingstarted.html │ ├── index.html │ ├── library.html │ ├── maps.html │ ├── memorymgt.html │ ├── natmod.html │ ├── optimizations.html │ ├── porting.html │ ├── publiccapi.html │ ├── qstr.html │ └── writingtests.html ├── differences │ ├── python_310.html │ ├── python_35.html │ ├── python_36.html │ ├── python_37.html │ ├── python_38.html │ └── python_39.html ├── esp32 │ ├── general.html │ ├── quickref.html │ └── tutorial │ │ ├── index.html │ │ ├── intro.html │ │ ├── peripheral_access.html │ │ └── pwm.html ├── esp8266 │ ├── general.html │ ├── quickref.html │ └── tutorial │ │ ├── adc.html │ │ ├── apa102.html │ │ ├── dht.html │ │ ├── filesystem.html │ │ ├── index.html │ │ ├── intro.html │ │ ├── neopixel.html │ │ ├── network_basics.html │ │ ├── network_tcp.html │ │ ├── nextsteps.html │ │ ├── onewire.html │ │ ├── pins.html │ │ ├── powerctrl.html │ │ ├── pwm.html │ │ ├── repl.html │ │ └── ssd1306.html ├── genindex.html ├── genrst │ ├── builtin_types.html │ ├── core_language.html │ ├── index.html │ ├── modules.html │ └── syntax.html ├── index.html ├── library │ ├── _thread.html │ ├── array.html │ ├── asyncio.html │ ├── binascii.html │ ├── bluetooth.html │ ├── btree.html │ ├── builtins.html │ ├── cmath.html │ ├── collections.html │ ├── cryptolib.html │ ├── deflate.html │ ├── errno.html │ ├── esp.html │ ├── esp32.html │ ├── espnow.html │ ├── framebuf.html │ ├── gc.html │ ├── gzip.html │ ├── hashlib.html │ ├── heapq.html │ ├── index.html │ ├── io.html │ ├── json.html │ ├── lcd160cr.html │ ├── machine.ADC.html │ ├── machine.ADCBlock.html │ ├── machine.ADCWiPy.html │ ├── machine.CAN.html │ ├── machine.I2C.html │ ├── machine.I2S.html │ ├── machine.LED.html │ ├── machine.PWM.html │ ├── machine.Pin.html │ ├── machine.RTC.html │ ├── machine.SD.html │ ├── machine.SDCard.html │ ├── machine.SPI.html │ ├── machine.Signal.html │ ├── machine.Timer.html │ ├── machine.TimerWiPy.html │ ├── machine.UART.html │ ├── machine.WDT.html │ ├── machine.html │ ├── marshal.html │ ├── math.html │ ├── micropython.html │ ├── mutex.html │ ├── neopixel.html │ ├── network.LAN.html │ ├── network.PPP.html │ ├── network.WINC.html │ ├── network.WIZNET5K.html │ ├── network.WLAN.html │ ├── network.WLANWiPy.html │ ├── network.html │ ├── omv.audio.html │ ├── omv.buzzer.html │ ├── omv.cpufreq.html │ ├── omv.display.DACBacklight.html │ ├── omv.display.PWMBacklight.html │ ├── omv.display.ST7701.html │ ├── omv.display.displaydata.html │ ├── omv.display.dsidisplay.html │ ├── omv.display.html │ ├── omv.display.rgbdisplay.html │ ├── omv.display.spidisplay.html │ ├── omv.fir.html │ ├── omv.ft5x06.html │ ├── omv.gif.html │ ├── omv.gt911.html │ ├── omv.image.html │ ├── omv.imu.html │ ├── omv.lcd.html │ ├── omv.micro_speech.html │ ├── omv.mjpeg.html │ ├── omv.ml.apps.html │ ├── omv.ml.html │ ├── omv.ml.postprocessing.html │ ├── omv.ml.preprocessing.html │ ├── omv.ml.utils.html │ ├── omv.omv.html │ ├── omv.rpc.html │ ├── omv.rtsp.html │ ├── omv.sensor.html │ ├── omv.tf.html │ ├── omv.tfp410.html │ ├── omv.tof.html │ ├── omv.tv.html │ ├── openamp.html │ ├── os.html │ ├── platform.html │ ├── pyb.ADC.html │ ├── pyb.Accel.html │ ├── pyb.CAN.html │ ├── pyb.DAC.html │ ├── pyb.ExtInt.html │ ├── pyb.Flash.html │ ├── pyb.I2C.html │ ├── pyb.LCD.html │ ├── pyb.LED.html │ ├── pyb.Pin.html │ ├── pyb.RTC.html │ ├── pyb.SPI.html │ ├── pyb.Servo.html │ ├── pyb.Switch.html │ ├── pyb.Timer.html │ ├── pyb.UART.html │ ├── pyb.USB_HID.html │ ├── pyb.USB_VCP.html │ ├── pyb.html │ ├── random.html │ ├── re.html │ ├── requests.html │ ├── rp2.Flash.html │ ├── rp2.PIO.html │ ├── rp2.StateMachine.html │ ├── rp2.html │ ├── select.html │ ├── socket.html │ ├── ssl.html │ ├── stm.html │ ├── struct.html │ ├── sys.html │ ├── time.html │ ├── uasyncio.html │ ├── uctypes.html │ ├── uping.html │ ├── urequests.html │ ├── vfs.html │ ├── wipy.html │ ├── wm8960.html │ ├── zephyr.DiskAccess.html │ ├── zephyr.FlashArea.html │ ├── zephyr.html │ ├── zephyr.zsensor.html │ └── zlib.html ├── license.html ├── mimxrt │ ├── general.html │ ├── pinout.html │ ├── quickref.html │ └── tutorial │ │ └── intro.html ├── objects.inv ├── openmvcam │ ├── general.html │ ├── quickref.html │ └── tutorial │ │ ├── analog_io.html │ │ ├── gpio_control.html │ │ ├── hardware_setup.html │ │ ├── index.html │ │ ├── io_tutorial.html │ │ ├── led_control.html │ │ ├── more_information.html │ │ ├── openmvide_overview.html │ │ ├── overview.html │ │ ├── production.html │ │ ├── script_structure.html │ │ ├── software_setup.html │ │ ├── system_architecture.html │ │ └── uart_control.html ├── py-modindex.html ├── pyboard │ ├── general.html │ ├── hardware │ │ └── index.html │ ├── quickref.html │ └── tutorial │ │ ├── accel.html │ │ ├── amp_skin.html │ │ ├── assembler.html │ │ ├── debounce.html │ │ ├── fading_led.html │ │ ├── index.html │ │ ├── intro.html │ │ ├── lcd160cr_skin.html │ │ ├── lcd_skin.html │ │ ├── leds.html │ │ ├── pass_through.html │ │ ├── power_ctrl.html │ │ ├── repl.html │ │ ├── reset.html │ │ ├── script.html │ │ ├── servo.html │ │ ├── switch.html │ │ ├── timer.html │ │ └── usb_mouse.html ├── reference │ ├── asm_thumb2_arith.html │ ├── asm_thumb2_compare.html │ ├── asm_thumb2_directives.html │ ├── asm_thumb2_float.html │ ├── asm_thumb2_hints_tips.html │ ├── asm_thumb2_index.html │ ├── asm_thumb2_label_branch.html │ ├── asm_thumb2_ldr.html │ ├── asm_thumb2_logical_bit.html │ ├── asm_thumb2_misc.html │ ├── asm_thumb2_mov.html │ ├── asm_thumb2_stack.html │ ├── asm_thumb2_str.html │ ├── constrained.html │ ├── filesystem.html │ ├── glossary.html │ ├── index.html │ ├── isr_rules.html │ ├── manifest.html │ ├── micropython2_migration.html │ ├── mpremote.html │ ├── mpyfiles.html │ ├── packages.html │ ├── pyboard.py.html │ ├── repl.html │ ├── reset_boot.html │ └── speed_python.html ├── renesas-ra │ ├── general.html │ ├── quickref.html │ └── tutorial │ │ ├── index.html │ │ ├── intro.html │ │ ├── program_in_flash.html │ │ ├── reset.html │ │ ├── troubleshooting.html │ │ └── using_peripheral.html ├── rp2 │ ├── general.html │ ├── quickref.html │ └── tutorial │ │ ├── intro.html │ │ └── pio.html ├── samd │ ├── general.html │ ├── pinout.html │ ├── quickref.html │ └── tutorial │ │ └── intro.html ├── search.html ├── searchindex.js ├── unix │ └── quickref.html ├── wipy │ ├── general.html │ ├── quickref.html │ └── tutorial │ │ ├── blynk.html │ │ ├── index.html │ │ ├── intro.html │ │ ├── repl.html │ │ ├── reset.html │ │ ├── timer.html │ │ └── wlan.html └── zephyr │ ├── general.html │ ├── quickref.html │ └── tutorial │ ├── index.html │ ├── intro.html │ ├── pins.html │ ├── repl.html │ └── storage.html └── make.py /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-22.04 11 | 12 | steps: 13 | - uses: actions/checkout@v3 14 | with: 15 | submodules: 'true' 16 | 17 | - uses: ammaraskar/sphinx-action@master 18 | with: 19 | pre-build-command: "rm micropython/docs/requirements.txt && pip install sphinx -U && pip install sphinx_rtd_theme -U && pip install sphinx" 20 | docs-folder: "micropython/docs/" 21 | 22 | - uses: actions/upload-artifact@v4 23 | with: 24 | name: html 25 | path: micropython/docs/build/html/ 26 | 27 | - name: Commit documentation changes 28 | run: | 29 | git clone https://github.com/openmv/openmv-doc.git 30 | cp -r micropython/docs/build/html/* docs/ 31 | cd docs 32 | touch .nojekyll 33 | git config --local user.email "action@github.com" 34 | git config --local user.name "GitHub Action" 35 | git add . 36 | git commit -m "Update documentation" -a || true 37 | # The above command will fail if no changes were present, so we ignore that. 38 | 39 | - name: Push documentation changes 40 | uses: ad-m/github-push-action@master 41 | with: 42 | branch: master 43 | directory: docs 44 | github_token: ${{ secrets.GITHUB_TOKEN }} 45 | 46 | - name: Pushes to another repository 47 | uses: cpina/github-action-push-to-another-repository@main 48 | env: 49 | SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} 50 | with: 51 | source-directory: 'micropython/docs/build/html' 52 | destination-github-username: 'openmv' 53 | destination-repository-name: 'qt-creator' 54 | target-branch: openmv-qtc-14.0.2 55 | target-directory: 'share/qtcreator/html' 56 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /micropython/docs/_build/ 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "openmv-media"] 2 | path = openmv-media 3 | url = https://github.com/openmv/openmv-media.git 4 | branch = master 5 | [submodule "micropython"] 6 | path = micropython 7 | url = https://github.com/openmv/micropython-doc.git 8 | branch = openmv-1.24.0-doc 9 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | docs.openmv.io -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-2023 OpenMV 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/.nojekyll -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | docs.openmv.io -------------------------------------------------------------------------------- /docs/_images/adafruit_products_pinoutstop.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/adafruit_products_pinoutstop.jpg -------------------------------------------------------------------------------- /docs/_images/bitmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/bitmap.png -------------------------------------------------------------------------------- /docs/_images/camera.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/camera.jpg -------------------------------------------------------------------------------- /docs/_images/collision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/collision.png -------------------------------------------------------------------------------- /docs/_images/ek_ra6m2_board.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/ek_ra6m2_board.jpg -------------------------------------------------------------------------------- /docs/_images/esp32.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/esp32.jpg -------------------------------------------------------------------------------- /docs/_images/fading_leds_breadboard_fritzing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/fading_leds_breadboard_fritzing.png -------------------------------------------------------------------------------- /docs/_images/itsybitsy_m4_express.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/itsybitsy_m4_express.jpg -------------------------------------------------------------------------------- /docs/_images/linprob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/linprob.png -------------------------------------------------------------------------------- /docs/_images/mem32_gpio_output.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/mem32_gpio_output.jpg -------------------------------------------------------------------------------- /docs/_images/pico_pinout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/pico_pinout.png -------------------------------------------------------------------------------- /docs/_images/pinout-openmv-ae3-pag7936.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/pinout-openmv-ae3-pag7936.png -------------------------------------------------------------------------------- /docs/_images/pinout-openmv-cam-h7-ov7725.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/pinout-openmv-cam-h7-ov7725.png -------------------------------------------------------------------------------- /docs/_images/pinout-openmv-cam-h7-ov77251.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/pinout-openmv-cam-h7-ov77251.png -------------------------------------------------------------------------------- /docs/_images/pinout-openmv-cam-h7-plus-ov5640.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/pinout-openmv-cam-h7-plus-ov5640.png -------------------------------------------------------------------------------- /docs/_images/pinout-openmv-cam-h7-plus-ov56401.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/pinout-openmv-cam-h7-plus-ov56401.png -------------------------------------------------------------------------------- /docs/_images/pinout-openmv-cam-m4-ov2640.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/pinout-openmv-cam-m4-ov2640.png -------------------------------------------------------------------------------- /docs/_images/pinout-openmv-cam-m4-ov26401.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/pinout-openmv-cam-m4-ov26401.png -------------------------------------------------------------------------------- /docs/_images/pinout-openmv-cam-m4-ov7725.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/pinout-openmv-cam-m4-ov7725.png -------------------------------------------------------------------------------- /docs/_images/pinout-openmv-cam-m4-ov77251.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/pinout-openmv-cam-m4-ov77251.png -------------------------------------------------------------------------------- /docs/_images/pinout-openmv-cam-m7-ov7725.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/pinout-openmv-cam-m7-ov7725.png -------------------------------------------------------------------------------- /docs/_images/pinout-openmv-cam-m7-ov77251.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/pinout-openmv-cam-m7-ov77251.png -------------------------------------------------------------------------------- /docs/_images/pinout-openmv-cam-rt1062-ov5640.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/pinout-openmv-cam-rt1062-ov5640.png -------------------------------------------------------------------------------- /docs/_images/pinout-openmv-n6-pag7936.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/pinout-openmv-n6-pag7936.png -------------------------------------------------------------------------------- /docs/_images/pyboard_servo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/pyboard_servo.jpg -------------------------------------------------------------------------------- /docs/_images/pyboard_usb_micro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/pyboard_usb_micro.jpg -------------------------------------------------------------------------------- /docs/_images/skin_amp_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/skin_amp_1.jpg -------------------------------------------------------------------------------- /docs/_images/skin_amp_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/skin_amp_2.jpg -------------------------------------------------------------------------------- /docs/_images/skin_lcd_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/skin_lcd_1.jpg -------------------------------------------------------------------------------- /docs/_images/skin_lcd_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/skin_lcd_2.jpg -------------------------------------------------------------------------------- /docs/_images/teensy_4.1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_images/teensy_4.1.jpg -------------------------------------------------------------------------------- /docs/_sources/develop/extendingmicropython.rst.txt: -------------------------------------------------------------------------------- 1 | .. _extendingmicropython: 2 | 3 | Extending MicroPython in C 4 | ========================== 5 | 6 | This chapter describes options for implementing additional functionality in C, but from code 7 | written outside of the main MicroPython repository. The first approach is useful for building 8 | your own custom firmware with some project-specific additional modules or functions that can 9 | be accessed from Python. The second approach is for building modules that can be loaded at runtime. 10 | 11 | Please see the :ref:`library section ` for more information on building core modules that 12 | live in the main MicroPython repository. 13 | 14 | .. toctree:: 15 | :maxdepth: 3 16 | 17 | cmodules.rst 18 | natmod.rst 19 | -------------------------------------------------------------------------------- /docs/_sources/develop/index.rst.txt: -------------------------------------------------------------------------------- 1 | MicroPython Internals 2 | ===================== 3 | 4 | This chapter covers a tour of MicroPython from the perspective of a developer, contributing 5 | to MicroPython. It acts as a comprehensive resource on the implementation details of MicroPython 6 | for both novice and expert contributors. 7 | 8 | Development around MicroPython usually involves modifying the core runtime, porting or 9 | maintaining a new library. This guide describes at great depth, the implementation 10 | details of MicroPython including a getting started guide, compiler internals, porting 11 | MicroPython to a new platform and implementing a core MicroPython library. 12 | 13 | .. toctree:: 14 | :maxdepth: 3 15 | 16 | gettingstarted.rst 17 | writingtests.rst 18 | compiler.rst 19 | memorymgt.rst 20 | library.rst 21 | optimizations.rst 22 | qstr.rst 23 | maps.rst 24 | publiccapi.rst 25 | extendingmicropython.rst 26 | porting.rst 27 | -------------------------------------------------------------------------------- /docs/_sources/develop/publiccapi.rst.txt: -------------------------------------------------------------------------------- 1 | .. _publiccapi: 2 | 3 | The public C API 4 | ================ 5 | 6 | The public C-API comprises functions defined in all C header files in the ``py/`` 7 | directory. Most of the important core runtime C APIs are exposed in ``runtime.h`` and 8 | ``obj.h``. 9 | 10 | The following is an example of public API functions from ``obj.h``: 11 | 12 | .. code-block:: c 13 | 14 | mp_obj_t mp_obj_new_list(size_t n, mp_obj_t *items); 15 | mp_obj_t mp_obj_list_append(mp_obj_t self_in, mp_obj_t arg); 16 | mp_obj_t mp_obj_list_remove(mp_obj_t self_in, mp_obj_t value); 17 | void mp_obj_list_get(mp_obj_t self_in, size_t *len, mp_obj_t **items); 18 | 19 | At its core, any functions and macros in header files make up the public 20 | API and can be used to access very low-level details of MicroPython. Static 21 | inline functions in header files are fine too, such functions will be 22 | inlined in the code when used. 23 | 24 | Header files in the ``ports`` directory are only exposed to the functionality 25 | specific to a given port. 26 | -------------------------------------------------------------------------------- /docs/_sources/develop/writingtests.rst.txt: -------------------------------------------------------------------------------- 1 | .. _writingtests: 2 | 3 | Writing tests 4 | ============= 5 | 6 | Tests in MicroPython are located at the path ``tests/``. The following is a listing of 7 | key directories and the run-tests.py runner script: 8 | 9 | .. code-block:: bash 10 | 11 | . 12 | ├── basics 13 | ├── extmod 14 | ├── float 15 | ├── micropython 16 | ├── run-tests.py 17 | ... 18 | 19 | There are subfolders maintained to categorize the tests. Add a test by creating a new file in one of the 20 | existing folders or in a new folder. It's also possible to make custom tests outside this tests folder, 21 | which would be recommended for a custom port. 22 | 23 | For example, add the following code in a file ``print.py`` in the ``tests/unix/`` subdirectory: 24 | 25 | .. code-block:: python 26 | 27 | def print_one(): 28 | print(1) 29 | 30 | print_one() 31 | 32 | If you run your tests, this test should appear in the test output: 33 | 34 | .. code-block:: bash 35 | 36 | $ cd ports/unix 37 | $ make tests 38 | skip unix/extra_coverage.py 39 | pass unix/ffi_callback.py 40 | pass unix/ffi_float.py 41 | pass unix/ffi_float2.py 42 | pass unix/print.py 43 | pass unix/time.py 44 | pass unix/time2.py 45 | 46 | Tests are run by comparing the output from the test target against the output from CPython. 47 | So any test should use print statements to indicate test results. 48 | 49 | For tests that can't be compared to CPython (i.e. micropython-specific functionality), 50 | you can provide a ``.py.exp`` file which will be used as the truth for comparison. 51 | 52 | The other way to run tests, which is useful when running on targets other than the Unix port, is: 53 | 54 | .. code-block:: bash 55 | 56 | $ cd tests 57 | $ ./run-tests.py 58 | 59 | Then to run on a board: 60 | 61 | .. code-block:: bash 62 | 63 | $ ./run-tests.py --target minimal --device /dev/ttyACM0 64 | 65 | And to run only a certain set of tests (eg a directory): 66 | 67 | .. code-block:: bash 68 | 69 | $ ./run-tests.py -d basics 70 | $ ./run-tests.py float/builtin*.py 71 | -------------------------------------------------------------------------------- /docs/_sources/esp32/tutorial/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. _esp32_tutorial: 2 | 3 | MicroPython tutorial for ESP32 4 | ============================== 5 | 6 | This tutorial is intended to get you started using MicroPython on the ESP32 7 | system-on-a-chip. If it is your first time it is recommended to follow the 8 | tutorial through in the order below. Otherwise the sections are mostly self 9 | contained, so feel free to skip to those that interest you. 10 | 11 | The tutorial does not assume that you know Python, but it also does not attempt 12 | to explain any of the details of the Python language. Instead it provides you 13 | with commands that are ready to run, and hopes that you will gain a bit of 14 | Python knowledge along the way. To learn more about Python itself please refer 15 | to ``__. 16 | 17 | .. toctree:: 18 | :maxdepth: 1 19 | :numbered: 20 | 21 | intro.rst 22 | pwm.rst 23 | peripheral_access.rst 24 | -------------------------------------------------------------------------------- /docs/_sources/esp8266/tutorial/adc.rst.txt: -------------------------------------------------------------------------------- 1 | Analog to Digital Conversion 2 | ============================ 3 | 4 | The ESP8266 has a single pin (separate to the GPIO pins) which can be used to 5 | read analog voltages and convert them to a digital value. You can construct 6 | such an ADC pin object using:: 7 | 8 | >>> import machine 9 | >>> adc = machine.ADC(0) 10 | 11 | Then read its value with:: 12 | 13 | >>> adc.read() 14 | 58 15 | 16 | The values returned from the ``read()`` function are between 0 (for 0.0 volts) 17 | and 1024 (for 1.0 volts). Please note that this input can only tolerate a 18 | maximum of 1.0 volts and you must use a voltage divider circuit to measure 19 | larger voltages. 20 | -------------------------------------------------------------------------------- /docs/_sources/esp8266/tutorial/dht.rst.txt: -------------------------------------------------------------------------------- 1 | Temperature and Humidity 2 | ======================== 3 | 4 | DHT (Digital Humidity & Temperature) sensors are low cost digital sensors with 5 | capacitive humidity sensors and thermistors to measure the surrounding air. 6 | They feature a chip that handles analog to digital conversion and provide a 7 | 1-wire interface. Newer sensors additionally provide an I2C interface. 8 | 9 | The DHT11 (blue) and DHT22 (white) sensors provide the same 1-wire interface, 10 | however, the DHT22 requires a separate object as it has more complex 11 | calculation. DHT22 have 1 decimal place resolution for both humidity and 12 | temperature readings. DHT11 have whole number for both. 13 | 14 | A custom 1-wire protocol, which is different to Dallas 1-wire, is used to get 15 | the measurements from the sensor. The payload consists of a humidity value, 16 | a temperature value and a checksum. 17 | 18 | To use the 1-wire interface, construct the objects referring to their data pin:: 19 | 20 | >>> import dht 21 | >>> import machine 22 | >>> d = dht.DHT11(machine.Pin(4)) 23 | 24 | >>> import dht 25 | >>> import machine 26 | >>> d = dht.DHT22(machine.Pin(4)) 27 | 28 | Then measure and read their values with:: 29 | 30 | >>> d.measure() 31 | >>> d.temperature() 32 | >>> d.humidity() 33 | 34 | Values returned from ``temperature()`` are in degrees Celsius and values 35 | returned from ``humidity()`` are a percentage of relative humidity. 36 | 37 | The DHT11 can be called no more than once per second and the DHT22 once every 38 | two seconds for most accurate results. Sensor accuracy will degrade over time. 39 | Each sensor supports a different operating range. Refer to the product 40 | datasheets for specifics. 41 | 42 | In 1-wire mode, only three of the four pins are used and in I2C mode, all four 43 | pins are used. Older sensors may still have 4 pins even though they do not 44 | support I2C. The 3rd pin is simply not connected. 45 | 46 | Pin configurations: 47 | 48 | Sensor without I2C in 1-wire mode (eg. DHT11, DHT22, AM2301, AM2302): 49 | 50 | 1=VDD, 2=Data, 3=NC, 4=GND 51 | 52 | Sensor with I2C in 1-wire mode (eg. DHT12, AM2320, AM2321, AM2322): 53 | 54 | 1=VDD, 2=Data, 3=GND, 4=GND 55 | 56 | Sensor with I2C in I2C mode (eg. DHT12, AM2320, AM2321, AM2322): 57 | 58 | 1=VDD, 2=SDA, 3=GND, 4=SCL 59 | 60 | You should use pull-up resistors for the Data, SDA and SCL pins. 61 | 62 | To make newer I2C sensors work in backwards compatible 1-wire mode, you must 63 | connect both pins 3 and 4 to GND. This disables the I2C interface. 64 | 65 | DHT22 sensors are now sold under the name AM2302 and are otherwise identical. 66 | -------------------------------------------------------------------------------- /docs/_sources/esp8266/tutorial/filesystem.rst.txt: -------------------------------------------------------------------------------- 1 | The internal filesystem 2 | ======================= 3 | 4 | If your devices has 1Mbyte or more of storage then it will be set up (upon first 5 | boot) to contain a filesystem. This filesystem uses the FAT format and is 6 | stored in the flash after the MicroPython firmware. 7 | 8 | Creating and reading files 9 | -------------------------- 10 | 11 | MicroPython on the ESP8266 supports the standard way of accessing files in 12 | Python, using the built-in ``open()`` function. 13 | 14 | To create a file try:: 15 | 16 | >>> f = open('data.txt', 'w') 17 | >>> f.write('some data') 18 | 9 19 | >>> f.close() 20 | 21 | The "9" is the number of bytes that were written with the ``write()`` method. 22 | Then you can read back the contents of this new file using:: 23 | 24 | >>> f = open('data.txt') 25 | >>> f.read() 26 | 'some data' 27 | >>> f.close() 28 | 29 | Note that the default mode when opening a file is to open it in read-only mode, 30 | and as a text file. Specify ``'wb'`` as the second argument to ``open()`` to 31 | open for writing in binary mode, and ``'rb'`` to open for reading in binary 32 | mode. 33 | 34 | Listing file and more 35 | --------------------- 36 | 37 | The os module can be used for further control over the filesystem. First 38 | import the module:: 39 | 40 | >>> import os 41 | 42 | Then try listing the contents of the filesystem:: 43 | 44 | >>> os.listdir() 45 | ['boot.py', 'port_config.py', 'data.txt'] 46 | 47 | You can make directories:: 48 | 49 | >>> os.mkdir('dir') 50 | 51 | And remove entries:: 52 | 53 | >>> os.remove('data.txt') 54 | 55 | Start up scripts 56 | ---------------- 57 | 58 | There are two files that are treated specially by the ESP8266 when it starts up: 59 | boot.py and main.py. The boot.py script is executed first (if it exists) and 60 | then once it completes the main.py script is executed. You can create these 61 | files yourself and populate them with the code that you want to run when the 62 | device starts up. 63 | 64 | Accessing the filesystem via WebREPL 65 | ------------------------------------ 66 | 67 | You can access the filesystem over WebREPL using the web client in a browser 68 | or via the command-line tool. Please refer to Quick Reference and Tutorial 69 | sections for more information about WebREPL. 70 | -------------------------------------------------------------------------------- /docs/_sources/esp8266/tutorial/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. _esp8266_tutorial: 2 | 3 | MicroPython tutorial for ESP8266 4 | ================================ 5 | 6 | This tutorial is intended to get you started using MicroPython on the ESP8266 7 | system-on-a-chip. If it is your first time it is recommended to follow the 8 | tutorial through in the order below. Otherwise the sections are mostly self 9 | contained, so feel free to skip to those that interest you. 10 | 11 | The tutorial does not assume that you know Python, but it also does not attempt 12 | to explain any of the details of the Python language. Instead it provides you 13 | with commands that are ready to run, and hopes that you will gain a bit of 14 | Python knowledge along the way. To learn more about Python itself please refer 15 | to ``__. 16 | 17 | .. toctree:: 18 | :maxdepth: 1 19 | :numbered: 20 | 21 | intro.rst 22 | repl.rst 23 | filesystem.rst 24 | network_basics.rst 25 | network_tcp.rst 26 | pins.rst 27 | pwm.rst 28 | adc.rst 29 | powerctrl.rst 30 | onewire.rst 31 | neopixel.rst 32 | apa102.rst 33 | dht.rst 34 | ssd1306.rst 35 | nextsteps.rst 36 | -------------------------------------------------------------------------------- /docs/_sources/esp8266/tutorial/neopixel.rst.txt: -------------------------------------------------------------------------------- 1 | Controlling NeoPixels 2 | ===================== 3 | 4 | NeoPixels, also known as WS2812 LEDs, are full-colour LEDs that are connected in 5 | serial, are individually addressable, and can have their red, green and blue 6 | components set between 0 and 255. They require precise timing to control them 7 | and there is a special neopixel module to do just this. 8 | 9 | To create a NeoPixel object do the following:: 10 | 11 | >>> import machine, neopixel 12 | >>> np = neopixel.NeoPixel(machine.Pin(4), 8) 13 | 14 | This configures a NeoPixel strip on GPIO4 with 8 pixels. You can adjust the 15 | "4" (pin number) and the "8" (number of pixel) to suit your set up. 16 | 17 | To set the colour of pixels use:: 18 | 19 | >>> np[0] = (255, 0, 0) # set to red, full brightness 20 | >>> np[1] = (0, 128, 0) # set to green, half brightness 21 | >>> np[2] = (0, 0, 64) # set to blue, quarter brightness 22 | 23 | For LEDs with more than 3 colours, such as RGBW pixels or RGBY pixels, the 24 | NeoPixel class takes a ``bpp`` parameter. To setup a NeoPixel object for an 25 | RGBW Pixel, do the following:: 26 | 27 | >>> import machine, neopixel 28 | >>> np = neopixel.NeoPixel(machine.Pin(4), 8, bpp=4) 29 | 30 | In a 4-bpp mode, remember to use 4-tuples instead of 3-tuples to set the colour. 31 | For example to set the first three pixels use:: 32 | 33 | >>> np[0] = (255, 0, 0, 128) # Orange in an RGBY Setup 34 | >>> np[1] = (0, 255, 0, 128) # Yellow-green in an RGBY Setup 35 | >>> np[2] = (0, 0, 255, 128) # Green-blue in an RGBY Setup 36 | 37 | Then use the ``write()`` method to output the colours to the LEDs:: 38 | 39 | >>> np.write() 40 | 41 | The following demo function makes a fancy show on the LEDs:: 42 | 43 | import time 44 | 45 | def demo(np): 46 | n = np.n 47 | 48 | # cycle 49 | for i in range(4 * n): 50 | for j in range(n): 51 | np[j] = (0, 0, 0) 52 | np[i % n] = (255, 255, 255) 53 | np.write() 54 | time.sleep_ms(25) 55 | 56 | # bounce 57 | for i in range(4 * n): 58 | for j in range(n): 59 | np[j] = (0, 0, 128) 60 | if (i // n) % 2 == 0: 61 | np[i % n] = (0, 0, 0) 62 | else: 63 | np[n - 1 - (i % n)] = (0, 0, 0) 64 | np.write() 65 | time.sleep_ms(60) 66 | 67 | # fade in/out 68 | for i in range(0, 4 * 256, 8): 69 | for j in range(n): 70 | if (i // 256) % 2 == 0: 71 | val = i & 0xff 72 | else: 73 | val = 255 - (i & 0xff) 74 | np[j] = (val, 0, 0) 75 | np.write() 76 | 77 | # clear 78 | for i in range(n): 79 | np[i] = (0, 0, 0) 80 | np.write() 81 | 82 | Execute it using:: 83 | 84 | >>> demo(np) 85 | -------------------------------------------------------------------------------- /docs/_sources/esp8266/tutorial/nextsteps.rst.txt: -------------------------------------------------------------------------------- 1 | Next steps 2 | ========== 3 | 4 | That brings us to the end of the tutorial! Hopefully by now you have a good 5 | feel for the capabilities of MicroPython on the ESP8266 and understand how to 6 | control both the WiFi and IO aspects of the chip. 7 | 8 | There are many features that were not covered in this tutorial. The best way 9 | to learn about them is to read the full documentation of the modules, and to 10 | experiment! 11 | 12 | Good luck creating your Internet of Things devices! 13 | -------------------------------------------------------------------------------- /docs/_sources/esp8266/tutorial/onewire.rst.txt: -------------------------------------------------------------------------------- 1 | Controlling 1-wire devices 2 | ========================== 3 | 4 | The 1-wire bus is a serial bus that uses just a single wire for communication 5 | (in addition to wires for ground and power). The DS18B20 temperature sensor 6 | is a very popular 1-wire device, and here we show how to use the onewire module 7 | to read from such a device. 8 | 9 | For the following code to work you need to have at least one DS18S20 or DS18B20 temperature 10 | sensor with its data line connected to GPIO12. You must also power the sensors 11 | and connect a 4.7k Ohm resistor between the data pin and the power pin. :: 12 | 13 | import time 14 | import machine 15 | import onewire, ds18x20 16 | 17 | # the device is on GPIO12 18 | dat = machine.Pin(12) 19 | 20 | # create the onewire object 21 | ds = ds18x20.DS18X20(onewire.OneWire(dat)) 22 | 23 | # scan for devices on the bus 24 | roms = ds.scan() 25 | print('found devices:', roms) 26 | 27 | # loop 10 times and print all temperatures 28 | for i in range(10): 29 | print('temperatures:', end=' ') 30 | ds.convert_temp() 31 | time.sleep_ms(750) 32 | for rom in roms: 33 | print(ds.read_temp(rom), end=' ') 34 | print() 35 | 36 | Note that you must execute the ``convert_temp()`` function to initiate a 37 | temperature reading, then wait at least 750ms before reading the value. 38 | -------------------------------------------------------------------------------- /docs/_sources/esp8266/tutorial/pins.rst.txt: -------------------------------------------------------------------------------- 1 | GPIO Pins 2 | ========= 3 | 4 | The way to connect your board to the external world, and control other 5 | components, is through the GPIO pins. Not all pins are available to use, 6 | in most cases only pins 0, 2, 4, 5, 12, 13, 14, 15, and 16 can be used. 7 | 8 | The pins are available in the machine module, so make sure you import that 9 | first. Then you can create a pin using:: 10 | 11 | >>> pin = machine.Pin(0) 12 | 13 | Here, the "0" is the pin that you want to access. Usually you want to 14 | configure the pin to be input or output, and you do this when constructing 15 | it. To make an input pin use:: 16 | 17 | >>> pin = machine.Pin(0, machine.Pin.IN, machine.Pin.PULL_UP) 18 | 19 | You can either use PULL_UP or None for the input pull-mode. If it's 20 | not specified then it defaults to None, which is no pull resistor. GPIO16 21 | has no pull-up mode. 22 | You can read the value on the pin using:: 23 | 24 | >>> pin.value() 25 | 0 26 | 27 | The pin on your board may return 0 or 1 here, depending on what it's connected 28 | to. To make an output pin use:: 29 | 30 | >>> pin = machine.Pin(0, machine.Pin.OUT) 31 | 32 | Then set its value using:: 33 | 34 | >>> pin.value(0) 35 | >>> pin.value(1) 36 | 37 | Or:: 38 | 39 | >>> pin.off() 40 | >>> pin.on() 41 | 42 | External interrupts 43 | ------------------- 44 | 45 | All pins except number 16 can be configured to trigger a hard interrupt if their 46 | input changes. You can set code (a callback function) to be executed on the 47 | trigger. 48 | 49 | Let's first define a callback function, which must take a single argument, 50 | being the pin that triggered the function. We will make the function just print 51 | the pin:: 52 | 53 | >>> def callback(p): 54 | ... print('pin change', p) 55 | 56 | Next we will create two pins and configure them as inputs:: 57 | 58 | >>> from machine import Pin 59 | >>> p0 = Pin(0, Pin.IN) 60 | >>> p2 = Pin(2, Pin.IN) 61 | 62 | An finally we need to tell the pins when to trigger, and the function to call 63 | when they detect an event:: 64 | 65 | >>> p0.irq(trigger=Pin.IRQ_FALLING, handler=callback) 66 | >>> p2.irq(trigger=Pin.IRQ_RISING | Pin.IRQ_FALLING, handler=callback) 67 | 68 | We set pin 0 to trigger only on a falling edge of the input (when it goes from 69 | high to low), and set pin 2 to trigger on both a rising and falling edge. After 70 | entering this code you can apply high and low voltages to pins 0 and 2 to see 71 | the interrupt being executed. 72 | 73 | A hard interrupt will trigger as soon as the event occurs and will interrupt any 74 | running code, including Python code. As such your callback functions are 75 | limited in what they can do (they cannot allocate memory, for example) and 76 | should be as short and simple as possible. 77 | -------------------------------------------------------------------------------- /docs/_sources/esp8266/tutorial/powerctrl.rst.txt: -------------------------------------------------------------------------------- 1 | Power control 2 | ============= 3 | 4 | The ESP8266 provides the ability to change the CPU frequency on the fly, and 5 | enter a deep-sleep state. Both can be used to manage power consumption. 6 | 7 | Changing the CPU frequency 8 | -------------------------- 9 | 10 | The machine module has a function to get and set the CPU frequency. To get the 11 | current frequency use:: 12 | 13 | >>> import machine 14 | >>> machine.freq() 15 | 80000000 16 | 17 | By default the CPU runs at 80MHz. It can be changed to 160MHz if you need more 18 | processing power, at the expense of current consumption:: 19 | 20 | >>> machine.freq(160000000) 21 | >>> machine.freq() 22 | 160000000 23 | 24 | You can change to the higher frequency just while your code does the heavy 25 | processing and then change back when it's finished. 26 | 27 | Deep-sleep mode 28 | --------------- 29 | 30 | The deep-sleep mode will shut down the ESP8266 and all its peripherals, 31 | including the WiFi (but not including the real-time-clock, which is used to wake 32 | the chip). This drastically reduces current consumption and is a good way to 33 | make devices that can run for a while on a battery. 34 | 35 | To be able to use the deep-sleep feature you must connect GPIO16 to the reset 36 | pin (RST on the Adafruit Feather HUZZAH board). Then the following code can be 37 | used to sleep and wake the device:: 38 | 39 | import machine 40 | 41 | # configure RTC.ALARM0 to be able to wake the device 42 | rtc = machine.RTC() 43 | rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP) 44 | 45 | # set RTC.ALARM0 to fire after 10 seconds (waking the device) 46 | rtc.alarm(rtc.ALARM0, 10000) 47 | 48 | # put the device to sleep 49 | machine.deepsleep() 50 | 51 | Note that when the chip wakes from a deep-sleep it is completely reset, 52 | including all of the memory. The boot scripts will run as usual and you can 53 | put code in them to check the reset cause to perhaps do something different if 54 | the device just woke from a deep-sleep. For example, to print the reset cause 55 | you can use:: 56 | 57 | if machine.reset_cause() == machine.DEEPSLEEP_RESET: 58 | print('woke from a deep sleep') 59 | else: 60 | print('power on or hard reset') 61 | 62 | -------------------------------------------------------------------------------- /docs/_sources/genrst/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. This document was generated by tools/gen-cpydiff.py 2 | 3 | .. _cpython_diffs: 4 | 5 | MicroPython differences from CPython 6 | ==================================== 7 | 8 | MicroPython implements Python 3.4 and some select features of Python 3.5 and 9 | above. The sections below describe the current status of these features. 10 | 11 | .. toctree:: 12 | 13 | ../differences/python_35.rst 14 | ../differences/python_36.rst 15 | ../differences/python_37.rst 16 | ../differences/python_38.rst 17 | ../differences/python_39.rst 18 | ../differences/python_310.rst 19 | 20 | For the features of Python that are implemented by MicroPython, there are 21 | sometimes differences in their behaviour compared to standard Python. The 22 | operations listed in the sections below produce conflicting results in 23 | MicroPython when compared to standard Python. 24 | 25 | .. toctree:: 26 | :maxdepth: 2 27 | 28 | syntax.rst 29 | core_language.rst 30 | builtin_types.rst 31 | modules.rst 32 | -------------------------------------------------------------------------------- /docs/_sources/index.rst.txt: -------------------------------------------------------------------------------- 1 | MicroPython documentation and references 2 | ======================================== 3 | 4 | .. toctree:: 5 | 6 | library/index.rst 7 | reference/index.rst 8 | genrst/index.rst 9 | license.rst 10 | openmvcam/quickref.rst 11 | -------------------------------------------------------------------------------- /docs/_sources/library/_thread.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`_thread` -- multithreading support 2 | ======================================== 3 | 4 | .. module:: _thread 5 | :synopsis: multithreading support 6 | 7 | |see_cpython_module| :mod:`python:_thread`. 8 | 9 | This module implements multithreading support. 10 | 11 | This module is highly experimental and its API is not yet fully settled 12 | and not yet described in this documentation. 13 | -------------------------------------------------------------------------------- /docs/_sources/library/binascii.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`binascii` -- binary/ASCII conversions 2 | =========================================== 3 | 4 | .. module:: binascii 5 | :synopsis: binary/ASCII conversions 6 | 7 | |see_cpython_module| :mod:`python:binascii`. 8 | 9 | This module implements conversions between binary data and various 10 | encodings of it in ASCII form (in both directions). 11 | 12 | Functions 13 | --------- 14 | 15 | .. function:: hexlify(data, [sep]) 16 | 17 | Convert the bytes in the *data* object to a hexadecimal representation. 18 | Returns a bytes object. 19 | 20 | If the additional argument *sep* is supplied it is used as a separator 21 | between hexadecimal values. 22 | 23 | .. function:: unhexlify(data) 24 | 25 | Convert hexadecimal data to binary representation. Returns bytes string. 26 | (i.e. inverse of hexlify) 27 | 28 | .. function:: a2b_base64(data) 29 | 30 | Decode base64-encoded data, ignoring invalid characters in the input. 31 | Conforms to `RFC 2045 s.6.8 `_. 32 | Returns a bytes object. 33 | 34 | .. function:: b2a_base64(data, *, newline=True) 35 | 36 | Encode binary data in base64 format, as in `RFC 3548 37 | `_. Returns the encoded data 38 | followed by a newline character if newline is true, as a bytes object. 39 | 40 | .. function:: crc32(data, [value]) 41 | 42 | Compute CRC-32, the 32-bit checksum of *data*, starting with an initial CRC 43 | of *value*. The default initial CRC is zero. The algorithm is consistent 44 | with the ZIP file checksum. 45 | -------------------------------------------------------------------------------- /docs/_sources/library/cmath.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`cmath` -- mathematical functions for complex numbers 2 | ========================================================== 3 | 4 | .. module:: cmath 5 | :synopsis: mathematical functions for complex numbers 6 | 7 | |see_cpython_module| :mod:`python:cmath`. 8 | 9 | The ``cmath`` module provides some basic mathematical functions for 10 | working with complex numbers. 11 | 12 | Functions 13 | --------- 14 | 15 | .. function:: cos(z) 16 | 17 | Return the cosine of ``z``. 18 | 19 | .. function:: exp(z) 20 | 21 | Return the exponential of ``z``. 22 | 23 | .. function:: log(z) 24 | 25 | Return the natural logarithm of ``z``. The branch cut is along the negative real axis. 26 | 27 | .. function:: log10(z) 28 | 29 | Return the base-10 logarithm of ``z``. The branch cut is along the negative real axis. 30 | 31 | .. function:: phase(z) 32 | 33 | Returns the phase of the number ``z``, in the range (-pi, +pi]. 34 | 35 | .. function:: polar(z) 36 | 37 | Returns, as a tuple, the polar form of ``z``. 38 | 39 | .. function:: rect(r, phi) 40 | 41 | Returns the complex number with modulus ``r`` and phase ``phi``. 42 | 43 | .. function:: sin(z) 44 | 45 | Return the sine of ``z``. 46 | 47 | .. function:: sqrt(z) 48 | 49 | Return the square-root of ``z``. 50 | 51 | Constants 52 | --------- 53 | 54 | .. data:: e 55 | 56 | base of the natural logarithm 57 | 58 | .. data:: pi 59 | 60 | the ratio of a circle's circumference to its diameter 61 | -------------------------------------------------------------------------------- /docs/_sources/library/cryptolib.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`cryptolib` -- cryptographic ciphers 2 | ========================================= 3 | 4 | .. module:: cryptolib 5 | :synopsis: cryptographic ciphers 6 | 7 | Classes 8 | ------- 9 | 10 | .. class:: aes 11 | 12 | .. classmethod:: __init__(key, mode, [IV]) 13 | 14 | Initialize cipher object, suitable for encryption/decryption. Note: 15 | after initialization, cipher object can be use only either for 16 | encryption or decryption. Running decrypt() operation after encrypt() 17 | or vice versa is not supported. 18 | 19 | Parameters are: 20 | 21 | * *key* is an encryption/decryption key (bytes-like). 22 | * *mode* is: 23 | 24 | * ``1`` (or ``cryptolib.MODE_ECB`` if it exists) for Electronic Code Book (ECB). 25 | * ``2`` (or ``cryptolib.MODE_CBC`` if it exists) for Cipher Block Chaining (CBC). 26 | * ``6`` (or ``cryptolib.MODE_CTR`` if it exists) for Counter mode (CTR). 27 | 28 | * *IV* is an initialization vector for CBC mode. 29 | * For Counter mode, *IV* is the initial value for the counter. 30 | 31 | .. method:: encrypt(in_buf, [out_buf]) 32 | 33 | Encrypt *in_buf*. If no *out_buf* is given result is returned as a 34 | newly allocated `bytes` object. Otherwise, result is written into 35 | mutable buffer *out_buf*. *in_buf* and *out_buf* can also refer 36 | to the same mutable buffer, in which case data is encrypted in-place. 37 | 38 | .. method:: decrypt(in_buf, [out_buf]) 39 | 40 | Like `encrypt()`, but for decryption. 41 | -------------------------------------------------------------------------------- /docs/_sources/library/errno.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`errno` -- system error codes 2 | ================================== 3 | 4 | .. module:: errno 5 | :synopsis: system error codes 6 | 7 | |see_cpython_module| :mod:`python:errno`. 8 | 9 | This module provides access to symbolic error codes for `OSError` exception. 10 | A particular inventory of codes depends on :term:`MicroPython port`. 11 | 12 | Constants 13 | --------- 14 | 15 | .. data:: EEXIST, EAGAIN, etc. 16 | 17 | Error codes, based on ANSI C/POSIX standard. All error codes start with 18 | "E". As mentioned above, inventory of the codes depends on 19 | :term:`MicroPython port`. Errors are usually accessible as ``exc.errno`` 20 | where ``exc`` is an instance of `OSError`. Usage example:: 21 | 22 | try: 23 | os.mkdir("my_dir") 24 | except OSError as exc: 25 | if exc.errno == errno.EEXIST: 26 | print("Directory already exists") 27 | 28 | .. data:: errorcode 29 | 30 | Dictionary mapping numeric error codes to strings with symbolic error 31 | code (see above):: 32 | 33 | >>> print(errno.errorcode[errno.EEXIST]) 34 | EEXIST 35 | -------------------------------------------------------------------------------- /docs/_sources/library/gc.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`gc` -- control the garbage collector 2 | ========================================== 3 | 4 | .. module:: gc 5 | :synopsis: control the garbage collector 6 | 7 | |see_cpython_module| :mod:`python:gc`. 8 | 9 | Functions 10 | --------- 11 | 12 | .. function:: enable() 13 | 14 | Enable automatic garbage collection. 15 | 16 | .. function:: disable() 17 | 18 | Disable automatic garbage collection. Heap memory can still be allocated, 19 | and garbage collection can still be initiated manually using :meth:`gc.collect`. 20 | 21 | .. function:: collect() 22 | 23 | Run a garbage collection. 24 | 25 | .. function:: mem_alloc() 26 | 27 | Return the number of bytes of heap RAM that are allocated by Python code. 28 | 29 | .. admonition:: Difference to CPython 30 | :class: attention 31 | 32 | This function is MicroPython extension. 33 | 34 | .. function:: mem_free() 35 | 36 | Return the number of bytes of heap RAM that is available for Python 37 | code to allocate, or -1 if this amount is not known. 38 | 39 | .. admonition:: Difference to CPython 40 | :class: attention 41 | 42 | This function is MicroPython extension. 43 | 44 | .. function:: threshold([amount]) 45 | 46 | Set or query the additional GC allocation threshold. Normally, a collection 47 | is triggered only when a new allocation cannot be satisfied, i.e. on an 48 | out-of-memory (OOM) condition. If this function is called, in addition to 49 | OOM, a collection will be triggered each time after *amount* bytes have been 50 | allocated (in total, since the previous time such an amount of bytes 51 | have been allocated). *amount* is usually specified as less than the 52 | full heap size, with the intention to trigger a collection earlier than when the 53 | heap becomes exhausted, and in the hope that an early collection will prevent 54 | excessive memory fragmentation. This is a heuristic measure, the effect 55 | of which will vary from application to application, as well as 56 | the optimal value of the *amount* parameter. 57 | 58 | Calling the function without argument will return the current value of 59 | the threshold. A value of -1 means a disabled allocation threshold. 60 | 61 | .. admonition:: Difference to CPython 62 | :class: attention 63 | 64 | This function is a MicroPython extension. CPython has a similar 65 | function - ``set_threshold()``, but due to different GC 66 | implementations, its signature and semantics are different. 67 | -------------------------------------------------------------------------------- /docs/_sources/library/hashlib.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`hashlib` -- hashing algorithms 2 | ==================================== 3 | 4 | .. module:: hashlib 5 | :synopsis: hashing algorithms 6 | 7 | |see_cpython_module| :mod:`python:hashlib`. 8 | 9 | This module implements binary data hashing algorithms. The exact inventory 10 | of available algorithms depends on a board. Among the algorithms which may 11 | be implemented: 12 | 13 | * SHA256 - The current generation, modern hashing algorithm (of SHA2 series). 14 | It is suitable for cryptographically-secure purposes. Included in the 15 | MicroPython core and any board is recommended to provide this, unless 16 | it has particular code size constraints. 17 | 18 | * SHA1 - A previous generation algorithm. Not recommended for new usages, 19 | but SHA1 is a part of number of Internet standards and existing 20 | applications, so boards targeting network connectivity and 21 | interoperability will try to provide this. 22 | 23 | * MD5 - A legacy algorithm, not considered cryptographically secure. Only 24 | selected boards, targeting interoperability with legacy applications, 25 | will offer this. 26 | 27 | Constructors 28 | ------------ 29 | 30 | .. class:: hashlib.sha256([data]) 31 | 32 | Create an SHA256 hasher object and optionally feed ``data`` into it. 33 | 34 | .. class:: hashlib.sha1([data]) 35 | 36 | Create an SHA1 hasher object and optionally feed ``data`` into it. 37 | 38 | .. class:: hashlib.md5([data]) 39 | 40 | Create an MD5 hasher object and optionally feed ``data`` into it. 41 | 42 | Methods 43 | ------- 44 | 45 | .. method:: hash.update(data) 46 | 47 | Feed more binary data into hash. 48 | 49 | .. method:: hash.digest() 50 | 51 | Return hash for all data passed through hash, as a bytes object. After this 52 | method is called, more data cannot be fed into the hash any longer. 53 | 54 | .. method:: hash.hexdigest() 55 | 56 | This method is NOT implemented. Use ``binascii.hexlify(hash.digest())`` 57 | to achieve a similar effect. 58 | -------------------------------------------------------------------------------- /docs/_sources/library/heapq.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`heapq` -- heap queue algorithm 2 | ==================================== 3 | 4 | .. module:: heapq 5 | :synopsis: heap queue algorithm 6 | 7 | |see_cpython_module| :mod:`python:heapq`. 8 | 9 | This module implements the 10 | `min heap queue algorithm `_. 11 | 12 | A heap queue is essentially a list that has its elements stored in such a way 13 | that the first item of the list is always the smallest. 14 | 15 | Functions 16 | --------- 17 | 18 | .. function:: heappush(heap, item) 19 | 20 | Push the ``item`` onto the ``heap``. 21 | 22 | .. function:: heappop(heap) 23 | 24 | Pop the first item from the ``heap``, and return it. Raise ``IndexError`` if 25 | ``heap`` is empty. 26 | 27 | The returned item will be the smallest item in the ``heap``. 28 | 29 | .. function:: heapify(x) 30 | 31 | Convert the list ``x`` into a heap. This is an in-place operation. 32 | -------------------------------------------------------------------------------- /docs/_sources/library/json.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`json` -- JSON encoding and decoding 2 | ========================================= 3 | 4 | .. module:: json 5 | :synopsis: JSON encoding and decoding 6 | 7 | |see_cpython_module| :mod:`python:json`. 8 | 9 | This modules allows to convert between Python objects and the JSON 10 | data format. 11 | 12 | Functions 13 | --------- 14 | 15 | .. function:: dump(obj, stream, separators=None) 16 | 17 | Serialise *obj* to a JSON string, writing it to the given *stream*. 18 | 19 | If specified, separators should be an ``(item_separator, key_separator)`` 20 | tuple. The default is ``(', ', ': ')``. To get the most compact JSON 21 | representation, you should specify ``(',', ':')`` to eliminate whitespace. 22 | 23 | .. function:: dumps(obj, separators=None) 24 | 25 | Return *obj* represented as a JSON string. 26 | 27 | The arguments have the same meaning as in `dump`. 28 | 29 | .. function:: load(stream) 30 | 31 | Parse the given *stream*, interpreting it as a JSON string and 32 | deserialising the data to a Python object. The resulting object is 33 | returned. 34 | 35 | Parsing continues until end-of-file is encountered. 36 | A :exc:`ValueError` is raised if the data in *stream* is not correctly formed. 37 | 38 | .. function:: loads(str) 39 | 40 | Parse the JSON *str* and return an object. Raises :exc:`ValueError` if the 41 | string is not correctly formed. 42 | -------------------------------------------------------------------------------- /docs/_sources/library/machine.ADC.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: machine 2 | .. _machine.ADC: 3 | 4 | class ADC -- analog to digital conversion 5 | ========================================= 6 | 7 | The ADC class provides an interface to analog-to-digital converters, and 8 | represents a single endpoint that can sample a continuous voltage and 9 | convert it to a discretised value. 10 | 11 | For extra control over ADC sampling see :ref:`machine.ADCBlock `. 12 | 13 | Example usage:: 14 | 15 | from machine import ADC 16 | 17 | adc = ADC(pin) # create an ADC object acting on a pin 18 | val = adc.read_u16() # read a raw analog value in the range 0-65535 19 | val = adc.read_uv() # read an analog value in microvolts 20 | 21 | Constructors 22 | ------------ 23 | 24 | .. class:: ADC(id, *, sample_ns, atten) 25 | 26 | Access the ADC associated with a source identified by *id*. This 27 | *id* may be an integer (usually specifying a channel number), a 28 | :ref:`Pin ` object, or other value supported by the 29 | underlying machine. 30 | 31 | If additional keyword-arguments are given then they will configure 32 | various aspects of the ADC. If not given, these settings will take 33 | previous or default values. The settings are: 34 | 35 | - *sample_ns* is the sampling time in nanoseconds. 36 | 37 | - *atten* specifies the input attenuation. 38 | 39 | Methods 40 | ------- 41 | 42 | .. method:: ADC.init(*, sample_ns, atten) 43 | 44 | Apply the given settings to the ADC. Only those arguments that are 45 | specified will be changed. See the ADC constructor above for what the 46 | arguments are. 47 | 48 | .. method:: ADC.block() 49 | 50 | Return the :ref:`ADCBlock ` instance associated with 51 | this ADC object. 52 | 53 | This method only exists if the port supports the 54 | :ref:`ADCBlock ` class. 55 | 56 | .. method:: ADC.read_u16() 57 | 58 | Take an analog reading and return an integer in the range 0-65535. 59 | The return value represents the raw reading taken by the ADC, scaled 60 | such that the minimum value is 0 and the maximum value is 65535. 61 | 62 | .. method:: ADC.read_uv() 63 | 64 | Take an analog reading and return an integer value with units of 65 | microvolts. It is up to the particular port whether or not this value 66 | is calibrated, and how calibration is done. 67 | -------------------------------------------------------------------------------- /docs/_sources/library/machine.ADCBlock.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: machine 2 | .. _machine.ADCBlock: 3 | 4 | class ADCBlock -- control ADC peripherals 5 | ========================================= 6 | 7 | The ADCBlock class provides access to an ADC peripheral which has a 8 | number of channels that can be used to sample analog values. It allows 9 | finer control over configuration of :ref:`machine.ADC ` 10 | objects, which do the actual sampling. 11 | 12 | This class is not always available. 13 | 14 | Example usage:: 15 | 16 | from machine import ADCBlock 17 | 18 | block = ADCBlock(id, bits=12) # create an ADCBlock with 12-bit resolution 19 | adc = block.connect(4, pin) # connect channel 4 to the given pin 20 | val = adc.read_uv() # read an analog value 21 | 22 | Constructors 23 | ------------ 24 | 25 | .. class:: ADCBlock(id, *, bits) 26 | 27 | Access the ADC peripheral identified by *id*, which may be an integer 28 | or string. 29 | 30 | The *bits* argument, if given, sets the resolution in bits of the 31 | conversion process. If not specified then the previous or default 32 | resolution is used. 33 | 34 | Methods 35 | ------- 36 | 37 | .. method:: ADCBlock.init(*, bits) 38 | 39 | Configure the ADC peripheral. *bits* will set the resolution of the 40 | conversion process. 41 | 42 | .. method:: ADCBlock.connect(channel, *, ...) 43 | ADCBlock.connect(source, *, ...) 44 | ADCBlock.connect(channel, source, *, ...) 45 | 46 | Connect up a channel on the ADC peripheral so it is ready for sampling, 47 | and return an :ref:`ADC ` object that represents that connection. 48 | 49 | The *channel* argument must be an integer, and *source* must be an object 50 | (for example a :ref:`Pin `) which can be connected up for sampling. 51 | 52 | If only *channel* is given then it is configured for sampling. 53 | 54 | If only *source* is given then that object is connected to a default 55 | channel ready for sampling. 56 | 57 | If both *channel* and *source* are given then they are connected together 58 | and made ready for sampling. 59 | 60 | Any additional keyword arguments are used to configure the returned ADC object, 61 | via its :meth:`init ` method. 62 | -------------------------------------------------------------------------------- /docs/_sources/library/machine.ADCWiPy.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: machine 2 | .. _machine.ADCWiPy: 3 | 4 | class ADCWiPy -- analog to digital conversion 5 | ============================================= 6 | 7 | .. note:: 8 | 9 | This class is a non-standard ADC implementation for the WiPy. 10 | It is available simply as ``machine.ADC`` on the WiPy but is named in the 11 | documentation below as ``machine.ADCWiPy`` to distinguish it from the 12 | more general :ref:`machine.ADC ` class. 13 | 14 | Usage:: 15 | 16 | import machine 17 | 18 | adc = machine.ADC() # create an ADC object 19 | apin = adc.channel(pin='GP3') # create an analog pin on GP3 20 | val = apin() # read an analog value 21 | 22 | Constructors 23 | ------------ 24 | 25 | .. class:: ADCWiPy(id=0, *, bits=12) 26 | 27 | Create an ADC object associated with the given pin. 28 | This allows you to then read analog values on that pin. 29 | For more info check the `pinout and alternate functions 30 | table. `_ 31 | 32 | .. warning:: 33 | 34 | ADC pin input range is 0-1.4V (being 1.8V the absolute maximum that it 35 | can withstand). When GP2, GP3, GP4 or GP5 are remapped to the 36 | ADC block, 1.8 V is the maximum. If these pins are used in digital mode, 37 | then the maximum allowed input is 3.6V. 38 | 39 | Methods 40 | ------- 41 | 42 | .. method:: ADCWiPy.channel(id, *, pin) 43 | 44 | Create an analog pin. If only channel ID is given, the correct pin will 45 | be selected. Alternatively, only the pin can be passed and the correct 46 | channel will be selected. Examples:: 47 | 48 | # all of these are equivalent and enable ADC channel 1 on GP3 49 | apin = adc.channel(1) 50 | apin = adc.channel(pin='GP3') 51 | apin = adc.channel(id=1, pin='GP3') 52 | 53 | .. method:: ADCWiPy.init() 54 | 55 | Enable the ADC block. 56 | 57 | .. method:: ADCWiPy.deinit() 58 | 59 | Disable the ADC block. 60 | 61 | class ADCChannel --- read analog values from internal or external sources 62 | ========================================================================= 63 | 64 | ADC channels can be connected to internal points of the MCU or to GPIO pins. 65 | ADC channels are created using the ADC.channel method. 66 | 67 | .. method:: adcchannel() 68 | 69 | Fast method to read the channel value. 70 | 71 | .. method:: adcchannel.value() 72 | 73 | Read the channel value. 74 | 75 | .. method:: adcchannel.init() 76 | 77 | Re-init (and effectively enable) the ADC channel. 78 | 79 | .. method:: adcchannel.deinit() 80 | 81 | Disable the ADC channel. 82 | -------------------------------------------------------------------------------- /docs/_sources/library/machine.LED.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: machine 2 | .. _machine.LED: 3 | 4 | class LED -- LED Control 5 | ======================== 6 | 7 | The LED class provides an interface to control the on-board LED. 8 | 9 | Example usage:: 10 | 11 | from machine import LED 12 | 13 | r = LED("LED_RED") 14 | g = LED("LED_GREEN") 15 | b = LED("LED_BLUE") 16 | 17 | r.on() 18 | g.off() 19 | b.toggle() 20 | 21 | Constructors 22 | ------------ 23 | 24 | .. class:: LED(pin_name) -> LED 25 | 26 | Access the LED associated with a source identified by *pin_name*. This 27 | ``pin_name`` may be a string (usually specifying a color), a 28 | :ref:`Pin ` object, or other value supported by the 29 | underlying machine. 30 | 31 | Methods 32 | ------- 33 | 34 | .. method:: LED.boardname() -> str 35 | 36 | Returns the name of the board. 37 | 38 | .. method:: LED.on() -> None 39 | 40 | Turns the LED on. 41 | 42 | .. method:: LED.() -> None 43 | 44 | Turns the LED off. 45 | 46 | .. method:: LED.toggle() -> None 47 | 48 | Toggles the LED state. 49 | 50 | .. method:: LED.value(v=None) -> int 51 | 52 | If ``v`` is given, sets the LED to the given value. If ``v`` is not given, 53 | returns the current LED value. 54 | -------------------------------------------------------------------------------- /docs/_sources/library/machine.SD.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: machine 2 | .. _machine.SD: 3 | 4 | class SD -- secure digital memory card (cc3200 port only) 5 | ========================================================= 6 | 7 | .. warning:: 8 | 9 | This is a non-standard class and is only available on the cc3200 port. 10 | 11 | 12 | The SD card class allows to configure and enable the memory card 13 | module of the WiPy and automatically mount it as ``/sd`` as part 14 | of the file system. There are several pin combinations that can be 15 | used to wire the SD card socket to the WiPy and the pins used can 16 | be specified in the constructor. Please check the `pinout and alternate functions 17 | table. `_ for 18 | more info regarding the pins which can be remapped to be used with a SD card. 19 | 20 | Example usage:: 21 | 22 | from machine import SD 23 | import os 24 | # clk cmd and dat0 pins must be passed along with 25 | # their respective alternate functions 26 | sd = machine.SD(pins=('GP10', 'GP11', 'GP15')) 27 | os.mount(sd, '/sd') 28 | # do normal file operations 29 | 30 | Constructors 31 | ------------ 32 | 33 | .. class:: SD(id,... ) 34 | 35 | Create a SD card object. See ``init()`` for parameters if initialization. 36 | 37 | Methods 38 | ------- 39 | 40 | .. method:: SD.init(id=0, pins=('GP10', 'GP11', 'GP15')) 41 | 42 | Enable the SD card. In order to initialize the card, give it a 3-tuple: 43 | ``(clk_pin, cmd_pin, dat0_pin)``. 44 | 45 | .. method:: SD.deinit() 46 | 47 | Disable the SD card. 48 | -------------------------------------------------------------------------------- /docs/_sources/library/machine.WDT.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: machine 2 | .. _machine.WDT: 3 | 4 | class WDT -- watchdog timer 5 | =========================== 6 | 7 | The WDT is used to restart the system when the application crashes and ends 8 | up into a non recoverable state. Once started it cannot be stopped or 9 | reconfigured in any way. After enabling, the application must "feed" the 10 | watchdog periodically to prevent it from expiring and resetting the system. 11 | 12 | Example usage:: 13 | 14 | from machine import WDT 15 | wdt = WDT(timeout=2000) # enable it with a timeout of 2s 16 | wdt.feed() 17 | 18 | Constructors 19 | ------------ 20 | 21 | .. class:: WDT(id=0, timeout=5000) 22 | 23 | Create a WDT object and start it. The timeout must be given in milliseconds. 24 | Once it is running the timeout cannot be changed and the WDT cannot be stopped either. 25 | 26 | Notes: On the esp8266 a timeout cannot be specified, it is determined by the underlying system. 27 | On rp2040 devices, the maximum timeout is 8388 ms. 28 | 29 | Methods 30 | ------- 31 | 32 | .. method:: WDT.feed() 33 | 34 | Feed the WDT to prevent it from resetting the system. The application 35 | should place this call in a sensible place ensuring that the WDT is 36 | only fed after verifying that everything is functioning correctly. 37 | -------------------------------------------------------------------------------- /docs/_sources/library/marshal.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`marshal` -- Python object serialization 2 | ============================================= 3 | 4 | .. module:: marshal 5 | :synopsis: Convert Python objects to and from a binary format 6 | 7 | |see_cpython_module| :mod:`python:marshal`. 8 | 9 | This module implements conversion between Python objects and a binary format. 10 | The format is specific to MicroPython but does not depend on the machine 11 | architecture, so the data can be transferred and used on a different MicroPython 12 | instance, as long as the version of the binary data matches (it's currently 13 | versioned as the mpy file version, see :ref:`mpy_files`). 14 | 15 | Functions 16 | --------- 17 | 18 | .. function:: dumps(value, /) 19 | 20 | Convert the given *value* to binary format and return a corresponding ``bytes`` 21 | object. 22 | 23 | Currently, code objects are the only supported values that can be converted. 24 | 25 | .. function:: loads(data, /) 26 | 27 | Convert the given bytes-like *data* to its corresponding Python object, and 28 | return it. 29 | -------------------------------------------------------------------------------- /docs/_sources/library/mutex.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`mutex` --- mutex module 2 | ============================= 3 | 4 | .. module:: mutex 5 | :synopsis: mutex module 6 | 7 | The ``mutex`` module is used for creating mutexes. 8 | 9 | class Mutex -- mutex object 10 | --------------------------- 11 | 12 | A mutex is an object enabling threads of execution to protect critical sections of code from 13 | reentrancy or to temporarily protect critical data sets from being updated by other threads. 14 | The term "mutex" derives from the notion of mutual exclusion. A mutex usually provides three methods: 15 | 16 | | lock() (POSIX pthread_mutex_lock): wait until the mutex is free, then lock it 17 | | unlock() (POSIX pthread_mutex_unlock): Immediate return. unlock the mutex. 18 | | test() (POSIX pthread_mutex_trylock): Immediate return. test if it is locked. 19 | 20 | In this implementation lock and unlock is controlled by a context manager. 21 | 22 | In the context of MicroPython a mutex provides a mechanism where an interrupt service routine (ISR) 23 | can test whether the main loop was using critical variables at the time the interrupt occurred, and 24 | if so avoid modifying those variables. Typical usage:: 25 | 26 | import pyb, mutex 27 | mutex = mutex.Mutex() 28 | data_ready = False 29 | 30 | def callback(): # Timer or interrupt callback 31 | global data_ready 32 | if mutex.test(): 33 | data_ready = True 34 | # Update critical variables 35 | mutex.release() 36 | else: 37 | # defer any update 38 | # Associate callback with device (pin or timer) 39 | 40 | while True: 41 | # code 42 | if data_ready: 43 | with mutex: 44 | data_ready = False 45 | # Access critical variables 46 | # more code 47 | 48 | Note that the with statement will execute immediately because no other process runs a with block on 49 | the same mutex instance. 50 | 51 | `Linux man page `_ 52 | 53 | References describing mutex and semaphore objects 54 | 55 | | `geeksforgeeks `_ 56 | | `stackoverflow `_ 57 | | `differencebetween `_ 58 | 59 | Constructors 60 | ~~~~~~~~~~~~ 61 | 62 | .. class:: Mutex() 63 | 64 | Creates an unlocked mutex object. 65 | 66 | Methods 67 | ~~~~~~~ 68 | 69 | .. method:: release() -> None 70 | 71 | Unlock the mutex. 72 | 73 | .. method:: test() -> bool 74 | 75 | Try to acquire the mutex in a non-blocking way. Return ``True`` on success and ``False`` on failure. 76 | 77 | You may also acquire the mutex in a blocking way by using ``with``. 78 | -------------------------------------------------------------------------------- /docs/_sources/library/neopixel.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`neopixel` --- control of WS2812 / NeoPixel LEDs 2 | ===================================================== 3 | 4 | .. module:: neopixel 5 | :synopsis: control of WS2812 / NeoPixel LEDs 6 | 7 | This module provides a driver for WS2818 / NeoPixel LEDs. 8 | 9 | .. note:: This module is only included by default on the ESP8266, ESP32 and RP2 10 | ports. On STM32 / Pyboard and others, you can either install the 11 | ``neopixel`` package using :term:`mip`, or you can download the module 12 | directly from :term:`micropython-lib` and copy it to the filesystem. 13 | 14 | class NeoPixel 15 | -------------- 16 | 17 | This class stores pixel data for a WS2812 LED strip connected to a pin. The 18 | application should set pixel data and then call :meth:`NeoPixel.write` 19 | when it is ready to update the strip. 20 | 21 | For example:: 22 | 23 | import neopixel 24 | 25 | # 32 LED strip connected to X8. 26 | p = machine.Pin.board.X8 27 | n = neopixel.NeoPixel(p, 32) 28 | 29 | # Draw a red gradient. 30 | for i in range(32): 31 | n[i] = (i * 8, 0, 0) 32 | 33 | # Update the strip. 34 | n.write() 35 | 36 | Constructors 37 | ------------ 38 | 39 | .. class:: NeoPixel(pin, n, *, bpp=3, timing=1) 40 | 41 | Construct an NeoPixel object. The parameters are: 42 | 43 | - *pin* is a machine.Pin instance. 44 | - *n* is the number of LEDs in the strip. 45 | - *bpp* is 3 for RGB LEDs, and 4 for RGBW LEDs. 46 | - *timing* is 0 for 400KHz, and 1 for 800kHz LEDs (most are 800kHz). 47 | 48 | Pixel access methods 49 | -------------------- 50 | 51 | .. method:: NeoPixel.fill(pixel) 52 | 53 | Sets the value of all pixels to the specified *pixel* value (i.e. an 54 | RGB/RGBW tuple). 55 | 56 | .. method:: NeoPixel.__len__() 57 | 58 | Returns the number of LEDs in the strip. 59 | 60 | .. method:: NeoPixel.__setitem__(index, val) 61 | 62 | Set the pixel at *index* to the value, which is an RGB/RGBW tuple. 63 | 64 | .. method:: NeoPixel.__getitem__(index) 65 | 66 | Returns the pixel at *index* as an RGB/RGBW tuple. 67 | 68 | Output methods 69 | -------------- 70 | 71 | .. method:: NeoPixel.write() 72 | 73 | Writes the current pixel data to the strip. 74 | -------------------------------------------------------------------------------- /docs/_sources/library/network.WIZNET5K.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: network 2 | .. _network.WIZNET5K: 3 | 4 | class WIZNET5K -- control WIZnet5x00 Ethernet modules 5 | ===================================================== 6 | 7 | This class allows you to control WIZnet5x00 Ethernet adaptors based on 8 | the W5200 and W5500 chipsets. The particular chipset that is supported 9 | by the firmware is selected at compile-time via the MICROPY_PY_NETWORK_WIZNET5K 10 | option. 11 | 12 | Example usage:: 13 | 14 | import network 15 | nic = network.WIZNET5K(pyb.SPI(1), pyb.Pin.board.X5, pyb.Pin.board.X4) 16 | print(nic.ifconfig()) 17 | 18 | # now use socket as usual 19 | ... 20 | 21 | For this example to work the WIZnet5x00 module must have the following connections: 22 | 23 | - MOSI connected to X8 24 | - MISO connected to X7 25 | - SCLK connected to X6 26 | - nSS connected to X5 27 | - nRESET connected to X4 28 | 29 | It is possible to use other SPI buses and other pins for nSS and nRESET. 30 | 31 | Constructors 32 | ------------ 33 | 34 | .. class:: WIZNET5K(spi, pin_cs, pin_rst) 35 | 36 | Create a WIZNET5K driver object, initialise the WIZnet5x00 module using the given 37 | SPI bus and pins, and return the WIZNET5K object. 38 | 39 | Arguments are: 40 | 41 | - *spi* is an :ref:`SPI object ` which is the SPI bus that the WIZnet5x00 is 42 | connected to (the MOSI, MISO and SCLK pins). 43 | - *pin_cs* is a :ref:`Pin object ` which is connected to the WIZnet5x00 nSS pin. 44 | - *pin_rst* is a :ref:`Pin object ` which is connected to the WIZnet5x00 nRESET pin. 45 | 46 | All of these objects will be initialised by the driver, so there is no need to 47 | initialise them yourself. For example, you can use:: 48 | 49 | nic = network.WIZNET5K(pyb.SPI(1), pyb.Pin.board.X5, pyb.Pin.board.X4) 50 | 51 | Methods 52 | ------- 53 | 54 | .. method:: WIZNET5K.isconnected() 55 | 56 | Returns ``True`` if the physical Ethernet link is connected and up. 57 | Returns ``False`` otherwise. 58 | 59 | .. method:: WIZNET5K.ifconfig([(ip, subnet, gateway, dns)]) 60 | 61 | Get/set IP address, subnet mask, gateway and DNS. 62 | 63 | When called with no arguments, this method returns a 4-tuple with the above information. 64 | 65 | To set the above values, pass a 4-tuple with the required information. For example:: 66 | 67 | nic.ifconfig(('192.168.0.4', '255.255.255.0', '192.168.0.1', '8.8.8.8')) 68 | 69 | .. method:: WIZNET5K.regs() 70 | 71 | Dump the WIZnet5x00 registers. Useful for debugging. 72 | -------------------------------------------------------------------------------- /docs/_sources/library/omv.audio.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`audio` --- Audio Module 2 | ============================= 3 | 4 | .. module:: audio 5 | :synopsis: Get audio samples. 6 | 7 | The ``audio`` module is used to record audio samples from a microphone on the Arduino Portenta or the Arduino Nicla. 8 | 9 | Functions 10 | --------- 11 | 12 | .. function:: init(channels:int=2, frequency:int=16000, gain_db:float=24, highpass:float=0.9883, samples:int=-1) -> None 13 | 14 | Initializes the audio module. Must be called first before using the audio module. 15 | 16 | ``channels`` specifies the number of audio channels. May be 1 or 2. Audio samples are 17 | interleaved for two audio channels. Using more than one channel is only possible on boards 18 | with more than one mic. 19 | 20 | ``frequency`` is the sample frequency to run at. Running at a higher sample frequency results 21 | in a higher noise floor which means less effective bits per sample. 22 | 23 | ``gain_db`` is the microphone gain to apply. 24 | 25 | ``highpass`` is the high pass filter cut-off given the target sample frequency. This parameter 26 | is applicable for the Arduino Portenta H7 only. 27 | 28 | ``samples`` is the number of samples to accumulate per callback. This is typically caluclated 29 | based on the decimation factor and number of channels. If set to -1, the number of samples 30 | will be calculated automatically based on the decimation factor and number of channels. 31 | 32 | .. function:: start_streaming(callback) -> None 33 | 34 | Calls the ``callback`` that takes one argument ``pcmbuf`` automatically forever when enough 35 | PCM samples have accumulated based on the `audio` module settings. You can cast the ``pcmbuf`` 36 | into an ``ndarray`` for processing the audio samples in numpy and then pass the ``ndarray`` 37 | to a `ml.Model` object for inference. 38 | 39 | ``pcmbuf`` is a signed 16-bit array of audio samples who's sized based on the decimation factor 40 | and number of channels, or the number of samples specified in the `audio.init()` function. 41 | 42 | In single channel mode audio samples will be 16-bits each filling up the 16-bit array. 43 | 44 | In dual channel mode audio samples will be 16-bits each in pairs filling up the 16-bit array. 45 | 46 | .. function:: stop_streaming() -> None 47 | 48 | Stops audio streaming and the callback from being called. 49 | -------------------------------------------------------------------------------- /docs/_sources/library/omv.buzzer.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`buzzer` --- buzzer driver 2 | =============================== 3 | 4 | .. module:: buzzer 5 | :synopsis: buzzer driver 6 | 7 | The ``buzzer`` module is used to control the amplitude and frequency of a buzzer onboard your OpenMV Cam. 8 | 9 | .. note:: 10 | 11 | The buzzer (and this module) is not present on all OpenMV Cam models. 12 | 13 | Functions 14 | --------- 15 | 16 | .. function:: freq(freq:int) -> None 17 | 18 | Sets the buzzer frequency independently of the volume. 19 | 20 | ``freq`` any frequency to drive the buzzer at. 21 | 22 | .. function:: duty(duty:int) -> None 23 | 24 | Sets the buzzer duty cycle independently of the frequency. 25 | 26 | ``duty`` any PWM duty cycle percentage (0-255 for 0-100%). 27 | 28 | Constants 29 | --------- 30 | 31 | .. data:: RESONANT_FREQ 32 | :type: int 33 | 34 | Constant definting the highest volume frequency of the buzzer (typically 4000 Hz). 35 | -------------------------------------------------------------------------------- /docs/_sources/library/omv.cpufreq.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`cpufreq` --- CPU Frequency Control 2 | ======================================== 3 | 4 | .. module:: cpufreq 5 | :synopsis: CPU Frequency Control 6 | 7 | The ``cpufreq`` module is used to get/set the CPU frequency to save power. 8 | 9 | .. note:: 10 | 11 | This module is not supported on the OpenMV Cam M4 because the CPU frequency, 12 | for various reasons, cannot be set independently of peripherals. 13 | 14 | Functions 15 | --------- 16 | 17 | .. function:: set_frequency(supported_frequency:int) -> None 18 | 19 | Sets the CPU frequency to a supported frequency in MHz. Peripherals 20 | frequencies are not changed. Only the CPU performance. 21 | 22 | .. function:: get_current_frequencies() -> Tuple[int, int, int, int] 23 | 24 | Returns (cpu_clk_in_mhz, hclk_in_mhz, pclk1_in_mhz, pclk2_in_mhz). 25 | 26 | .. function:: get_supported_frequencies() -> List[int] 27 | 28 | Returns the supported CPU frequencies [120, 144, 168, 192, 216] on the 29 | OpenMV Cam M7 and [60/50, 120/100, 240/200, 480/400] on the OpenMV Cam H7 Rev V/XY silicon in MHz. 30 | -------------------------------------------------------------------------------- /docs/_sources/library/omv.display.DACBacklight.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: display 2 | .. _display.DACBacklight: 3 | 4 | class DACBacklight -- DAC Backlight 5 | =================================== 6 | 7 | The `DACBacklight` class is used to control a screen backlight. 8 | 9 | Constructors 10 | ------------ 11 | 12 | .. class:: display.DACBacklight(channel:int, bits=8) 13 | 14 | Creates a backlight object to initialize the display backlight. This class should be passed as 15 | the ``backlight`` argument to any display object constructor which can use a backlight controller. 16 | 17 | ``channel`` specifies the DAC channel to use. This can be the GPIO pin also. For STM32 based 18 | OpenMV Cams this is ``P5``. 19 | 20 | ``bits`` specifies the resolution of the DAC. The default value of 8-bits should be good enough. 21 | 22 | Methods 23 | ------- 24 | 25 | .. method:: DACBacklight.deinit() -> None 26 | 27 | Deinitializes the backlight controller. 28 | 29 | .. method:: DACBacklight.backlight(value:Optional[int]=None) -> int 30 | 31 | Sets the backlight strength from 0-100. Note that a linear voltage on the backlight output 32 | will not necessary result in a linear brightness change on the screen. Typically there's 33 | a small region where the screen brightness will change drastically. 34 | -------------------------------------------------------------------------------- /docs/_sources/library/omv.display.PWMBacklight.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: display 2 | .. _display.PWMBacklight: 3 | 4 | class PWMBacklight -- PWM Backlight 5 | =================================== 6 | 7 | The `PWMBacklight` class is used to control a screen backlight. 8 | 9 | Constructors 10 | ------------ 11 | 12 | .. class:: display.PWMBacklight(pin, timer=3, channel=3, frequency=200) 13 | 14 | Creates a backlight object to initialize the display backlight. This class should be passed as 15 | the ``backlight`` argument to any display object constructor which can use a backlight controller. 16 | 17 | ``pin`` specifies the Pin to use. 18 | 19 | ``timer`` specifies the Timer number to use. 20 | 21 | ``channel`` specifies the Timer channel to use. 22 | 23 | ``frequency`` specifies the PWM frequency. 24 | 25 | Methods 26 | ------- 27 | 28 | .. method:: PWMBacklight.deinit() -> None 29 | 30 | Deinitializes the backlight controller. 31 | 32 | .. method:: PWMBacklight.backlight(value:Optional[int]=None) -> int 33 | 34 | Sets the backlight strength from 0-100. Note that a linear pwm duty cycle on the backlight output 35 | will not necessary result in a linear brightness change on the screen. Typically there's 36 | a small region where the screen brightness will change drastically. 37 | -------------------------------------------------------------------------------- /docs/_sources/library/omv.display.ST7701.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: display 2 | .. _display.ST7701: 3 | 4 | class ST7701 -- Display Controller 5 | ================================== 6 | 7 | The `ST7701` class is used to initialize the LCD screen controller. 8 | 9 | Constructors 10 | ------------ 11 | 12 | .. class:: display.ST7701() 13 | 14 | Creates a controller object to initialize the ST7701 display controller which typically powers 15 | MIPI DSI displays. This class should be passed as the ``cotnroller`` argument to the `DSIDisplay()` 16 | class constructor which will take care of calling the `ST7701.init()` method for you. 17 | 18 | Methods 19 | ------- 20 | 21 | .. method:: ST7701.init(display_controller) -> None 22 | 23 | Initializes the display using the display controller which must provide `display.DSIDisplay.bus_write()` and 24 | `display.DSIDisplay.bus_read()` methods. 25 | 26 | .. method:: ST7701.read_id() -> int 27 | 28 | Returns the display id. 29 | -------------------------------------------------------------------------------- /docs/_sources/library/omv.display.displaydata.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: display 2 | .. _display.DisplayData: 3 | 4 | class DisplayData -- Display Data 5 | ================================= 6 | 7 | The `DisplayData` class is used for getting information about the attached DisplayPort/HDMI Display. 8 | 9 | Constructors 10 | ------------ 11 | 12 | .. class:: display.DisplayData(cec=False, ddc=False, ddc_addr=0x50) 13 | 14 | ``cec`` Pass `True` to enable CEC communication to an external display (if possible). 15 | 16 | ``ddc`` Pass `True` to enable DDC communication to an external display (if possible). 17 | 18 | ``ddc_addr`` The I2C address to use to talk to the external display EEPROM. 19 | 20 | Methods 21 | ------- 22 | 23 | .. method:: DisplayData.display_id() -> int 24 | 25 | Returns the external display EDID data as a bytes() 26 | object. Verifying the EDID headers, checksums, and concatenating all sections into one bytes() 27 | object is done for you. You may then parse this information by `following this guide `__. 28 | 29 | .. method:: DisplayData.send_frame(dst_addr, src_addr, bytes) 30 | 31 | Sends a packet on the HDMI-CEC bus to ``dst_addr`` with source ``src_addr`` and data ``bytes``. 32 | 33 | .. method:: DisplayData.receive_frame(dst_addr, timeout=1000) 34 | 35 | Waits ``timeout`` milliseconds to receive an HDMI-CEC 36 | frame for address ``dst_addr``. Returns True if the received frame was for ``dst_addr`` and False 37 | if not. On timeout throws an `OSError` Exception. 38 | 39 | .. method:: DisplayData.frame_callback(callback, dst_addr) 40 | 41 | Registers a ``callback`` which will be called on reception of an 42 | HDMI-CEC frame. The callback will receive two arguments of the frame src_addr as an int and 43 | payload as a `bytes()` object. 44 | 45 | ``dst_addr`` sets the filter address to listen to on the CEC bus. 46 | 47 | If you use this method do not call `DisplayData.receive_frame()` anymore until the callback is 48 | disabled by passing ``None`` as the callback for this method. 49 | -------------------------------------------------------------------------------- /docs/_sources/library/omv.display.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`display` --- display driver 2 | ================================= 3 | 4 | .. module:: display 5 | :synopsis: display driver 6 | 7 | The ``display`` module is used for driving SPI LCDs, 24-bit parallel LCDs, MIPI DSI LCDs, HDMI output, and Display Port output. 8 | 9 | Classes 10 | ------- 11 | 12 | .. toctree:: 13 | :maxdepth: 1 14 | 15 | omv.display.spidisplay.rst 16 | omv.display.rgbdisplay.rst 17 | omv.display.dsidisplay.rst 18 | omv.display.displaydata.rst 19 | omv.display.ST7701.rst 20 | omv.display.DACBacklight.rst 21 | omv.display.PWMBacklight.rst 22 | 23 | Constants 24 | --------- 25 | 26 | .. data:: QVGA 27 | :type: int 28 | 29 | 320x240 resolution for framesize. 30 | 31 | .. data:: TQVGA 32 | :type: int 33 | 34 | 240x320 resolution for framesize. 35 | 36 | .. data:: FHVGA 37 | :type: int 38 | 39 | 480x272 resolution for framesize. 40 | 41 | .. data:: FHVGA2 42 | :type: int 43 | 44 | 480x128 resolution for framesize. 45 | 46 | .. data:: VGA 47 | :type: int 48 | 49 | 640x480 resolution for framesize. 50 | 51 | .. data:: THVGA 52 | :type: int 53 | 54 | 320x480 resolution for framesize. 55 | 56 | .. data:: FWVGA 57 | :type: int 58 | 59 | 800x480 resolution for framesize. 60 | 61 | .. data:: FWVGA2 62 | :type: int 63 | 64 | 800x320 resolution for framesize. 65 | 66 | .. data:: TFWVGA 67 | :type: int 68 | 69 | 480x800 resolution for framesize. 70 | 71 | .. data:: TFWVGA2 72 | :type: int 73 | 74 | 480x480 resolution for framesize. 75 | 76 | .. data:: SVGA 77 | :type: int 78 | 79 | 800x600 resolution for framesize. 80 | 81 | .. data:: WSVGA 82 | :type: int 83 | 84 | 1024x600 resolution for framesize. 85 | 86 | .. data:: XGA 87 | :type: int 88 | 89 | 1024x768 resolution for framesize. 90 | 91 | .. data:: SXGA 92 | :type: int 93 | 94 | 1280x1024 resolution for framesize. 95 | 96 | .. data:: SXGA2 97 | :type: int 98 | 99 | 1280x400 resolution for framesize. 100 | 101 | .. data:: UXGA 102 | :type: int 103 | 104 | 1600x1200 resolution for framesize. 105 | 106 | .. data:: HD 107 | :type: int 108 | 109 | 1280x720 resolution for framesize. 110 | 111 | .. data:: FHD 112 | :type: int 113 | 114 | 1920x1080 resolution for framesize. 115 | 116 | .. note:: 117 | 118 | Use a ``refresh`` of 30 Hz with this setting. The STM32H7 is not capable of 119 | driving 1080p at 60 Hz. 120 | -------------------------------------------------------------------------------- /docs/_sources/library/omv.gt911.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`gt911` --- Touch Screen Driver 2 | ==================================== 3 | 4 | .. module:: gt911 5 | :synopsis: Touch Screen Driver 6 | 7 | Basic polling mode example usage:: 8 | 9 | import time 10 | from gt911 import GT911 11 | from machine import I2C 12 | # Note use pin numbers or names not Pin objects because the 13 | # driver needs to change pin directions to reset the controller. 14 | touch = GT911(I2C(1, freq=400_000), reset_pin="P1", irq_pin="P2", touch_points=5) 15 | while True: 16 | n, points = touch.read_points() 17 | for i in range(0, n): 18 | print(f"id {points[i][3]} x {points[i][0]} y {points[i][1]} size {points[i][2]}") 19 | time.sleep_ms(100) 20 | 21 | Constructors 22 | ------------ 23 | 24 | .. class:: gt911.GT911(bus:int, reset_pin, irq_pin, address=0x5D, width=800, height=480, touch_points=1, reserve_x=False, reserve_y=False, reverse_axis=True, stio=True, refresh_rate=240, touch_callback=None) 25 | 26 | Creates a touch screen controller object. You should initialize it according to the example above. 27 | 28 | Methods 29 | ------- 30 | 31 | .. method:: GT911._read_reg(reg:int, size=1, buf=None) 32 | 33 | Reads a register value. 34 | 35 | .. method:: GT911._write_reg(reg:int, val:int, size=1) 36 | 37 | Writes a register value. 38 | 39 | .. method:: GT911.read_id() -> int 40 | 41 | Returns the ID of the gt911 chip. 42 | 43 | .. method:: GT911.read_points() 44 | 45 | Returns a tuple containing the count of points an array of point tuples. Each point tuple has 46 | an x[0], y[1], size[2], and id[3]. x/y are the position on screen. Size is the amount of pressure 47 | applied. And id is a unique id per point which should correlate to the same point over reads. 48 | 49 | .. method:: GT911.reset() -> None 50 | 51 | Resets the gt911 chip. 52 | -------------------------------------------------------------------------------- /docs/_sources/library/omv.imu.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`imu` --- imu sensor 2 | ========================= 3 | 4 | .. module:: imu 5 | :synopsis: imu sensor 6 | 7 | The ``imu`` module is used for reading the 6-DOF `LSM6DS3 `_ 8 | IMU sensor under the camera sensor. 9 | 10 | .. note:: 11 | 12 | The IMU sensor (and this module) is not present on all OpenMV Cam models. 13 | 14 | Functions 15 | --------- 16 | 17 | .. function:: acceleration_mg() -> Tuple[float, float, float] 18 | 19 | Returns the acceleration for (x, y, z) in a float tuple in milli-g's. 20 | 21 | For when the camera board is lying on a table face up: 22 | 23 | X points to the right of the camera sensor 24 | Y points down below the camera sensor (towards the bottom on the board) 25 | Z points in the reverse direction of the camera sensor (into the table) 26 | 27 | .. function:: angular_rate_mdps() -> Tuple[float, float, float] 28 | 29 | Returns the angular rate for (x, y, z) in a float tuple in milli-degrees-per-second. 30 | 31 | For when the camera board is lying on a table face up: 32 | 33 | X points to the right of the camera sensor 34 | Y points down below the camera sensor (towards the bottom on the board) 35 | Z points in the reverse direction of the camera sensor (into the table) 36 | 37 | .. function:: temperature_c() -> float 38 | 39 | Returns the temperature in celsius (float). 40 | 41 | .. function:: roll() -> float 42 | 43 | Returns the rotation angle in degrees (float) of the camera module. 44 | 45 | * 0 -> Camera is standing up. 46 | * 90 -> Camera is roated left. 47 | * 180 -> Camera is upside down. 48 | * 270 -> Camera is rotated right. 49 | 50 | .. function:: pitch() -> float 51 | 52 | Returns the rotation angle in degrees (float) of the camera module. 53 | 54 | * 0 -> Camera is standing up. 55 | * 90 -> Camera is pointing down. 56 | * 180 -> Camera is upside down. 57 | * 270 -> Camera is pointing up. 58 | 59 | .. function:: sleep(enable:bool) -> None 60 | 61 | Pass ``True`` to put the IMU sensor to sleep. ``False`` to wake it back up (the default). 62 | 63 | .. function:: __write_reg(addr:int, val:int) -> None 64 | 65 | Set 8-bit LSM6DS3 register ``addr`` to 8-bit ``val``. 66 | 67 | .. function:: __read_reg(addr:int) -> int 68 | 69 | Get 8-bit LSM6DS3 register ``addr``. 70 | -------------------------------------------------------------------------------- /docs/_sources/library/omv.micro_speech.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`micro_speech` --- Micro Speech Audio Module Example 2 | ========================================================= 3 | 4 | .. module:: micro_speech 5 | :synopsis: Example voice recognition module 6 | 7 | The `micro_speech` module runs Google's TensorFlow Lite for Microcontrollers Micro Speech framework 8 | for voice recognition. 9 | 10 | Please see this `guide `__ for training a new model. 11 | 12 | Constructors 13 | ------------ 14 | 15 | .. class:: MicroSpeech() 16 | 17 | Creates a MicroSpeech voice recognition class. 18 | 19 | .. method:: audio_callback(buf_in) 20 | 21 | Pass this method to `audio.start_streaming()` to fill the `MicroSpeech` class with audio samples. 22 | 23 | `MicroSpeech` will compute the FFT of the audio samples and keep a sliding window internally 24 | of the FFT the last 100ms or so of audio samples received as features for voice recognition. 25 | 26 | .. method:: listen(tf_model, [threshold=0.9, [timeout=1000, [filter=None]]]) 27 | 28 | Executes the tensor flow lite model ``tf_model``, which should be a path to a tensor flow lite 29 | model on disk, on the audio stream. 30 | 31 | This method will continue to execute the model until it classifies a result that has a 32 | confidence ratio above ``threshold`` and that's within the range specified by ``filter``. 33 | 34 | For example, if the model is designed to classify sounds into the four labels ['Silence', 35 | 'Unknown', 'Yes', 'No'], then a ``threshold`` of 0.7 mean that listen() only returns when 36 | the confidence score for one of those classes goes above 0.7. ``filter`` can then be ``[2, 3]`` 37 | to specify that we only care about 'Yes' or 'No' going above 0.7. 38 | 39 | ``timeout`` is the amount of time to run the model on audio data. If zero then listen will 40 | run forever until a result passes the threshold and filter criteria. 41 | 42 | Returns the index of the the label with the highest confidence score. E.g. for the example 43 | above 0, 1, 2, or 3 for ['Silence', 'Unknown', 'Yes', 'No'] respectively. 44 | -------------------------------------------------------------------------------- /docs/_sources/library/omv.ml.apps.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: ml.apps 2 | 3 | :mod:`ml.apps` --- ML Apps 4 | ========================== 5 | 6 | .. module:: ml.apps 7 | :synopsis: ML Apps 8 | 9 | The `ml.apps` module contains various ML application classes. 10 | 11 | .. _apps.MicroSpeech: 12 | 13 | class MicroSpeech -- Speech Recognition 14 | --------------------------------------- 15 | 16 | The MicroSpeech object is used to recognize simple spoken words using the MicroSpeech model from 17 | TensorFlow Lite for Microcontrollers. The model recognizes the words "yes" and "no" by default. 18 | 19 | You can customize the model to recognize other words by training a new model. See the 20 | `Micro Speech `__ 21 | guide. 22 | 23 | Constructors 24 | ~~~~~~~~~~~~ 25 | 26 | .. class:: MicroSpeech(preprocessor:str=None, micro_speech:str=None, labels:list[str, ...]=None, **kwargs) -> MicroSpeech 27 | 28 | Creates a MicroSpeech object. If no preprocessor is provided, the default preprocessor is used. 29 | If no micro_speech model is provided, the default model is used. If no labels are provided, the 30 | default labels are used from the default model. 31 | 32 | Methods 33 | ~~~~~~~ 34 | 35 | .. method:: listen(timeout:int=0, callback=None, threshold:float=0.65, filter:list[str, ...]=["Yes", "No"]) -> tuple[str, float] 36 | 37 | Listens for a spoken word and returns the word and confidence level as a tuple if the 38 | confidence level is above the threshold and the word is in the filter list. 39 | 40 | ``timeout`` is the maximum time in milliseconds to listen for a word. If zero, the method 41 | will listen indefinitely until a word is recognized. If -1 is passed, the method will not 42 | block and will return immediately with the result tuple which may contain ``None`` if no 43 | word is recognized. If a positive value is passed, the method will listen for that amount 44 | of time in milliseconds and then return the result tuple. 45 | 46 | ``callback`` is a function that will be called with the word and confidence level instead 47 | of returning the result. When combined with a timeout of zero, this allows you to listen 48 | for words indefinitely and process them as they are recognized. 49 | 50 | ``threshold`` is the minimum confidence level required to return a result. 51 | 52 | ``filter`` is a list of words that the model should recognize. If the recognized word is 53 | not in the filter list, the result is ignored. 54 | -------------------------------------------------------------------------------- /docs/_sources/library/omv.ml.utils.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: ml.utils 2 | 3 | :mod:`ml.utils` --- ML Utils 4 | ============================ 5 | 6 | .. module:: ml.utils 7 | :synopsis: ML Utils 8 | 9 | The `ml.utils` module contains utility classes and functions for machine learning. 10 | 11 | .. _utils.NMS: 12 | 13 | class NMS - Soft-Non-Maximum Suppression 14 | ---------------------------------------- 15 | 16 | The `NMS` object is used to collect a list of bounding boxes and their associated scores and then filter 17 | out overlapping bounding boxes with lower scores. Additionally, it remaps bounding boxes detected 18 | in a sub-window back to the original image coordinates. 19 | 20 | Constructors 21 | ~~~~~~~~~~~~ 22 | 23 | .. class:: NMS(window_w:int, window_h:int, roi:tuple[int,int,int,int]) -> NMS 24 | 25 | Creates a `NMS` object with the given window size and region of interest (ROI). The window is 26 | width/height of the input tensor of image model. The ROI is the region of interest that returned by the 27 | `Normalization()` object which corresponds to the region of the image that the model was run on. 28 | This allows the `NMS` object to remap bounding boxes detected in a sub-window back to the original 29 | image coordinates. 30 | 31 | Methods 32 | ~~~~~~~ 33 | 34 | .. method:: add_bounding_boxes(xmin:float, ymin:float, xmax:float, ymax:float, score:float, label_index:int) -> None 35 | 36 | Adds a bounding box to the `NMS` object with the given coordinates, score, and label index. 37 | 38 | ``xmin``, ``ymin``, ``xmax``, and ``ymax`` are the bounding box coordinates in the range of 0.0 to 1.0 39 | where (0.0, 0.0) is the top-left corner of the image and (1.0, 1.0) is the bottom-right corner of the image. 40 | 41 | ``score`` is the confidence score of the bounding box (0.0-1.0). 42 | 43 | ``label_index`` is the index of the label associated with the bounding box. 44 | 45 | .. method:: get_bounding_boxes(threshold:float=0.1, sigma:float=0.1) -> list[tuple[int,int,int,int,float,int]] 46 | 47 | Returns a list of bounding boxes that have been filtered by the `NMS` object and remapped 48 | to the original image coordinates. Bounding box tuples are 49 | ``(x, y, w, h, score, label_index)``. After calling this method you should create a new 50 | `NMS` object if you want to process a new set of bounding boxes. 51 | 52 | Bounding boxes must have a higher score then ``threshold`` to be kept. 53 | 54 | ``sigma`` controls the gaussian used to apply a score penalty to overlapping bounding boxes 55 | using the Soft-Non-Maximum-Suppression algorithm. A higher ``sigma`` will result in a more 56 | aggressive suppression of overlapping bounding boxes. 57 | -------------------------------------------------------------------------------- /docs/_sources/library/omv.omv.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`omv` --- OpenMV Cam Information 2 | ===================================== 3 | 4 | .. module:: omv 5 | :synopsis: OpenMV Cam Information 6 | 7 | The ``omv`` module is used to get OpenMV Cam information. 8 | 9 | Functions 10 | --------- 11 | 12 | .. function:: version_major() -> int 13 | 14 | Returns the major version number (int). 15 | 16 | .. function:: version_minor() -> int 17 | 18 | Returns the minor version number (int). 19 | 20 | .. function:: version_patch() -> int 21 | 22 | Returns the patch version number (int). 23 | 24 | .. function:: version_string() -> str 25 | 26 | Returns the version string (e.g. "2.8.0"). 27 | 28 | .. function:: arch() -> str 29 | 30 | Returns the board architecture string. This string is really just meant for 31 | OpenMV IDE but you can get it with this function. 32 | 33 | .. function:: board_type() -> str 34 | 35 | Returns the board type string. This string is really just meant for 36 | OpenMV IDE but you can get it with this function. 37 | 38 | .. function:: board_id() -> str 39 | 40 | Returns the board id string. This string is really just meant for 41 | OpenMV IDE but you can get it with this function. 42 | 43 | .. function:: disable_fb(disable: Optional[bool]=None) -> bool 44 | 45 | When ``disable`` is set to ``True`` the OpenMV Cam will no longer jpeg compress images and stream 46 | them to OpenMV IDE. The IDE may still poll for images unless ``Disable FB`` is checked in OpenMV 47 | IDE. You may wish to disable the frame buffer when streaming images over to another system while 48 | debugging you script with OpenMV IDE. If no arguments are passed this function will return 49 | ``True`` if the frame buffer is disabled and ``False`` if not. 50 | 51 | .. note:: 52 | 53 | This is a different flag than the ``Disable FB`` button in OpenMV IDE. 54 | -------------------------------------------------------------------------------- /docs/_sources/library/omv.tfp410.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`tfp410` --- DVI/HDMI Controller 2 | ===================================== 3 | 4 | .. module:: TFP410 5 | :synopsis: DVI/HDMI Controller 6 | 7 | DVI/HDMI Controller for the OpenMV Pure Thermal. 8 | 9 | .. note:: 10 | 11 | This will be refactored to be under the display module soon. 12 | 13 | Constructors 14 | ------------ 15 | 16 | .. class:: tfp410.TFP410(i2c_addr=0x3F) 17 | 18 | Initializes the TFP410 DVI/HDMI controller chip to drive an external DVI/HDMI display via 19 | a 24-bit parallel LCD bus. You just need to create this object to initialize the display. 20 | 21 | Methods 22 | ------- 23 | 24 | .. method:: TFP410.isconnected() -> bool 25 | 26 | Returns if an external display is connected. 27 | 28 | .. method:: TFP410.hotplug_callback(callback) -> None 29 | 30 | Registers a ``callback`` function that be called whenever the state 31 | of an external display being connected changes. The new state will be passed as an argument. 32 | 33 | If you use this method do not call `TFP410.isconnected()` anymore until the callback is 34 | disabled by pass ``None`` as the callback for this method. 35 | -------------------------------------------------------------------------------- /docs/_sources/library/platform.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`platform` -- access to underlying platform’s identifying data 2 | =================================================================== 3 | 4 | .. module:: platform 5 | :synopsis: access to underlying platform’s identifying data 6 | 7 | |see_cpython_module| :mod:`python:platform`. 8 | 9 | This module tries to retrieve as much platform-identifying data as possible. It 10 | makes this information available via function APIs. 11 | 12 | Functions 13 | --------- 14 | 15 | .. function:: platform() 16 | 17 | Returns a string identifying the underlying platform. This string is composed 18 | of several substrings in the following order, delimited by dashes (``-``): 19 | 20 | - the name of the platform system (e.g. Unix, Windows or MicroPython) 21 | - the MicroPython version 22 | - the architecture of the platform 23 | - the version of the underlying platform 24 | - the concatenation of the name of the libc that MicroPython is linked to 25 | and its corresponding version. 26 | 27 | For example, this could be 28 | ``"MicroPython-1.20.0-xtensa-IDFv4.2.4-with-newlib3.0.0"``. 29 | 30 | .. function:: python_compiler() 31 | 32 | Returns a string identifying the compiler used for compiling MicroPython. 33 | 34 | .. function:: libc_ver() 35 | 36 | Returns a tuple of strings *(lib, version)*, where *lib* is the name of the 37 | libc that MicroPython is linked to, and *version* the corresponding version 38 | of this libc. 39 | -------------------------------------------------------------------------------- /docs/_sources/library/pyb.Accel.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: pyb 2 | .. _pyb.Accel: 3 | 4 | class Accel -- accelerometer control 5 | ==================================== 6 | 7 | Accel is an object that controls the accelerometer. Example usage:: 8 | 9 | accel = pyb.Accel() 10 | for i in range(10): 11 | print(accel.x(), accel.y(), accel.z()) 12 | 13 | Raw values are between -32 and 31. 14 | 15 | 16 | Constructors 17 | ------------ 18 | 19 | .. class:: Accel() 20 | 21 | Create and return an accelerometer object. 22 | 23 | Methods 24 | ------- 25 | 26 | .. method:: Accel.filtered_xyz() 27 | 28 | Get a 3-tuple of filtered x, y and z values. 29 | 30 | Implementation note: this method is currently implemented as taking the 31 | sum of 4 samples, sampled from the 3 previous calls to this function along 32 | with the sample from the current call. Returned values are therefore 4 33 | times the size of what they would be from the raw x(), y() and z() calls. 34 | 35 | .. method:: Accel.tilt() 36 | 37 | Get the tilt register. 38 | 39 | .. method:: Accel.x() 40 | 41 | Get the x-axis value. 42 | 43 | .. method:: Accel.y() 44 | 45 | Get the y-axis value. 46 | 47 | .. method:: Accel.z() 48 | 49 | Get the z-axis value. 50 | 51 | Hardware Note 52 | ------------- 53 | 54 | The accelerometer uses I2C bus 1 to communicate with the processor. Consequently 55 | when readings are being taken pins X9 and X10 should be unused (other than for 56 | I2C). Other devices using those pins, and which therefore cannot be used 57 | concurrently, are UART 1 and Timer 4 channels 1 and 2. 58 | -------------------------------------------------------------------------------- /docs/_sources/library/pyb.Flash.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: pyb 2 | .. _pyb.Flash: 3 | 4 | class Flash -- access to built-in flash storage 5 | =============================================== 6 | 7 | The Flash class allows direct access to the primary flash device on the pyboard. 8 | 9 | In most cases, to store persistent data on the device, you'll want to use a 10 | higher-level abstraction, for example the filesystem via Python's standard file 11 | API, but this interface is useful to :ref:`customise the filesystem 12 | configuration ` or implement a low-level storage system for your 13 | application. 14 | 15 | Constructors 16 | ------------ 17 | 18 | .. class:: Flash() 19 | 20 | Create and return a block device that represents the flash device presented 21 | to the USB mass storage interface. 22 | 23 | It includes a virtual partition table at the start, and the actual flash 24 | starts at block ``0x100``. 25 | 26 | This constructor is deprecated and will be removed in a future version of MicroPython. 27 | 28 | .. class:: Flash(*, start=-1, len=-1) 29 | :noindex: 30 | 31 | Create and return a block device that accesses the flash at the specified offset. The length defaults to the remaining size of the device. 32 | 33 | The *start* and *len* offsets are in bytes, and must be a multiple of the block size (typically 512 for internal flash). 34 | 35 | Methods 36 | ------- 37 | 38 | .. method:: Flash.readblocks(block_num, buf) 39 | Flash.readblocks(block_num, buf, offset) 40 | .. method:: Flash.writeblocks(block_num, buf) 41 | Flash.writeblocks(block_num, buf, offset) 42 | .. method:: Flash.ioctl(cmd, arg) 43 | 44 | These methods implement the simple and :ref:`extended 45 | ` block protocol defined by 46 | :class:`vfs.AbstractBlockDev`. 47 | 48 | Hardware Note 49 | ------------- 50 | 51 | On boards with external spiflash (e.g. Pyboard D or the OpenMV Cam H7 Plus), the MicroPython firmware will 52 | be configured to use that as the primary flash storage. On all other boards, the 53 | internal flash inside the :term:`MCU` will be used. 54 | -------------------------------------------------------------------------------- /docs/_sources/library/pyb.LED.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: pyb 2 | .. _pyb.LED: 3 | 4 | class LED -- LED object 5 | ======================= 6 | 7 | The LED object controls an individual LED (Light Emitting Diode). 8 | 9 | 10 | Constructors 11 | ------------ 12 | 13 | .. class:: LED(id) 14 | 15 | Create an LED object associated with the given LED: 16 | 17 | - ``id`` is the LED number, 1-4. 18 | 19 | 20 | Methods 21 | ------- 22 | 23 | .. only:: port_pyboard 24 | 25 | .. method:: LED.intensity([value]) 26 | 27 | Get or set the LED intensity. Intensity ranges between 0 (off) and 255 (full on). 28 | If no argument is given, return the LED intensity. 29 | If an argument is given, set the LED intensity and return ``None``. 30 | 31 | *Note:* Only LED(3) and LED(4) can have a smoothly varying intensity, and 32 | they use timer PWM to implement it. LED(3) uses Timer(2) and LED(4) uses 33 | Timer(3). These timers are only configured for PWM if the intensity of the 34 | relevant LED is set to a value between 1 and 254. Otherwise the timers are 35 | free for general purpose use. 36 | 37 | .. method:: LED.off() 38 | 39 | Turn the LED off. 40 | 41 | .. method:: LED.on() 42 | 43 | Turn the LED on, to maximum intensity. 44 | 45 | .. method:: LED.toggle() 46 | 47 | Toggle the LED between on (maximum intensity) and off. If the LED is at 48 | non-zero intensity then it is considered "on" and toggle will turn it off. 49 | -------------------------------------------------------------------------------- /docs/_sources/library/pyb.RTC.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: pyb 2 | .. _pyb.RTC: 3 | 4 | class RTC -- real time clock 5 | ============================ 6 | 7 | The RTC is an independent clock that keeps track of the date 8 | and time. 9 | 10 | Example usage:: 11 | 12 | rtc = pyb.RTC() 13 | rtc.datetime((2014, 5, 1, 4, 13, 0, 0, 0)) 14 | print(rtc.datetime()) 15 | 16 | 17 | Constructors 18 | ------------ 19 | 20 | .. class:: RTC() 21 | 22 | Create an RTC object. 23 | 24 | 25 | Methods 26 | ------- 27 | 28 | .. method:: RTC.datetime([datetimetuple]) 29 | 30 | Get or set the date and time of the RTC. 31 | 32 | With no arguments, this method returns an 8-tuple with the current 33 | date and time. With 1 argument (being an 8-tuple) it sets the date 34 | and time (and ``subseconds`` is reset to 255). 35 | 36 | The 8-tuple has the following format: 37 | 38 | (year, month, day, weekday, hours, minutes, seconds, subseconds) 39 | 40 | ``weekday`` is 1-7 for Monday through Sunday. 41 | 42 | ``subseconds`` counts down from 255 to 0 43 | 44 | .. method:: RTC.wakeup(timeout, callback=None) 45 | 46 | Set the RTC wakeup timer to trigger repeatedly at every ``timeout`` 47 | milliseconds. This trigger can wake the pyboard from both the sleep 48 | states: :meth:`pyb.stop` and :meth:`pyb.standby`. 49 | 50 | If ``timeout`` is ``None`` then the wakeup timer is disabled. 51 | 52 | If ``callback`` is given then it is executed at every trigger of the 53 | wakeup timer. ``callback`` must take exactly one argument. 54 | 55 | .. method:: RTC.info() 56 | 57 | Get information about the startup time and reset source. 58 | 59 | - The lower 0xffff are the number of milliseconds the RTC took to 60 | start up. 61 | - Bit 0x10000 is set if a power-on reset occurred. 62 | - Bit 0x20000 is set if an external reset occurred 63 | 64 | .. method:: RTC.calibration(cal) 65 | 66 | Get or set RTC calibration. 67 | 68 | With no arguments, ``calibration()`` returns the current calibration 69 | value, which is an integer in the range [-511 : 512]. With one 70 | argument it sets the RTC calibration. 71 | 72 | The RTC Smooth Calibration mechanism adjusts the RTC clock rate by 73 | adding or subtracting the given number of ticks from the 32768 Hz 74 | clock over a 32 second period (corresponding to 2^20 clock ticks.) 75 | Each tick added will speed up the clock by 1 part in 2^20, or 0.954 76 | ppm; likewise the RTC clock it slowed by negative values. The 77 | usable calibration range is: 78 | (-511 * 0.954) ~= -487.5 ppm up to (512 * 0.954) ~= 488.5 ppm 79 | -------------------------------------------------------------------------------- /docs/_sources/library/pyb.Servo.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: pyb 2 | .. _pyb.Servo: 3 | 4 | class Servo -- 3-wire hobby servo driver 5 | ======================================== 6 | 7 | Servo objects control standard hobby servo motors with 3-wires (ground, power, 8 | signal). 9 | 10 | Example usage:: 11 | 12 | import pyb 13 | 14 | s1 = pyb.Servo(1) # create a servo object on position P7 15 | s2 = pyb.Servo(2) # create a servo object on position P8 16 | 17 | s1.angle(45) # move servo 1 to 45 degrees 18 | s2.angle(0) # move servo 2 to 0 degrees 19 | 20 | # move servo1 and servo2 synchronously, taking 1500ms 21 | s1.angle(-60, 1500) 22 | s2.angle(30, 1500) 23 | 24 | .. note:: The Servo objects use Timer(5) to produce the PWM output. You can 25 | use Timer(5) for Servo control, or your own purposes, but not both at the 26 | same time. 27 | 28 | Constructors 29 | ------------ 30 | 31 | .. class:: Servo(id) 32 | 33 | Create a servo object. ``id`` is 1-3, and corresponds to pins P7 through P9. 34 | 35 | Methods 36 | ------- 37 | 38 | .. method:: Servo.angle([angle, time=0]) 39 | 40 | If no arguments are given, this function returns the current angle. 41 | 42 | If arguments are given, this function sets the angle of the servo: 43 | 44 | - ``angle`` is the angle to move to in degrees. 45 | - ``time`` is the number of milliseconds to take to get to the specified 46 | angle. If omitted, then the servo moves as quickly as possible to its 47 | new position. 48 | 49 | .. method:: Servo.speed([speed, time=0]) 50 | 51 | If no arguments are given, this function returns the current speed. 52 | 53 | If arguments are given, this function sets the speed of the servo: 54 | 55 | - ``speed`` is the speed to change to, between -100 and 100. 56 | - ``time`` is the number of milliseconds to take to get to the specified 57 | speed. If omitted, then the servo accelerates as quickly as possible. 58 | 59 | .. method:: Servo.pulse_width([value]) 60 | 61 | If no arguments are given, this function returns the current raw pulse-width 62 | value. 63 | 64 | If an argument is given, this function sets the raw pulse-width value. 65 | 66 | .. method:: Servo.calibration([pulse_min, pulse_max, pulse_centre, [pulse_angle_90, pulse_speed_100]]) 67 | 68 | If no arguments are given, this function returns the current calibration 69 | data, as a 5-tuple. 70 | 71 | If arguments are given, this function sets the timing calibration: 72 | 73 | - ``pulse_min`` is the minimum allowed pulse width. 74 | - ``pulse_max`` is the maximum allowed pulse width. 75 | - ``pulse_centre`` is the pulse width corresponding to the centre/zero position. 76 | - ``pulse_angle_90`` is the pulse width corresponding to 90 degrees. 77 | - ``pulse_speed_100`` is the pulse width corresponding to a speed of 100. 78 | -------------------------------------------------------------------------------- /docs/_sources/library/pyb.Switch.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: pyb 2 | .. _pyb.Switch: 3 | 4 | class Switch -- switch object 5 | ============================= 6 | 7 | A Switch object is used to control a push-button switch. 8 | 9 | Usage:: 10 | 11 | sw = pyb.Switch() # create a switch object 12 | sw.value() # get state (True if pressed, False otherwise) 13 | sw() # shorthand notation to get the switch state 14 | sw.callback(f) # register a callback to be called when the 15 | # switch is pressed down 16 | sw.callback(None) # remove the callback 17 | 18 | Example:: 19 | 20 | pyb.Switch().callback(lambda: pyb.LED(1).toggle()) 21 | 22 | 23 | Constructors 24 | ------------ 25 | 26 | .. class:: Switch() 27 | 28 | Create and return a switch object. 29 | 30 | 31 | Methods 32 | ------- 33 | 34 | .. method:: Switch.__call__() 35 | 36 | Call switch object directly to get its state: ``True`` if pressed down, 37 | ``False`` otherwise. 38 | 39 | .. method:: Switch.value() 40 | 41 | Get the switch state. Returns ``True`` if pressed down, otherwise ``False``. 42 | 43 | .. method:: Switch.callback(fun) 44 | 45 | Register the given function to be called when the switch is pressed down. 46 | If ``fun`` is ``None``, then it disables the callback. 47 | -------------------------------------------------------------------------------- /docs/_sources/library/pyb.USB_HID.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: pyb 2 | .. _pyb.USB_HID: 3 | 4 | class USB_HID -- USB Human Interface Device (HID) 5 | ================================================= 6 | 7 | The USB_HID class allows creation of an object representing the USB 8 | Human Interface Device (HID) interface. It can be used to emulate 9 | a peripheral such as a mouse or keyboard. 10 | 11 | Before you can use this class, you need to use :meth:`pyb.usb_mode()` to set the USB mode to include the HID interface. 12 | 13 | Constructors 14 | ------------ 15 | 16 | .. class:: USB_HID() 17 | 18 | Create a new USB_HID object. 19 | 20 | 21 | Methods 22 | ------- 23 | 24 | .. method:: USB_HID.recv(data, *, timeout=5000) 25 | 26 | Receive data on the bus: 27 | 28 | - ``data`` can be an integer, which is the number of bytes to receive, 29 | or a mutable buffer, which will be filled with received bytes. 30 | - ``timeout`` is the timeout in milliseconds to wait for the receive. 31 | 32 | Return value: if ``data`` is an integer then a new buffer of the bytes received, 33 | otherwise the number of bytes read into ``data`` is returned. 34 | 35 | .. method:: USB_HID.send(data) 36 | 37 | Send data over the USB HID interface: 38 | 39 | - ``data`` is the data to send (a tuple/list of integers, or a 40 | bytearray). 41 | -------------------------------------------------------------------------------- /docs/_sources/library/random.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`random` -- generate random numbers 2 | ======================================== 3 | 4 | .. module:: random 5 | :synopsis: random numbers 6 | 7 | This module implements a pseudo-random number generator (PRNG). 8 | 9 | |see_cpython_module| :mod:`python:random` . 10 | 11 | .. note:: 12 | 13 | The following notation is used for intervals: 14 | 15 | - () are open interval brackets and do not include their endpoints. 16 | For example, (0, 1) means greater than 0 and less than 1. 17 | In set notation: (0, 1) = {x | 0 < x < 1}. 18 | 19 | - [] are closed interval brackets which include all their limit points. 20 | For example, [0, 1] means greater than or equal to 0 and less than 21 | or equal to 1. 22 | In set notation: [0, 1] = {x | 0 <= x <= 1}. 23 | 24 | .. note:: 25 | 26 | The :func:`randrange`, :func:`randint` and :func:`choice` functions are only 27 | available if the ``MICROPY_PY_RANDOM_EXTRA_FUNCS`` configuration option is 28 | enabled. 29 | 30 | 31 | Functions for integers 32 | ---------------------- 33 | 34 | .. function:: getrandbits(n) 35 | 36 | Return an integer with *n* random bits (0 <= n <= 32). 37 | 38 | .. function:: randint(a, b) 39 | 40 | Return a random integer in the range [*a*, *b*]. 41 | 42 | .. function:: randrange(stop) 43 | randrange(start, stop) 44 | randrange(start, stop[, step]) 45 | 46 | The first form returns a random integer from the range [0, *stop*). 47 | The second form returns a random integer from the range [*start*, *stop*). 48 | The third form returns a random integer from the range [*start*, *stop*) in 49 | steps of *step*. For instance, calling ``randrange(1, 10, 2)`` will 50 | return odd numbers between 1 and 9 inclusive. 51 | 52 | 53 | Functions for floats 54 | -------------------- 55 | 56 | .. function:: random() 57 | 58 | Return a random floating point number in the range [0.0, 1.0). 59 | 60 | .. function:: uniform(a, b) 61 | 62 | Return a random floating point number N such that *a* <= N <= *b* for *a* <= *b*, 63 | and *b* <= N <= *a* for *b* < *a*. 64 | 65 | 66 | Other Functions 67 | --------------- 68 | 69 | .. function:: seed(n=None, /) 70 | 71 | Initialise the random number generator module with the seed *n* which should 72 | be an integer. When no argument (or ``None``) is passed in it will (if 73 | supported by the port) initialise the PRNG with a true random number 74 | (usually a hardware generated random number). 75 | 76 | The ``None`` case only works if ``MICROPY_PY_RANDOM_SEED_INIT_FUNC`` is 77 | enabled by the port, otherwise it raises ``ValueError``. 78 | 79 | .. function:: choice(sequence) 80 | 81 | Chooses and returns one item at random from *sequence* (tuple, list or 82 | any object that supports the subscript operation). 83 | -------------------------------------------------------------------------------- /docs/_sources/library/requests.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`requests` --- Related functions of HTTP client 2 | ===================================================== 3 | 4 | .. module:: requests 5 | :synopsis: Relevant functional functions of the HTTP client, providing various HTTP request methods 6 | 7 | Relevant functional functions of the HTTP client, providing various HTTP request methods 8 | 9 | Response class 10 | -------------- 11 | 12 | .. class:: Response(s) 13 | 14 | The Response class object contains the server's response to the HTTP request. 15 | 16 | Methods 17 | ~~~~~~~ 18 | 19 | .. decorator:: headers 20 | 21 | Returns the headers. 22 | 23 | .. decorator:: content 24 | 25 | Returns the content of the response, in bytes. 26 | 27 | .. method:: json() 28 | 29 | Return response json encoded content and convert to dict type. 30 | 31 | Functions 32 | --------- 33 | 34 | .. function:: request(function, url, data=None, json=None, files=None, headers={}, auth=None) 35 | 36 | Send an HTTP request to the server. 37 | 38 | - ``function`` - HTTP function to use 39 | - ``url`` - URL to send 40 | - ``data`` - To append to the body of the request. If a dictionary or tuple list is provided, the form will be encoded. 41 | - ``json`` - json is used to attach to the body of the request. 42 | - ``files`` - Used for file upload, the type is 2-tuple, which defines the file name, file path and content type. As follows,{‘name’, (file directory,content-type)} 43 | - ``headers`` - Dictionary of headers to send. 44 | - ``auth`` - Auth tuple to enable Basic/Digest/Custom HTTP Auth. 45 | 46 | .. function:: head(url, **kw) 47 | 48 | Send HEAD request and return Response object. 49 | 50 | - ``url`` - Request object URL 51 | - ``**kw`` - The parameters of the request function. 52 | 53 | .. function:: get(url, **kw) 54 | 55 | Send GET request and return Response object. 56 | 57 | - ``url`` - Request object URL 58 | - ``**kw`` - Parameters of request function. 59 | 60 | .. function:: post(url, **kw) 61 | 62 | Send POST request and return Response object. 63 | 64 | - ``url`` - Request object URL 65 | - ``**kw`` - Parameters of request function. 66 | 67 | .. function:: put(url, **kw) 68 | 69 | Send PUT request and return Response object. 70 | 71 | - ``url`` - RRequest object URL 72 | - ``**kw`` - Parameters of request function. 73 | 74 | .. function:: patch(url, **kw) 75 | 76 | Send PATCH request, return Response object. 77 | 78 | - ``url`` - Request object URL 79 | - ``**kw`` - Parameters of request function. 80 | 81 | .. function:: delete(url, **kw) 82 | 83 | Send a DELETE request. Return Response object。 84 | 85 | - ``url`` - Request object URL 86 | - ``**kw`` - Parameters of request function. 87 | -------------------------------------------------------------------------------- /docs/_sources/library/rp2.Flash.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: rp2 2 | .. _rp2.Flash: 3 | 4 | class Flash -- access to built-in flash storage 5 | =============================================== 6 | 7 | This class gives access to the SPI flash memory. 8 | 9 | In most cases, to store persistent data on the device, you'll want to use a 10 | higher-level abstraction, for example the filesystem via Python's standard file 11 | API, but this interface is useful to :ref:`customise the filesystem 12 | configuration ` or implement a low-level storage system for your 13 | application. 14 | 15 | 16 | Constructors 17 | ------------ 18 | 19 | .. class:: Flash() 20 | 21 | Gets the singleton object for accessing the SPI flash memory. 22 | 23 | 24 | Methods 25 | ------- 26 | 27 | .. method:: Flash.readblocks(block_num, buf) 28 | Flash.readblocks(block_num, buf, offset) 29 | .. method:: Flash.writeblocks(block_num, buf) 30 | Flash.writeblocks(block_num, buf, offset) 31 | .. method:: Flash.ioctl(cmd, arg) 32 | 33 | These methods implement the simple and extended 34 | :ref:`block protocol ` defined by 35 | :class:`os.AbstractBlockDev`. 36 | 37 | -------------------------------------------------------------------------------- /docs/_sources/library/rp2.PIO.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: rp2 2 | .. _rp2.PIO: 3 | 4 | class PIO -- advanced PIO usage 5 | =============================== 6 | 7 | The :class:`PIO` class gives access to an instance of the RP2040's PIO 8 | (programmable I/O) interface. 9 | 10 | The preferred way to interact with PIO is using :class:`rp2.StateMachine`, the 11 | PIO class is for advanced use. 12 | 13 | For assembling PIO programs, see :func:`rp2.asm_pio`. 14 | 15 | 16 | Constructors 17 | ------------ 18 | 19 | .. class:: PIO(id) 20 | 21 | Gets the PIO instance numbered *id*. The RP2040 has two PIO instances, 22 | numbered 0 and 1. 23 | 24 | Raises a ``ValueError`` if any other argument is provided. 25 | 26 | 27 | Methods 28 | ------- 29 | 30 | .. method:: PIO.add_program(program) 31 | 32 | Add the *program* to the instruction memory of this PIO instance. 33 | 34 | The amount of memory available for programs on each PIO instance is 35 | limited. If there isn't enough space left in the PIO's program memory 36 | this method will raise ``OSError(ENOMEM)``. 37 | 38 | .. method:: PIO.remove_program([program]) 39 | 40 | Remove *program* from the instruction memory of this PIO instance. 41 | 42 | If no program is provided, it removes all programs. 43 | 44 | It is not an error to remove a program which has already been removed. 45 | 46 | .. method:: PIO.state_machine(id, [program, ...]) 47 | 48 | Gets the state machine numbered *id*. On the RP2040, each PIO instance has 49 | four state machines, numbered 0 to 3. 50 | 51 | Optionally initialize it with a *program*: see `StateMachine.init`. 52 | 53 | >>> rp2.PIO(1).state_machine(3) 54 | StateMachine(7) 55 | 56 | .. method:: PIO.irq(handler=None, trigger=IRQ_SM0|IRQ_SM1|IRQ_SM2|IRQ_SM3, hard=False) 57 | 58 | Returns the IRQ object for this PIO instance. 59 | 60 | MicroPython only uses IRQ 0 on each PIO instance. IRQ 1 is not available. 61 | 62 | Optionally configure it. 63 | 64 | 65 | Constants 66 | --------- 67 | 68 | .. data:: PIO.IN_LOW 69 | PIO.IN_HIGH 70 | PIO.OUT_LOW 71 | PIO.OUT_HIGH 72 | 73 | These constants are used for the *out_init*, *set_init*, and *sideset_init* 74 | arguments to `asm_pio`. 75 | 76 | .. data:: PIO.SHIFT_LEFT 77 | PIO.SHIFT_RIGHT 78 | 79 | These constants are used for the *in_shiftdir* and *out_shiftdir* arguments 80 | to `asm_pio` or `StateMachine.init`. 81 | 82 | .. data:: PIO.JOIN_NONE 83 | PIO.JOIN_TX 84 | PIO.JOIN_RX 85 | 86 | These constants are used for the *fifo_join* argument to `asm_pio`. 87 | 88 | .. data:: PIO.IRQ_SM0 89 | PIO.IRQ_SM1 90 | PIO.IRQ_SM2 91 | PIO.IRQ_SM3 92 | 93 | These constants are used for the *trigger* argument to `PIO.irq`. 94 | 95 | -------------------------------------------------------------------------------- /docs/_sources/library/uping.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`uping` --- Ping another computer 2 | ====================================== 3 | 4 | .. module:: uping 5 | :synopsis: Ping another computer 6 | 7 | .. function:: ping(host, count=4, timeout=5000, interval=10, quiet=False, size=64) 8 | 9 | Ping the ``host`` with ``count`` packets each having ``timeout`` at a 10 | rate between packets of ``interval``. If ``quiet`` is ``True`` do not print 11 | stats on return. Packet sizes are ``size`` bytes each. 12 | 13 | Returns a tuple containing the number of transmitted packets and the number received. 14 | -------------------------------------------------------------------------------- /docs/_sources/library/urequests.rst.txt: -------------------------------------------------------------------------------- 1 | :mod:`urequests` --- Related functions of HTTP client 2 | ===================================================== 3 | 4 | .. module:: urequests 5 | :synopsis: Relevant functional functions of the HTTP client, providing various HTTP request methods 6 | 7 | Relevant functional functions of the HTTP client, providing various HTTP request methods 8 | 9 | Response class 10 | -------------- 11 | 12 | .. class:: Response(s) 13 | 14 | The Response class object contains the server's response to the HTTP request. 15 | 16 | Methods 17 | ~~~~~~~ 18 | 19 | .. decorator:: headers 20 | 21 | Returns the headers. 22 | 23 | .. decorator:: content 24 | 25 | Returns the content of the response, in bytes. 26 | 27 | .. method:: json() 28 | 29 | Return response json encoded content and convert to dict type. 30 | 31 | Functions 32 | --------- 33 | 34 | .. function:: request(function, url, data=None, json=None, files=None, headers={}, auth=None) 35 | 36 | Send an HTTP request to the server. 37 | 38 | - ``function`` - HTTP function to use 39 | - ``url`` - URL to send 40 | - ``data`` - To append to the body of the request. If a dictionary or tuple list is provided, the form will be encoded. 41 | - ``json`` - json is used to attach to the body of the request. 42 | - ``files`` - Used for file upload, the type is 2-tuple, which defines the file name, file path and content type. As follows,{‘name’, (file directory,content-type)} 43 | - ``headers`` - Dictionary of headers to send. 44 | - ``auth`` - Auth tuple to enable Basic/Digest/Custom HTTP Auth. 45 | 46 | .. function:: head(url, **kw) 47 | 48 | Send HEAD request and return Response object. 49 | 50 | - ``url`` - Request object URL 51 | - ``**kw`` - The parameters of the request function. 52 | 53 | .. function:: get(url, **kw) 54 | 55 | Send GET request and return Response object. 56 | 57 | - ``url`` - Request object URL 58 | - ``**kw`` - Parameters of request function. 59 | 60 | .. function:: post(url, **kw) 61 | 62 | Send POST request and return Response object. 63 | 64 | - ``url`` - Request object URL 65 | - ``**kw`` - Parameters of request function. 66 | 67 | .. function:: put(url, **kw) 68 | 69 | Send PUT request and return Response object. 70 | 71 | - ``url`` - RRequest object URL 72 | - ``**kw`` - Parameters of request function. 73 | 74 | .. function:: patch(url, **kw) 75 | 76 | Send PATCH request, return Response object. 77 | 78 | - ``url`` - Request object URL 79 | - ``**kw`` - Parameters of request function. 80 | 81 | .. function:: delete(url, **kw) 82 | 83 | Send a DELETE request. Return Response object。 84 | 85 | - ``url`` - Request object URL 86 | - ``**kw`` - Parameters of request function. 87 | -------------------------------------------------------------------------------- /docs/_sources/library/wipy.rst.txt: -------------------------------------------------------------------------------- 1 | ************************************* 2 | :mod:`wipy` -- WiPy specific features 3 | ************************************* 4 | 5 | .. module:: wipy 6 | :synopsis: WiPy specific features 7 | 8 | The ``wipy`` module contains functions to control specific features of the 9 | WiPy, such as the heartbeat LED. 10 | 11 | Functions 12 | --------- 13 | 14 | .. function:: heartbeat([enable]) 15 | 16 | Get or set the state (enabled or disabled) of the heartbeat LED. Accepts and 17 | returns boolean values (``True`` or ``False``). 18 | -------------------------------------------------------------------------------- /docs/_sources/library/zephyr.DiskAccess.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: zephyr 2 | .. _zephyr.DiskAccess: 3 | 4 | class DiskAccess -- access to disk storage 5 | ========================================== 6 | 7 | Uses `Zephyr Disk Access API `_. 8 | 9 | This class allows access to storage devices on the board, such as support for SD card controllers and 10 | interfacing with SD cards via SPI. Disk devices are automatically detected and initialized on boot using 11 | Zephyr devicetree data. 12 | 13 | The Zephyr disk access class enables the transfer of data between a disk device and an accessible memory buffer given a disk name, 14 | buffer, starting disk block, and number of sectors to read. MicroPython reads as many blocks as necessary to fill the buffer, so 15 | the number of sectors to read is found by dividing the buffer length by block size of the disk. 16 | 17 | Constructors 18 | ------------ 19 | 20 | .. class:: DiskAccess(disk_name) 21 | 22 | Gets an object for accessing disk memory of the specific disk. 23 | For accessing an SD card on the mimxrt1050_evk, ``disk_name`` would be ``SDHC``. See board documentation and 24 | devicetree for usable disk names for your board (ex. RT boards use style USDHC#). 25 | 26 | Methods 27 | ------- 28 | 29 | .. method:: DiskAccess.readblocks(block_num, buf) 30 | DiskAccess.readblocks(block_num, buf, offset) 31 | .. method:: DiskAccess.writeblocks(block_num, buf) 32 | DiskAccess.writeblocks(block_num, buf, offset) 33 | .. method:: DiskAccess.ioctl(cmd, arg) 34 | 35 | These methods implement the simple and extended 36 | :ref:`block protocol ` defined by 37 | :class:`os.AbstractBlockDev`. 38 | 39 | -------------------------------------------------------------------------------- /docs/_sources/library/zephyr.FlashArea.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: zephyr 2 | .. _zephyr.FlashArea: 3 | 4 | class FlashArea -- access to built-in flash storage 5 | =================================================== 6 | 7 | Uses `Zephyr flash map API `_. 8 | 9 | This class allows access to device flash partition data. 10 | Flash area structs consist of a globally unique ID number, the name of the flash device the partition is in, 11 | the start offset (expressed in relation to the flash memory beginning address per partition), 12 | and the size of the partition that the device represents. For fixed flash partitions, data from the device 13 | tree is used; however, fixed flash partitioning is not enforced in MicroPython because MCUBoot is not enabled. 14 | 15 | Constructors 16 | ------------ 17 | 18 | .. class:: FlashArea(id, block_size) 19 | 20 | Gets an object for accessing flash memory at partition specified by ``id`` and with block size of ``block_size``. 21 | 22 | ``id`` values are integers correlating to fixed flash partitions defined in the devicetree. 23 | A commonly used partition is the designated flash storage area defined as ``FlashArea.STORAGE`` if 24 | ``FLASH_AREA_LABEL_EXISTS(storage)`` returns true at boot. 25 | Zephyr devicetree fixed flash partitions are ``boot_partition``, ``slot0_partition``, ``slot1_partition``, and 26 | ``scratch_partition``. Because MCUBoot is not enabled by default for MicroPython, these fixed partitions can be accessed by 27 | ID integer values 1, 2, 3, and 4, respectively. 28 | 29 | Methods 30 | ------- 31 | 32 | .. method:: FlashArea.readblocks(block_num, buf) 33 | FlashArea.readblocks(block_num, buf, offset) 34 | .. method:: FlashArea.writeblocks(block_num, buf) 35 | FlashArea.writeblocks(block_num, buf, offset) 36 | .. method:: FlashArea.ioctl(cmd, arg) 37 | 38 | These methods implement the simple and extended 39 | :ref:`block protocol ` defined by 40 | :class:`os.AbstractBlockDev`. 41 | -------------------------------------------------------------------------------- /docs/_sources/library/zephyr.rst.txt: -------------------------------------------------------------------------------- 1 | .. currentmodule:: zephyr 2 | 3 | :mod:`zephyr` --- functionality specific to the Zephyr port 4 | =========================================================== 5 | 6 | .. module:: zephyr 7 | :synopsis: functionality specific to Zephyr 8 | 9 | The ``zephyr`` module contains functions and classes specific to the Zephyr port. 10 | 11 | Functions 12 | --------- 13 | 14 | .. function:: is_preempt_thread() 15 | 16 | Returns true if the current thread is a preemptible thread. 17 | 18 | Zephyr preemptible threads are those with non-negative priority values (low priority levels), which therefore, 19 | can be supplanted as soon as a higher or equal priority thread becomes ready. 20 | 21 | .. function:: current_tid() 22 | 23 | Returns the thread id of the current thread, which is used to reference the thread. 24 | 25 | .. function:: thread_analyze() 26 | 27 | Runs the Zephyr debug thread analyzer on the current thread and prints stack size statistics in the format: 28 | 29 | "``thread_name``-20s: STACK: unused ``available_stack_space`` usage ``stack_space_used`` 30 | / ``stack_size`` (``percent_stack_space_used`` %); CPU: ``cpu_utilization`` %" 31 | 32 | * *CPU utilization is only printed if runtime statistics are configured via the ``CONFIG_THREAD_RUNTIME_STATS`` kconfig* 33 | 34 | This function can only be accessed if ``CONFIG_THREAD_ANALYZER`` is configured for the port in ``zephyr/prj.conf``. 35 | For more information, see documentation for Zephyr `thread analyzer 36 | `_. 37 | 38 | .. function:: shell_exec(cmd_in) 39 | 40 | Executes the given command on an UART backend. This function can only be accessed if ``CONFIG_SHELL_BACKEND_SERIAL`` 41 | is configured for the port in ``zephyr/prj.conf``. 42 | 43 | A list of possible commands can be found in the documentation for Zephyr `shell commands `_. 44 | 45 | Classes 46 | ------- 47 | 48 | .. toctree:: 49 | :maxdepth: 1 50 | 51 | zephyr.DiskAccess.rst 52 | zephyr.FlashArea.rst 53 | 54 | Additional Modules 55 | ------------------ 56 | 57 | .. toctree:: 58 | :maxdepth: 1 59 | 60 | zephyr.zsensor.rst 61 | -------------------------------------------------------------------------------- /docs/_sources/license.rst.txt: -------------------------------------------------------------------------------- 1 | MicroPython license information 2 | =============================== 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (c) 2013-2025 Damien P. George, Paul Sokolovsky, OpenMV LLC, and others 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /docs/_sources/openmvcam/tutorial/analog_io.rst.txt: -------------------------------------------------------------------------------- 1 | Analog IO 2 | ========= 3 | 4 | The OpenMV Cam has one analog I/O pin (P6) which can be used as an ADC input or 5 | DAC output. Here's how to use it to read a voltage value between 0V and 3.3V:: 6 | 7 | import pyb 8 | 9 | adc = pyb.ADC(pyb.Pin('P6')) 10 | 11 | while(True): 12 | pyb.delay(10) # wait 10 ms 13 | print("%f volts" % (((adc.read() * 3.3) + 2047.5) / 4095)) # read value, 0-4095 14 | 15 | The ADC has 12-bits of resolution so it will output a value between 0 and 4095 16 | for 0 to 3.3 volts. Finally, note that while the pin is in ADC mode it is not 17 | 5V tolerant anymore. 18 | 19 | Next, to generate an analog output voltage you can put the I/O pin in DAC 20 | mode:: 21 | 22 | import pyb, math 23 | 24 | dac = pyb.DAC(pyb.Pin('P6')) 25 | 26 | counter = 0 27 | 28 | while(True): 29 | pyb.delay(10) # wait 10 ms 30 | dac.write(int(math.sin(math.radians(counter % 360)) * 255)) 31 | counter += 1 32 | 33 | The above code generates a sin wave on the I/O pin which will go from 0 to 255 34 | for 0 to 3.3 volts. Again, note that while the pin is in DAC mode it is not 35 | 5V tolerant anymore. 36 | -------------------------------------------------------------------------------- /docs/_sources/openmvcam/tutorial/gpio_control.rst.txt: -------------------------------------------------------------------------------- 1 | GPIO Control 2 | ============ 3 | 4 | Your OpenMV Cam has between 9 (OpenMV Cam M4) to 10 (OpenMV Cam M7) general 5 | purpose I/O pins onboard for talking to the real-world. We're probably going to 6 | keep the pin count this low moving into the future to keep the OpenMV Cam tiny. 7 | 8 | Anyway, there are a few ways to use GPIO pins. 9 | 10 | As an Input 11 | ----------- 12 | 13 | To use a GPIO pin as an input just do:: 14 | 15 | import pyb 16 | 17 | p = pyb.Pin("P0", pyb.Pin.IN) 18 | p.value() # Returns 0 or 1. 19 | 20 | The `pyb.Pin()` constructor creates a pin object which you will use to control 21 | the I/O pin on your OpenMV Cam. The string you pass to the OpenMV Cam should be 22 | ``P`` and then ``0-8`` for the OpenMV Cam M4 and ``0-9`` for the OpenMV Cam M7. 23 | 24 | Once you've created the GPIO pin use the `pyb.Pin.value()` method to get the 25 | state of the IO pin. 26 | 27 | Finally, if you need to pull-up or pull-down the IO pin pass `pyb.Pin.PULL_UP` 28 | or `pyb.Pin.PULL_DOWN` as additional arguments to `pyb.Pin()` constructor:: 29 | 30 | p = pyb.Pin("P0", pyb.Pin.IN, pyb.Pin.PULL_UP) 31 | 32 | As an Output 33 | ------------ 34 | 35 | Now, to use a GPIO pin as an output just do:: 36 | 37 | import pyb 38 | 39 | p = pyb.Pin("P0", pyb.Pin.OUT_PP) 40 | p.high() # or p.value(1) to make the pin high (3.3V) 41 | p.low() # or p.value(0) to make the pin low (0V) 42 | 43 | It's that easy! However, what if you want to open-drain an output? Just do:: 44 | 45 | p = pyb.Pin("P0", pyb.Pin.OUT_OD) 46 | 47 | And now ``pyb.Pin.high()`` will cause the pin to float while ``pyb.Pin.low()`` will 48 | pull the pin low. If you need a pull-up resistor on the Pin just add:: 49 | 50 | p = pyb.Pin("P0", pyb.Pin.OUT_OD, pyb.Pin.PULL_UP) 51 | 52 | ... to the constructor. 53 | -------------------------------------------------------------------------------- /docs/_sources/openmvcam/tutorial/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. _tutorial-index: 2 | 3 | OpenMV Cam Tutorial 4 | =================== 5 | 6 | The OpenMV Cam tutorial covers how to use your OpenMV Cam and its accessories. 7 | 8 | .. toctree:: 9 | :maxdepth: 3 10 | :numbered: 11 | 12 | overview.rst 13 | software_setup.rst 14 | hardware_setup.rst 15 | openmvide_overview.rst 16 | 17 | script_structure.rst 18 | io_tutorial.rst 19 | system_architecture.rst 20 | 21 | production.rst 22 | 23 | more_information.rst 24 | -------------------------------------------------------------------------------- /docs/_sources/openmvcam/tutorial/io_tutorial.rst.txt: -------------------------------------------------------------------------------- 1 | I/O Tutorial 2 | ============ 3 | 4 | Before getting into machine vision topics we're going to talk about I/O pin 5 | control on your OpenMV Cam. It's important you know how to toggle I/O pins, 6 | transmit and receive serial data, and put your OpenMV Cam to sleep so that you 7 | can create a system that's able to "sense", "plan", and "act" in one package. 8 | 9 | First, let's take a look at your OpenMV Cam's pinout below: 10 | 11 | .. image:: ../pinout-openmv-n6-pag7936.png 12 | :alt: OpenMV N6 PAG7936 Pinout 13 | :width: 700px 14 | 15 | .. image:: ../pinout-openmv-ae3-pag7936.png 16 | :alt: OpenMV AE3 PAG7936 Pinout 17 | :width: 700px 18 | 19 | .. image:: ../pinout-openmv-cam-rt1062-ov5640.png 20 | :alt: OpenMV Cam RT1062 OV5640 Pinout 21 | :width: 700px 22 | 23 | .. image:: ../pinout-openmv-cam-h7-plus-ov5640.png 24 | :alt: OpenMV Cam H7 Plus OV5640 Pinout 25 | :width: 700px 26 | 27 | .. image:: ../pinout-openmv-cam-h7-ov7725.png 28 | :alt: OpenMV Cam H7 OV7725 Pinout 29 | :width: 700px 30 | 31 | .. image:: ../pinout-openmv-cam-m7-ov7725.png 32 | :alt: OpenMV Cam M7 OV7725 Pinout 33 | :width: 700px 34 | 35 | .. image:: ../pinout-openmv-cam-m4-ov7725.png 36 | :alt: OpenMV Cam M4 OV7725 Pinout 37 | :width: 700px 38 | 39 | .. image:: ../pinout-openmv-cam-m4-ov2640.png 40 | :alt: OpenMV Cam M4 OV2640 Pinout 41 | :width: 700px 42 | 43 | Depending on the model of your OpenMV Cam you have 9-10 general purpose I/O pins 44 | available which can be used for low-speed digital input and output. Note that we 45 | use STM32 processors which have 5V tolerant I/O pins so you can hookup your 46 | OpenMV Cam directly to an Arduino or other 5V device without worry. The I/O pins 47 | are quite beefy too and can source or sink up to 25 mA each. 48 | 49 | Anyway, different I/O pins have different special functions. P0-P3, for example, 50 | are your OpenMV Cam's SPI bus pins which you can use to control SPI devices. 51 | P4-P5 are your OpenMV Cam's Asynchronous Serial or I2C bus bins to talk serial 52 | or I2C. P6 is your OpenMV Cam's ADC/DAC pin for 0V to 3.3V input and output. And 53 | P7-P8 (or P7-P9) are your OpenMV Cam's Auxiliary I/O pins. 54 | 55 | The PYB Module 56 | -------------- 57 | 58 | All microcontroller I/O functionality is available from the `pyb` (Python 59 | Board) module. You just need to ``import pyb`` in your script to get access to 60 | it. Once imported you'll have access to the ADC, CAN, DAC, I2C, Pin, Servo, SPI, 61 | and UART classes along with being able to control the board's power consumption. 62 | 63 | .. toctree:: 64 | 65 | led_control.rst 66 | gpio_control.rst 67 | analog_io.rst 68 | uart_control.rst 69 | 70 | .. note:: 71 | 72 | The tutorial is not complete at right now. Please see the quick reference 73 | and library for more documentation. 74 | -------------------------------------------------------------------------------- /docs/_sources/openmvcam/tutorial/led_control.rst.txt: -------------------------------------------------------------------------------- 1 | LED Control 2 | =========== 3 | 4 | Your OpenMV Cam has an RGB LED and two IR LEDs on board. You can control the 5 | red, green, and blue segments of the RGB LED individually and the two IR LEDs 6 | as one unit. To control the LEDs first import the `pyb` module. Then create 7 | an LED class object for the particular LED you want to control:: 8 | 9 | import pyb 10 | 11 | red_led = pyb.LED(1) 12 | green_led = pyb.LED(2) 13 | blue_led = pyb.LED(3) 14 | ir_leds = pyb.LED(4) 15 | 16 | The `pyb.LED()` call creates an LED object which you can use to control a 17 | particular LED. Pass `pyb.LED()` "1" to control the red RGB LED segment, "2" to 18 | control the green RGB LED segment, "3" to control the blue RGB LED segment, and 19 | "4" to control the two IR LEDs. 20 | 21 | After creating the LED control objects like above I heavily recommend that you 22 | call the `pyb.LED.off()` method for a new LED to put it into a known state. 23 | 24 | Anyway, there are three methods you can call for each LED, `pyb.LED.off()`, 25 | `pyb.LED.on()`, and `pyb.LED.toggle()` which do exactly that. 26 | 27 | Unlike other MicroPython Boards the OpenMV Cam doesn't support the 28 | ``intensity()`` method to allow for PWM dimming of the LEDs. We re-purposed the 29 | timer that was used for LED dimming for generating a clock source to power the 30 | camera chip. 31 | 32 | Finally, use the RGB LED for indicator purposes in your script. As the IR LEDs, 33 | those are for night vision. When you switch out your OpenMV Cam's regular lens 34 | for our IR lens (which is a lens without an IR filter) you can then turn on the 35 | IR LEDs so that your OpenMV Cam can see in the dark. The IR LEDs are strong 36 | enough to illuminate about 3 meters in front of your OpenMV Cam in pitch black. 37 | -------------------------------------------------------------------------------- /docs/_sources/openmvcam/tutorial/more_information.rst.txt: -------------------------------------------------------------------------------- 1 | More Information 2 | ================ 3 | 4 | That's all the information we have online in our tutorial for the OpenMV Cam 5 | for now. Please signup on our `email list `_ or 6 | follow us on `twitter `_ to receive update 7 | notifications. 8 | 9 | If you need help please search through our `forums `_ 10 | and if you can't find the answer you need then create an account and ask us. 11 | You should get a response to your question in just a few minutes to hours. 12 | -------------------------------------------------------------------------------- /docs/_sources/openmvcam/tutorial/overview.rst.txt: -------------------------------------------------------------------------------- 1 | Overview 2 | ======== 3 | 4 | .. image:: ../camera.jpg 5 | :alt: OpenMV Cam 6 | :width: 700px 7 | 8 | Hi, thanks for reading this tutorial and being interested in the OpenMV Cam! Before 9 | getting into the tuturial I'd like to quickly go over why the OpenMV Cam exists 10 | and what it's designed to be used for. 11 | 12 | Currently, doing anything serious involving computer vision requires a computer 13 | running an operating system running may layers of software and requiring much 14 | setup before you can get computer vision code working. This is all well and fine 15 | if you need to do many other things than just processing images, like connecting 16 | to the internet, running many different applications concurrently, etc. 17 | 18 | But, what if, I just want to make an LED turn on if a red object appears in front 19 | of a white wall. Why do a need to build up a complex system for that? Or, what 20 | if I just want to turn on an LED when a face is in view? 21 | 22 | For example, if I wanted to turn an LED on for a short duration when a line sensor was 23 | broken I'd use an Arduino to accomplish this. I'd write about 10 lines of 24 | code and be done with it. And... after flashing the Arduino that code would run 25 | happily forever. 26 | 27 | But, if I want to use a 2D sensor like a camera everything changes. 28 | Since a camera sensor generates tons of data a faster more resourceful computer is 29 | required to process the sensor data. Now, with this faster more powerful computer 30 | you can definately do many more things. But, what if my goal were still to just 31 | turn on an LED? Spin a motor? Or open a valve? Could I still get the Arduino 32 | like experience with a camera sensor? 33 | 34 | Yes! This is the point behind the OpenMV Cam. A little programmable computer to 35 | do simple computer vision things! 36 | 37 | Our goal with the OpenMV Cam is to make a flexible system for solving very 38 | straight forward computer vision problems. To achieve this goal we built the 39 | OpenMV Cam on-top of MicroPython running on a microcontroller. This approach 40 | allows you to write Python scripts to execute on the OpenMV which compile and 41 | load extremely fast while maintaining microcontroller benefits like low power 42 | consumption and instant on processing for embedded applications. 43 | 44 | Now, the OpenMV Cam isn't the answer to all computer vision problems, or even most. 45 | You should use a single-board-computer running linux and OpenCV when required. But, 46 | if you just need to do some simple thing with a camera the OpenMV Cam might 47 | be the right tool for the job. 48 | 49 | For more information about this see our `FAQ `_. 50 | -------------------------------------------------------------------------------- /docs/_sources/openmvcam/tutorial/script_structure.rst.txt: -------------------------------------------------------------------------------- 1 | Script Structure 2 | ================ 3 | 4 | Let's learn how to program your OpenMV Cam now! Note that this tuturial assumes 5 | you know how the python language works. If you don't know how python works 6 | please study up on it. There are plenty of web tuturials about how to write 7 | python code (finally, if you know any other C like programming language you can 8 | pick up python easily since it's VERY similar). 9 | 10 | Anyway, any script you write is going to have three distinct parts:: 11 | 12 | import ... 13 | 14 | ... 15 | 16 | one time setup ... 17 | 18 | ... 19 | 20 | while(True): # Loop 21 | ... 22 | 23 | The first part of your OpenMV Cam code should include some header comments, 24 | import statements to bring modules into scope, and finally constants and global 25 | variables in your code. 26 | 27 | Next, you're going to want to do one-time setup code. This includes things like 28 | creating I/O pin objects, setting up the camera, defining helper functions, 29 | etc. 30 | 31 | Finally, you'll create a ``while(True):`` loop under which you'll put all code 32 | that gets called in a loop repeatedly until power-off. 33 | 34 | Here's an example of this:: 35 | 36 | ### Header comments, import statements, etc. 37 | 38 | # Hello World Example 39 | # 40 | # Welcome to the OpenMV IDE! Click on the green run arrow button below to run the script! 41 | 42 | import sensor, image, time 43 | 44 | ### One time setup 45 | 46 | sensor.reset() # Reset and initialize the sensor. 47 | sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) 48 | sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) 49 | sensor.skip_frames(time = 2000) # Wait for settings take effect. 50 | clock = time.clock() # Create a clock object to track the FPS. 51 | 52 | ### Infinite loop 53 | 54 | while(True): 55 | clock.tick() # Update the FPS clock. 56 | img = sensor.snapshot() # Take a picture and return the image. 57 | print(clock.fps()) # Note: OpenMV Cam runs about half as fast when connected 58 | # to the IDE. The FPS should increase once disconnected. 59 | 60 | Note that if you do not have an infinite while loop in your code then once your 61 | OpenMV Cam finishes running the script it will sit there and do nothing. 62 | -------------------------------------------------------------------------------- /docs/_sources/openmvcam/tutorial/uart_control.rst.txt: -------------------------------------------------------------------------------- 1 | UART Control 2 | ============ 3 | 4 | The OpenMV Cam has a main UART on pins P4 (TX) and P5 (RX) which you can use 5 | for serial communication. To create a UART object do the following:: 6 | 7 | import pyb 8 | 9 | uart = pyb.UART(3, 115200, timeout_char = 1000) 10 | 11 | First, let's breakdown what we did. The first argument is the UART bus. This 12 | is the index of the UART bus on the OpenMV Cam. You have to call the UART 13 | constructor with this value because we're leveraging the `pyb` module from 14 | MicroPython's pyboard. The second value is the baudrate which can be any 15 | standard baudrate value you like. Finally, the third argument tells the driver 16 | to wait up to 1 second between sending chars if the UART is busy. The default 17 | value for ``timeout_char`` of 0 causes the driver to abadon sending characters 18 | if your code ever has to block waiting for space in the UART buffer which is 19 | something you don't want (generally). 20 | 21 | Anyway, once you've got a UART object then sending data is easy. Just do:: 22 | 23 | uart.write("Hello World\n") 24 | 25 | And that's it. 26 | 27 | But, if you'd like to send binary data instead, use the ``struct`` module. The 28 | ``struct`` module will let you serialize data easily. Here's an example:: 29 | 30 | import ustruct 31 | 32 | uart.write(ustruct.pack("`_ for 38 | more information. 39 | 40 | Now, if you'd like to receive data just use the `pyb.UART.any()` method along with 41 | the `pyb.UART.read()` method. Note that you'll need to code up some sort of state 42 | machine to receive data reliability. For example, see the 43 | ``Examples->Pixy Emulation->pixy_uart_emulation.py`` example. 44 | -------------------------------------------------------------------------------- /docs/_sources/pyboard/hardware/index.rst.txt: -------------------------------------------------------------------------------- 1 | The pyboard hardware 2 | -------------------- 3 | 4 | For the pyboard: 5 | 6 | * v1.1 7 | * `PYBv1.1 schematics and layout `_ (2.9MiB PDF) 8 | * v1.0 9 | * `PYBv1.0 schematics and layout `_ (2.4MiB PDF) 10 | * `PYBv1.0 metric dimensions `_ (360KiB PDF) 11 | * `PYBv1.0 imperial dimensions `_ (360KiB PDF) 12 | 13 | For the official skin modules: 14 | 15 | * `LCD32MKv1.0 schematics `_ (194KiB PDF) 16 | * `AMPv1.0 schematics `_ (209KiB PDF) 17 | * LCD160CRv1.0: see :mod:`lcd160cr` 18 | 19 | Datasheets for the components on the pyboard 20 | -------------------------------------------- 21 | 22 | * The microcontroller: `STM32F405RGT6 `_ (link to manufacturer's site) 23 | * The accelerometer: `Freescale MMA7660 `_ (800kiB PDF) 24 | * The LDO voltage regulator: `Microchip MCP1802 `_ (400kiB PDF) 25 | 26 | Datasheets for other components 27 | ------------------------------- 28 | 29 | * The LCD display on the LCD touch-sensor skin: `Newhaven Display NHD-C12832A1Z-FSW-FBW-3V3 `_ (460KiB PDF) 30 | * The touch sensor chip on the LCD touch-sensor skin: `Freescale MPR121 `_ (280KiB PDF) 31 | * The digital potentiometer on the audio skin: `Microchip MCP4541 `_ (2.7MiB PDF) 32 | -------------------------------------------------------------------------------- /docs/_sources/pyboard/tutorial/debounce.rst.txt: -------------------------------------------------------------------------------- 1 | Debouncing a pin input 2 | ====================== 3 | 4 | A pin used as input from a switch or other mechanical device can have a lot 5 | of noise on it, rapidly changing from low to high when the switch is first 6 | pressed or released. This noise can be eliminated using a capacitor (a 7 | debouncing circuit). It can also be eliminated using a simple function that 8 | makes sure the value on the pin is stable. 9 | 10 | The following function does just this. It gets the current value of the given 11 | pin, and then waits for the value to change. The new pin value must be stable 12 | for a continuous 20ms for it to register the change. You can adjust this time 13 | (to say 50ms) if you still have noise. :: 14 | 15 | import pyb 16 | 17 | def wait_pin_change(pin): 18 | # wait for pin to change value 19 | # it needs to be stable for a continuous 20ms 20 | cur_value = pin.value() 21 | active = 0 22 | while active < 20: 23 | if pin.value() != cur_value: 24 | active += 1 25 | else: 26 | active = 0 27 | pyb.delay(1) 28 | 29 | 30 | Use it something like this:: 31 | 32 | import pyb 33 | 34 | pin_x1 = pyb.Pin('X1', pyb.Pin.IN, pyb.Pin.PULL_DOWN) 35 | while True: 36 | wait_pin_change(pin_x1) 37 | pyb.LED(4).toggle() 38 | -------------------------------------------------------------------------------- /docs/_sources/pyboard/tutorial/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. _pyboard_tutorial: 2 | 3 | MicroPython tutorial for the pyboard 4 | ==================================== 5 | 6 | This tutorial is intended to get you started with your pyboard. 7 | All you need is a pyboard and a micro-USB cable to connect it to 8 | your PC. If it is your first time, it is recommended to follow 9 | the tutorial through in the order below. 10 | 11 | .. toctree:: 12 | :maxdepth: 1 13 | :numbered: 14 | 15 | intro.rst 16 | script.rst 17 | repl.rst 18 | leds.rst 19 | switch.rst 20 | accel.rst 21 | reset.rst 22 | usb_mouse.rst 23 | timer.rst 24 | assembler.rst 25 | power_ctrl.rst 26 | 27 | Tutorials requiring extra components 28 | ------------------------------------ 29 | 30 | .. toctree:: 31 | :maxdepth: 1 32 | :numbered: 33 | 34 | servo.rst 35 | fading_led.rst 36 | lcd_skin.rst 37 | amp_skin.rst 38 | lcd160cr_skin.rst 39 | 40 | Tips, tricks and useful things to know 41 | -------------------------------------- 42 | 43 | .. toctree:: 44 | :maxdepth: 1 45 | :numbered: 46 | 47 | debounce.rst 48 | pass_through.rst 49 | -------------------------------------------------------------------------------- /docs/_sources/pyboard/tutorial/intro.rst.txt: -------------------------------------------------------------------------------- 1 | Introduction to the pyboard 2 | =========================== 3 | 4 | To get the most out of your pyboard, there are a few basic things to 5 | understand about how it works. 6 | 7 | Caring for your pyboard 8 | ----------------------- 9 | 10 | Because the pyboard does not have a housing it needs a bit of care: 11 | 12 | - Be gentle when plugging/unplugging the USB cable. Whilst the USB connector 13 | is soldered through the board and is relatively strong, if it breaks off 14 | it can be very difficult to fix. 15 | 16 | - Static electricity can shock the components on the pyboard and destroy them. 17 | If you experience a lot of static electricity in your area (eg dry and cold 18 | climates), take extra care not to shock the pyboard. If your pyboard came 19 | in a black plastic box, then this box is the best way to store and carry the 20 | pyboard as it is an anti-static box (it is made of a conductive plastic, with 21 | conductive foam inside). 22 | 23 | As long as you take care of the hardware, you should be okay. It's almost 24 | impossible to break the software on the pyboard, so feel free to play around 25 | with writing code as much as you like. If the filesystem gets corrupt, see 26 | below on how to reset it. In the worst case you might need to reflash the 27 | MicroPython software, but that can be done over USB. 28 | 29 | Layout of the pyboard 30 | --------------------- 31 | 32 | The micro USB connector is on the top right, the micro SD card slot on 33 | the top left of the board. There are 4 LEDs between the SD slot and 34 | USB connector. The colours are: red on the bottom, then green, orange, 35 | and blue on the top. There are 2 switches: the right one is the reset 36 | switch, the left is the user switch. 37 | 38 | Plugging in and powering on 39 | --------------------------- 40 | 41 | The pyboard can be powered via USB. Connect it to your PC via a micro USB 42 | cable. There is only one way that the cable will fit. Once connected, 43 | the green LED on the board should flash quickly. 44 | 45 | Powering by an external power source 46 | ------------------------------------ 47 | 48 | The pyboard can be powered by a battery or other external power source. 49 | 50 | **Be sure to connect the positive lead of the power supply to VIN, and 51 | ground to GND. There is no polarity protection on the pyboard so you 52 | must be careful when connecting anything to VIN.** 53 | 54 | **The input voltage must be between 3.6V and 10V.** 55 | -------------------------------------------------------------------------------- /docs/_sources/pyboard/tutorial/pass_through.rst.txt: -------------------------------------------------------------------------------- 1 | Making a UART - USB pass through 2 | ================================ 3 | 4 | It's as simple as:: 5 | 6 | import pyb 7 | import select 8 | 9 | def pass_through(usb, uart): 10 | usb.setinterrupt(-1) 11 | while True: 12 | select.select([usb, uart], [], []) 13 | if usb.any(): 14 | uart.write(usb.read(256)) 15 | if uart.any(): 16 | usb.write(uart.read(256)) 17 | 18 | pass_through(pyb.USB_VCP(), pyb.UART(1, 9600, timeout=0)) 19 | -------------------------------------------------------------------------------- /docs/_sources/pyboard/tutorial/power_ctrl.rst.txt: -------------------------------------------------------------------------------- 1 | Power control 2 | ============= 3 | 4 | :meth:`pyb.wfi` is used to reduce power consumption while waiting for an 5 | event such as an interrupt. You would use it in the following situation:: 6 | 7 | while True: 8 | do_some_processing() 9 | pyb.wfi() 10 | 11 | Control the frequency using :meth:`pyb.freq`:: 12 | 13 | pyb.freq(30000000) # set CPU frequency to 30MHz 14 | -------------------------------------------------------------------------------- /docs/_sources/pyboard/tutorial/reset.rst.txt: -------------------------------------------------------------------------------- 1 | Safe mode and factory reset 2 | =========================== 3 | 4 | If something goes wrong with your pyboard, don't panic! It is almost 5 | impossible for you to break the pyboard by programming the wrong thing. 6 | 7 | The first thing to try is to enter safe mode: this temporarily skips 8 | execution of ``boot.py`` and ``main.py`` and gives default USB settings. 9 | 10 | If you have problems with the filesystem you can do a factory reset, 11 | which restores the filesystem to its original state. 12 | 13 | Safe mode 14 | --------- 15 | 16 | To enter safe mode, do the following steps: 17 | 18 | 1. Connect the pyboard to USB so it powers up. 19 | 2. Hold down the USR switch. 20 | 3. While still holding down USR, press and release the RST switch. 21 | 4. The LEDs will then cycle green to orange to green+orange and back again. 22 | 5. Keep holding down USR until *only the orange LED is lit*, and then let 23 | go of the USR switch. 24 | 6. The orange LED should flash quickly 4 times, and then turn off. 25 | 7. You are now in safe mode. 26 | 27 | In safe mode, the ``boot.py`` and ``main.py`` files are not executed, and so 28 | the pyboard boots up with default settings. This means you now have access 29 | to the filesystem (the USB drive should appear), and you can edit ``boot.py`` 30 | and ``main.py`` to fix any problems. 31 | 32 | Entering safe mode is temporary, and does not make any changes to the 33 | files on the pyboard. 34 | 35 | Factory reset the filesystem 36 | ---------------------------- 37 | 38 | If you pyboard's filesystem gets corrupted (for example, you forgot to 39 | eject/unmount it), or you have some code in ``boot.py`` or ``main.py`` which 40 | you can't escape from, then you can reset the filesystem. 41 | 42 | Resetting the filesystem deletes all files on the internal pyboard storage 43 | (not the SD card), and restores the files ``boot.py``, ``main.py``, ``README.txt`` 44 | and ``pybcdc.inf`` back to their original state. 45 | 46 | To do a factory reset of the filesystem you follow a similar procedure as 47 | you did to enter safe mode, but release USR on green+orange: 48 | 49 | 1. Connect the pyboard to USB so it powers up. 50 | 2. Hold down the USR switch. 51 | 3. While still holding down USR, press and release the RST switch. 52 | 4. The LEDs will then cycle green to orange to green+orange and back again. 53 | 5. Keep holding down USR until *both the green and orange LEDs are lit*, and 54 | then let go of the USR switch. 55 | 6. The green and orange LEDs should flash quickly 4 times. 56 | 7. The red LED will turn on (so red, green and orange are now on). 57 | 8. The pyboard is now resetting the filesystem (this takes a few seconds). 58 | 9. The LEDs all turn off. 59 | 10. You now have a reset filesystem, and are in safe mode. 60 | 11. Press and release the RST switch to boot normally. 61 | -------------------------------------------------------------------------------- /docs/_sources/reference/asm_thumb2_arith.rst.txt: -------------------------------------------------------------------------------- 1 | Arithmetic instructions 2 | ======================= 3 | 4 | Document conventions 5 | -------------------- 6 | 7 | Notation: ``Rd, Rm, Rn`` denote ARM registers R0-R7. ``immN`` denotes an immediate 8 | value having a width of N bits e.g. ``imm8``, ``imm3``. ``carry`` denotes 9 | the carry condition flag, ``not(carry)`` denotes its complement. In the case of instructions 10 | with more than one register argument, it is permissible for some to be identical. For example 11 | the following will add the contents of R0 to itself, placing the result in R0: 12 | 13 | * add(r0, r0, r0) 14 | 15 | Arithmetic instructions affect the condition flags except where stated. 16 | 17 | Addition 18 | -------- 19 | 20 | * add(Rdn, imm8) ``Rdn = Rdn + imm8`` 21 | * add(Rd, Rn, imm3) ``Rd = Rn + imm3`` 22 | * add(Rd, Rn, Rm) ``Rd = Rn +Rm`` 23 | * adc(Rd, Rn) ``Rd = Rd + Rn + carry`` 24 | 25 | Subtraction 26 | ----------- 27 | 28 | * sub(Rdn, imm8) ``Rdn = Rdn - imm8`` 29 | * sub(Rd, Rn, imm3) ``Rd = Rn - imm3`` 30 | * sub(Rd, Rn, Rm) ``Rd = Rn - Rm`` 31 | * sbc(Rd, Rn) ``Rd = Rd - Rn - not(carry)`` 32 | 33 | Negation 34 | -------- 35 | 36 | * neg(Rd, Rn) ``Rd = -Rn`` 37 | 38 | Multiplication and division 39 | --------------------------- 40 | 41 | * mul(Rd, Rn) ``Rd = Rd * Rn`` 42 | 43 | This produces a 32 bit result with overflow lost. The result may be treated as 44 | signed or unsigned according to the definition of the operands. 45 | 46 | * sdiv(Rd, Rn, Rm) ``Rd = Rn / Rm`` 47 | * udiv(Rd, Rn, Rm) ``Rd = Rn / Rm`` 48 | 49 | These functions perform signed and unsigned division respectively. Condition flags 50 | are not affected. 51 | -------------------------------------------------------------------------------- /docs/_sources/reference/asm_thumb2_directives.rst.txt: -------------------------------------------------------------------------------- 1 | Assembler directives 2 | ==================== 3 | 4 | Labels 5 | ------ 6 | 7 | * label(INNER1) 8 | 9 | This defines a label for use in a branch instruction. Thus elsewhere in the code a ``b(INNER1)`` 10 | will cause execution to continue with the instruction after the label directive. 11 | 12 | Defining inline data 13 | -------------------- 14 | 15 | The following assembler directives facilitate embedding data in an assembler code block. 16 | 17 | * data(size, d0, d1 .. dn) 18 | 19 | The data directive creates n array of data values in memory. The first argument specifies the 20 | size in bytes of the subsequent arguments. Hence the first statement below will cause the 21 | assembler to put three bytes (with values 2, 3 and 4) into consecutive memory locations 22 | while the second will cause it to emit two four byte words. 23 | 24 | :: 25 | 26 | data(1, 2, 3, 4) 27 | data(4, 2, 100000) 28 | 29 | Data values longer than a single byte are stored in memory in little-endian format. 30 | 31 | * align(nBytes) 32 | 33 | Align the following instruction to an nBytes value. ARM Thumb-2 instructions must be two 34 | byte aligned, hence it's advisable to issue ``align(2)`` after ``data`` directives and 35 | prior to any subsequent code. This ensures that the code will run irrespective of the 36 | size of the data array. 37 | -------------------------------------------------------------------------------- /docs/_sources/reference/asm_thumb2_ldr.rst.txt: -------------------------------------------------------------------------------- 1 | Load register from memory 2 | ========================= 3 | 4 | Document conventions 5 | -------------------- 6 | 7 | Notation: ``Rt, Rn`` denote ARM registers R0-R7 except where stated. ``immN`` represents an immediate 8 | value having a width of N bits hence ``imm5`` is constrained to the range 0-31. ``[Rn + immN]`` is the contents 9 | of the memory address obtained by adding Rn and the offset ``immN``. Offsets are measured in 10 | bytes. These instructions affect the condition flags. 11 | 12 | Register Load 13 | ------------- 14 | 15 | * ldr(Rt, [Rn, imm7]) ``Rt = [Rn + imm7]`` Load a 32 bit word 16 | * ldrb(Rt, [Rn, imm5]) ``Rt = [Rn + imm5]`` Load a byte 17 | * ldrh(Rt, [Rn, imm6]) ``Rt = [Rn + imm6]`` Load a 16 bit half word 18 | 19 | Where a byte or half word is loaded, it is zero-extended to 32 bits. 20 | 21 | The specified immediate offsets are measured in bytes. Hence in the case of ``ldr`` the 7 bit value 22 | enables 32 bit word aligned values to be accessed with a maximum offset of 31 words. In the case of ``ldrh`` the 23 | 6 bit value enables 16 bit half-word aligned values to be accessed with a maximum offset of 31 half-words. 24 | -------------------------------------------------------------------------------- /docs/_sources/reference/asm_thumb2_logical_bit.rst.txt: -------------------------------------------------------------------------------- 1 | Logical & bitwise instructions 2 | ============================== 3 | 4 | Document conventions 5 | -------------------- 6 | 7 | Notation: ``Rd, Rn`` denote ARM registers R0-R7 except in the case of the 8 | special instructions where R0-R15 may be used. ``Rn`` denotes an ARM register 9 | whose contents must lie in range ``a <= contents <= b``. In the case of instructions 10 | with two register arguments, it is permissible for them to be identical. For example 11 | the following will zero R0 (Python ``R0 ^= R0``) regardless of its initial contents. 12 | 13 | * eor(r0, r0) 14 | 15 | These instructions affect the condition flags except where stated. 16 | 17 | Logical instructions 18 | -------------------- 19 | 20 | * and\_(Rd, Rn) ``Rd &= Rn`` 21 | * orr(Rd, Rn) ``Rd |= Rn`` 22 | * eor(Rd, Rn) ``Rd ^= Rn`` 23 | * mvn(Rd, Rn) ``Rd = Rn ^ 0xffffffff`` i.e. Rd = 1's complement of Rn 24 | * bic(Rd, Rn) ``Rd &= ~Rn`` bit clear Rd using mask in Rn 25 | 26 | Note the use of "and\_" instead of "and", because "and" is a reserved keyword in Python. 27 | 28 | Shift and rotation instructions 29 | ------------------------------- 30 | 31 | * lsl(Rd, Rn<0-31>) ``Rd <<= Rn`` 32 | * lsr(Rd, Rn<1-32>) ``Rd = (Rd & 0xffffffff) >> Rn`` Logical shift right 33 | * asr(Rd, Rn<1-32>) ``Rd >>= Rn`` arithmetic shift right 34 | * ror(Rd, Rn<1-31>) ``Rd = rotate_right(Rd, Rn)`` Rd is rotated right Rn bits. 35 | 36 | A rotation by (for example) three bits works as follows. If Rd initially 37 | contains bits ``b31 b30..b0`` after rotation it will contain ``b2 b1 b0 b31 b30..b3`` 38 | 39 | Special instructions 40 | -------------------- 41 | 42 | Condition codes are unaffected by these instructions. 43 | 44 | * clz(Rd, Rn) ``Rd = count_leading_zeros(Rn)`` 45 | 46 | count_leading_zeros(Rn) returns the number of binary zero bits before the first binary one bit in Rn. 47 | 48 | * rbit(Rd, Rn) ``Rd = bit_reverse(Rn)`` 49 | 50 | bit_reverse(Rn) returns the bit-reversed contents of Rn. If Rn contains bits ``b31 b30..b0`` Rd will be set 51 | to ``b0 b1 b2..b31`` 52 | 53 | Trailing zeros may be counted by performing a bit reverse prior to executing clz. 54 | -------------------------------------------------------------------------------- /docs/_sources/reference/asm_thumb2_misc.rst.txt: -------------------------------------------------------------------------------- 1 | Miscellaneous instructions 2 | ========================== 3 | 4 | * nop() ``pass`` no operation. 5 | * wfi() Suspend execution in a low power state until an interrupt occurs. 6 | * cpsid(flags) set the Priority Mask Register - disable interrupts. 7 | * cpsie(flags) clear the Priority Mask Register - enable interrupts. 8 | * mrs(Rd, special_reg) ``Rd = special_reg`` copy a special register to a general register. The special register 9 | may be IPSR (Interrupt Status Register) or BASEPRI (Base Priority Register). The IPSR provides a means of determining 10 | the exception number of an interrupt being processed. It contains zero if no interrupt is being processed. 11 | 12 | Currently the ``cpsie()`` and ``cpsid()`` functions are partially implemented. 13 | They require but ignore the flags argument and serve as a means of enabling and disabling interrupts. 14 | -------------------------------------------------------------------------------- /docs/_sources/reference/asm_thumb2_mov.rst.txt: -------------------------------------------------------------------------------- 1 | Register move instructions 2 | ========================== 3 | 4 | Document conventions 5 | -------------------- 6 | 7 | Notation: ``Rd, Rn`` denote ARM registers R0-R15. ``immN`` denotes an immediate 8 | value having a width of N bits. These instructions affect the condition flags. 9 | 10 | Register moves 11 | -------------- 12 | 13 | Where immediate values are used, these are zero-extended to 32 bits. Thus 14 | ``mov(R0, 0xff)`` will set R0 to 255. 15 | 16 | * mov(Rd, imm8) ``Rd = imm8`` 17 | * mov(Rd, Rn) ``Rd = Rn`` 18 | * movw(Rd, imm16) ``Rd = imm16`` 19 | * movt(Rd, imm16) ``Rd = (Rd & 0xffff) | (imm16 << 16)`` 20 | 21 | movt writes an immediate value to the top halfword of the destination register. 22 | It does not affect the contents of the bottom halfword. 23 | 24 | * movwt(Rd, imm32) ``Rd = imm32`` 25 | 26 | movwt is a pseudo-instruction: the MicroPython assembler emits a ``movw`` followed 27 | by a ``movt`` to move a 32-bit value into Rd. 28 | -------------------------------------------------------------------------------- /docs/_sources/reference/asm_thumb2_stack.rst.txt: -------------------------------------------------------------------------------- 1 | Stack push and pop 2 | ================== 3 | 4 | Document conventions 5 | -------------------- 6 | 7 | The ``push()`` and ``pop()`` instructions accept as their argument a register set containing 8 | a subset, or possibly all, of the general-purpose registers R0-R12 and the link register (lr or R14). 9 | As with any Python set the order in which the registers are specified is immaterial. Thus the 10 | in the following example the pop() instruction would restore R1, R7 and R8 to their contents prior 11 | to the push(): 12 | 13 | * push({r1, r8, r7}) Save three registers on the stack. 14 | * pop({r7, r1, r8}) Restore them 15 | 16 | Stack operations 17 | ---------------- 18 | 19 | * push({regset}) Push a set of registers onto the stack 20 | * pop({regset}) Restore a set of registers from the stack 21 | -------------------------------------------------------------------------------- /docs/_sources/reference/asm_thumb2_str.rst.txt: -------------------------------------------------------------------------------- 1 | Store register to memory 2 | ======================== 3 | 4 | Document conventions 5 | -------------------- 6 | 7 | Notation: ``Rt, Rn`` denote ARM registers R0-R7 except where stated. ``immN`` represents an immediate 8 | value having a width of N bits hence ``imm5`` is constrained to the range 0-31. ``[Rn + imm5]`` is the 9 | contents of the memory address obtained by adding Rn and the offset ``imm5``. Offsets are measured in 10 | bytes. These instructions do not affect the condition flags. 11 | 12 | Register Store 13 | -------------- 14 | 15 | * str(Rt, [Rn, imm7]) ``[Rn + imm7] = Rt`` Store a 32 bit word 16 | * strb(Rt, [Rn, imm5]) ``[Rn + imm5] = Rt`` Store a byte (b0-b7) 17 | * strh(Rt, [Rn, imm6]) ``[Rn + imm6] = Rt`` Store a 16 bit half word (b0-b15) 18 | 19 | The specified immediate offsets are measured in bytes. Hence in the case of ``str`` the 7 bit value 20 | enables 32 bit word aligned values to be accessed with a maximum offset of 31 words. In the case of ``strh`` the 21 | 6 bit value enables 16 bit half-word aligned values to be accessed with a maximum offset of 31 half-words. 22 | -------------------------------------------------------------------------------- /docs/_sources/reference/index.rst.txt: -------------------------------------------------------------------------------- 1 | MicroPython language and implementation 2 | ======================================= 3 | 4 | MicroPython aims to implement the Python 3.4 standard (with selected 5 | features from later versions) with respect to language syntax, and most 6 | of the features of MicroPython are identical to those described by the 7 | "Language Reference" documentation at 8 | `docs.python.org `_. 9 | 10 | The MicroPython standard library is described in the 11 | :ref:`corresponding chapter `. The :ref:`cpython_diffs` 12 | chapter describes differences between MicroPython and CPython (which 13 | mostly concern standard library and types, but also some language-level 14 | features). 15 | 16 | This chapter describes features and peculiarities of MicroPython 17 | implementation and the best practices to use them. 18 | 19 | .. toctree:: 20 | :maxdepth: 1 21 | 22 | glossary.rst 23 | repl.rst 24 | reset_boot.rst 25 | mpremote.rst 26 | mpyfiles.rst 27 | isr_rules.rst 28 | speed_python.rst 29 | constrained.rst 30 | manifest.rst 31 | packages.rst 32 | asm_thumb2_index.rst 33 | filesystem.rst 34 | pyboard.py.rst 35 | micropython2_migration.rst 36 | -------------------------------------------------------------------------------- /docs/_sources/reference/micropython2_migration.rst.txt: -------------------------------------------------------------------------------- 1 | .. _micropython2_migration: 2 | 3 | MicroPython 2.0 Migration Guide 4 | =============================== 5 | 6 | MicroPython 2.0 is the (currently in development, not yet available) next major 7 | release of MicroPython. 8 | 9 | After maintaining API compatibility for almost a decade with the ``1.x`` series, in 10 | order to unblock some project-wide improvements MicroPython 2.0 will introduce a 11 | small number of breaking API changes that will require some programs to be 12 | updated. This guide explains how to update your Python code to accommodate these 13 | changes. 14 | 15 | This document is a work-in-progress. As more work is done on MicroPython 2.0, 16 | more items will be added to the lists below. 17 | 18 | **Note:** There are currently no MicroPython 2.0 firmware builds available for 19 | download. You can build it yourself by enabling the ``MICROPY_PREVIEW_VERSION_2`` 20 | config option. As it gets closer to being ready for release, builds will be 21 | provided for both ``1.x.y`` and ``2.0.0-preview``. 22 | 23 | Hardware and peripherals 24 | ------------------------ 25 | 26 | Overview 27 | ~~~~~~~~ 28 | 29 | The goal is to improve consistency in the :mod:`machine` APIs across different 30 | ports, making it easier to write code, documentation, and tutorials that work on 31 | any supported microcontroller. 32 | 33 | This means that some ports' APIs need to change to match other ports. 34 | 35 | Changes 36 | ~~~~~~~ 37 | 38 | *None yet* 39 | 40 | OS & filesystem 41 | --------------- 42 | 43 | Overview 44 | ~~~~~~~~ 45 | 46 | The primary goal is to support the ability to execute :term:`.mpy files <.mpy 47 | file>` directly from the filesystem without first copying them into RAM. This 48 | improves code deployment time and reduces memory overhead and fragmentation. 49 | 50 | Additionally, a further goal is to support a more flexible way of configuring 51 | partitions, filesystem types, and options like USB mass storage. 52 | 53 | Changes 54 | ~~~~~~~ 55 | 56 | *None yet* 57 | 58 | CPython compatibility 59 | --------------------- 60 | 61 | Overview 62 | ~~~~~~~~ 63 | 64 | The goal is to improve compatibility with CPython by removing MicroPython 65 | extensions from CPython APIs. In most cases this means moving existing 66 | MicroPython-specific functions or classes to new modules. 67 | 68 | This makes it easier to write code that works on both CPython and MicroPython, 69 | which is useful for development and testing. 70 | 71 | Changes 72 | ~~~~~~~ 73 | 74 | Introduction of a new module :mod:`vfs`. The following functions and 75 | classes have moved out of :mod:`os` to :mod:`vfs`: 76 | - `os.mount` 77 | - `os.umount` 78 | - `os.VfsFat` 79 | - `os.VfsLfs1` 80 | - `os.VfsLfs2` 81 | - `os.VfsPosix` 82 | -------------------------------------------------------------------------------- /docs/_sources/renesas-ra/general.rst.txt: -------------------------------------------------------------------------------- 1 | .. _renesas-ra_general: 2 | 3 | General information about Renesas RA port 4 | ========================================= 5 | 6 | Overview 7 | -------- 8 | 9 | The renesas-ra port supports boards powered by Renesas Electronics's 10 | the flexible Renesas Advanced (RA) 32-bit microcontrollers (MCUs) family, 11 | industry-leading 32-bit MCUs with the Arm® Cortex®-M33, -M23 and -M4 12 | processor cores and PSA certification. 13 | 14 | The ported hardware functionalities are Pin, SPI, I2C, UART and RTC at this present. 15 | Other hardware functionalities such as Timer, PWM, USB, CAN and WDT are not implemented yet. 16 | 17 | The following boards are officially supported. 18 | 19 | * RA4M1-CLICKER 20 | 21 | For the manual and other references for the board and RA Family MCU, please refer to the web page: `RA4M1 CLICKER `_ 22 | 23 | * EK-RA6M2 24 | 25 | For the manual and other references for the board and RA Family MCU, please refer to the web page: `EK-RA6M2 `_ 26 | 27 | The following boards are unofficially supported. 28 | 29 | * EK-RA4M1 30 | 31 | For the manual and other references for the board and RA Family MCU, please refer to the web page: `EK-RA4M1 `_ 32 | 33 | * EK-RA4W1 34 | 35 | For the manual and other references for the board and RA Family MCU, please refer to the web page: `EK-RA4W1 `_ 36 | 37 | * EK-RA6M1 38 | 39 | For the manual and other references for the board and RA Family MCU, please refer to the web page: `EK-RA6M1 `_ 40 | 41 | For more information, please visit the web page: ``_ 42 | 43 | -------------------------------------------------------------------------------- /docs/_sources/renesas-ra/tutorial/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. _renesas-ra_tutorial: 2 | 3 | MicroPython tutorial for Renesas RA port 4 | ======================================== 5 | 6 | This tutorial is intended to get you started using MicroPython on the Renesas RA port. 7 | 8 | .. toctree:: 9 | :maxdepth: 1 10 | :numbered: 11 | 12 | intro.rst 13 | using_peripheral.rst 14 | program_in_flash.rst 15 | reset.rst 16 | troubleshooting.rst 17 | -------------------------------------------------------------------------------- /docs/_sources/renesas-ra/tutorial/intro.rst.txt: -------------------------------------------------------------------------------- 1 | .. _renesas-ra_intro: 2 | 3 | Getting started with MicroPython on the Renesas RA 4 | ================================================== 5 | 6 | This tutorial will guide you through setting up MicroPython, 7 | getting a prompt, using the hardware peripherals, using internal 8 | flash file system, reset and boot modes, and Factory reset the 9 | internal file system. 10 | 11 | Requirements 12 | ------------ 13 | 14 | You need a board. For the information of available boards, 15 | please refer to the general information about Renesas RA port: :ref:`renesas-ra_general`. 16 | 17 | You need a USB-Serial conversion cable to connect the board and your PC. 18 | Please get a type with separate signal pins so that you can connect to 19 | the UART TX and RX pins on the board. 20 | 21 | Flashing the MicroPython image with J-Link OB 22 | --------------------------------------------- 23 | 24 | The board has a builtin programmer interface called J-Link OB. 25 | Using the J-Link Software, you can flash the binary image "firmware.hex" 26 | of MicroPython on the board via J-Link OB. 27 | 28 | You can download the J-Link Software and Documentation pack from https://www.segger.com/downloads/jlink/. 29 | 30 | After installing J-Link Software, start J-Flash-Lite program. Then specify following device in Device select menu in J-Flash-Lite. 31 | 32 | =============== ================ 33 | Board Device 34 | --------------- ---------------- 35 | EK-RA4M1 R7FA4M1AB 36 | EK-RA4W1 R7FA4W1AD2CNG 37 | EK-RA6M1 R7FA6M1AD 38 | EK-RA6M2 R7FA6M2AF 39 | RA4M1 CLICKER R7FA4M1AB 40 | =============== ================ 41 | 42 | Select a firmware hex file in Data File of J-Link-Lite, and push Program Device button to flash the firmware. 43 | 44 | Getting a prompt of MicroPython 45 | ------------------------------- 46 | 47 | Cross connect USB-Serial conversion cable RX/TX/GND pins to TX/RX/GND pins on the board. 48 | 49 | =============== =============== =============== 50 | Board USB Serial RX USB Serial TX 51 | --------------- --------------- --------------- 52 | EK-RA4M1 P411 P410 53 | EK-RA4W1 P205 P206 54 | EK-RA6M1 P411 P410 55 | EK-RA6M2 P411 P410 56 | RA4M1 CLICKER P401 P402 57 | =============== =============== =============== 58 | 59 | Access the MicroPython REPL (the Python prompt) via USB serial or UART with 115200 baud rate, 1 stop bit and no parity bit using your favorite terminal software, picocom on Linux or Tera Term on Windows. You can try on Linux:: 60 | 61 | $ picocom /dev/ttyACM0 62 | 63 | You can see the MicroPython REPL prompt like below:: 64 | 65 | MicroPython v1.20.0 on 2023-04-27; EK-RA6M2 with RA6M2 66 | Type "help()" for more information. 67 | >>> 68 | -------------------------------------------------------------------------------- /docs/_sources/renesas-ra/tutorial/program_in_flash.rst.txt: -------------------------------------------------------------------------------- 1 | .. _renesas-ra_program_in_flash: 2 | 3 | Write a program in internal file system 4 | ======================================= 5 | 6 | Internal file system 7 | -------------------- 8 | 9 | The FAT file system is created and initialized in the RA MCU's internal 10 | flash when the MicroPython starts at the first time on the board. 11 | The file system is mounted as "/flash", so you can access this flash system 12 | and create a program file into the /flash directory. 13 | 14 | As the factory setting, following size is allocated for the file system: 15 | 16 | =============== =================== 17 | Board File System Size 18 | --------------- ------------------- 19 | EK-RA4M1 36KB ( 36864B) 20 | EK-RA4W1 64KB ( 65536B) 21 | EK-RA6M1 64KB ( 65536B) 22 | EK-RA6M2 128KB (131072B) 23 | RA4M1 CLICKER 36KB ( 36864B) 24 | =============== =================== 25 | 26 | As the factory setting, following 2 files are created in the file system: 27 | 28 | * boot.py : executed first when the system starts 29 | * main.py : executed after boot.py completes 30 | 31 | Write a program in the internal file system 32 | ------------------------------------------- 33 | 34 | You can write a program in main.py which is executed automatically 35 | when the MicroPython starts. For example, you can write LED blinking 36 | program like below:: 37 | 38 | import os 39 | os.getcwd() 40 | f = open('main.py', 'rw+') 41 | print(f.read()) 42 | f.write('import time\n') 43 | f.write('from machine import Pin\n') 44 | f.write('led1 = Pin(Pin.cpu.P106)\n') 45 | f.write('while True:\n') 46 | f.write(' led1.on()\n') 47 | f.write(' time.sleep(1)\n') 48 | f.write(' led1.off()\n') 49 | f.write(' time.sleep(1)\n') 50 | f.close() 51 | f = open('main.py', 'r') 52 | print(f.read()) 53 | f.close() 54 | 55 | Entering CTRL-D for software reset, the MicroPython reboots, displays 56 | following messages:: 57 | 58 | MPY: sync filesystems 59 | MPY: soft reboot 60 | 61 | and main.py is executed and LED1 blinks per 1 second. 62 | If you want to stop the program, please enter CTRL-C. 63 | -------------------------------------------------------------------------------- /docs/_sources/renesas-ra/tutorial/reset.rst.txt: -------------------------------------------------------------------------------- 1 | .. _renesas-ra_reset: 2 | 3 | Reset and boot mode 4 | =================== 5 | 6 | Resetting the board 7 | ------------------- 8 | 9 | If something goes wrong, you can reset the board in two ways. The first is 10 | to press CTRL-D at the MicroPython prompt, which performs a soft reset. 11 | You will see a message something like :: 12 | 13 | MPY: sync filesystems 14 | MPY: soft reboot 15 | MicroPython v1.18-293-g339aa09b8-dirty on 2022-03-26; RA6M2_EK with RA6M2 16 | Type "help()" for more information. 17 | >>> 18 | 19 | If that isn't working you can perform a hard reset (turn-it-off-and-on-again) 20 | by pressing the RESET button. This will end your session, disconnecting 21 | whatever program (PuTTY, screen, etc) that you used to connect to the board. 22 | 23 | boot mode 24 | --------- 25 | 26 | There are 3 boot modes: 27 | 28 | * normal boot mode 29 | * safe boot mode 30 | * factory filesystem boot mode 31 | 32 | boot.py and main.py are executed on "normal boot mode". 33 | 34 | boot.py and main.py are *NOT* executed on "safe boot mode". 35 | 36 | The file system of internal flash is initialized and *all files are erased* on "factory filesystem boot mode". 37 | 38 | For changing boot mode, please push the RESET button with pressing USER SW1 39 | on the board: 40 | 41 | * For normal boot mode, release the USER SW1 after LED1 flashes 4 times or more 42 | 43 | * For safe boot mode, release the USER SW1 after LED1 flashes 2 times 44 | 45 | * For factory file system boot mode, release the USER SW1 after LED1 flashes 3 times. 46 | 47 | You have created the main.py which executes LED1 blinking in the previous part. 48 | If you change the boot mode to safe boot mode, the MicroPython starts without 49 | the execution of main.py. Then you can remove the main.py by following 50 | command or change the boot mode to factory file system boot mode.:: 51 | 52 | import os 53 | os.remove('main.py') 54 | 55 | or change the boot mode to factory file system boot mode. 56 | 57 | You can confirm that the initialized file system that there are only boot.py and main.py files.:: 58 | 59 | import os 60 | os.listdir() 61 | 62 | -------------------------------------------------------------------------------- /docs/_sources/renesas-ra/tutorial/troubleshooting.rst.txt: -------------------------------------------------------------------------------- 1 | .. _renesas-ra_troubleshooting: 2 | 3 | Trouble Shooting 4 | =================== 5 | 6 | Flash file system 7 | ------------------- 8 | 9 | * MicroPython REPL prompt is not displayed. 10 | 11 | - Re-program the MicroPython image file. 12 | 13 | - Confirm serial port connection. 14 | The connection must be crossed that the board TXD pin is connected with 15 | USB-serial conversion's RXD signal pin. 16 | 17 | - If the prompt is not displayed suddenly, try to do factory file 18 | system boot mode as the final method. Please note that all files are removed forever. 19 | -------------------------------------------------------------------------------- /docs/_sources/renesas-ra/tutorial/using_peripheral.rst.txt: -------------------------------------------------------------------------------- 1 | .. _renesas-ra_using_peripheral: 2 | 3 | Using peripherals 4 | ================= 5 | 6 | For quick help information, please enter:: 7 | 8 | help() 9 | 10 | You can access RA MCU's peripherals using MicroPython modules. 11 | To list supported modules, please enter:: 12 | 13 | help('modules') 14 | 15 | Especially `machine` module and class :ref:`machine.Pin ` are very 16 | important for using peripherals. 17 | 18 | Using "from machine import Pin", Pin name is available corresponding to 19 | the RA MCU's pin name which are Pin.cpu.P000 and 'P000'. 20 | In addition, you can use 'LED1', 'LED2', 'SW1', and 'SW2' name if the board 21 | has these LEDs and switches. 22 | 23 | LED blinking 24 | ------------ 25 | 26 | As simple example, you can enter following program to blink LED1. 27 | Please enter key 4 times after the input of last time.sleep(1). :: 28 | 29 | import time 30 | from machine import Pin 31 | led1 = Pin('LED1') 32 | print(led1) 33 | while True: 34 | led1.on() 35 | time.sleep(1) 36 | led1.off() 37 | time.sleep(1) 38 | 39 | You can see the LED1 blinking per 1 second. 40 | 41 | If you want to stop the program, please enter CTRL-C. :: 42 | 43 | Traceback (most recent call last): 44 | File "", line 5, in 45 | KeyboardInterrupt: 46 | 47 | This message is displayed, and the program stops. 48 | The message means the program was interrupted at line 5 "while" statement. 49 | 50 | Using print(led1), you can confirm that LED1 is assigned to Pin.cpu.P106 51 | on the board.:: 52 | 53 | Pin(Pin.cpu.P106, mode=Pin.OUT, pull=Pin.PULL_NONE, drive=Pin.LOW_POWER) 54 | 55 | So you can get the same result if Pin(Pin.cpu.P106) is specified 56 | instead of Pin('LED1'). :: 57 | 58 | import time 59 | from machine import Pin 60 | led1 = Pin(Pin.cpu.P106) 61 | print(led1) 62 | while True: 63 | led1.on() 64 | time.sleep(1) 65 | led1.off() 66 | time.sleep(1) 67 | 68 | -------------------------------------------------------------------------------- /docs/_sources/rp2/general.rst.txt: -------------------------------------------------------------------------------- 1 | .. _rp2_general: 2 | 3 | General information about the RP2xxx port 4 | ========================================= 5 | 6 | The rp2 port supports boards powered by the Raspberry Pi Foundation's RP2xxx 7 | family of microcontrollers, most notably the Raspberry Pi Pico that employs 8 | the RP2040. 9 | 10 | Technical specifications and SoC datasheets 11 | ------------------------------------------- 12 | 13 | For detailed technical specifications, please refer to the `datasheets 14 | `_ 15 | 16 | The RP2040 microcontroller is manufactured on a 40 nm silicon process in a 7x7mm 17 | QFN-56 SMD package. The key features include: 18 | 19 | * 133 MHz dual ARM Cortex-M0+ cores (overclockable to over 400 MHz) 20 | * 264KB SRAM in six independent banks 21 | * No internal Flash or EEPROM memory (after reset, the bootloader loads 22 | firmware from either the external flash memory or USB bus into internal SRAM) 23 | * QSPI bus controller, which 24 | supports up to 16 MB of external Flash memory 25 | * On-chip programmable LDO to generate core voltage 26 | * 2 on-chip PLLs to generate USB and core clocks 27 | * 30 GPIO pins, of which 4 can optionally be used as analog inputs 28 | 29 | The peripherals include: 30 | 31 | * 2 UARTs 32 | * 2 SPI controllers 33 | * 2 I2C controllers 34 | * 16 PWM channels 35 | * USB 1.1 controller 36 | * 8 PIO state machines 37 | -------------------------------------------------------------------------------- /docs/_sources/rp2/tutorial/intro.rst.txt: -------------------------------------------------------------------------------- 1 | .. _rp2_intro: 2 | 3 | Getting started with MicroPython on the RP2xxx 4 | ============================================== 5 | 6 | Let's get started! 7 | 8 | .. toctree:: 9 | :maxdepth: 1 10 | 11 | pio.rst 12 | -------------------------------------------------------------------------------- /docs/_sources/wipy/tutorial/blynk.rst.txt: -------------------------------------------------------------------------------- 1 | Getting started with Blynk and the WiPy 2 | --------------------------------------- 3 | 4 | Blynk provides iOS and Android apps to control any hardware over the Internet 5 | or directly using Bluetooth. You can easily build graphic interfaces for all 6 | your projects by simply dragging and dropping widgets, right on your smartphone. 7 | 8 | Before anything else, make sure that your WiPy is running 9 | the latest software, check :ref:`OTA How-To ` for instructions. 10 | 11 | 1. Get the `Blynk library `_ and put it in ``/flash/lib/`` via FTP. 12 | 2. Get the `Blynk example for WiPy `_, edit the network settings, and afterwards 13 | upload it to ``/flash/`` via FTP as well. 14 | 3. Follow the instructions on each example to setup the Blynk dashboard on your smartphone or tablet. 15 | 4. Give it a try, for instance:: 16 | 17 | >>> execfile('sync_virtual.py') 18 | -------------------------------------------------------------------------------- /docs/_sources/wipy/tutorial/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. _wipy_tutorial: 2 | 3 | WiPy tutorials and examples 4 | =========================== 5 | 6 | Before starting, make sure that you are running the latest firmware, 7 | for instructions see :ref:`OTA How-To `. 8 | 9 | .. toctree:: 10 | :maxdepth: 1 11 | :numbered: 12 | 13 | intro.rst 14 | repl.rst 15 | blynk.rst 16 | wlan.rst 17 | timer.rst 18 | reset.rst 19 | -------------------------------------------------------------------------------- /docs/_sources/wipy/tutorial/reset.rst.txt: -------------------------------------------------------------------------------- 1 | Reset and boot modes 2 | ==================== 3 | 4 | There are soft resets and hard resets. 5 | 6 | - A soft reset simply clears the state of the MicroPython virtual machine, 7 | but leaves hardware peripherals unaffected. To do a soft reset, simply press 8 | **Ctrl+D** on the REPL, or within a script do:: 9 | 10 | import sys 11 | sys.exit() 12 | 13 | - A hard reset is the same as performing a power cycle to the board. In order to 14 | hard reset the WiPy, press the switch on the board or:: 15 | 16 | import machine 17 | machine.reset() 18 | 19 | Safe boot 20 | --------- 21 | 22 | If something goes wrong with your WiPy, don't panic! It is almost 23 | impossible for you to break the WiPy by programming the wrong thing. 24 | 25 | The first thing to try is to boot in safe mode: this temporarily skips 26 | execution of ``boot.py`` and ``main.py`` and gives default WLAN settings. 27 | 28 | If you have problems with the filesystem you can :ref:`format the internal flash 29 | drive `. 30 | 31 | To boot in safe mode, follow the detailed instructions described :ref:`here `. 32 | 33 | In safe mode, the ``boot.py`` and ``main.py`` files are not executed, and so 34 | the WiPy boots up with default settings. This means you now have access 35 | to the filesystem, and you can edit ``boot.py`` and ``main.py`` to fix any problems. 36 | 37 | Entering safe mode is temporary, and does not make any changes to the 38 | files on the WiPy. 39 | 40 | .. _wipy_factory_reset: 41 | 42 | Factory reset the filesystem 43 | ---------------------------- 44 | 45 | If you WiPy's filesystem gets corrupted (very unlikely, but possible), you 46 | can format it very easily by doing:: 47 | 48 | >>> import os 49 | >>> os.mkfs('/flash') 50 | 51 | Resetting the filesystem deletes all files on the internal WiPy storage 52 | (not the SD card), and restores the files ``boot.py`` and ``main.py`` back 53 | to their original state after the next reset. 54 | 55 | -------------------------------------------------------------------------------- /docs/_sources/zephyr/general.rst.txt: -------------------------------------------------------------------------------- 1 | .. _zephyr_general: 2 | 3 | General information about the Zephyr port 4 | ========================================= 5 | 6 | The Zephyr Project is a Linux Foundation hosted Collaboration Project. It’s an open 7 | source collaborative effort uniting developers and users in building a 8 | small, scalable, real-time operating system (RTOS) optimized for resource-constrained 9 | devices, across multiple architectures. 10 | 11 | Multitude of boards 12 | ------------------- 13 | 14 | There is a multitude of modules and boards from different sources that are supported 15 | by the Zephyr OS. All boards supported by Zephyr (with standard level of features 16 | support, like UART console) should work with MicroPython (but not all were tested). 17 | The FRDM-K64f board is taken as a reference board for the port for this documentation. 18 | If you have another board, please make sure you have a datasheet, schematics and other 19 | reference materials for your board handy to look up various aspects of your board 20 | functioning. 21 | 22 | For a full list of Zephyr supported boards click `here (external link) `_ 23 | -------------------------------------------------------------------------------- /docs/_sources/zephyr/tutorial/index.rst.txt: -------------------------------------------------------------------------------- 1 | .. _zephyr_tutorial: 2 | 3 | MicroPython tutorial for the Zephyr port 4 | ======================================== 5 | 6 | This tutorial is intended to get you started with the Zephyr port. 7 | 8 | .. toctree:: 9 | :maxdepth: 1 10 | :numbered: 11 | 12 | intro.rst 13 | repl.rst 14 | storage.rst 15 | pins.rst 16 | 17 | -------------------------------------------------------------------------------- /docs/_sources/zephyr/tutorial/intro.rst.txt: -------------------------------------------------------------------------------- 1 | .. _intro_zephyr: 2 | 3 | Getting started with MicroPython on the Zephyr port 4 | =================================================== 5 | 6 | Let’s get started! 7 | 8 | Requirements 9 | ------------ 10 | 11 | To use the MicroPython Zephyr port, you will need a Zephyr supported board (for a list of acceptable 12 | boards see :ref:`zephyr_general`). 13 | 14 | Powering up 15 | ----------- 16 | 17 | If your board has a USB connector on it then most likely it is powered 18 | through this when connected to your PC. Otherwise you will need to power 19 | it directly. Please refer to the documentation for your board for 20 | further details. 21 | 22 | Getting and deploying the firmware 23 | ---------------------------------- 24 | 25 | The first step you will need to do is either clone the `MicroPython repository `_ 26 | or download it from the `MicroPython downloads page `_. If you are an end user of MicroPython, 27 | it is recommended to start with the stable firmware builds. If you would like to work on development, you may follow the daily 28 | builds on git. 29 | 30 | Next, follow the Zephyr port readme document (``ports/zephyr/README.md``) to build and run the application on your board. 31 | -------------------------------------------------------------------------------- /docs/_sources/zephyr/tutorial/pins.rst.txt: -------------------------------------------------------------------------------- 1 | .. _pins_zephyr: 2 | 3 | GPIO Pins 4 | ========= 5 | 6 | Use :ref:`machine.Pin ` to control I/O pins. 7 | 8 | For Zephyr, pins are initialized using a tuple of port and pin number ``(\"GPIO_x\", pin#)`` 9 | for the ``id`` value. For example to initialize a pin for the red LED on a FRDM-k64 board:: 10 | 11 | LED = Pin(("GPIO_1", 22), Pin.OUT) 12 | 13 | Reference your board's datasheet or Zephyr documentation for pin numbers, see below for more examples. 14 | 15 | .. list-table:: Pin Formatting 16 | :header-rows: 1 17 | 18 | * - Board 19 | - Pin 20 | - Format 21 | * - frdm_k64f 22 | - Red LED = PTB22 23 | - ("GPIO_1", 22) 24 | * - 96b_carbon 25 | - LED1 = PD2 26 | - ("GPIOD", 2) 27 | * - mimxrt685_evk_cm33 28 | - Green LED = PIO0_14 29 | - ("GPIO0", 14) 30 | 31 | Interrupts 32 | ---------- 33 | 34 | The Zephyr port also supports interrupt handling for Pins using `machine.Pin.irq() `. 35 | To respond to Pin change IRQs run:: 36 | 37 | from machine import Pin 38 | 39 | SW2 = Pin(("GPIO_2", 6), Pin.IN) # create Pin object for switch 2 40 | SW3 = Pin(("GPIO_0", 4), Pin.IN) # create Pin object for switch 3 41 | 42 | SW2.irq(lambda t: print("SW2 changed")) # print message when SW2 state is changed (triggers change IRQ) 43 | SW3.irq(lambda t: print("SW3 changed")) # print message when SW3 state is changed (triggers change IRQ) 44 | 45 | while True: # wait 46 | pass 47 | -------------------------------------------------------------------------------- /docs/_static/css/fonts/Roboto-Slab-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/css/fonts/Roboto-Slab-Bold.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/Roboto-Slab-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/css/fonts/Roboto-Slab-Bold.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/Roboto-Slab-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/css/fonts/Roboto-Slab-Regular.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/Roboto-Slab-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/css/fonts/Roboto-Slab-Regular.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/css/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/_static/css/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/css/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/_static/css/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/css/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/css/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-bold-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/css/fonts/lato-bold-italic.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-bold-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/css/fonts/lato-bold-italic.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/css/fonts/lato-bold.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/css/fonts/lato-bold.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-normal-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/css/fonts/lato-normal-italic.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-normal-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/css/fonts/lato-normal-italic.woff2 -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-normal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/css/fonts/lato-normal.woff -------------------------------------------------------------------------------- /docs/_static/css/fonts/lato-normal.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/css/fonts/lato-normal.woff2 -------------------------------------------------------------------------------- /docs/_static/custom.css: -------------------------------------------------------------------------------- 1 | /* Workaround to force Sphinx to render tables to 100% and wordwrap */ 2 | /* See https://stackoverflow.com/questions/69359978/grid-table-does-not-word-wrap for more details */ 3 | .wy-table-responsive table td, .wy-table-responsive table th { 4 | white-space: inherit; 5 | } 6 | -------------------------------------------------------------------------------- /docs/_static/customstyle.css: -------------------------------------------------------------------------------- 1 | /* custom CSS for MicroPython docs 2 | */ 3 | 4 | .admonition-difference-to-cpython { 5 | border: 1px solid black; 6 | } 7 | 8 | .admonition-difference-to-cpython .admonition-title { 9 | margin: 4px; 10 | } 11 | -------------------------------------------------------------------------------- /docs/_static/default.css: -------------------------------------------------------------------------------- 1 | @import url("classic.css"); 2 | -------------------------------------------------------------------------------- /docs/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), 3 | VERSION: '1.25', 4 | LANGUAGE: 'en', 5 | COLLAPSE_INDEX: false, 6 | BUILDER: 'html', 7 | FILE_SUFFIX: '.html', 8 | LINK_SUFFIX: '.html', 9 | HAS_SOURCE: true, 10 | SOURCELINK_SUFFIX: '.txt', 11 | NAVIGATION_WITH_KEYS: false, 12 | SHOW_SEARCH_SUMMARY: true, 13 | ENABLE_SEARCH_SHORTCUTS: true, 14 | }; -------------------------------------------------------------------------------- /docs/_static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/favicon.ico -------------------------------------------------------------------------------- /docs/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/file.png -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/Lato/lato-bold.eot -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/Lato/lato-bold.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/Lato/lato-bold.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/Lato/lato-bold.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bolditalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/Lato/lato-bolditalic.eot -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/Lato/lato-bolditalic.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/Lato/lato-bolditalic.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-bolditalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/Lato/lato-bolditalic.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/Lato/lato-italic.eot -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/Lato/lato-italic.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/Lato/lato-italic.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/Lato/lato-italic.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/Lato/lato-regular.eot -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/Lato/lato-regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/Lato/lato-regular.woff -------------------------------------------------------------------------------- /docs/_static/fonts/Lato/lato-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/Lato/lato-regular.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 -------------------------------------------------------------------------------- /docs/_static/js/badge_only.js: -------------------------------------------------------------------------------- 1 | !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}({4:function(e,t,r){}}); -------------------------------------------------------------------------------- /docs/_static/js/html5shiv.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | !function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3-pre",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document); -------------------------------------------------------------------------------- /docs/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/minus.png -------------------------------------------------------------------------------- /docs/_static/openmv.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/openmv.ico -------------------------------------------------------------------------------- /docs/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/plus.png -------------------------------------------------------------------------------- /docs/_static/web-logo-sticky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/_static/web-logo-sticky.png -------------------------------------------------------------------------------- /docs/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openmv/openmv-doc/f49192ca7fb11c84fe17987fcd0d7a8bf0337993/docs/objects.inv -------------------------------------------------------------------------------- /make.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # by: Kwabena W. Agyeman - kwagyeman@openmv.io 4 | 5 | import os, sys 6 | 7 | def make(): 8 | 9 | __folder__ = os.path.dirname(os.path.abspath(__file__)) 10 | 11 | if sys.platform.startswith('win'): 12 | os.environ["MICROPY_PORT"] = "openmvcam" 13 | os.environ["SPHINXBUILD"] = "python -m sphinx.cmd.build" 14 | if os.system("cd " + os.path.join(__folder__, 15 | "micropython/docs") + " && make.bat html"): 16 | sys.exit("Make Failed...") 17 | 18 | else: 19 | if os.system("cd " + os.path.join(__folder__, 20 | "micropython/docs") + " && make MICROPY_PORT=openmvcam " 21 | "BUILDDIR=_build html"): 22 | sys.exit("Make Failed...") 23 | 24 | if __name__ == "__main__": 25 | make() 26 | --------------------------------------------------------------------------------