Full Code of virtualabs/radiobit for AI

master f1578e003a34 cached
364 files
3.5 MB
941.2k tokens
2793 symbols
1 requests
Download .txt
Showing preview only (3,761K chars total). Download the full file or copy to clipboard to get everything.
Repository: virtualabs/radiobit
Branch: master
Commit: f1578e003a34
Files: 364
Total size: 3.5 MB

Directory structure:
gitextract_ckfa0abd/

├── .gitignore
├── README.md
├── doc/
│   └── README.md
├── examples/
│   ├── ble-advertiser/
│   │   ├── advertise.py
│   │   └── sniffer.py
│   ├── ble-conn-sniffing/
│   │   └── sniff_conn.py
│   ├── esb-sample-sniff.py/
│   │   └── wireless-keyboard-sniff.py
│   └── helloworld/
│       └── helloworld.py
├── micropython/
│   ├── .gitignore
│   ├── AUTHORS
│   ├── LICENSE
│   ├── Makefile
│   ├── README.md
│   ├── config.json
│   ├── docs/
│   │   ├── Makefile
│   │   ├── accelerometer.rst
│   │   ├── audio.rst
│   │   ├── ble.rst
│   │   ├── button.rst
│   │   ├── compass.rst
│   │   ├── conf.py
│   │   ├── devguide/
│   │   │   ├── contributing.rst
│   │   │   ├── devfaq.rst
│   │   │   ├── flashfirmware.rst
│   │   │   ├── hexformat.rst
│   │   │   ├── installation.rst
│   │   │   └── repl.rst
│   │   ├── display.rst
│   │   ├── filesystem.rst
│   │   ├── i2c.rst
│   │   ├── image.rst
│   │   ├── index.rst
│   │   ├── machine.rst
│   │   ├── make.bat
│   │   ├── microbit.rst
│   │   ├── microbit_micropython_api.rst
│   │   ├── micropython.rst
│   │   ├── music.rst
│   │   ├── neopixel.rst
│   │   ├── os.rst
│   │   ├── pin.rst
│   │   ├── radio.rst
│   │   ├── random.rst
│   │   ├── speech.rst
│   │   ├── spi.rst
│   │   ├── tutorials/
│   │   │   ├── buttons.rst
│   │   │   ├── direction.rst
│   │   │   ├── gestures.rst
│   │   │   ├── hello.rst
│   │   │   ├── images.rst
│   │   │   ├── introduction.rst
│   │   │   ├── io.rst
│   │   │   ├── movement.rst
│   │   │   ├── music.rst
│   │   │   ├── network.rst
│   │   │   ├── next.rst
│   │   │   ├── radio.rst
│   │   │   ├── random.rst
│   │   │   ├── speech.rst
│   │   │   └── storage.rst
│   │   ├── uart.rst
│   │   └── utime.rst
│   ├── examples/
│   │   ├── analog_watch.py
│   │   ├── asmleds.py
│   │   ├── bubble_level_2d.py
│   │   ├── compass.py
│   │   ├── conway.py
│   │   ├── counter.py
│   │   ├── digital_water.py
│   │   ├── dodge_game.py
│   │   ├── flame_simulation.py
│   │   ├── flappybit.py
│   │   ├── four_buttons.py
│   │   ├── i_feel_today.py
│   │   ├── led_dance.py
│   │   ├── magic8.py
│   │   ├── maze.py
│   │   ├── music.py
│   │   ├── neopixel_random.py
│   │   ├── play_file.py
│   │   ├── pomodoro.py
│   │   ├── radio.py
│   │   ├── reverb.py
│   │   ├── simple_slalom.py
│   │   ├── speech.py
│   │   ├── tiltmusic.py
│   │   ├── watch.py
│   │   └── waveforms.py
│   ├── inc/
│   │   ├── extmod/
│   │   │   ├── machine_mem.h
│   │   │   ├── machine_pulse.h
│   │   │   └── utime_mphal.h
│   │   ├── genhdr/
│   │   │   ├── mpversion.h
│   │   │   └── qstrdefs.generated.h
│   │   ├── lib/
│   │   │   ├── iters.h
│   │   │   ├── mp-readline/
│   │   │   │   └── readline.h
│   │   │   ├── pwm.h
│   │   │   ├── ticker.h
│   │   │   └── utils/
│   │   │       ├── interrupt_char.h
│   │   │       └── pyexec.h
│   │   ├── microbit/
│   │   │   ├── MicroBitCustomConfig.h
│   │   │   ├── filesystem.h
│   │   │   ├── memory.h
│   │   │   ├── microbit_image.h
│   │   │   ├── microbitdal.h
│   │   │   ├── modaudio.h
│   │   │   ├── modmicrobit.h
│   │   │   ├── modmusic.h
│   │   │   ├── mpconfigport.h
│   │   │   ├── mphalport.h
│   │   │   └── qstrdefsport.h
│   │   └── py/
│   │       ├── asmarm.h
│   │       ├── asmbase.h
│   │       ├── asmthumb.h
│   │       ├── asmx64.h
│   │       ├── asmx86.h
│   │       ├── asmxtensa.h
│   │       ├── bc.h
│   │       ├── bc0.h
│   │       ├── binary.h
│   │       ├── builtin.h
│   │       ├── compile.h
│   │       ├── emit.h
│   │       ├── emitglue.h
│   │       ├── formatfloat.h
│   │       ├── frozenmod.h
│   │       ├── gc.h
│   │       ├── grammar.h
│   │       ├── lexer.h
│   │       ├── misc.h
│   │       ├── mpconfig.h
│   │       ├── mperrno.h
│   │       ├── mphal.h
│   │       ├── mpprint.h
│   │       ├── mpstate.h
│   │       ├── mpthread.h
│   │       ├── mpz.h
│   │       ├── nlr.h
│   │       ├── obj.h
│   │       ├── objarray.h
│   │       ├── objexcept.h
│   │       ├── objfun.h
│   │       ├── objgenerator.h
│   │       ├── objint.h
│   │       ├── objlist.h
│   │       ├── objmodule.h
│   │       ├── objstr.h
│   │       ├── objstringio.h
│   │       ├── objtuple.h
│   │       ├── objtype.h
│   │       ├── parse.h
│   │       ├── parse2.h
│   │       ├── parsenum.h
│   │       ├── parsenumbase.h
│   │       ├── persistentcode.h
│   │       ├── qstr.h
│   │       ├── qstrdefs.h
│   │       ├── reader.h
│   │       ├── repl.h
│   │       ├── ringbuf.h
│   │       ├── runtime.h
│   │       ├── runtime0.h
│   │       ├── scope.h
│   │       ├── smallint.h
│   │       ├── stackctrl.h
│   │       ├── stream.h
│   │       ├── unicode.h
│   │       └── vmentrytable.h
│   ├── module.json
│   ├── source/
│   │   ├── extmod/
│   │   │   ├── machine_mem.c
│   │   │   ├── machine_pulse.c
│   │   │   └── utime_mphal.c
│   │   ├── lib/
│   │   │   ├── iters.c
│   │   │   ├── mp-readline/
│   │   │   │   └── readline.c
│   │   │   ├── neopixelsend.s
│   │   │   ├── pwm.c
│   │   │   ├── sam/
│   │   │   │   ├── ReciterTabs.h
│   │   │   │   ├── RenderTabs.h
│   │   │   │   ├── SamTabs.h
│   │   │   │   ├── debug.c
│   │   │   │   ├── debug.h
│   │   │   │   ├── main.c
│   │   │   │   ├── reciter.c
│   │   │   │   ├── reciter.h
│   │   │   │   ├── render.c
│   │   │   │   ├── render.h
│   │   │   │   ├── sam.c
│   │   │   │   └── sam.h
│   │   │   ├── ticker.c
│   │   │   └── utils/
│   │   │       ├── interrupt_char.c
│   │   │       └── pyexec.c
│   │   ├── microbit/
│   │   │   ├── display_readme.md
│   │   │   ├── events.cpp
│   │   │   ├── fileobj.c
│   │   │   ├── filesystem.c
│   │   │   ├── gccollect.c
│   │   │   ├── help.c
│   │   │   ├── main.cpp
│   │   │   ├── microbitaccelerometer.cpp
│   │   │   ├── microbitbutton.cpp
│   │   │   ├── microbitcompass.cpp
│   │   │   ├── microbitconstimage.cpp
│   │   │   ├── microbitconstimagetuples.c
│   │   │   ├── microbitdisplay.cpp
│   │   │   ├── microbiti2c.cpp
│   │   │   ├── microbitimage.cpp
│   │   │   ├── microbitpin.cpp
│   │   │   ├── microbitpinmode.c
│   │   │   ├── microbitspi.cpp
│   │   │   ├── microbituart.cpp
│   │   │   ├── modantigravity.cpp
│   │   │   ├── modaudio.cpp
│   │   │   ├── modlove.cpp
│   │   │   ├── modmachine.c
│   │   │   ├── modmicrobit.cpp
│   │   │   ├── modmusic.cpp
│   │   │   ├── modmusictunes.c
│   │   │   ├── modneopixel.cpp
│   │   │   ├── modos.c
│   │   │   ├── modradio.cpp
│   │   │   ├── modrandom.cpp
│   │   │   ├── modspeech.c
│   │   │   ├── modthis.cpp
│   │   │   ├── modutime.c
│   │   │   ├── mphalport.cpp
│   │   │   └── persistent.c
│   │   └── py/
│   │       ├── argcheck.c
│   │       ├── asmarm.c
│   │       ├── asmbase.c
│   │       ├── asmthumb.c
│   │       ├── asmx64.c
│   │       ├── asmx86.c
│   │       ├── asmxtensa.c
│   │       ├── bc.c
│   │       ├── binary.c
│   │       ├── builtinevex.c
│   │       ├── builtinhelp.c
│   │       ├── builtinimport.c
│   │       ├── compile.c
│   │       ├── compile2.c
│   │       ├── emitbc.c
│   │       ├── emitcommon.c
│   │       ├── emitglue.c
│   │       ├── emitinlinethumb.c
│   │       ├── emitinlinextensa.c
│   │       ├── emitnative.c
│   │       ├── formatfloat.c
│   │       ├── frozenmod.c
│   │       ├── gc.c
│   │       ├── lexer.c
│   │       ├── makeqstrdata.py
│   │       ├── makeqstrdefs.py
│   │       ├── makeversionhdr.py
│   │       ├── malloc.c
│   │       ├── map.c
│   │       ├── modarray.c
│   │       ├── modbuiltins.c
│   │       ├── modcmath.c
│   │       ├── modcollections.c
│   │       ├── modgc.c
│   │       ├── modio.c
│   │       ├── modmath.c
│   │       ├── modmicropython.c
│   │       ├── modstruct.c
│   │       ├── modsys.c
│   │       ├── modthread.c
│   │       ├── moduerrno.c
│   │       ├── mpprint.c
│   │       ├── mpstate.c
│   │       ├── mpz.c
│   │       ├── nativeglue.c
│   │       ├── nlrsetjmp.c
│   │       ├── nlrthumb.c
│   │       ├── nlrx64.c
│   │       ├── nlrx86.c
│   │       ├── nlrxtensa.c
│   │       ├── obj.c
│   │       ├── objarray.c
│   │       ├── objattrtuple.c
│   │       ├── objbool.c
│   │       ├── objboundmeth.c
│   │       ├── objcell.c
│   │       ├── objclosure.c
│   │       ├── objcomplex.c
│   │       ├── objdict.c
│   │       ├── objenumerate.c
│   │       ├── objexcept.c
│   │       ├── objfilter.c
│   │       ├── objfloat.c
│   │       ├── objfun.c
│   │       ├── objgenerator.c
│   │       ├── objgetitemiter.c
│   │       ├── objint.c
│   │       ├── objint_longlong.c
│   │       ├── objint_mpz.c
│   │       ├── objlist.c
│   │       ├── objmap.c
│   │       ├── objmodule.c
│   │       ├── objnamedtuple.c
│   │       ├── objnone.c
│   │       ├── objobject.c
│   │       ├── objpolyiter.c
│   │       ├── objproperty.c
│   │       ├── objrange.c
│   │       ├── objreversed.c
│   │       ├── objset.c
│   │       ├── objsingleton.c
│   │       ├── objslice.c
│   │       ├── objstr.c
│   │       ├── objstringio.c
│   │       ├── objstrunicode.c
│   │       ├── objtuple.c
│   │       ├── objtype.c
│   │       ├── objzip.c
│   │       ├── opmethods.c
│   │       ├── parse.c
│   │       ├── parse2.c
│   │       ├── parsenum.c
│   │       ├── parsenumbase.c
│   │       ├── persistentcode.c
│   │       ├── qstr.c
│   │       ├── reader.c
│   │       ├── repl.c
│   │       ├── runtime.c
│   │       ├── runtime_utils.c
│   │       ├── scheduler.c
│   │       ├── scope.c
│   │       ├── sequence.c
│   │       ├── showbc.c
│   │       ├── smallint.c
│   │       ├── stackctrl.c
│   │       ├── stream.c
│   │       ├── unicode.c
│   │       ├── vm.c
│   │       ├── vstr.c
│   │       └── warning.c
│   ├── tests/
│   │   ├── README.md
│   │   ├── exercise.py
│   │   ├── radio_audio.py
│   │   ├── sample.raw
│   │   ├── test_files.py
│   │   ├── test_files2.py
│   │   ├── test_files3.py
│   │   ├── test_image.py
│   │   ├── test_music.py
│   │   ├── test_pins.py
│   │   ├── test_pwm.py
│   │   ├── test_random.py
│   │   └── test_speech.py
│   └── tools/
│       ├── adduicr.py
│       ├── hexlifyscript.js
│       ├── hexlifyscript.py
│       ├── makecombinedhex.py
│       ├── makeqstrhdr.sh
│       ├── makeversionhdr.py
│       ├── pyboard.py
│       └── upload.py
├── precompiled/
│   └── radiobit.hex
└── tools/
    ├── cheerson-cx10/
    │   ├── README.md
    │   └── cxp0wn.py
    ├── ubit-sniffer/
    │   ├── README.md
    │   ├── middleware/
    │   │   └── ubit-sniffer-mw.py
    │   └── ubit-sniffer.py
    └── wireless-keylogger/
        ├── README.md
        └── msft-keylogger.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# ignore Micropython build firmware
micropython/build/

# ignore Micropython yotta_modules
micropython/yotta_modules/

# ignore Micropython yotta_targets
micropython/yotta_targets/
micropython/.yotta*

# ignore compiled Python modules
*.pyc

# ignore our virtualenv
venv


================================================
FILE: README.md
================================================
Radiobit, a BBC Micro:Bit RF firmware
=====================================

Introduction
------------

Radiobit is composed of a dedicated Micropython-based firmware and a set of tools allowing security researchers to:

* sniff, receive and send data over Nordic's Enhanced ShockBurst protocol (ESB)
* sniff, receive and send data over Nordic' ShockBurst protocol (SB)
* sniff, receive and send data over Bluetooth Smart Link Layer
* sniff raw 2.4GHz GFSK demodulated data

Using Radiobit tools and examples
---------------------------------

Radiobit provides the following tools:

* **ubit-sniffer**: a ESB/SB/BLE/raw sniffer able to collect data and display them.
* **cheerson-cx10**: the firmware corresponding to the hack described in my DefCon25 presentation, used to hijack a Cheerson CX-10 quadcopter in flight.
* **wireless-keylogger**: Microsoft wireless keyboard sniffer firmware, as shown at DefCon25

See the corresponding README.md files for each tool of the *tools* directory.

Radiobit also provides many examples of what can be achieved with its firmware:

* A BLE advertiser and its associated sniffer
* A BLE connection request packet sniffer
* An ESB basic sniffer running on the Micro:Bit

**A precompiled version of the Radiobit firmware is provided in the *precompiled* directory, as a convenience.**

If you want to try Radiobit's custom radio Python module, read the [specific documentation](doc/README.md).

How to program the Micro:Bit with some Python code
--------------------------------------------------

Use *uflash* to program your Micro:Bit:

1. Plug your Micro:Bit to your computer with a USB cable, it will be recognised as a mass storage device
2. Mount it
3. Use uflash to merge the firmware with your main Python3 program and flash the device

```
$ uflash -r precompiled/radiobit.hex yourprogramhere.py
```

*Uflash* will program your Micro:Bit and reset it once it's done !

Recompiling the firmware
------------------------

If you want to modify the Radiobit firmware, you must follow the procedure below. This procedure has been tested on Debian, but should work on Ubuntu as well.

### How to setup the environment

First, install all the required packages (Debian):

```
$ sudo apt-get install cmake ninja-build gcc-arm-none-eabi srecord libssl-dev
```

Create a virtual environment with *virtualenv* for Python 3.x:

```
$ virtualenv venv
```

This will create a Python3.x virtual environment in a dedicated folder named *venv*. You then need
to activate this environment in order to install all the required tools with pip3.

```
$ source venv/bin/activate
```

Use pip to install **yotta** in our newly created virtual environment:

```
(venv)$ pip install yotta
```

Finally, use **yotta** to setup the build environment:

```
(venv)$ cd micropython
(venv)$ yt target bbc-microbit-classic-gcc-nosd
(venv)$ yt up
```

### How to build the firmware

You can now uild the modified micropython firmware. Make sure you are in the *micropython* directory:

```
(venv)$ yt build
```

This may produce a lot of warnings (who said python developers produce clean code ?) but at last a valid binary (in Ihex format).

Your compiled firmware should be located in the *build/bbc-microbit-classic-gcc-nosd/source* directory, named *microbit-micropython.hex*.

### How to flash a Micro:Bit with this new firmware

Micropython should not be used alone (as a REPL), but combined with a Python script merged into the firmware. This is a usual way to *program* a Micro:Bit using CLI rather than online services.

First, you need to install **uflash** in your virtual environment:

```
(venv)$ pip install uflash
```

You then can use **uflash** to flash your Micro:Bit using the following command:

```
(venv)$ uflash -r build/bbc-microbit-classic-gcc-nosd/source/microbit-micropython.hex ../examples/helloworld/helloworld.py
```

Obviously, you must have your Micro:Bit connected to your host machine when launching the previous command, or *uflash* will complain.


================================================
FILE: doc/README.md
================================================
How to use Radiobit's radio module ?
====================================

Radiobit's *radio* module exposes multiple methods allowing sniffing, receiving and injecting
ESB/SB/BLE packets.

Sniffing ESB/SB packets
-----------------------

If you want to sniff Enhanced ShockBurst packets, you need to enable the radio
and activate the sniffing mode, as shown below:

``` python
import radio

radio.on()
radio.sniff_on()
```

You may then want to loop over each sniffed packets:

``` python
while True:
    pkt = radio.sniff()
    if pkt is not None:
        # do something with the pkt
```

The sniffing algorithm tries by default to find ESB packets rather than SB packets, but you may use raw sniffing to get them:

``` python
import radio

radio.on()
radio.config(raw=1, length=40, channel=80)
radio.sniff_on()

while True:
    pkt = radio.sniff()
    if pkt is not None:
        # pkt should be either ESB or SB, as no CRC check is made
        # you have to sort it out and find your SB packets :S
```

This raw sniffing feature may also be used to investigate unknown protocols, as it operates as a simple GFSK demodulator using a specific data rate.


Receiving ESB packets
---------------------

In order to receive ESB packets, you need to tune the transceiver to a specific channel and set
a 5-byte address as shown below:

``` python
import radio

radio.on()

# Listen on channel 80 for address 0x1122334455
radio.config(channel=80, address=0x11223344, group=0x55)
radio.esb()
```

The received packets can then be processed:

``` python
pkt = radio.receive_bytes()
if pkt is not None:
    # process packet
```

Sending ESB packets
---------------------

You may also want to send packets:

``` python
radio.send_bytes(b'Trolololo')
```


Receiving SB packets
--------------------

In order to receive Legacy SB packets, you need to tune the transceiver to a specific channel and set
a 5-byte address as shown below:

``` python
import radio

radio.on()

# Listen on channel 80 for address 0x1122334455, packet size of 10 bytes
radio.config(channel=80, address=0x11223344, group=0x55, length=10)
radio.sb()
```

Note the packet size is mandatory when using ShockBurst (SB) procotol, as the packet format
contains no length field. By default, the length used is 32.

The received packets can then be processed the usual way, by calling *radio.receive_bytes()*:

``` python
pkt = radio.receive_bytes()
if pkt is not None:
    # process packet
```


================================================
FILE: examples/ble-advertiser/advertise.py
================================================
"""
BLE advertising example

This example uses a little hack to send BLE scan responses
in time: it sends it straight forward even if not required.
"""
from microbit import *
import radio

adv_pkt = bytes([0x40, 0x42, 0xd8, 0x2a, 0x41, 0x32, 0x65,0x02, 0x01, 0x1a, 0x09, 0x09])+b'DEFCON25'
scan_rsp = bytes([0x44, 0x42, 0xd8, 0x2a, 0x41, 0x32, 0x65, 0x03, 0xff,0x12,0x13])
radio.on()
radio.config(channel=38)
radio.ble()
while True:
    for  i in range(37,40):
        radio.config(channel=i)
        radio.send(adv_pkt)
        radio.send(scan_rsp)
        sleep(50)


================================================
FILE: examples/ble-advertiser/sniffer.py
================================================
from microbit import *
import radio

radio.on()
radio.config(channel=38)
radio.ble()

while True:
    pkt = radio.receive_bytes()
    if pkt is not None:
        if len(pkt) > 13:
            addr = '%02x:%02x:%02x:%02x:%02x:%02x' % (
                pkt[13], pkt[12], pkt[11], pkt[10], pkt[9], pkt[8]
            )
            advinfo = ' '.join(['%02x'%c for c in pkt[14:]])
            print('+ %s > %s' % (addr, advinfo))
            del advinfo
            del addr
            del pkt


================================================
FILE: examples/ble-conn-sniffing/sniff_conn.py
================================================
"""
This script simply loops on advertising channels and
sniffs BLE connection requests.
"""
import radio
from microbit import *

radio.on()
radio.ble()
timeout = 50
last = running_time()
chan = 0

while True:
    if (running_time() - last) >= timeout:
        chan = (chan+1)%3
        radio.config(channel=(chan+37))
        last = running_time()
    p = radio.receive()
    if p is not None and p[5]&0x0F == 5 and p[6]==0x22:
        #print(' '.join(['%02x'%c for c in p]))
        payload = p[8:]
        pl =  ' '.join(['%02x' % c for c in payload])
        print(pl)
        # parse connect_req
        inita = ':'.join(['%02x'%c for c in payload[:6]])
        adva = ':'.join(['%02x'%c for c in payload[6:12]])
        aa = payload[12] | payload[13]<<8 | payload[14]<<16 |payload[15]<<24
        crcinit = (payload[16])|(payload[17]<<8)|(payload[18]<<16)
        hop_increment = (payload[33]&0x1f)
        hop_interval = payload[22] | payload[23]<<8

        print('[%08x] %s -> %s (CRCInit: %06x, hopInc: %d, hopInter: %d)' % (aa, inita, adva, crcinit, hop_increment, hop_interval))


================================================
FILE: examples/esb-sample-sniff.py/wireless-keyboard-sniff.py
================================================
"""
Quick'n'dirty ESB sniffer listening on channel 74 at 2MBit/s
"""
import radio

radio.on()
radio.config(data_rate=radio.RATE_2MBIT, channel=74)
radio.sniff_on()

while True:
    pkt = radio.sniff()
    if pkt is not None:
        addr = ':'.join(['%2x'%c for c in pkt[:5]])
        payload = ''.join(['%02x '%c for c in pkt[5:]])
        print('%s > %s' % (addr, payload))


================================================
FILE: examples/helloworld/helloworld.py
================================================
import microbit

microbit.display.scroll('Hello world !')


================================================
FILE: micropython/.gitignore
================================================
.yotta.json
build/*
yotta_modules/*
yotta_targets/*
*.swp
__pycache__

# This file is generated by the build process
inc/genhdr/microbitversion.h


================================================
FILE: micropython/AUTHORS
================================================
Damien P. George (@dpgeorge)
Nicholas H. Tollervey (@ntoll)
Matthew Else (@matthewelse)
Alan M. Jackson (@alanmjackson)
Mark Shannon (@markshannon)
Larry Hastings (@larryhastings)
Mariia Koroliuk (@marichkakorolyuk)
Andrew Mulholland (@gbaman)
Joe Glancy (@JoeGlancy)


================================================
FILE: micropython/LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2013-2016 The MicroPython-on-micro:bit Developers, as listed
in the accompanying AUTHORS file

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


================================================
FILE: micropython/Makefile
================================================
ECHO = @echo

HEX_SRC = build/bbc-microbit-classic-gcc-nosd/source/microbit-micropython.hex
HEX_FINAL = build/firmware.hex
MBIT_VER_FILE = inc/genhdr/microbitversion.h
VER_ADDR_FILE = build/veraddr.txt

all: $(HEX_FINAL)

# Anything that depends on FORCE will be considered out-of-date
FORCE:
.PHONY: FORCE

$(HEX_FINAL): yotta $(VER_ADDR_FILE)
	tools/adduicr.py $(HEX_SRC) $$(cat $(VER_ADDR_FILE)) -o $(HEX_FINAL)
	@size $(HEX_SRC:.hex=)

yotta: $(MBIT_VER_FILE)
	@yt build

$(MBIT_VER_FILE): FORCE
	python tools/makeversionhdr.py $(MBIT_VER_FILE)

$(VER_ADDR_FILE): yotta
	@echo -n "0x" > $(VER_ADDR_FILE)
	@objdump -x $(HEX_SRC:.hex=) | grep microbit_version_string | cut -f 1 -d' ' >> $(VER_ADDR_FILE)

deploy: $(HEX_FINAL)
	$(ECHO) "Deploying $<"
	@mount /dev/sdb
	@sleep 1s
	@cp $< /mnt/
	@sleep 1s
	@umount /mnt

serial:
	@picocom /dev/ttyACM0 -b 115200


================================================
FILE: micropython/README.md
================================================
MicroPython for the BBC micro:bit
=================================

This is the source code for MicroPython running on the BBC micro:bit!

To get involved with the micro:bit community join the Slack channel by signing up here:
https://tech.microbit.org/get-involved/where-to-find/

Various things are in this repository, including:
- Source code in source/ and inc/ directories.
- Example Python programs in the examples/ directory.
- Tools in the tools/ directory.

The source code is a yotta application and needs yotta to build, along
with an ARM compiler toolchain (eg arm-none-eabi-gcc and friends).

Ubuntu users can install the needed packages using:
```
sudo add-apt-repository -y ppa:team-gcc-arm-embedded
sudo add-apt-repository -y ppa:pmiller-opensource/ppa
sudo apt-get update
sudo apt-get install cmake ninja-build gcc-arm-none-eabi srecord libssl-dev
pip3 install yotta
```

Once all packages are installed, use yotta and the provided Makefile to build.
You might need need an Arm Mbed account to complete some of the yotta commands,
if so, you could be prompted to create one as a part of the process.

- Use target bbc-microbit-classic-gcc-nosd:

  ```
  yt target bbc-microbit-classic-gcc-nosd
  ```

- Run yotta update to fetch remote assets:

  ```
  yt up
  ```

- Start the build:

  ```
  make all
  ```

The resulting firmware.hex file to flash onto the device can be
found in the build/ directory from the root of the repository.

The Makefile provided does some extra preprocessing of the source,
adds version information to the UICR region, puts the resulting
firmware at build/firmware.hex, and includes some convenience targets.

How to use
==========

Upon reset you will have a REPL on the USB CDC serial port, with baudrate
115200 (eg picocom /dev/ttyACM0 -b 115200).

Then try:

    >>> import microbit
    >>> microbit.display.scroll('hello!')
    >>> microbit.button_a.is_pressed()
    >>> dir(microbit)

Tab completion works and is very useful!

Read our documentation here:

https://microbit-micropython.readthedocs.io/en/latest/

You can also use the tools/pyboard.py script to run Python scripts directly
from your PC, eg:

    $ ./tools/pyboard.py /dev/ttyACM0 examples/conway.py

Be brave! Break things! Learn and have fun!


================================================
FILE: micropython/config.json
================================================
{
    "microbit" : {
        "configfile" : "inc/microbit/MicroBitCustomConfig.h"
    }
}


================================================
FILE: micropython/docs/Makefile
================================================
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS    =
SPHINXBUILD   = sphinx-build
PAPER         =
BUILDDIR      = _build

# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif

# Internal variables.
PAPEROPT_a4     = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

help:
	@echo "Please use \`make <target>' where <target> is one of"
	@echo "  html       to make standalone HTML files"
	@echo "  dirhtml    to make HTML files named index.html in directories"
	@echo "  singlehtml to make a single large HTML file"
	@echo "  pickle     to make pickle files"
	@echo "  json       to make JSON files"
	@echo "  htmlhelp   to make HTML files and a HTML help project"
	@echo "  qthelp     to make HTML files and a qthelp project"
	@echo "  devhelp    to make HTML files and a Devhelp project"
	@echo "  epub       to make an epub"
	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
	@echo "  latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
	@echo "  text       to make text files"
	@echo "  man        to make manual pages"
	@echo "  texinfo    to make Texinfo files"
	@echo "  info       to make Texinfo files and run them through makeinfo"
	@echo "  gettext    to make PO message catalogs"
	@echo "  changes    to make an overview of all changed/added/deprecated items"
	@echo "  xml        to make Docutils-native XML files"
	@echo "  pseudoxml  to make pseudoxml-XML files for display purposes"
	@echo "  linkcheck  to check all external links for integrity"
	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"

clean:
	rm -rf $(BUILDDIR)/*

html:
	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
	@echo
	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
	@echo
	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
	@echo
	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
	@echo
	@echo "Build finished; now you can process the pickle files."

json:
	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
	@echo
	@echo "Build finished; now you can process the JSON files."

htmlhelp:
	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
	@echo
	@echo "Build finished; now you can run HTML Help Workshop with the" \
	      ".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
	@echo
	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/BBCMicrobitMicropython.qhcp"
	@echo "To view the help file:"
	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/BBCMicrobitMicropython.qhc"

devhelp:
	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
	@echo
	@echo "Build finished."
	@echo "To view the help file:"
	@echo "# mkdir -p $$HOME/.local/share/devhelp/BBCMicrobitMicropython"
	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/BBCMicrobitMicropython"
	@echo "# devhelp"

epub:
	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
	@echo
	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	@echo
	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
	@echo "Run \`make' in that directory to run these through (pdf)latex" \
	      "(use \`make latexpdf' here to do that automatically)."

latexpdf:
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	@echo "Running LaTeX files through pdflatex..."
	$(MAKE) -C $(BUILDDIR)/latex all-pdf
	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

latexpdfja:
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	@echo "Running LaTeX files through platex and dvipdfmx..."
	$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
	@echo
	@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
	@echo
	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

texinfo:
	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
	@echo
	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
	@echo "Run \`make' in that directory to run these through makeinfo" \
	      "(use \`make info' here to do that automatically)."

info:
	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
	@echo "Running Texinfo files through makeinfo..."
	make -C $(BUILDDIR)/texinfo info
	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

gettext:
	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
	@echo
	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."

changes:
	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
	@echo
	@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
	@echo
	@echo "Link check complete; look for any errors in the above output " \
	      "or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
	@echo "Testing of doctests in the sources finished, look at the " \
	      "results in $(BUILDDIR)/doctest/output.txt."

xml:
	$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
	@echo
	@echo "Build finished. The XML files are in $(BUILDDIR)/xml."

pseudoxml:
	$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
	@echo
	@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."


================================================
FILE: micropython/docs/accelerometer.rst
================================================
Accelerometer
*************

.. py:module:: microbit.accelerometer

This object gives you access to the on-board accelerometer. The accelerometer
also provides convenience functions for detecting gestures. The
recognised gestures are: ``up``, ``down``, ``left``, ``right``, ``face up``,
``face down``, ``freefall``, ``3g``, ``6g``, ``8g``, ``shake``.

By default MicroPython sets the accelerometer range to +/- 2g, changing the
accelerometer range is currently not possible in MicroPython.
The accelerometer returns a value in the range 0..1024 for each axis, which is
then scaled accordingly.

Functions
=========

.. py:function:: get_x()

    Get the acceleration measurement in the ``x`` axis, as a positive or
    negative integer, depending on the direction. The measurement is given in
    milli-g. By default the accelerometer is configured with a range of +/- 2g,
    and so this method will return within the range of +/- 2000mg.

.. py:function:: get_y()

    Get the acceleration measurement in the ``y`` axis, as a positive or
    negative integer, depending on the direction. The measurement is given in
    milli-g. By default the accelerometer is configured with a range of +/- 2g,
    and so this method will return within the range of +/- 2000mg.

.. py:function:: get_z()

    Get the acceleration measurement in the ``z`` axis, as a positive or
    negative integer, depending on the direction. The measurement is given in
    milli-g. By default the accelerometer is configured with a range of +/- 2g,
    and so this method will return within the range of +/- 2000mg.

.. py:function:: get_values()

    Get the acceleration measurements in all axes at once, as a three-element
    tuple of integers ordered as X, Y, Z.
    By default the accelerometer is configured with a range of +/- 2g, and so
    X, Y, and Z will be within the range of +/-2000mg.

.. py:function:: current_gesture()

    Return the name of the current gesture.

.. note::

    MicroPython understands the following gesture names: ``"up"``, ``"down"``,
    ``"left"``, ``"right"``, ``"face up"``, ``"face down"``, ``"freefall"``,
    ``"3g"``, ``"6g"``, ``"8g"``, ``"shake"``. Gestures are always
    represented as strings.

.. py:function:: is_gesture(name)

    Return True or False to indicate if the named gesture is currently active.

.. py:function:: was_gesture(name)

    Return True or False to indicate if the named gesture was active since the
    last call.

.. py:function:: get_gestures()

    Return a tuple of the gesture history. The most recent is listed last.
    Also clears the gesture history before returning.
    
.. note::

    Gestures are not updated in the background so there needs to be constant 
    calls to some accelerometer method to do the gesture detection. Usually 
    gestures can be detected using a loop with a small :func:`microbit.sleep` delay.

Examples
--------

A fortune telling magic 8-ball. Ask a question then shake the device for an
answer.

.. include:: ../examples/magic8.py
    :code: python

Simple Slalom. Move the device to avoid the obstacles.

.. include:: ../examples/simple_slalom.py
    :code: python


================================================
FILE: micropython/docs/audio.rst
================================================
Audio
*******

.. py:module:: audio

This module allows you play sounds from a speaker attached to the Microbit.
In order to use the audio module you will need to provide a sound source.

A sound source is an iterable (sequence, like list or tuple, or a generator) of
frames, each of 32 samples.
The ``audio`` modules plays samples at the rate of 7812.5 samples per second,
which means that it can reproduce frequencies up to 3.9kHz.

Functions
=========

.. py:function:: play(source, wait=True, pin=pin0, return_pin=None)

    Play the source to completion.

    ``source`` is an iterable, each element of which must be an ``AudioFrame``.

    If ``wait`` is ``True``, this function will block until the source is exhausted.

    ``pin`` specifies which pin the speaker is connected to.

    ``return_pin`` specifies a differential pin to connect to the speaker
    instead of ground.

Classes
=======

.. py:class::
    AudioFrame

    An ``AudioFrame`` object is a list of 32 samples each of which is a signed byte
    (whole number between -128 and 127).

    It takes just over 4 ms to play a single frame.

Using audio
===========

You will need a sound source, as input to the ``play`` function. You can generate your own, like in
``examples/waveforms.py``.


Technical Details
=================

.. note::
    You don't need to understand this section to use the ``audio`` module.
    It is just here in case you wanted to know how it works.

The ``audio`` module consumes samples at 7812.5 Hz, and uses linear interpolation to
output a PWM signal at 32.5 kHz, which gives tolerable sound quality.

The function ``play`` fully copies all data from each ``AudioFrame`` before it
calls ``next()`` for the next frame, so a sound source can use the same ``AudioFrame``
repeatedly.

The ``audio`` module has an internal 64 sample buffer from which it reads samples.
When reading reaches the start or the mid-point of the buffer, it triggers a callback to
fetch the next ``AudioFrame`` which is then copied into the buffer.
This means that a sound source has under 4ms to compute the next ``AudioFrame``,
and for reliable operation needs to take less 2ms (which is 32000 cycles, so should be plenty).


Example
=======

.. include:: ../examples/waveforms.py
    :code: python



================================================
FILE: micropython/docs/ble.rst
================================================
Bluetooth
*********

While the BBC micro:bit has hardware capable of allowing the device to work as
a Bluetooth Low Energy (BLE) device, it only has 16k of RAM. The BLE stack
alone takes up 12k RAM which means there's not enough memory for MicroPython
to support Bluetooth.

.. note::
    MicroPython uses the radio hardware with the :mod:`radio` module. This
    allows users to create simple yet effective wireless networks of micro:bit
    devices.

    Furthermore, the protocol used in the :mod:`radio` module is a lot simpler
    than BLE, making it far easier to use in an educational context.


================================================
FILE: micropython/docs/button.rst
================================================
Buttons
*******

.. py::module:: microbit

There are two buttons on the board, called ``button_a`` and ``button_b``.

Attributes
==========


.. py:attribute:: button_a

    A ``Button`` instance (see below) representing the left button.


.. py:attribute:: button_b

    Represents the right button.


Classes
=======

.. py:class:: Button()

    Represents a button.

    .. note::
        This class is not actually available to the user, it is only used by
        the two button instances, which are provided already initialized.


    .. py:method:: is_pressed()

        Returns ``True`` if the specified button ``button`` is currently being
        held down, and ``False`` otherwise.

    .. py:method:: was_pressed()

        Returns ``True`` or ``False`` to indicate if the button was pressed
        (went from up to down) since the device started or the last time this
        method was called.  Calling this method will clear the press state so
        that the button must be pressed again before this method will return
        ``True`` again.

    .. py:method:: get_presses()

        Returns the running total of button presses, and resets this total
        to zero before returning.

Example
=======

.. code::

    import microbit

    while True:
        if microbit.button_a.is_pressed() and microbit.button_b.is_pressed():
            microbit.display.scroll("AB")
            break
        elif microbit.button_a.is_pressed():
            microbit.display.scroll("A")
        elif microbit.button_b.is_pressed():
            microbit.display.scroll("B")
        microbit.sleep(100)


================================================
FILE: micropython/docs/compass.rst
================================================
Compass
*******

.. py:module:: microbit.compass

This module lets you access the built-in electronic compass. Before using,
the compass should be calibrated, otherwise the readings may be wrong.

.. warning::

    Calibrating the compass will cause your program to pause until calibration
    is complete. Calibration consists of a little game to draw a circle on the
    LED display by rotating the device.


Functions
=========

.. py:function:: calibrate()

    Starts the calibration process. An instructive message will be scrolled
    to the user after which they will need to rotate the device in order to
    draw a circle on the LED display.

.. py:function:: is_calibrated()

    Returns ``True`` if the compass has been successfully calibrated, and
    returns ``False`` otherwise.


.. py:function:: clear_calibration()

    Undoes the calibration, making the compass uncalibrated again.


.. py:function:: get_x()

    Gives the reading of the magnetic field strength on the ``x`` axis in nano 
    tesla, as a positive or negative integer, depending on the direction of the
    field.


.. py:function:: get_y()

    Gives the reading of the magnetic field strength on the ``y`` axis in nano 
    tesla, as a positive or negative integer, depending on the direction of the
    field.


.. py:function:: get_z()

    Gives the reading of the magnetic field strength on the ``z`` axis in nano 
    tesla, as a positive or negative integer, depending on the direction of the
    field.


.. py:function:: heading()

    Gives the compass heading, calculated from the above readings, as an
    integer in the range from 0 to 360, representing the angle in degrees,
    clockwise, with north as 0.


.. py:function:: get_field_strength()

    Returns an integer indication of the magnitude of the magnetic field around
    the device in nano tesla.


Example
=======

.. include:: ../examples/compass.py
    :code: python


================================================
FILE: micropython/docs/conf.py
================================================
# -*- coding: utf-8 -*-
#
# BBC Microbit Micropython documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 20 10:41:30 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import json

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.doctest',
    'sphinx.ext.intersphinx',
    'sphinx.ext.todo',
    'sphinx.ext.mathjax',
    'sphinx.ext.ifconfig',
    'sphinx.ext.viewcode',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix of source filenames.
source_suffix = '.rst'

# The encoding of source files.
#source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'BBC micro:bit MicroPython'
copyright = u'2015-2016, Multiple authors'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#

yotta_module = json.load(open('../module.json'))

# The short X.Y version.
version = yotta_module['version']
# The full version, including alpha/beta/rc tags.
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']

# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None

# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []

# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
# html_theme = 'default'

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}

# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []

# The name for this set of Sphinx documents.  If None, it defaults to
# "<project> v<release> documentation".
#html_title = None

# A shorter title for the navigation bar.  Default is the same as html_title.
#html_short_title = None

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None

# The name of an image file (within the static path) to use as favicon of the
# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}

# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}

# If false, no module index is generated.
#html_domain_indices = True

# If false, no index is generated.
#html_use_index = True

# If true, the index is split into individual pages for each letter.
#html_split_index = False

# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it.  The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''

# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'BBCMicrobitMicropythondoc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#'preamble': '',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
#  author, documentclass [howto, manual, or own class]).
latex_documents = [
  ('index', 'BBCMicrobitMicropython.tex', u'BBC micro:bit MicroPython Documentation',
   u'Multiple authors', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False

# If true, show page references after internal links.
#latex_show_pagerefs = False

# If true, show URL addresses after external links.
#latex_show_urls = False

# Documents to append as an appendix to all manuals.
#latex_appendices = []

# If false, no module index is generated.
#latex_domain_indices = True


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
    ('index', 'bbcmicrobitmicropython', u'BBC Microbit Micropython Documentation',
     [u'Multiple authors'], 1)
]

# If true, show URL addresses after external links.
#man_show_urls = False


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
#  dir menu entry, description, category)
texinfo_documents = [
  ('index', 'BBCMicrobitMicropython', u'BBC micro:bit MicroPython Documentation',
   u'Multiple authors', 'BBCMicrobitMicropython', 'One line description of project.',
   'Miscellaneous'),
]

# Documents to append as an appendix to all manuals.
#texinfo_appendices = []

# If false, no module index is generated.
#texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'

# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False


# -- Options for Epub output ----------------------------------------------

# Bibliographic Dublin Core info.
epub_title = u'BBC Microbit Micropython'
epub_author = u'Multiple authors'
epub_publisher = u'Multiple authors'
epub_copyright = u'2015, Multiple authors'

# The basename for the epub file. It defaults to the project name.
#epub_basename = u'BBC Microbit Micropython'

# The HTML theme for the epub output. Since the default themes are not optimized
# for small screen space, using the same theme for HTML and epub output is
# usually not wise. This defaults to 'epub', a theme designed to save visual
# space.
#epub_theme = 'epub'

# The language of the text. It defaults to the language option
# or en if the language is not set.
#epub_language = ''

# The scheme of the identifier. Typical schemes are ISBN or URL.
#epub_scheme = ''

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#epub_identifier = ''

# A unique identification for the text.
#epub_uid = ''

# A tuple containing the cover image and cover page html template filenames.
#epub_cover = ()

# A sequence of (type, uri, title) tuples for the guide element of content.opf.
#epub_guide = ()

# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_pre_files = []

# HTML files shat should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_post_files = []

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']

# The depth of the table of contents in toc.ncx.
#epub_tocdepth = 3

# Allow duplicate toc entries.
#epub_tocdup = True

# Choose between 'default' and 'includehidden'.
#epub_tocscope = 'default'

# Fix unsupported image types using the PIL.
#epub_fix_images = False

# Scale large images.
#epub_max_image_width = 0

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#epub_show_urls = 'inline'

# If false, no index is generated.
#epub_use_index = True


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}

# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd:  # only import and set the theme if we're building docs locally
    import sphinx_rtd_theme
    html_theme = 'sphinx_rtd_theme'
    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# otherwise, readthedocs.org uses their theme by default, so no need to specify it


================================================
FILE: micropython/docs/devguide/contributing.rst
================================================
Contributing
------------

Hey! Many thanks for wanting to improve MicroPython on the micro:bit.

Contributions are welcome without prejudice from *anyone* irrespective of
age, gender, religion, race or sexuality. Good quality code and engagement
with respect, humour and intelligence wins every time.

* If you're from a background which isn't well-represented in most geeky groups, get involved - *we want to help you make a difference*.
* If you're from a background which *is* well-represented in most geeky groups, get involved - *we want your help making a difference*.
* If you're worried about not being technical enough, get involved - *your fresh perspective will be invaluable*.
* If you think you're an imposter, get involved.
* If your day job isn't code, get involved.
* This isn't a group of experts, just people. Get involved!
* This is a new community, so, get involved.

We expect contributors to follow the Python Software Foundation's Code of
Conduct: https://www.python.org/psf/codeofconduct/

Feedback may be given for contributions and, where necessary, changes will
be politely requested and discussed with the originating author. Respectful
yet robust argument is most welcome.

Checklist
+++++++++

* Your code should be commented in *plain English* (British spelling).
* If your contribution is for a major block of work and you've not done so
  already, add yourself to the AUTHORS file following the convention found
  therein.
* If in doubt, ask a question. The only stupid question is the one that's never asked.
* Have fun!


================================================
FILE: micropython/docs/devguide/devfaq.rst
================================================
.. _devfaq:

=============
Developer FAQ
=============

.. note::

    This project is under active development. Please help other
    developers by adding tips, how-tos, and Q&A to this document.
    Thanks!

Where do I get a copy of the DAL? A: Ask Nicholas Tollervey for details.


================================================
FILE: micropython/docs/devguide/flashfirmware.rst
================================================
.. _flashfirmware:

=================
Flashing Firmware
=================

Building firmware
-----------------
Use yotta to build.

Use target bbc-microbit-classic-gcc-nosd::

  yt target bbc-microbit-classic-gcc-nosd

Run yotta update to fetch remote assets::

  yt up

Start the build with either yotta::

  yt build

...or use the Makefile::

  make all

The result is a microbit-micropython hex file (i.e. ``microbit-micropython.hex``)
found in the build/bbc-microbit-classic-gcc-nosd/source from the root of the
repository.

The Makefile does some extra preprocessing of the source, which is needed only
if you add new interned strings to ``qstrdefsport.h``. The Makefile also puts
the resulting firmware at build/firmware.hex, and includes some convenience
targets.

Preparing firmware and a Python program
---------------------------------------

tools/makecombined

hexlify



Flashing to the micro:bit
-------------------------




**Installation Scenarios**

* :ref:`Windows <microbit-windows>`
* :ref:`OS X <microbit-osx>`
* :ref:`Linux <microbit-linux>`
* :ref:`Debian and Ubuntu <microbit-debian-ubuntu>`
* :ref:`Red Hat Fedora/CentOS <microbit-redhat>`
* :ref:`Raspberry Pi <microbit-rpi>`


================================================
FILE: micropython/docs/devguide/hexformat.rst
================================================
.. _hexformat:

=================
Firmware Hex File
=================

When MicroPython is built, the compiler produces an
`Intel Hex <https://en.wikipedia.org/wiki/Intel_HEX>`_ file containing the
MicroPython firmware.
Additional data can then be added to this file to contain information about the
MicroPython version, or the Python code to execute on start-up.

The general memory layout used is:

- ``0x00000000``: Start of MicroPython firmware - up to 248 KBs
- ``0x0003e000``: Start of appended script (optional) - up to 8 Kbs
- ``0x100010c0``: UICR customer[16] register, start of MicroPython information - 28 bytes
    
.. note::
    If you append any data or modify the Intel Hex file, please ensure the
    addresses of the data stored progress in incremental order.
    If there is an address jump backwards DAPLink will fail to flash the file.

Appended script format
----------------------

MicroPython checks the first 2 bytes at address ``0x0003e000`` for a magic
string to indicate if there is an appended script. If the magic string is
found, it will automatically execute the Python code stored there, unless there
is a main.py file stored in the MicroPython filesystem.

- ``0x0003e000``: 2 bytes "MP"
- ``0x0003e002``: 2 bytes, little endian integer for the length (in bytes) of the appended script (not counting this 4 byte header)
- ``0x0003e004``: Script stored as bytes, for MicroPython to decode using utf-8.

UICR format
-----------

The User Information Configuration Registers (UICR) is a region of Non-Volatile
Memory available to store user-specific settings.
The first 128 Bytes are reserved, but we can use the other 128 Bytes to store
any arbitrary data.

MicroPython stores the following information, in little endian, starting from
the UICR customer[16] register:

- ``0x100010c0``: 4-byte integer with magic value ``0x17eeb07c``
- ``0x100010c4``: 4-byte integer with value ``0xffffffff``
- ``0x100010c8``: 4-byte integer with value ``0x0000000a`` (log base 2 of the flash page size, being 1024 bytes)
- ``0x100010ca``: 2-byte integer with value ``0x0000`` (start page of the firmware)
- ``0x100010cc``: 2-byte integer storing number of pages used by the firmware
- ``0x100010d0``: 4-byte integer with value ``0xffffffff``
- ``0x100010d4``: 4-byte integer with the address in the firmware of the version string
- ``0x100010d8``: 4-byte integer with value ``0x00000000``

Steps to create the firmware.hex file
-------------------------------------

The yotta tool is used to build MicroPython, but before that takes place
additional files have to be generated by the Makefile in preparation for the 
build, and additional data is added to the hex file after.

Running the ``make all`` command executes the following steps:

- The ``tools/makeversionhdr.py`` script creates the ``microbitversion.h`` file with macros containing build information
- Yotta builds the source and creates a bare hex file with just the firmware
- The ``tools/adduicr.py`` script adds the UICR to the bare hex
- The final hex file is placed in ``build/firmware.hex``
- The user can optionally append a script using ``tools/makecombinedhex.py`` (or other tools)


================================================
FILE: micropython/docs/devguide/installation.rst
================================================
.. _install-dev:

============
Installation
============

This section will help you set up the tools and programs needed for
developing programs and firmware to flash to the BBC micro:bit using MicroPython.

Dependencies
------------


Development Environment
-----------------------

You will need:

* git
* yotta

Depending on your operating system, the installation instructions vary. Use
the installation scenario that best suits your system.

Yotta will require an ARM mbed account.  It will walk you through signing up
if you are not registered.

Installation Scenarios
----------------------

* :ref:`Windows <microbit-windows>`
* :ref:`OS X <microbit-osx>`
* :ref:`Linux <microbit-linux>`
* :ref:`Debian and Ubuntu <microbit-debian-ubuntu>`
* :ref:`Red Hat Fedora/CentOS <microbit-redhat>`
* :ref:`Raspberry Pi <microbit-rpi>`


.. _microbit-windows:

Windows
~~~~~~~

When installing `Yotta
<http://yottadocs.mbed.com/>`_, make sure you have these components ticked to install.

- python
- gcc
- cMake
- ninja
- Yotta
- git-scm
- mbed serial driver



.. _microbit-osx:

OS X
~~~~


.. _microbit-linux:

Linux
~~~~~

These steps will cover the basic flavors of Linux and working with the
micro:bit and MicroPython. See also the specific sections for Raspberry Pi,
Debian/Ubuntu, and Red Hat Fedora/Centos.


.. _microbit-debian-ubuntu:

Debian and Ubuntu
^^^^^^^^^^^^^^^^^

::

  sudo add-apt-repository -y ppa:team-gcc-arm-embedded
  sudo add-apt-repository -y ppa:pmiller-opensource/ppa
  sudo apt-get update
  sudo apt-get install cmake ninja-build gcc-arm-none-eabi srecord libssl-dev
  pip3 install yotta


.. _microbit-redhat:

Red Hat Fedora/CentOS
^^^^^^^^^^^^^^^^^^^^^


.. _microbit-rpi:

Raspberry Pi
^^^^^^^^^^^^



.. _next-steps:

Next steps
----------

Congratulations. You have installed your development environment and are ready to
begin :ref:`flashing firmware <flashfirmware>`  to the micro:bit.


================================================
FILE: micropython/docs/devguide/repl.rst
================================================
.. _dev-repl:

==================
Accessing the REPL
==================

REPL (Read-Evaluate-Print-Loop) allows the micro:bit to read and evaluate code 
in real-time as you write it.

Accessing the REPL on the micro:bit will require you to:

* Determine the communication port identifier for the micro:bit
* Use a program to establish communication with the device

For versions of Windows before 10 you might need to install the Mbed serial 
driver, the instructions for which are found here:

https://os.mbed.com/docs/latest/tutorials/windows-serial-driver.html


Using a serial communication program
------------------------------------

The `Mu Editor <https://codewith.mu/en/tutorials/1.0/repl>`_ has built-in 
support for REPL and even includes a real-time data plotter. Some other common 
options are `picocom` and `screen`. You will need to install a program and 
read the appropriate documentation to understand the basics of connecting to a 
device.


Determining the port
--------------------

The micro:bit will have a port identifier (tty, usb) that can be used by the 
computer for communicating. Before connecting to the micro:bit we must 
determine the port identifier.

**Windows**

When you have installed the aforementioned drivers the micro:bit will appear in
device-manager as a COM port.

**Mac OS**

Open Terminal and type ``ls /dev/cu.*`` to see a list of connected serial 
devices; one of them will look like ``/dev/cu.usbmodem1422`` (the exact number 
will depend on your computer).

**Linux**

In terminal, type ``dmesg | tail`` which will show which ``/dev`` node the 
micro:bit was assigned (e.g. ``/dev/ttyUSB0``).


Communicating with the micro:bit
--------------------------------

Once you have found the port identifier you can use a serial terminal program 
to communicate with the micro:bit.

**Windows**

You may wish to use Tera Term, PuTTY, or another program.

In Tera Term:
	* Plug in the micro:bit and open Tera Term
	* Select Serial as the port
	* Go to Setup -> Serial port. Ensure the Port is the correct COM port.
	* Choose a baud rate of ``115200``, data 8 bits, parity none, stop 1 bit.

In PuTTY:
	* Plug in the micro:bit and open PuTTY
	* Switch the Connection Type to Serial
	* Ensure the Port is the correct COM port
	* Change the baud rate to ``115200``
	* Select 'Serial' on the menu on the left, then click 'Open'


**Mac OS**

Open Terminal and type ``screen /dev/cu.usbmodem1422 115200``, replacing
``/dev/cu.usbmodem1422`` with the port you found earlier. This will open the
micro:bit's serial output and show all messages received from the device.

To exit, press Ctrl-A then Ctrl-\\ and answer Yes to the question. There are
many ways back to a command prompt including Ctrl-A then Ctrl-D, which will
detach screen, but the serial port with still be locked, preventing other
applications from accessing it. You can then restart screen by typing
``screen -r``.


**Linux**

Using the ``screen`` program, type ``screen /dev/ttyUSB0 115200``, replacing
``/dev/ttyUSB0`` with the port you found earlier.

To exit, press Ctrl-A then \\ and answer Yes to the question. There are many
ways back to a command prompt including Ctrl-A then Ctrl-D, which will detach
screen. All serial output from the micro:bit will still be received by
``screen``, the serial port will be locked, preventing other applications from
accessing it. You can restart screen by typing ``screen -r``.

Using ``picocom``, type ``picocom /dev/ttyACM0 -b 115200``, again replacing
``/dev/ttyACM0`` with the port you found earlier.

To exit, press Ctrl-A then Ctrl-Q.


================================================
FILE: micropython/docs/display.rst
================================================
Display
*******

.. py:module:: microbit.display

This module controls the 5×5 LED display on the front of your board. It can
be used to display images, animations and even text.

.. image:: scroll-hello.gif

Functions
=========

.. py:function:: get_pixel(x, y)

    Return the brightness of the LED at column ``x`` and row ``y`` as an
    integer between 0 (off) and 9 (bright).


.. py:function:: set_pixel(x, y, value)

    Set the brightness of the LED at column ``x`` and row ``y`` to ``value``,
    which has to be an integer between 0 and 9.


.. py:function:: clear()

    Set the brightness of all LEDs to 0 (off).

.. py:function:: show(image)

    Display the ``image``.


.. py:function:: show(value, delay=400, \*, wait=True, loop=False, clear=False)

    If ``value`` is a string, float or integer, display letters/digits in sequence.
    Otherwise, if ``value`` is an iterable sequence of images, display these images in sequence.
    Each letter, digit or image is shown with ``delay`` milliseconds between them.

    If ``wait`` is ``True``, this function will block until the animation is
    finished, otherwise the animation will happen in the background.

    If ``loop`` is ``True``, the animation will repeat forever.

    If ``clear`` is ``True``, the display will be cleared after the iterable has finished.

    Note that the ``wait``, ``loop`` and ``clear`` arguments must be specified
    using their keyword.

.. note::

    If using a generator as the ``iterable``, then take care not to allocate any memory
    in the generator as allocating memory in an interrupt is prohibited and will raise a
    ``MemoryError``.

.. py:function:: scroll(value, delay=150, \*, wait=True, loop=False, monospace=False)

    Scrolls ``value`` horizontally on the display. If ``value`` is an integer or float it is
    first converted to a string using ``str()``. The ``delay`` parameter controls how fast
    the text is scrolling.

    If ``wait`` is ``True``, this function will block until the animation is
    finished, otherwise the animation will happen in the background.

    If ``loop`` is ``True``, the animation will repeat forever.

    If ``monospace`` is ``True``, the characters will all take up 5 pixel-columns
    in width, otherwise there will be exactly 1 blank pixel-column between each
    character as they scroll.

    Note that the ``wait``, ``loop`` and ``monospace`` arguments must be specified
    using their keyword.

.. py:function:: on()

    Use on() to turn on the display.

.. py:function:: off()

    Use off() to turn off the display (thus allowing you to re-use the GPIO
    pins associated with the display for other purposes).

.. py:function:: is_on()

    Returns ``True`` if the display is on, otherwise returns ``False``.

.. py:function:: read_light_level()

    Use the display's LEDs in reverse-bias mode to sense the amount of light
    falling on the display.  Returns an integer between 0 and 255 representing
    the light level, with larger meaning more light.

Example
=======

To continuously scroll a string across the display, and do it in the background,
you can use::

    import microbit

    microbit.display.scroll('Hello!', wait=False, loop=True)


================================================
FILE: micropython/docs/filesystem.rst
================================================
Local Persistent File System
****************************

It is useful to store data in a persistent manner so that it remains intact
between restarts of the device. On traditional computers this is often achieved
by a file system consisting of named files that hold raw data, and named
directories that contain files. Python supports the various operations needed
to work with such file systems.

However, since the micro:bit is a limited device in terms of both hardware and
storage capacity MicroPython provides a small subset of the functions needed
to persist data on the device. Because of memory constraints **there is
approximately 30k of storage available** on the file system.

.. warning::

    Re-flashing the device will DESTROY YOUR DATA.

    Since the file system is stored in the micro:bit's flash memory and
    flashing the device rewrites all the available flash memory then all your
    data will be lost if you flash your device.

    However, if you switch your device off the data will remain intact until
    you either delete it (see below) or re-flash the device.

MicroPython on the micro:bit provides a flat file system; i.e. there is no
notion of a directory hierarchy, the file system is just a list of named
files. Reading and writing a file is achieved via the standard Python ``open``
function and the resulting file-like object (representing the file) of types
``TextIO`` or ``BytesIO``. Operations for working with files on the file system
(for example, listing or deleting files) are contained within the
:py:mod:`os` module.

If a file ends in the ``.py`` file extension then it can be imported. For
example, a file named ``hello.py`` can be imported like this: ``import hello``.

An example session in the MicroPython REPL may look something like this::

    >>> with open('hello.py', 'w') as hello:
    ...    hello.write("print('Hello')")
    ...
    >>> import hello
    Hello
    >>> with open('hello.py') as hello:
    ...   print(hello.read())
    ...
    print('Hello')
    >>> import os
    >>> os.listdir()
    ['hello.py']
    >>> os.remove('hello.py')
    >>> os.listdir()
    []

.. py:function:: open(filename, mode='r')

    Returns a file object representing the file named in the argument
    ``filename``. The mode defaults to ``'r'`` which means open for reading in
    text mode. The other common mode is ``'w'`` for writing (overwriting the
    content of the file if it already exists). Two other modes are available
    to be used in conjunction with the ones describes above: ``'t'`` means
    text mode (for reading and writing strings) and ``'b'`` means binary mode
    (for reading and writing bytes). If these are not specified then ``'t'``
    (text mode) is assumed. When in text mode the file object will be an
    instance of ``TextIO``. When in binary mode the file object will be an
    instance of ``BytesIO``. For example, use ``'rb'`` to read binary data from
    a file.


.. py:class::
    TextIO
    BytesIO

    Instances of these classes represent files in the micro:bit's flat file
    system. The TextIO class is used to represent text files. The BytesIO
    class is used to represent binary files. They work in exactly the same
    except that TextIO works with strings and BytesIO works with bytes.

    You do not directly instantiate these classes. Rather, an appropriately
    configured instance of the class is returned by the ``open`` function
    described above.

    .. py:method:: close()

        Flush and close the file. This method has no effect if the file is
        already closed. Once the file is closed, any operation on the file
        (e.g. reading or writing) will raise an exception.

    .. py:method:: name()

        Returns the name of the file the object represents. This will be the
        same as the ``filename`` argument passed into the call to the ``open``
        function that instantiated the object.

    .. py:method:: read(size)

        Read and return at most ``size`` characters as a single string or
        ``size`` bytes from the file. As a convenience, if ``size`` is
        unspecified or -1, all the data contained in the file is returned.
        Fewer than ``size`` characters or bytes may be returned if there are
        less than ``size`` characters or bytes remaining to be read from
        the file.

        If 0 characters or bytes are returned, and ``size`` was not 0, this
        indicates end of file.

        A ``MemoryError`` exception will occur if ``size`` is larger than the
        available RAM.

    .. py:method:: readinto(buf, n=-1)

        Read characters or bytes into the buffer ``buf``. If ``n`` is supplied,
        read ``n`` number of bytes or characters into the buffer ``buf``.

    .. py:method:: readline(size)

        Read and return one line from the file. If ``size`` is specified, at
        most ``size`` characters will be read.

        The line terminator is always ``'\n'`` for strings or ``b'\n'`` for
        bytes.

    .. py:method:: writable()

        Return ``True`` if the file supports writing. If ``False``, ``write()``
        will raise ``OSError``.

    .. py:method:: write(buf)

        Write the string or bytes ``buf`` to the file and return the number of
        characters or bytes written.


================================================
FILE: micropython/docs/i2c.rst
================================================
I²C
***

.. py:module:: microbit.i2c

The ``i2c`` module lets you communicate with devices connected to your board
using the I²C bus protocol. There can be multiple slave devices connected at
the same time, and each one has its own unique address, that is either fixed
for the device or configured on it. Your board acts as the I²C master.

We use 7-bit addressing for devices because of the reasons stated
`here <http://www.totalphase.com/support/articles/200349176-7-bit-8-bit-and-10-bit-I2C-Slave-Addressing>`_.

This may be different to other micro:bit related solutions.

How exactly you should communicate with the devices, that is, what bytes to
send and how to interpret the responses, depends on the device in question and
should be described separately in that device's documentation.


Functions
=========

.. py:function:: init(freq=100000, sda=pin20, scl=pin19)

    Re-initialize peripheral with the specified clock frequency ``freq`` on the
    specified ``sda`` and ``scl`` pins.

    .. warning::

        Changing the I²C pins from defaults will make the accelerometer and
        compass stop working, as they are connected internally to those pins.


.. py:function:: scan()

    Scan the bus for devices.  Returns a list of 7-bit addresses corresponding
    to those devices that responded to the scan.


.. py:function:: read(addr, n, repeat=False)

    Read ``n`` bytes from the device with 7-bit address ``addr``. If ``repeat``
    is ``True``, no stop bit will be sent.


.. py:function:: write(addr, buf, repeat=False)

    Write bytes from ``buf`` to the device with 7-bit address ``addr``. If
    ``repeat`` is ``True``, no stop bit will be sent.


Connecting
----------

You should connect the device's ``SCL`` pin to micro:bit pin 19, and the
device's ``SDA`` pin to micro:bit pin 20. You also must connect the device's
ground to the micro:bit ground (pin ``GND``). You may need to power the device
using an external power supply or the micro:bit.

There are internal pull-up resistors on the I²C lines of the board, but with
particularly long wires or large number of devices you may need to add
additional pull-up resistors, to ensure noise-free communication.


================================================
FILE: micropython/docs/image.rst
================================================
Image
*****

.. py:module:: microbit

The ``Image`` class is used to create images that can be displayed easily on
the device's LED matrix. Given an image object it's possible to display it via
the ``display`` API::

    display.show(Image.HAPPY)

.. image:: image-smile.png

There are four ways in which you can construct an image:

- ``Image()`` - Create a blank 5x5 image

- ``Image(string)`` - Create an image by parsing the string, a single character
  returns that glyph

- ``Image(width, height)`` - Create a blank image of given size

- ``Image(width, height, buffer)`` - Create an image from the given buffer


Classes
=======

.. py:class::
    Image(string)
    Image(width=None, height=None, buffer=None)

    If ``string`` is used, it has to consist of digits 0-9 arranged into
    lines, describing the image, for example::

        image = Image("90009:"
                      "09090:"
                      "00900:"
                      "09090:"
                      "90009")

    will create a 5×5 image of an X. The end of a line is indicated by a colon.
    It's also possible to use a newline (\n) to indicate the end of a line
    like this::

        image = Image("90009\n"
                      "09090\n"
                      "00900\n"
                      "09090\n"
                      "90009")

    The other form creates an empty image with ``width`` columns and
    ``height`` rows. Optionally ``buffer`` can be an array of
    ``width``×``height`` integers in range 0-9 to initialize the image::
   
        Image(2, 2, b'\x08\x08\x08\x08')

    or::

    	Image(2, 2, bytearray([9,9,9,9]))
	
    Will create a 2 x 2 pixel image at full brightness.
    
    .. note::
    
        Keyword arguments cannot be passed to ``buffer``.

    .. py:method:: width()

        Return the number of columns in the image.


    .. py:method:: height()

        Return the numbers of rows in the image.


    .. py:method:: set_pixel(x, y, value)

        Set the brightness of the pixel at column ``x`` and row ``y`` to the
        ``value``, which has to be between 0 (dark) and 9 (bright).

        This method will raise an exception when called on any of the built-in
        read-only images, like ``Image.HEART``.


    .. py:method:: get_pixel(x, y)

        Return the brightness of pixel at column ``x`` and row ``y`` as an
        integer between 0 and 9.


    .. py:method:: shift_left(n)

        Return a new image created by shifting the picture left by ``n``
        columns.


    .. py:method:: shift_right(n)

        Same as ``image.shift_left(-n)``.

    .. py:method:: shift_up(n)

        Return a new image created by shifting the picture up by ``n`` rows.


    .. py:method:: shift_down(n)

        Same as ``image.shift_up(-n)``.

    .. py:method:: crop(x, y, w, h)

        Return a new image by cropping the picture to a width of ``w`` and a
	height of ``h``, starting with the pixel at column ``x`` and row ``y``.

    .. py:method:: copy()

        Return an exact copy of the image.

    .. py:method:: invert()

        Return a new image by inverting the brightness of the pixels in the
        source image.

    .. py:method:: fill(value)

        Set the brightness of all the pixels in the image to the
        ``value``, which has to be between 0 (dark) and 9 (bright).

        This method will raise an exception when called on any of the built-in
        read-only images, like ``Image.HEART``.

    .. py:method:: blit(src, x, y, w, h, xdest=0, ydest=0)

        Copy the rectangle defined by ``x``, ``y``, ``w``, ``h`` from the image ``src`` into
        this image at ``xdest``, ``ydest``.
        Areas in the source rectangle, but outside the source image are treated as having a value of 0.

        ``shift_left()``, ``shift_right()``, ``shift_up()``, ``shift_down()`` and ``crop()``
        can are all implemented by using ``blit()``.
        For example, img.crop(x, y, w, h) can be implemented as::

            def crop(self, x, y, w, h):
                res = Image(w, h)
                res.blit(self, x, y, w, h)
                return res


Attributes
==========

The ``Image`` class also has the following built-in instances of itself
included as its attributes (the attribute names indicate what the image
represents):

    * ``Image.HEART``
    * ``Image.HEART_SMALL``
    * ``Image.HAPPY``
    * ``Image.SMILE``
    * ``Image.SAD``
    * ``Image.CONFUSED``
    * ``Image.ANGRY``
    * ``Image.ASLEEP``
    * ``Image.SURPRISED``
    * ``Image.SILLY``
    * ``Image.FABULOUS``
    * ``Image.MEH``
    * ``Image.YES``
    * ``Image.NO``
    * ``Image.CLOCK12``, ``Image.CLOCK11``, ``Image.CLOCK10``, ``Image.CLOCK9``,
      ``Image.CLOCK8``, ``Image.CLOCK7``, ``Image.CLOCK6``, ``Image.CLOCK5``,
      ``Image.CLOCK4``, ``Image.CLOCK3``, ``Image.CLOCK2``, ``Image.CLOCK1``
    * ``Image.ARROW_N``, ``Image.ARROW_NE``, ``Image.ARROW_E``,
      ``Image.ARROW_SE``, ``Image.ARROW_S``, ``Image.ARROW_SW``,
      ``Image.ARROW_W``, ``Image.ARROW_NW``
    * ``Image.TRIANGLE``
    * ``Image.TRIANGLE_LEFT``
    * ``Image.CHESSBOARD``
    * ``Image.DIAMOND``
    * ``Image.DIAMOND_SMALL``
    * ``Image.SQUARE``
    * ``Image.SQUARE_SMALL``
    * ``Image.RABBIT``
    * ``Image.COW``
    * ``Image.MUSIC_CROTCHET``
    * ``Image.MUSIC_QUAVER``
    * ``Image.MUSIC_QUAVERS``
    * ``Image.PITCHFORK``
    * ``Image.XMAS``
    * ``Image.PACMAN``
    * ``Image.TARGET``
    * ``Image.TSHIRT``
    * ``Image.ROLLERSKATE``
    * ``Image.DUCK``
    * ``Image.HOUSE``
    * ``Image.TORTOISE``
    * ``Image.BUTTERFLY``
    * ``Image.STICKFIGURE``
    * ``Image.GHOST``
    * ``Image.SWORD``
    * ``Image.GIRAFFE``
    * ``Image.SKULL``
    * ``Image.UMBRELLA``
    * ``Image.SNAKE``

Finally, related collections of images have been grouped together::

    * ``Image.ALL_CLOCKS``
    * ``Image.ALL_ARROWS``


Operations
==========

.. code::

    repr(image)

Get a compact string representation of the image.

.. code::

    str(image)

Get a readable string representation of the image.

.. code::

    image1 + image2

Create a new image by adding the brightness values from the two images for
each pixel.

.. code::

    image * n

Create a new image by multiplying the brightness of each pixel by ``n``.


================================================
FILE: micropython/docs/index.rst
================================================
.. BBC Microbit Micropython documentation master file, created by
   sphinx-quickstart on Tue Oct 20 10:41:30 2015.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

BBC micro:bit MicroPython documentation
=======================================

Welcome!

The BBC micro:bit is a small computing device for children. One of the
languages it understands is the popular Python programming language. The
version of Python that runs on the BBC micro:bit is called MicroPython.

This documentation includes lessons for teachers
and API documentation for developers (check out the index on the left). We hope
you enjoy developing for the BBC micro:bit using MicroPython.

If you're a new programmer, teacher or unsure where to start, begin with the tutorials.

.. image:: comic.png

.. note::

    This project is under active development. Please help other
    developers by adding tips, how-tos, and Q&A to this document.
    Thanks!

Projects related to MicroPython on the BBC micro:bit include:

* `Mu <https://github.com/ntoll/mu>`_ - a simple code editor for kids, teachers and beginner programmers. Probably the easiest way for people to program MicroPython on the BBC micro:bit.
* `uFlash <https://uflash.readthedocs.io/en/latest/>`_ - a command line tool for flashing raw Python scripts onto a BBC micro:bit.

.. toctree::
    :maxdepth: 2
    :caption: Tutorials

    tutorials/introduction
    tutorials/hello
    tutorials/images
    tutorials/buttons
    tutorials/io
    tutorials/music
    tutorials/random
    tutorials/movement
    tutorials/gestures
    tutorials/direction
    tutorials/storage
    tutorials/speech
    tutorials/network
    tutorials/radio
    tutorials/next

.. toctree::
   :maxdepth: 2
   :caption: API Reference

   microbit_micropython_api.rst
   microbit.rst
   accelerometer.rst
   audio.rst
   ble.rst
   button.rst
   compass.rst
   display.rst
   filesystem.rst
   i2c.rst
   image.rst
   machine.rst
   micropython.rst
   music.rst
   neopixel.rst
   os.rst
   pin.rst
   radio.rst
   random.rst
   speech.rst
   spi.rst
   uart.rst
   utime.rst

.. toctree::
   :maxdepth: 2
   :caption: Developer Guide

   devguide/installation
   devguide/flashfirmware
   devguide/repl
   devguide/hexformat
   devguide/devfaq
   devguide/contributing

.. toctree::
   :maxdepth: 2
   :caption: Indices and tables

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


================================================
FILE: micropython/docs/machine.rst
================================================
..
   MicroPython license information
   ===============================

   The MIT License (MIT)

   Copyright (c) 2013-2017 Damien P. George, and others

   Permission is hereby granted, free of charge, to any person obtaining a copy
   of this software and associated documentation files (the "Software"), to deal
   in the Software without restriction, including without limitation the rights
   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   copies of the Software, and to permit persons to whom the Software is
   furnished to do so, subject to the following conditions:

   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
   THE SOFTWARE.
   
   
Machine
*******

.. py:module:: machine

The machine module contains specific functions related to the micro:bit 
hardware. Most functions in this module allow to achieve direct and 
unrestricted access to and control of hardware blocks on a system (like CPU, 
timers, buses, etc.). Used incorrectly, this can lead to malfunction, lockups, 
crashes of your board, and in extreme cases, hardware damage.


Functions
=========

.. method:: machine.unique_id()

    Returns a byte string with a unique identifier of a board. It will vary 
    from one board instance to another.


.. method:: machine.reset()

    Resets the device in a manner similar to pushing the external RESET button.


.. method:: machine.freq()

    Returns CPU frequency in hertz.


.. method:: machine.disable_irq()

    Disable interrupt requests. Returns the previous IRQ state which should be 
    considered an opaque value. This return value should be passed to the 
    :func:`machine.enable_irq()` function to restore interrupts to their 
    original state, before :func:`machine.disable_irq()` was called.


.. method:: machine.enable_irq()

    Re-enable interrupt requests. The *state* parameter should be the value 
    that was returned from the most recent call to the
    :func:`machine.disable_irq()` function.


.. method:: machine.time_pulse_us(pin, pulse_level, timeout_us=1000000)

    Time a pulse on the given *pin*, and return the duration of the pulse in 
    microseconds. The *pulse_level* argument should be 0 to time a low pulse or
    1 to time a high pulse.

    If the current input value of the pin is different to *pulse_level*, the 
    function first (*) waits until the pin input becomes equal to 
    *pulse_level*, then (**) times the duration that the pin is equal to 
    *pulse_level*. If the pin is already equal to *pulse_level* then timing 
    starts straight away.

    The function will return -2 if there was timeout waiting for condition 
    marked (*) above, and -1 if there was timeout during the main measurement, 
    marked (**) above. The timeout is the same for both cases and given by 
    *timeout_us* (which is in microseconds).


Reading Memory
==============

The ``machine`` module allows you to read from the device's memory, getting 1 
byte (8 bits; ``mem8``), 2 byte (16 bits; ``mem16``), or 4 byte (32 bits; 
``mem32``) words from physical addresses. For example: ``mem8[0x00]`` reads 1 
byte on physical address ``0x00``. This has a number of uses, for example if 
you'd like to read data from the nRF51 registers.

================================================
FILE: micropython/docs/make.bat
================================================
@ECHO OFF

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
	set SPHINXBUILD=sphinx-build
)
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" (
	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
	set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
)

if "%1" == "" goto help

if "%1" == "help" (
	:help
	echo.Please use `make ^<target^>` where ^<target^> is one of
	echo.  html       to make standalone HTML files
	echo.  dirhtml    to make HTML files named index.html in directories
	echo.  singlehtml to make a single large HTML file
	echo.  pickle     to make pickle files
	echo.  json       to make JSON files
	echo.  htmlhelp   to make HTML files and a HTML help project
	echo.  qthelp     to make HTML files and a qthelp project
	echo.  devhelp    to make HTML files and a Devhelp project
	echo.  epub       to make an epub
	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
	echo.  text       to make text files
	echo.  man        to make manual pages
	echo.  texinfo    to make Texinfo files
	echo.  gettext    to make PO message catalogs
	echo.  changes    to make an overview over all changed/added/deprecated items
	echo.  xml        to make Docutils-native XML files
	echo.  pseudoxml  to make pseudoxml-XML files for display purposes
	echo.  linkcheck  to check all external links for integrity
	echo.  doctest    to run all doctests embedded in the documentation if enabled
	goto end
)

if "%1" == "clean" (
	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
	del /q /s %BUILDDIR%\*
	goto end
)


%SPHINXBUILD% 2> nul
if errorlevel 9009 (
	echo.
	echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
	echo.installed, then set the SPHINXBUILD environment variable to point
	echo.to the full path of the 'sphinx-build' executable. Alternatively you
	echo.may add the Sphinx directory to PATH.
	echo.
	echo.If you don't have Sphinx installed, grab it from
	echo.http://sphinx-doc.org/
	exit /b 1
)

if "%1" == "html" (
	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
	goto end
)

if "%1" == "dirhtml" (
	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
	goto end
)

if "%1" == "singlehtml" (
	%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
	goto end
)

if "%1" == "pickle" (
	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can process the pickle files.
	goto end
)

if "%1" == "json" (
	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can process the JSON files.
	goto end
)

if "%1" == "htmlhelp" (
	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
	goto end
)

if "%1" == "qthelp" (
	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\BBCMicrobitMicropython.qhcp
	echo.To view the help file:
	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\BBCMicrobitMicropython.ghc
	goto end
)

if "%1" == "devhelp" (
	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished.
	goto end
)

if "%1" == "epub" (
	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The epub file is in %BUILDDIR%/epub.
	goto end
)

if "%1" == "latex" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "latexpdf" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	cd %BUILDDIR%/latex
	make all-pdf
	cd %BUILDDIR%/..
	echo.
	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "latexpdfja" (
	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
	cd %BUILDDIR%/latex
	make all-pdf-ja
	cd %BUILDDIR%/..
	echo.
	echo.Build finished; the PDF files are in %BUILDDIR%/latex.
	goto end
)

if "%1" == "text" (
	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The text files are in %BUILDDIR%/text.
	goto end
)

if "%1" == "man" (
	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The manual pages are in %BUILDDIR%/man.
	goto end
)

if "%1" == "texinfo" (
	%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
	goto end
)

if "%1" == "gettext" (
	%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
	goto end
)

if "%1" == "changes" (
	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
	if errorlevel 1 exit /b 1
	echo.
	echo.The overview file is in %BUILDDIR%/changes.
	goto end
)

if "%1" == "linkcheck" (
	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
	if errorlevel 1 exit /b 1
	echo.
	echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
	goto end
)

if "%1" == "doctest" (
	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
	if errorlevel 1 exit /b 1
	echo.
	echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
	goto end
)

if "%1" == "xml" (
	%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The XML files are in %BUILDDIR%/xml.
	goto end
)

if "%1" == "pseudoxml" (
	%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
	if errorlevel 1 exit /b 1
	echo.
	echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
	goto end
)

:end


================================================
FILE: micropython/docs/microbit.rst
================================================
Microbit Module
***************

.. py:module:: microbit


The ``microbit`` module gives you access to all the hardware that is built-in
into your board.


Functions
=========

.. py:function:: panic(n)

    Enter a panic mode. Requires restart. Pass in an arbitrary integer <= 255
    to indicate a status::

        microbit.panic(255)


.. py:function:: reset()

    Restart the board.


.. py:function:: sleep(n)

    Wait for ``n`` milliseconds. One second is 1000 milliseconds, so::

        microbit.sleep(1000)

    will pause the execution for one second.  ``n`` can be an integer or
    a floating point number.


.. py:function:: running_time()

    Return the number of milliseconds since the board was switched on or
    restarted.


.. py:function:: temperature()

    Return the temperature of the micro:bit in degrees Celcius.


Attributes
==========

.. toctree::
    :maxdepth: 1

    button.rst
    pin.rst


Classes
=======

.. toctree::
    :maxdepth: 1

    image.rst


Modules
=======

.. toctree::
    :maxdepth: 1

    display.rst
    uart.rst
    spi.rst
    i2c.rst
    accelerometer.rst
    compass.rst


================================================
FILE: micropython/docs/microbit_micropython_api.rst
================================================
micro:bit Micropython API
*************************

The microbit module
===================

Everything directly related to interacting with the hardware lives in the `microbit` module.  For ease of use it's recommended you start all scripts with::

    from microbit import *

The following documentation assumes you have done this.

There are a few functions available directly::

    # sleep for the given number of milliseconds.
    sleep(ms)
    # returns the number of milliseconds since the micro:bit was last switched on.
    running_time()
    # makes the micro:bit enter panic mode (this usually happens when the DAL runs
    # out of memory, and causes a sad face to be drawn on the display). The error
    # code can be any arbitrary integer value.
    panic(error_code)
    # resets the micro:bit.
    reset()

The rest of the functionality is provided by objects and classes in the microbit module, as described below.

Note that the API exposes integers only (ie no floats are needed, but they may be accepted).  We thus use milliseconds for the standard time unit.

.. note::
    You can see a list of all available modules by writing ``help('modules')`` in the REPL.

Buttons
-------

There are 2 buttons::

    button_a
    button_b

These are both objects and have the following methods::

    # returns True or False to indicate if the button is pressed at the time of
    # the method call.
    button.is_pressed()
    # returns True or False to indicate if the button was pressed since the device
    # started or the last time this method was called.
    button.was_pressed()
    # returns the running total of button presses, and resets this counter to zero
    button.get_presses()

The LED display
---------------

The LED display is exposed via the `display` object::

    # gets the brightness of the pixel (x,y). Brightness can be from 0 (the pixel
    # is off) to 9 (the pixel is at maximum brightness).
    display.get_pixel(x, y)
    # sets the brightness of the pixel (x,y) to val (between 0 [off] and 9 [max
    # brightness], inclusive).
    display.set_pixel(x, y, val)
    # clears the display.
    display.clear()
    # shows the image.
    display.show(image, delay=0, wait=True, loop=False, clear=False)
    # shows each image or letter in the iterable, with delay ms. in between each.
    display.show(iterable, delay=400, wait=True, loop=False, clear=False)
    # scrolls a string across the display (more exciting than display.show for
    # written messages).
    display.scroll(string, delay=400)

Pins
----

Provide digital and analog input and output functionality, for the pins in the connector. Some pins are connected internally to the I/O that drives the LED matrix and the buttons.

Each pin is provided as an object directly in the ``microbit`` module.  This keeps the API relatively flat, making it very easy to use:

    * pin0
    * pin1
    * ...
    * pin15
    * pin16
    * *Warning: P17-P18 (inclusive) are unavailable.*
    * pin19
    * pin20

Each of these pins are instances of the ``MicroBitPin`` class, which offers the following API::

    # value can be 0, 1, False, True
    pin.write_digital(value)
    # returns either 1 or 0
    pin.read_digital()
    # value is between 0 and 1023
    pin.write_analog(value)
    # returns an integer between 0 and 1023
    pin.read_analog()
    # sets the period of the PWM output of the pin in milliseconds
    # (see https://en.wikipedia.org/wiki/Pulse-width_modulation)
    pin.set_analog_period(int)
    # sets the period of the PWM output of the pin in microseconds
    # (see https://en.wikipedia.org/wiki/Pulse-width_modulation)
    pin.set_analog_period_microseconds(int)
    # returns boolean
    pin.is_touched()

Images
------

.. note::

    You don't always need to create one of these yourself - you can access the
    image shown on the display directly with `display.image`. `display.image`
    is just an instance of `Image`, so you can use all of the same methods.

Images API::

    # creates an empty 5x5 image
    image = Image()
    # create an image from a string - each character in the string represents an
    # LED - 0 (or space) is off and 9 is maximum brightness. The colon ":"
    # indicates the end of a line.
    image = Image('90009:09090:00900:09090:90009:')
    # create an empty image of given size
    image = Image(width, height)
    # initialises an Image with the specified width and height. The buffer
    # should be an array of length width * height
    image = Image(width, height, buffer)

    # methods
    # returns the image's width (most often 5)
    image.width()
    # returns the image's height (most often 5)
    image.height()
    # sets the pixel at the specified position (between 0 and 9). May fail for
    # constant images.
    image.set_pixel(x, y, value)
    # gets the pixel at the specified position (between 0 and 9)
    image.get_pixel(x, y)
    # returns a new image created by shifting the picture left 'n' times.
    image.shift_left(n)
    # returns a new image created by shifting the picture right 'n' times.
    image.shift_right(n)
    # returns a new image created by shifting the picture up 'n' times.
    image.shift_up(n)
    # returns a new image created by shifting the picture down 'n' times.
    image.shift_down(n)
    # get a compact string representation of the image
    repr(image)
    # get a more readable string representation of the image
    str(image)

    #operators
    # returns a new image created by superimposing the two images
    image + image
    # returns a new image created by multiplying the brightness of each pixel by n
    image * n

    # built-in images.
    Image.HEART
    Image.HEART_SMALL
    Image.HAPPY
    Image.SMILE
    Image.SAD
    Image.CONFUSED
    Image.ANGRY
    Image.ASLEEP
    Image.SURPRISED
    Image.SILLY
    Image.FABULOUS
    Image.MEH
    Image.YES
    Image.NO
    Image.CLOCK12 # clock at 12 o' clock
    Image.CLOCK11
    ... # many clocks (Image.CLOCKn)
    Image.CLOCK1 # clock at 1 o'clock
    Image.ARROW_N
    ... # arrows pointing N, NE, E, SE, S, SW, W, NW (microbit.Image.ARROW_direction)
    Image.ARROW_NW
    Image.TRIANGLE
    Image.TRIANGLE_LEFT
    Image.CHESSBOARD
    Image.DIAMOND
    Image.DIAMOND_SMALL
    Image.SQUARE
    Image.SQUARE_SMALL
    Image.RABBIT
    Image.COW
    Image.MUSIC_CROTCHET
    Image.MUSIC_QUAVER
    Image.MUSIC_QUAVERS
    Image.PITCHFORK
    Image.XMAS
    Image.PACMAN
    Image.TARGET
    Image.TSHIRT
    Image.ROLLERSKATE
    Image.DUCK
    Image.HOUSE
    Image.TORTOISE
    Image.BUTTERFLY
    Image.STICKFIGURE
    Image.GHOST
    Image.SWORD
    Image.GIRAFFE
    Image.SKULL
    Image.UMBRELLA
    Image.SNAKE
    # built-in lists - useful for animations, e.g. display.show(Image.ALL_CLOCKS)
    Image.ALL_CLOCKS
    Image.ALL_ARROWS

The accelerometer
-----------------

The accelerometer is accessed via the ``accelerometer`` object::

    # read the X axis of the device. Measured in milli-g.
    accelerometer.get_x()
    # read the Y axis of the device. Measured in milli-g.
    accelerometer.get_y()
    # read the Z axis of the device. Measured in milli-g.
    accelerometer.get_z()
    # get tuple of all three X, Y and Z readings (listed in that order).
    accelerometer.get_values()
    # return the name of the current gesture.
    accelerometer.current_gesture()
    # return True or False to indicate if the named gesture is currently active.
    accelerometer.is_gesture(name)
    # return True or False to indicate if the named gesture was active since the
    # last call.
    accelerometer.was_gesture(name)
    # return a tuple of the gesture history. The most recent is listed last.
    accelerometer.get_gestures()

The recognised gestures are: ``up``, ``down``, ``left``, ``right``, ``face up``, ``face down``, ``freefall``, ``3g``, ``6g``, ``8g``, ``shake``.


The compass
-----------

The compass is accessed via the `compass` object::

    # calibrate the compass (this is needed to get accurate readings).
    compass.calibrate()
    # return a numeric indication of degrees offset from "north".
    compass.heading()
    # return an numeric indication of the strength of magnetic field around
    # the micro:bit.
    compass.get_field_strength()
    # returns True or False to indicate if the compass is calibrated.
    compass.is_calibrated()
    # resets the compass to a pre-calibration state.
    compass.clear_calibration()

I2C bus
-------

There is an I2C bus on the micro:bit that is exposed via the `i2c` object.  It has the following methods::

    # read n bytes from device with addr; repeat=True means a stop bit won't
    # be sent.
    i2c.read(addr, n, repeat=False)
    # write buf to device with addr; repeat=True means a stop bit won't be sent.
    i2c.write(addr, buf, repeat=False)

UART
----

Use ``uart`` to communicate with a serial device connected to the device's I/O pins::

    # set up communication (use pins 0 [TX] and 1 [RX]) with a baud rate of 9600.
    uart.init()
    # return True or False to indicate if there are incoming characters waiting to
    # be read.
    uart.any()
    # return (read) n incoming characters.
    uart.read(n)
    # return (read) as much incoming data as possible.
    uart.read()
    # return (read) all the characters to a newline character is reached.
    uart.readline()
    # read bytes into the referenced buffer.
    uart.readinto(buffer)
    # write bytes from the buffer to the connected device.
    uart.write(buffer)


================================================
FILE: micropython/docs/micropython.rst
================================================
..
   MicroPython license information
   ===============================

   The MIT License (MIT)

   Copyright (c) 2013-2017 Damien P. George, and others

   Permission is hereby granted, free of charge, to any person obtaining a copy
   of this software and associated documentation files (the "Software"), to deal
   in the Software without restriction, including without limitation the rights
   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   copies of the Software, and to permit persons to whom the Software is
   furnished to do so, subject to the following conditions:

   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
   THE SOFTWARE.


MicroPython
***********

.. py:module:: micropython

Access and control MicroPython internals.

Functions
=========

.. py:function:: micropython.const(expr)

    Used to declare that the expression is a constant so that the compiler can 
    optimise it. The use of this function should be as follows:

    .. code-block:: python

        from micropython import const
        CONST_X = const(123)
        CONST_Y = const(2 * CONST_X + 1)

    Constants declared this way are still accessible as global variables from 
    outside the module they are declared in. On the other hand, if a constant 
    begins with an underscore then it is hidden, it is not available as a 
    global variable, and does not take up any memory during execution.


.. py:function:: micropython.opt_level([level])

    If level is given then this function sets the optimisation level for 
    subsequent compilation of scripts, and returns None. Otherwise it returns 
    the current optimisation level.

    The optimisation level controls the following compilation features:

    *   Assertions: at level 0 assertion statements are enabled and compiled 
        into the bytecode; at levels 1 and higher assertions are not compiled.

    *   Built-in ``__debug__`` variable: at level 0 this variable expands to 
        True; at levels 1 and higher it expands to False.

    *   Source-code line numbers: at levels 0, 1 and 2 source-code line number 
        are stored along with the bytecode so that exceptions can report the 
        line number they occurred at; at levels 3 and higher line numbers are 
        not stored.

    The default optimisation level is usually level 0.


.. py:function:: micropython.mem_info([verbose])

    Print information about currently used memory. If the verbose argument is 
    given then extra information is printed.


.. py:function:: micropython.qstr_info([verbose])

    Print information about currently interned strings. If the verbose argument
    is given then extra information is printed.

    This includes the number of interned strings and the amount of RAM they 
    use. In verbose mode it prints out the names of all RAM-interned strings.


.. py:function:: micropython.stack_use()

    Return an integer representing the current amount of stack that is being 
    used. The absolute value of this is not particularly useful, rather it 
    should be used to compute differences in stack usage at different points.


.. py:function:: micropython.heap_lock()


.. py:function:: micropython.heap_unlock()

    Lock or unlock the heap. When locked no memory allocation can occur and a 
    ``MemoryError`` will be raised if any heap allocation is attempted.


.. py:function:: micropython.kbd_intr(chr)

    Set the character that will raise a KeyboardInterrupt exception. By default
    this is set to 3 during script execution, corresponding to Ctrl-C. Passing 
    -1 to this function will disable capture of Ctrl-C, and passing 3 will 
    restore it.

    This function can be used to prevent the capturing of Ctrl-C on the 
    incoming stream of characters that is usually used for the REPL, in case 
    that stream is used for other purposes

================================================
FILE: micropython/docs/music.rst
================================================
Music
*****

.. py:module:: music

This is the ``music`` module. You can use it to play simple tunes, provided
that you connect a speaker to your board. By default the ``music`` module
expects the speaker to be connected via pin 0:

.. image:: music-pins.png

This arrangement can be overridden (as discussed below).

To access this module you need to::

    import music

We assume you have done this for the examples below.

Musical Notation
================

An individual note is specified thus::

    NOTE[octave][:duration]

For example, ``A1:4`` refers to the note "A" in octave 1 that lasts for four
ticks (a tick is an arbitrary length of time defined by a tempo setting
function - see below). If the note name ``R`` is used then it is treated as a
rest (silence).

Accidentals (flats and sharps) are denoted by the ``b`` (flat - a lower case b)
and ``#`` (sharp - a hash symbol). For example, ``Ab`` is A-flat and ``C#`` is
C-sharp.

**Note names are case-insensitive.**

The ``octave`` and ``duration`` parameters are states that carry over to
subsequent notes until re-specified. The default states are ``octave = 4``
(containing middle C) and ``duration = 4`` (a crotchet, given the default tempo
settings - see below).

For example, if 4 ticks is a crotchet, the following list is crotchet, quaver,
quaver, crotchet based arpeggio::

    ['c1:4', 'e:2', 'g', 'c2:4']

The opening of Beethoven's 5th Symphony would be encoded thus::

    ['r4:2', 'g', 'g', 'g', 'eb:8', 'r:2', 'f', 'f', 'f', 'd:8']

The definition and scope of an octave conforms to the table listed `on this
page about scientific pitch notation`_.  For example, middle "C" is ``'c4'`` and
concert "A" (440) is ``'a4'``. Octaves start on the note "C".

.. _on this page about scientific pitch notation: https://en.wikipedia.org/wiki/Scientific_pitch_notation#Table_of_note_frequencies


Functions
=========

.. py:function:: set_tempo(ticks=4, bpm=120)

    Sets the approximate tempo for playback.

    A number of ticks (expressed as an integer) constitute a beat. Each beat is to be played at a certain frequency per minute (expressed as the more familiar BPM - beats per minute - also as an integer).

    Suggested default values allow the following useful behaviour:

    * ``music.set_tempo()`` - reset the tempo to default of ticks = 4, bpm = 120
    * ``music.set_tempo(ticks=8)`` - change the "definition" of a beat
    * ``music.set_tempo(bpm=180)`` - just change the tempo

    To work out the length of a tick in milliseconds is very simple arithmetic: ``60000/bpm/ticks_per_beat`` . For the default values that's ``60000/120/4 = 125 milliseconds`` or ``1 beat = 500 milliseconds``.

.. py:function:: get_tempo()

    Gets the current tempo as a tuple of integers: ``(ticks, bpm)``.

.. py:function:: play(music, pin=microbit.pin0, wait=True, loop=False)

    Plays ``music`` containing the musical DSL defined above.

    If ``music`` is a string it is expected to be a single note such as,
    ``'c1:4'``.

    If ``music`` is specified as a list of notes (as defined in the section on
    the musical DSL, above) then they are played one after the other to perform
    a melody.

    In both cases, the ``duration`` and ``octave`` values are reset to
    their defaults before the music (whatever it may be) is played.

    An optional argument to specify the output pin can be used to override the
    default of ``microbit.pin0``.

    If ``wait`` is set to ``True``, this function is blocking.

    If ``loop`` is set to ``True``, the tune repeats until ``stop`` is called
    (see below) or the blocking call is interrupted.

.. py:function:: pitch(frequency, duration=-1, pin=microbit.pin0, wait=True)

    Plays a pitch at the integer frequency given for the specified number of
    milliseconds. For example, if the frequency is set to 440 and the length to
    1000 then we hear a standard concert A for one second.

    Note that you can only play one pitch on one pin at any one time.

    If ``wait`` is set to ``True``, this function is blocking.

    If ``duration`` is negative the pitch is played continuously until either the
    blocking call is interrupted or, in the case of a background call, a new
    frequency is set or ``stop`` is called (see below).

.. py:function:: stop(pin=microbit.pin0)
    
    Stops all music playback on a given pin, eg. ``music.stop(pin1)``. 
    If no pin is given, eg. ``music.stop()`` pin0 is assumed.

.. py:function:: reset()

    Resets the state of the following attributes in the following way:

        * ``ticks = 4``
        * ``bpm = 120``
        * ``duration = 4``
        * ``octave = 4``

Built in Melodies
-----------------

For the purposes of education and entertainment, the module contains several
example tunes that are expressed as Python lists. They can be used like this::

    >>> import music
    >>> music.play(music.NYAN)

All the tunes are either out of copyright, composed by Nicholas H.Tollervey and
released to the public domain or have an unknown composer and are covered by a
fair (educational) use provision.

They are:

    * ``DADADADUM`` - the opening to Beethoven's 5th Symphony in C minor.
    * ``ENTERTAINER`` - the opening fragment of Scott Joplin's Ragtime classic "The Entertainer".
    * ``PRELUDE`` - the opening of the first Prelude in C Major of J.S.Bach's 48 Preludes and Fugues.
    * ``ODE`` - the "Ode to Joy" theme from Beethoven's 9th Symphony in D minor.
    * ``NYAN`` - the Nyan Cat theme (http://www.nyan.cat/). The composer is unknown. This is fair use for educational porpoises (as they say in New York).
    * ``RINGTONE`` - something that sounds like a mobile phone ringtone. To be used to indicate an incoming message.
    * ``FUNK`` - a funky bass line for secret agents and criminal masterminds.
    * ``BLUES`` - a boogie-woogie 12-bar blues walking bass.
    * ``BIRTHDAY`` - "Happy Birthday to You..." for copyright status see: http://www.bbc.co.uk/news/world-us-canada-34332853
    * ``WEDDING`` - the bridal chorus from Wagner's opera "Lohengrin".
    * ``FUNERAL`` - the "funeral march" otherwise known as Frédéric Chopin's Piano Sonata No. 2 in B♭ minor, Op. 35.
    * ``PUNCHLINE`` - a fun fragment that signifies a joke has been made.
    * ``PYTHON`` - John Philip Sousa's march "Liberty Bell" aka, the theme for "Monty Python's Flying Circus" (after which the Python programming language is named).
    * ``BADDY`` - silent movie era entrance of a baddy.
    * ``CHASE`` - silent movie era chase scene.
    * ``BA_DING`` - a short signal to indicate something has happened.
    * ``WAWAWAWAA`` - a very sad trombone.
    * ``JUMP_UP`` - for use in a game, indicating upward movement.
    * ``JUMP_DOWN`` - for use in a game, indicating downward movement.
    * ``POWER_UP`` - a fanfare to indicate an achievement unlocked.
    * ``POWER_DOWN`` - a sad fanfare to indicate an achievement lost.

Example
-------

.. include:: ../examples/music.py
    :code: python


================================================
FILE: micropython/docs/neopixel.rst
================================================
NeoPixel
********

.. py:module:: neopixel

The ``neopixel`` module lets you use NeoPixel (WS2812) individually addressable
RGB LED strips with the micro:bit. Note to use the ``neopixel`` module, you
need to import it separately with::

    import neopixel

.. note::

    From our tests, the Microbit NeoPixel module can drive up to around 256
    NeoPixels. Anything above that and you may experience weird bugs and
    issues. As the micro:bit can only supply 90mA to external devices,
    larger numbers of NeoPixels require an external power supply with common
    ground.

    NeoPixels are designed to work at 5V, but luckily they still function using
    the 3V supply of the BBC micro:bit. Please note that the micro:bit edge
    connector should not be connected to anything supplying 5V.


NeoPixels are fun strips of multi-coloured programmable LEDs. This module
contains everything to plug them into a micro:bit and create funky displays,
art and games such as the demo shown below.

.. image:: neopixel.gif

To connect a strip of neopixels you'll need to attach the micro:bit as shown
below (assuming you want to drive the pixels from pin 0 - you can connect
neopixels to pins 1 and 2 too). The label on the crocodile clip tells you where
to attach the other end on the neopixel strip. The VDD pin may be labelled
as something else on some variants of neopixels - for example "V+". In some
cases it may be called "+5V" and it is only safe to use this if you have no
other 5V devices connected.

.. warning::

    Do not use the 3v connector on the Microbit to power any more than 8
    Neopixels at a time.

    If you wish to use more than 8 Neopixels, you must use a separate 3v-5v
    power supply for the Neopixel power pin.

.. image:: neopixel-croc.png

Classes
=======

.. py:class::
    NeoPixel(pin, n)

    Initialise a new strip of ``n`` number of neopixel LEDs controlled via pin
    ``pin``. Each pixel is addressed by a position (starting from 0). Neopixels
    are given RGB (red, green, blue) values between 0-255 as a tuple. For
    example, ``(255,255,255)`` is white.

    .. py:method:: clear()

        Clear all the pixels.


    .. py:method:: show()

        Show the pixels. Must be called for any updates to become visible.

Operations
==========

Writing the colour doesn't update the display (use ``show()`` for that).

.. code::

    np[0] = (255, 0, 128)  # first element
    np[-1] = (0, 255, 0)  # last element
    np.show()  # only now will the updated value be shown

To read the colour of a specific pixel just reference it.

.. code::

    print(np[0])

Using Neopixels
===============

Interact with Neopixels as if they were a list of tuples. Each tuple represents
the RGB (red, green and blue) mix of colours for a specific pixel. The RGB
values can range between 0 to 255.

For example, initialise a strip of 8 neopixels on a strip connected to pin0
like this::

    import neopixel
    np = neopixel.NeoPixel(pin0, 8)

Set pixels by indexing them (like with a Python list). For instance, to
set the first pixel to full brightness red, you would use::

    np[0] = (255, 0, 0)

Or the final pixel to purple::

    np[-1] = (255, 0, 255)

Get the current colour value of a pixel by indexing it. For example, to print
the first pixel's RGB value use::

    print(np[0])

Finally, to push the new colour data to your Neopixel strip, use the .show()
function::

    np.show()

If nothing is happening, it's probably because you've forgotten this final
step..!

.. note::

    If you're not seeing anything change on your Neopixel strip, make sure
    you have ``show()`` at least somewhere otherwise your updates won't be
    shown.

Example
=======

.. include:: ../examples/neopixel_random.py
    :code: python


================================================
FILE: micropython/docs/os.rst
================================================
The ``os``  Module
******************

.. py:module:: os

MicroPython contains an ``os`` module based upon the ``os`` module in the
Python standard library. It's used for accessing what would traditionally be
termed as operating system dependent functionality. Since there is no operating
system in MicroPython the module provides functions relating to the management
of the simple on-device persistent file system and information about the
current system.

To access this module you need to::

    import os

We assume you have done this for the examples below.

Functions
=========

.. py:function:: listdir()

    Returns a list of the names of all the files contained within the local
    persistent on-device file system.

.. py:function:: remove(filename)

    Removes (deletes) the file named in the argument ``filename``. If the file
    does not exist an ``OSError`` exception will occur.

.. py:function:: size(filename)

    Returns the size, in bytes, of the file named in the argument ``filename``.
    If the file does not exist an ``OSError`` exception will occur.

.. py:function:: uname()

    Returns information identifying the current operating system. The return
    value is an object with five attributes:

    * ``sysname`` - operating system name
    * ``nodename`` - name of machine on network (implementation-defined)
    * ``release`` - operating system release
    * ``version`` - operating system version
    * ``machine`` - hardware identifier


.. note::

    There is no underlying operating system in MicroPython. As a result the
    information returned by the ``uname`` function is mostly useful for
    versioning details.


================================================
FILE: micropython/docs/pin.rst
================================================
Input/Output Pins
*****************

.. py:module:: microbit

The pins are your board's way to communicate with external devices connected to
it. There are 19 pins for your disposal, numbered 0-16 and 19-20. Pins 17 and
18 are not available.

For example, the script below will change the display on the micro:bit
depending upon the digital reading on pin 0::

    from microbit import *


    while True:
        if pin0.read_digital():
            display.show(Image.HAPPY)
        else:
            display.show(Image.SAD)


Pin Functions
=============

.. image:: pinout.png

Those pins are available as attributes on the ``microbit``
module:``microbit.pin0`` - ``microbit.pin20``.

+-----+---------+----------+
| Pin | Type    | Function |
+=====+=========+==========+
|  0  | Touch   | Pad 0    |
+-----+---------+----------+
|  1  | Touch   | Pad 1    |
+-----+---------+----------+
|  2  | Touch   | Pad 2    |
+-----+---------+----------+
|  3  | Analog  | Column 1 |
+-----+---------+----------+
|  4  | Analog  | Column 2 |
+-----+---------+----------+
|  5  | Digital | Button A |
+-----+---------+----------+
|  6  | Digital | Column 9 |
+-----+---------+----------+
|  7  | Digital | Column 8 |
+-----+---------+----------+
|  8  | Digital |          |
+-----+---------+----------+
|  9  | Digital | Column 7 |
+-----+---------+----------+
|  10 | Analog  | Column 3 |
+-----+---------+----------+
|  11 | Digital | Button B |
+-----+---------+----------+
|  12 | Digital |          |
+-----+---------+----------+
|  13 | Digital | SPI SCK  |
+-----+---------+----------+
|  14 | Digital | SPI MISO |
+-----+---------+----------+
|  15 | Digital | SPI MOSI |
+-----+---------+----------+
|  16 | Digital |          |
+-----+---------+----------+
+-----+---------+----------+
|  19 | Digital | I2C SCL  |
+-----+---------+----------+
|  20 | Digital | I2C SDA  |
+-----+---------+----------+

The above table summarizes the pins available, their types (see below) and what
they are internally connected to.


Pulse-Width Modulation
----------------------

The pins of your board cannot output analog signal the way an audio amplifier
can do it -- by modulating the voltage on the pin. Those pins can only either
enable the full 3.3V output, or pull it down to 0V. However, it is still
possible to control the brightness of LEDs or speed of an electric motor, by
switching that voltage on and off very fast, and controlling how long it is on
and how long it is off. This technique is called Pulse-Width Modulation (PWM),
and that's what the ``write_analog`` method below does.

.. image:: pwm.png

Above you can see the diagrams of three different PWM signals. All of them have
the same period (and thus frequency), but they have different duty cycles.

The first one would be generated by ``write_analog(511)``, as it has exactly
50% duty -- the power is on half of the time, and off half of the time. The
result of that is that the total energy of this signal is the same, as if it
was 1.65V instead of 3.3V.

The second signal has 25% duty cycle, and could be generated with
``write_analog(255)``. It has similar effect as if 0.825V was being output on
that pin.

The third signal has 75% duty cycle, and can be generated with
``write_analog(767)``. It has three times as much energy, as the second signal,
and is equivalent to outputting 2.475V on th pin.

Note that this works well with devices such as motors, which have huge inertia
by themselves, or LEDs, which blink too fast for the human eye to see the
difference, but will not work so good with generating sound waves. This board
can only generate square wave sounds on itself, which sound pretty much like
the very old computer games -- mostly because those games also only could do
that.


Classes
=======

There are three kinds of pins, differing in what is available for them. They
are represented by the classes listed below. Note that they form a hierarchy,
so that each class has all the functionality of the previous class, and adds
its own to that.

.. note::
    Those classes are not actually available for the user, you can't create
    new instances of them. You can only use the instances already provided,
    representing the physical pins on your board.

.. py:class:: MicroBitDigitalPin

    .. py:method:: read_digital()

        Return 1 if the pin is high, and 0 if it's low.

    .. py:method:: write_digital(value)

        Set the pin to high if ``value`` is 1, or to low, if it is 0.

    .. py:method::set_pull(value)

        Set the pull state to one of three possible values: ``pin.PULL_UP``,
        ``pin.PULL_DOWN`` or ``pin.NO_PULL`` (where ``pin`` is an instance of
        a pin). See below for discussion of default pull states.


    .. py:method::get_pull()

        Returns the pull configuration on a pin, which can be one of three 
        possible values: ``NO_PULL``, ``PULL_DOWN``, or ``PULL_UP``. These 
        are set using the ``set_pull()`` method or automatically configured 
        when a pin mode requires it.

    .. py:method::get_mode()

        Returns the pin mode. When a pin is used for a specific function, like 
        writing a digital value, or reading an analog value, the pin mode 
        changes. Pins can have one of the following modes: ``MODE_UNUSED``, 
        ``MODE_WRITE_ANALOG``, ``MODE_READ_DIGITAL``, ``MODE_WRITE_DIGITAL``, 
        ``MODE_DISPLAY``, ``MODE_BUTTON``, ``MODE_MUSIC``, ``MODE_AUDIO_PLAY``,
        ``MODE_TOUCH``, ``MODE_I2C``, ``MODE_SPI``.


.. py:class:: MicroBitAnalogDigitalPin

    .. py:method:: read_analog()

        Read the voltage applied to the pin, and return it as an integer
        between 0 (meaning 0V) and 1023 (meaning 3.3V).


    .. py:method:: write_analog(value)

        Output a PWM signal on the pin, with the duty cycle proportional to
        the provided ``value``. The ``value`` may be either an integer or a
        floating point number between 0 (0% duty cycle) and 1023 (100% duty).

    .. py:method:: set_analog_period(period)

        Set the period of the PWM signal being output to ``period`` in
        milliseconds. The minimum valid value is 1ms.

    .. py:method:: set_analog_period_microseconds(period)

        Set the period of the PWM signal being output to ``period`` in
        microseconds. The minimum valid value is 256µs.


.. py:class:: MicroBitAnalogDigitalPin

    .. py:method:: read_analog()

        Read the voltage applied to the pin, and return it as an integer
        between 0 (meaning 0V) and 1023 (meaning 3.3V).


.. py:class:: MicroBitTouchPin

    .. py:method:: is_touched()

        Return ``True`` if the pin is being touched with a finger, otherwise
        return ``False``.

        This test is done by measuring how much resistance there is between the
        pin and ground.  A low resistance gives a reading of ``True``.  To get
        a reliable reading using a finger you may need to touch the ground pin
        with another part of your body, for example your other hand.

The pull mode for a pin is automatically configured when the pin changes to an
input mode. Input modes are when you call ``read_analog`` / ``read_digital`` /
``is_touched``. The default pull mode for these is, respectively, ``NO_PULL``,
``PULL_DOWN``, ``PULL_UP``. Calling ``set_pull`` will configure the pin to be
in ``read_digital`` mode with the given pull mode.


.. note::
    The micro:bit has external weak (10M) pull-ups fitted on pins
    0, 1 and 2 only, in order for the touch sensing to work.

    There are also external (10k) pull-ups fitted on pins 5 and 11, in order
    for buttons A and B to work.

    GPIO pins are also used for the display. 6 of these are routed to the
    edge connector at 3, 4, 6, 7, 9. and 10. If you want to use these pins
    for another purpose, you may need to turn the `display off
    <https://microbit-micropython.readthedocs.io/en/latest/display.html#microbit.display.off>`_.

    See the `edge connector data sheet
    <http://tech.microbit.org/hardware/edgeconnector_ds>`_.


================================================
FILE: micropython/docs/radio.rst
================================================
Radio
*****

.. py:module:: radio

The ``radio`` module allows devices to work together via simple wireless
networks.

The radio module is conceptually very simple:

* Broadcast messages are of a certain configurable length (up to 251 bytes).
* Messages received are read from a queue of configurable size (the larger the queue the more RAM is used). If the queue is full, new messages are ignored. Reading a message removes it from the queue.
* Messages are broadcast and received on a preselected channel (numbered 0-83).
* Broadcasts are at a certain level of power - more power means more range.
* Messages are filtered by address (like a house number) and group (like a named recipient at the specified address).
* The rate of throughput can be one of three pre-determined settings.
* Send and receive bytes to work with arbitrary data.
* Use `receive_full` to obtain full details about an incoming message: the data, receiving signal strength, and a microsecond timestamp when the message arrived.
* As a convenience for children, it's easy to send and receive messages as strings.
* The default configuration is both sensible and compatible with other platforms that target the BBC micro:bit.

To access this module you need to::

    import radio

We assume you have done this for the examples below.

Constants
=========

.. py:attribute:: RATE_250KBIT

    Constant used to indicate a throughput of 256 Kbit a second.

.. py:attribute:: RATE_1MBIT

    Constant used to indicate a throughput of 1 MBit a second.

.. py:attribute:: RATE_2MBIT

    Constant used to indicate a throughput of 2 MBit a second.


Functions
=========

.. py:function:: on()

    Turns the radio on. This needs to be explicitly called since the radio
    draws power and takes up memory that you may otherwise need.

.. py:function:: off()

    Turns off the radio, thus saving power and memory.

.. py:function:: config(**kwargs)

    Configures various keyword based settings relating to the radio. The
    available settings and their sensible default values are listed below.

    The ``length`` (default=32) defines the maximum length, in bytes, of a
    message sent via the radio. It can be up to 251 bytes long (254 - 3 bytes
    for S0, LENGTH and S1 preamble).

    The ``queue`` (default=3) specifies the number of messages that can be
    stored on the incoming message queue. If there are no spaces left on the
    queue for incoming messages, then the incoming message is dropped.

    The ``channel`` (default=7) can be an integer value from 0 to 83
    (inclusive) that defines an arbitrary "channel" to which the radio is
    tuned. Messages will be sent via this channel and only messages received
    via this channel will be put onto the incoming message queue. Each step is
    1MHz wide, based at 2400MHz.

    The ``power`` (default=6) is an integer value from 0 to 7 (inclusive) to
    indicate the strength of signal used when broadcasting a message. The
    higher the value the stronger the signal, but the more power is consumed
    by the device. The numbering translates to positions in the following list
    of dBm (decibel milliwatt) values: -30, -20, -16, -12, -8, -4, 0, 4.

    The ``address`` (default=0x75626974) is an arbitrary name, expressed as a
    32-bit address, that's used to filter incoming packets at the hardware
    level, keeping only those that match the address you set. The default used
    by other micro:bit related platforms is the default setting used here.

    The ``group`` (default=0) is an 8-bit value (0-255) used with the
    ``address`` when filtering messages. Conceptually, "address" is like a
    house/office address and "group" is like the person at that address to
    which you want to send your message.

    The ``data_rate`` (default=radio.RATE_1MBIT) indicates the speed at which
    data throughput takes place. Can be one of the following contants defined
    in the ``radio`` module : ``RATE_250KBIT``, ``RATE_1MBIT`` or
    ``RATE_2MBIT``.

    If ``config`` is not called then the defaults described above are assumed.

.. py:function:: reset()

    Reset the settings to their default values (as listed in the documentation
    for the ``config`` function above).

.. note::

    None of the following send or receive methods will work until the radio is
    turned on.

.. py:function:: send_bytes(message)

    Sends a message containing bytes.

.. py:function:: receive_bytes()

    Receive the next incoming message on the message queue. Returns ``None`` if
    there are no pending messages. Messages are returned as bytes.

.. py:function:: receive_bytes_into(buffer)

    Receive the next incoming message on the message queue. Copies the message
    into ``buffer``, trimming the end of the message if necessary.
    Returns ``None`` if there are no pending messages, otherwise it returns the length
    of the message (which might be more than the length of the buffer).

.. py:function:: send(message)

    Sends a message string. This is the equivalent of
    ``send_bytes(bytes(message, 'utf8'))`` but with ``b'\x01\x00\x01'``
    prepended to the front (to make it compatible with other platforms that
    target the micro:bit).

.. py:function:: receive()

    Works in exactly the same way as ``receive_bytes`` but returns
    whatever was sent.

    Currently, it's equivalent to ``str(receive_bytes(), 'utf8')`` but with a
    check that the the first three bytes are ``b'\x01\x00\x01'`` (to make it
    compatible with other platforms that may target the micro:bit). It strips
    the prepended bytes before converting to a string.

    A ``ValueError`` exception is raised if conversion to string fails.

.. py:function:: receive_full()

    Returns a tuple containing three values representing the next incoming
    message on the message queue. If there are no pending messages then
    ``None`` is returned.

    The three values in the tuple represent:

    * the next incoming message on the message queue as bytes.
    * the RSSI (signal strength): a value between 0 (strongest) and -255 (weakest) as measured in dBm.
    * a microsecond timestamp: the value returned by ``time.ticks_us()`` when the message was received.

    For example::

        details = radio.receive_full()
        if details:
            msg, rssi, timestamp = details

    This function is useful for providing information needed for triangulation
    and/or triliteration with other micro:bit devices.


Examples
--------

.. include:: ../examples/radio.py
    :code: python


================================================
FILE: micropython/docs/random.rst
================================================
Random Number Generation
************************

.. py:module:: random

This module is based upon the ``random`` module in the Python standard library.
It contains functions for generating random behaviour.

To access this module you need to::

    import random

We assume you have done this for the examples below.

Functions
=========

.. py:function:: getrandbits(n)

    Returns an integer with ``n`` random bits.

.. warning::

    Because the underlying generator function returns at most 30 bits, ``n``
    may only be a value between 1-30 (inclusive).

.. py:function:: seed(n)

    Initialize the random number generator with a known integer ``n``. This
    will give you reproducibly deterministic randomness from a given starting
    state (``n``).


.. py:function:: randint(a, b)

    Return a random integer ``N`` such that ``a <= N <= b``. Alias for
    ``randrange(a, b+1)``.


.. py:function:: randrange(stop)

    Return a randomly selected integer between zero and up to (but not
    including) ``stop``.

.. py:function:: randrange(start, stop)

    Return a randomly selected integer from ``range(start, stop)``.

.. py:function:: randrange(start, stop, step)

    Return a randomly selected element from ``range(start, stop, step)``.


.. py:function:: choice(seq)

    Return a random element from the non-empty sequence ``seq``. If ``seq`` is
    empty, raises ``IndexError``.


.. py:function:: random()

    Return the next random floating point number in the range [0.0, 1.0)


.. py:function:: uniform(a, b)

    Return a random floating point number ``N`` such that ``a <= N <= b``
    for ``a <= b`` and ``b <= N <= a`` for ``b < a``.


================================================
FILE: micropython/docs/speech.rst
================================================
Speech
******

.. warning::

    WARNING! This is still work in progress; we reserve the right to change this API as development continues.

    The quality of the speech is not great, merely "good enough". Given the
    constraints of the device you may encounter memory errors and / or
    unexpected extra sounds during playback. It's early days and we're
    improving the code for the speech synthesiser all the time. Bug reports
    and pull requests are most welcome.


.. py:module:: speech

This module makes microbit talk, sing and make other speech like sounds
provided that you connect a speaker to your board as shown below:

.. image:: speech.png

.. note::

    This work is based upon the amazing reverse engineering efforts of
    Sebastian Macke based upon an old text-to-speech (TTS) program called SAM
    (Software Automated Mouth) originally released in 1982 for the
    Commodore 64. The result is a small C library that we have adopted and
    adapted for the micro:bit. You can find out more from
    `his homepage <http://simulationcorner.net/index.php?page=sam>`_. Much of
    the information in this document was gleaned from the original user's
    manual which can be found
    `here <http://www.apple-iigs.info/newdoc/sam.pdf>`_.

The speech synthesiser can produce around 2.5 seconds worth of sound from up to
255 characters of textual input.

To access this module you need to::

    import speech

We assume you have done this for the examples below.

Functions
=========

.. py:function:: translate(words)

    Given English words in the string ``words``, return a string containing
    a best guess at the appropriate phonemes to pronounce. The output is
    generated from this
    `text to phoneme translation table <https://github.com/s-macke/SAM/wiki/Text-to-phoneme-translation-table>`_.

    This function should be used to generate a first approximation of phonemes
    that can be further hand-edited to improve accuracy, inflection and
    emphasis.

.. py:function:: pronounce(phonemes, \*, pitch=64, speed=72, mouth=128, throat=128)

    Pronounce the phonemes in the string ``phonemes``. See below for details of
    how to use phonemes to finely control the output of the speech synthesiser.
    Override the optional pitch, speed, mouth and throat settings to change the
    timbre (quality) of the voice.

.. py:function:: say(words, \*, pitch=64, speed=72, mouth=128, throat=128)

    Say the English words in the string ``words``. The result is semi-accurate
    for English. Override the optional pitch, speed, mouth and throat
    settings to change the timbre (quality) of the voice. This is a short-hand
    equivalent of: ``speech.pronounce(speech.translate(words))``

.. py:function:: sing(phonemes, \*, pitch=64, speed=72, mouth=128, throat=128)

    Sing the phonemes contained in the string ``phonemes``. Changing the pitch
    and duration of the note is described below. Override the optional pitch,
    speed, mouth and throat settings to change the timbre (quality) of the
    voice.

Punctuation
===========

Punctuation is used to alter the delivery of speech. The synthesiser
understands four punctuation marks: hyphen, comma, full-stop and question mark.

The hyphen (``-``) marks clause boundaries by inserting a short pause in the
speech.

The comma (``,``) marks phrase boundaries and inserts a pause of approximately
double that of the hyphen.

The full-stop (``.``) and question mark (``?``) end sentences.

The full-stop inserts a pause and causes the pitch to fall.

The question mark also inserts a pause but causes the pitch to rise. This works
well with yes/no questions such as, "are we home yet?" rather than more complex
questions such as "why are we going home?". In the latter case, use a
full-stop.

Timbre
======

The timbre of a sound is the quality of the sound. It's the difference between
the voice of a DALEK and the voice of a human (for example). To control the
timbre change the numeric settings of the ``pitch``, ``speed``, ``mouth`` and
``throat`` arguments.

The pitch (how high or low the voice sounds) and speed (how quickly the speech
is delivered) settings are rather obvious and generally fall into the following
categories:

Pitch:

* 0-20 impractical
* 20-30 very high
* 30-40 high
* 40-50 high normal
* 50-70 normal
* 70-80 low normal
* 80-90 low
* 90-255 very low

(The default is 64)

Speed:

* 0-20 impractical
* 20-40 very fast
* 40-60 fast
* 60-70 fast conversational
* 70-75 normal conversational
* 75-90 narrative
* 90-100 slow
* 100-225 very slow

(The default is 72)

The mouth and throat values are a little harder to explain and the following
descriptions are based upon our aural impressions of speech produced as the
value of each setting is changed.

For mouth, the lower the number the more it sounds like the speaker is talking
without moving their lips. In contrast, higher numbers (up to 255) make it
sound like the speech is enunciated with exagerated mouth movement.

For throat, the lower the number the more relaxed the speaker sounds. In
contrast, the higher the number, the more tense the tone of voice becomes.

The important thing is to experiment and adjust the settings until you get the
effect you desire.

To get you started here are some examples::

    speech.say("I am a little robot",  speed=92, pitch=60, throat=190, mouth=190)
    speech.say("I am an elf", speed=72, pitch=64, throat=110, mouth=160)
    speech.say("I am a news presenter", speed=82, pitch=72, throat=110, mouth=105)
    speech.say("I am an old lady", speed=82, pitch=32, throat=145, mouth=145)
    speech.say("I am E.T.", speed=100, pitch=64, throat=150, mouth=200)
    speech.say("I am a DALEK - EXTERMINATE", speed=120, pitch=100, throat=100, mouth=200)

Phonemes
========

The ``say`` function makes it easy to produce speech - but often it's not
accurate. To make sure the speech synthesiser pronounces things
*exactly* how you'd like, you need to use phonemes: the smallest
perceptually distinct units of sound that can be used to distinguish different
words. Essentially, they are the building-block sounds of speech.

The ``pronounce`` function takes a string containing a simplified and readable
version of the `International Phonetic Alphabet <https://en.wikipedia.org/wiki/International_Phonetic_Alphabet>`_ and optional annotations to indicate
inflection and emphasis.

The advantage of using phonemes is that you don't have to know how to spell!
Rather, you only have to know how to say the word in order to spell it
phonetically.

The table below lists the phonemes understood by the synthesiser.

.. note::

    The table contains the phoneme as characters, and an example word. The
    example words have the sound of the phoneme (in parenthesis), but not
    necessarily the same letters.

    Often overlooked: the symbol for the "H" sound is ``/H``. A glottal stop
    is a forced stoppage of sound.

::

    SIMPLE VOWELS                          VOICED CONSONANTS
    IY           f(ee)t                    R        (r)ed
    IH           p(i)n                     L        a(ll)ow
    EH           b(e)g                     W        a(w)ay
    AE           S(a)m                     W        (wh)ale
    AA           p(o)t                     Y        (y)ou
    AH           b(u)dget                  M        Sa(m)
    AO           t(al)k                    N        ma(n)
    OH           c(o)ne                    NX       so(ng)
    UH           b(oo)k                    B        (b)ad
    UX           l(oo)t                    D        (d)og
    ER           b(ir)d                    G        a(g)ain
    AX           gall(o)n                  J        (j)u(dg)e
    IX           dig(i)t                   Z        (z)oo
                                           ZH       plea(s)ure
    DIPHTHONGS                             V        se(v)en
    EY           m(a)de                    DH       (th)en
    AY           h(igh)
    OY           b(oy)
    AW           h(ow)                     UNVOICED CONSONANTS
    OW           sl(ow)                    S         (S)am
    UW           cr(ew)                    SH        fi(sh)
                                           F         (f)ish
                                           TH        (th)in
    SPECIAL PHONEMES                       P         (p)oke
    UL           sett(le) (=AXL)           T         (t)alk
    UM           astron(om)y (=AXM)        K         (c)ake
    UN           functi(on) (=AXN)         CH        spee(ch)
    Q            kitt-en (glottal stop)    /H        a(h)ead

The following non-standard symbols are also available to the user::

    YX           diphthong ending (weaker version of Y)
    WX           diphthong ending (weaker version of W)
    RX           R after a vowel (smooth version of R)
    LX           L after a vowel (smooth version of L)
    /X           H before a non-front vowel or consonant - as in (wh)o
    DX           T as in pi(t)y (weaker version of T)

Here are some seldom used phoneme combinations (and suggested alternatives)::

    PHONEME        YOU PROBABLY WANT:     UNLESS IT SPLITS SYLLABLES LIKE:
    COMBINATION
    GS             GZ e.g. ba(gs)         bu(gs)pray
    BS             BZ e.g. slo(bz)        o(bsc)ene
    DS             DZ e.g. su(ds)         Hu(ds)son
    PZ             PS e.g. sla(ps)        -----
    TZ             TS e.g. cur(ts)y       -----
    KZ             KS e.g. fi(x)          -----
    NG             NXG e.g. singing       i(ng)rate
    NK             NXK e.g. bank          Su(nk)ist

If you use anything other than the phonemes described above, a ``ValueError``
exception will be raised. Pass in the phonemes as a string like this::

    speech.pronounce("/HEHLOW")  # "Hello"

The phonemes are classified into two broad groups: vowels and consonants.

Vowels are further subdivided into simple vowels and diphthongs. Simple vowels
don't change their sound as you say them whereas diphthongs start with one
sound and end with another. For example, when you say the word "oil" the "oi"
vowel starts with an "oh" sound but changes to an "ee" sound.

Consonants are also subdivided into two groups: voiced and unvoiced. Voiced
consonants require the speaker to use their vocal chords to produce the sound.
For example, consonants like "L", "N" and "Z" are voiced. Unvoiced consonants
are produced by rushing air, such as "P", "T" and "SH".

Once you get used to it, the phoneme system is easy. To begin with some
spellings may seem tricky (for example, "adventure" has a "CH" in it) but the
rule is to write what you say, not what you spell. Experimentation is the best
way to resolve problematic words.

It's also important that speech sounds natural and understandable. To help
with improving the quality of spoken output it's often good to use the built-in
stress system to add inflection or emphasis.

There are eight stress markers indicated by the numbers ``1`` - ``8``. Simply
insert the required number after the vowel to be stressed. For example, the
lack of expression of "/HEHLOW" is much improved (and friendlier) when
spelled out "/HEH3LOW".

It's also possible to change the meaning of words through the way they are
stressed. Consider the phrase "Why should I walk to the store?". It could be
pronounced in several different ways::

    # You need a reason to do it.
    speech.pronounce("WAY2 SHUH7D AY WAO5K TUX DHAH STOH5R.")
    # You are reluctant to go.
    speech.pronounce("WAY7 SHUH2D AY WAO7K TUX DHAH STOH5R.")
    # You want someone else to do it.
    speech.pronounce("WAY5 SHUH7D AY2 WAO7K TUX DHAH STOHR.")
    # You'd rather drive.
    speech.pronounce("WAY5 SHUHD AY7 WAO2K TUX7 DHAH STOHR.")
    # You want to walk somewhere else.
    speech.pronounce("WAY5 SHUHD AY WAO5K TUX DHAH STOH2OH7R.")

Put simply, different stresses in the speech create a more expressive tone of
voice.

They work by raising or lowering pitch and elongating the associated vowel
sound depending on the number you give:

#. very emotional stress
#. very emphatic stress
#. rather strong stress
#. ordinary stress
#. tight stress
#. neutral (no pitch change) stress
#. pitch-dropping stress
#. extreme pitch-dropping stress

The smaller the number, the more extreme the emphasis will be. However, such
stress markers will help pronounce difficult words correctly. For example, if
a syllable is not enunciated sufficiently, put in a neutral stress marker.

It's also possible to elongate words with stress markers::

    speech.pronounce("/HEH5EH4EH3EH2EH2EH3EH4EH5EHLP.”)

Singing
=======

It's possible to make MicroPython sing phonemes.

This is done by annotating a pitch related number onto a phoneme. The lower the
number, the higher the pitch. Numbers roughly translate into musical notes as
shown in the diagram below:

.. image:: speech-pitch.png

Annotations work by pre-pending a hash (``#``) sign and the pitch number in
front of the phoneme. The pitch will remain the same until a new annotation
is given. For example, make MicroPython sing a scale like this::

    solfa = [
        "#115DOWWWWWW",   # Doh
        "#103REYYYYYY",   # Re
        "#94MIYYYYYY",    # Mi
        "#88FAOAOAOAOR",  # Fa
        "#78SOHWWWWW",    # Soh
        "#70LAOAOAOAOR",  # La
        "#62TIYYYYYY",    # Ti
        "#58DOWWWWWW",    # Doh
    ]
    song = ''.join(solfa)
    speech.sing(song, speed=100)

In order to sing a note for a certain duration extend the
note by repeating vowel or voiced consonant phonemes (as demonstrated in
the example above). Beware diphthongs - to extend them you need to break them
into their component parts. For example, "OY" can be extended with
"OHOHIYIYIY".

Experimentation, listening carefully and adjusting is the only sure way to work
out how many times to repeat a phoneme so the note lasts for the desired
duration.

How Does it Work?
=================

The original manual explains it well:

    First, instead of recording the actual speech waveform, we only store the
    frequency spectrums. By doing this, we save memory and pick up other
    advantages. Second, we [...] store some data about timing. These are
    numbers pertaining to the duration of each phoneme under different
    circumstances, and also some data on transition times so we can know how
    to blend a phoneme into its neighbors. Third, we devise a system of rules
    to deal with all this data and, much to our amazement, our computer is
    babbling in no time.

    --- S.A.M. owner's manual.

The output is piped through the functions provided by the ``audio`` module and,
hey presto, we have a talking micro:bit.

Example
=======

.. include:: ../examples/speech.py
    :code: python


================================================
FILE: micropython/docs/spi.rst
================================================
SPI
***

.. py:module:: microbit.spi

The ``spi`` module lets you talk to a device connected to your board using
a serial peripheral interface (SPI) bus. SPI uses a so-called master-slave
architecture with a single master. You will need to specify the connections
for three signals:

* SCLK : Serial Clock (output from master).
* MOSI : Master Output, Slave Input (output from master).
* MISO : Master Input, Slave Output (output from slave).


Functions
=========

.. method:: init(baudrate=1000000, bits=8, mode=0, sclk=pin13, mosi=pin15, miso=pin14)

    Initialize SPI communication with the specified parameters on the
    specified ``pins``. Note that for correct communication, the parameters
    have to be the same on both communicating devices.

    The ``baudrate`` defines the speed of communication.

    The ``bits`` defines the size of bytes being transmitted. Currently only
    ``bits=8`` is supported. However, this may change in the future.

    The ``mode`` determines the combination of clock polarity and phase
    according to the following convention, with polarity as the high order bit
    and phase as the low order bit:

    +----------+-----------------+--------------+
    | SPI Mode | Polarity (CPOL) | Phase (CPHA) |
    +==========+=================+==============+
    | 0        | 0               | 0            |
    +----------+-----------------+--------------+
    | 1        | 0               | 1            |
    +----------+-----------------+--------------+
    | 2        | 1               | 0            |
    +----------+-----------------+--------------+
    | 3        | 1               | 1            |
    +----------+-----------------+--------------+

    Polarity (aka CPOL) 0 means that the clock is at logic value 0 when idle
    and goes high (logic value 1) when active; polarity 1 means the clock is
    at logic value 1 when idle and goes low (logic value 0) when active. Phase
    (aka CPHA) 0 means that data is sampled on the leading edge of the clock,
    and 1 means on the trailing edge
    (viz. https://en.wikipedia.org/wiki/Signal_edge).

    The ``sclk``, ``mosi`` and ``miso`` arguments specify the pins to use for
    each type of signal.

.. method:: spi.read(nbytes)

   Read at most ``nbytes``. Returns what was read.

.. method:: spi.write(buffer)

   Write the ``buffer`` of bytes to the bus.

.. method:: spi.write_readinto(out, in)

   Write the ``out`` buffer to the bus and read any response into the ``in``
   buffer. The length of the buffers should be the same. The buffers can be
   the same object.


================================================
FILE: micropython/docs/tutorials/buttons.rst
================================================
Buttons
-------

So far we have created code that makes the device do something. This is called
*output*. However, we also need the device to react to things. Such things are
called *inputs*.

It's easy to remember: output is what the device puts out to the world
whereas input is what goes into the device for it to process.

The most obvious means of input on the micro:bit are its two buttons, labelled
``A`` and ``B``. Somehow, we need MicroPython to react to button presses.

This is remarkably simple::

    from microbit import *

    sleep(10000)
    display.scroll(str(button_a.get_presses()))

All this script does is sleep for ten thousand milliseconds (i.e. 10 seconds)
and then scrolls the number of times you pressed button ``A``. That's it!

While it's a pretty useless script, it introduces a couple of interesting new
ideas:

#. The ``sleep`` *function* will make the micro:bit sleep for a certain number
   of milliseconds. If you want a pause in your program, this is how to do it.
   A *function* is just like a *method*, but it isn't attached by a dot to an
   *object*.
#. There is an object called ``button_a`` and it allows you to get the number
   of times it has been pressed with the ``get_presses`` *method*.

Since ``get_presses`` gives a numeric value and ``display.scroll`` only
displays characters, we need to convert the numeric value into a string of
characters. We do this with the ``str`` function (short for "string" ~ it
converts things into strings of characters).

The third line is a bit like an onion. If the parenthesis are the
onion skins then you'll notice that ``display.scroll`` contains ``str`` that
itself contains ``button_a.get_presses``. Python attempts to work out the
inner-most answer first before starting on the next layer out. This is called
*nesting* - the coding equivalent of a Russian Matrioshka doll.

.. image:: matrioshka.jpg

Let's pretend you've pressed the button 10 times. Here's how Python works out
what's happening on the third line:

Python sees the complete line and gets the value of ``get_presses``::

    display.scroll(str(button_a.get_presses()))

Now that Python knows how many button presses there have been, it converts the
numeric value into a string of characters::

    display.scroll(str(10))

Finally, Python knows what to scroll across the display::

    display.scroll("10")

While this might seem like a lot of work, MicroPython makes this happen
extraordinarily fast.

Event Loops
+++++++++++

Often you need your program to hang around waiting for something to happen. To
do this you make it loop around a piece of code that defines how to react to
certain expected events such as a button press.

To make loops in Python you use the ``while`` keyword. It checks if something
is ``True``. If it is, it runs a *block of code* called the *body* of the loop.
If it isn't, it breaks out of the loop (ignoring the body) and the rest of the
program can continue.

Python makes it easy to define blocks of code. Say I have a to-do list written
on a piece of paper. It probably looks something like this::

    Shopping
    Fix broken gutter
    Mow the lawn

If I wanted to break down my to-do list a bit further, I might write something
like this::

    Shopping:
        Eggs
        Bacon
        Tomatoes
    Fix broken gutter:
        Borrow ladder from next door
        Find hammer and nails
        Return ladder
    Mow the lawn:
        Check lawn around pond for frogs
        Check mower fuel level

It's obvious that the main tasks are broken down into sub-tasks that are
*indented* underneath the main task to which they are related. So ``Eggs``,
``Bacon`` and ``Tomatoes`` are obviously related to ``Shopping``. By indenting
things we make it easy to see, at a glance, how the tasks relate to each other.

This is called *nesting*. We use nesting to define blocks of code like this::

    from microbit import *

    while running_time() < 10000:
        display.show(Image.ASLEEP)

    display.show(Image.SURPRISED)

The ``running_time`` function returns the number of milliseconds since the
device started.

The ``while running_time() < 10000:`` line checks if the running time is less
than 10000 milliseconds (i.e. 10 seconds). If it is, *and this is where we can
see scoping in action*, then it'll display ``Image.ASLEEP``. Notice how this is
indented underneath the ``while`` statement *just like in our to-do list*.

Obviously, if the running time is equal to or greater than 10000 milliseconds
then the display will show ``Image.SURPRISED``. Why? Because the ``while``
condition will be False (``running_time`` is no longer ``< 10000``). In that
case the loop is finished and the program will continue after the ``while``
loop's block of code. It'll look like your device is asleep for 10
seconds before waking up with a surprised look on its face.

Try it!

Handling an Event
+++++++++++++++++

If we want MicroPython to react to button press events we should put it into
an infinite loop and check if the button ``is_pressed``.

An infinite loop is easy::

    while True:
        # Do stuff

(Remember, ``while`` checks if something is ``True`` to work out if it should
run its block of code. Since ``True`` is obviously ``True`` for all time, you
get an infinite loop!)

Let's make a very simple cyber-pet. It's always sad unless you're pressing
button ``A``. If you press button ``B`` it dies. (I realise this isn't a very
pleasant game, so perhaps you can figure out how to improve it.)::

    from microbit import *

    while True:
        if button_a.is_pressed():
            display.show(Image.HAPPY)
        elif button_b.is_pressed():
            break
        else:
            display.show(Image.SAD)

    display.clear()

Can you see how we check what buttons are pressed? We used ``if``,
``elif`` (short for "else if") and ``else``. These are called *conditionals*
and work like this::

    if something is True:
        # do one thing
    elif some other thing is True:
        # do another thing
    else:
        # do yet another thing.

This is remarkably similar to English!

The ``is_pressed`` method only produces two results: ``True`` or ``False``.
If you're pressing the button it returns ``True``, otherwise it returns
``False``. The code above is saying, in English, "for ever and ever, if
button A is pressed then show a happy face, else if button B is pressed break
out of the loop, otherwise display a sad face." We break out of the loop (stop
the program running for ever and ever) with the ``break`` statement.

At the very end, when the cyber-pet is dead, we ``clear`` the display.

Can you think of ways to make this game less tragic? How would you check if
*both* buttons are pressed? (Hint: Python has ``and``, ``or`` and ``not``
logical operators to help check multiple truth statements (things that
produce either ``True`` or ``False`` results).

.. footer:: The image of Matrioshka dolls is licensed CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=69402


================================================
FILE: micropython/docs/tutorials/direction.rst
================================================
Direction
---------

There is a compass on the BBC micro:bit. If you ever make a weather station
use the device to work out the wind direction.

Compass
+++++++

It can also tell you the direction of North like this::

    from microbit import *

    compass.calibrate()

    while True:
        needle = ((15 - compass.heading()) // 30) % 12
        display.show(Image.ALL_CLOCKS[needle])

.. note:: 

    **You must calibrate the compass before taking readings.** Failure to do so
    will produce garbage results. The ``calibration`` method runs a fun little
    game to help the device work out where it is in relation to the Earth's
    magnetic field.

    To calibrate the compass, tilt the micro:bit around until a circle of pixels is
    drawn on the outside edges of the display.

The program takes the ``compass.heading`` and, using some simple yet
cunning maths, `floor division <https://en.wikipedia.org/wiki/Floor_and_ceiling_functions>`_ ``//`` and `modulo <https://en.wikipedia.org/wiki/Modulo_operation>`_ ``%``, works out the number of the clock hand to use to display on the screen
so that it is pointing roughly North.


================================================
FILE: micropython/docs/tutorials/gestures.rst
================================================
Gestures
--------

The really interesting side-effect of having an accelerometer is gesture
detection. If you move your BBC micro:bit in a certain way (as a gesture) then
MicroPython is able to detect this.

MicroPython is able to recognise the following gestures: ``up``, ``down``,
``left``, ``right``, ``face up``, ``face down``, ``freefall``, ``3g``, ``6g``,
``8g``, ``shake``. Gestures are always represented as strings. While most of
the names should be obvious, the ``3g``, ``6g`` and ``8g`` gestures apply when
the device encounters these levels of g-force (like when an astronaut is
launched into space).

To get the current gesture use the ``accelerometer.current_gesture`` method.
Its result is going to be one of the named gestures listed above. For example,
this program will only make your device happy if it is face up::

    from microbit import *

    while True:
        gesture = accelerometer.current_gesture()
        if gesture == "face up":
            display.show(Image.HAPPY)
        else:
            display.show(Image.ANGRY)

Once again, because we want the device to react to changing circumstances we
use a ``while`` loop. Within the *scope* of the loop the current gesture is
read and put into ``gesture``. The ``if`` conditional checks if ``gesture`` is
equal to ``"face up"`` (Python uses ``==`` to test for equality, a single
equals sign ``=`` is used for assignment - just like how we assign the gesture
reading to the ``gesture`` object). If the gesture is equal to ``"face up"``
then use the display to show a happy face. Otherwise, the device is made to
look angry!

Magic-8
+++++++

A Magic-8 ball is a toy first invented in the 1950s. The idea is to ask
it a yes/no question, shake it and wait for it to reveal the truth. It's rather
easy to turn into a program::

    from microbit import *
    import random

    answers = [
        "It is certain",
        "It is decidedly so",
        "Without a doubt",
        "Yes, definitely",
        "You may rely on it",
        "As I see it, yes",
        "Most likely",
        "Outlook good",
        "Yes",
        "Signs point to yes",
        "Reply hazy try again",
        "Ask again later",
        "Better not tell you now",
        "Cannot predict now",
        "Concentrate and ask again",
        "Don't count on it",
        "My reply is no",
        "My sources say no",
        "Outlook not so good",
        "Very doubtful",
    ]

    while True:
        display.show("8")
        if accelerometer.was_gesture("shake"):
            display.clear()
            sleep(1000)
            display.scroll(random.choice(answers))

Most of the program is a list called ``answers``. The actual game is in the
``while`` loop at the end.

The default state of the game is to show the character ``"8"``. However, the
program needs to detect if it has been shaken. The ``was_gesture`` method uses
its argument (in this case, the string ``"shake"`` because we want to detect
a shake) to return a ``True`` / ``False`` response. If the device was shaken
the ``if`` conditional drops into its block of code where it clears the screen,
waits for a second (so the device appears to be thinking about your question)
and displays a randomly chosen answer.

Why not ask it if this is the greatest program ever written? What could you do
to "cheat" and make the answer always positive or negative? (Hint: use the
buttons.)


================================================
FILE: micropython/docs/tutorials/hello.rst
================================================
Hello, World!
-------------

The traditional way to start programming in a new language is to get your
computer to say, "Hello, World!".

.. image:: ../scroll-hello.gif

This is easy with MicroPython::

    from microbit import *
    display.scroll("Hello, World!")

Each line does something special. The first line::

    from microbit import *

...tells MicroPython to get all the stuff it needs to work with the BBC
micro:bit. All this stuff is in a module called ``microbit`` (a module
is a library of pre-existing code). When you ``import`` something you're telling
MicroPython that you want to use it, and ``*`` is Python's way to say
*everything*. So, ``from microbit import *`` means, in English, "I want to be
able to use everything from the microbit code library".

The second line::

    display.scroll("Hello, World!")

...tells MicroPython to use the display to scroll the string of characters
"Hello, World!". The ``display`` part of that line is an *object* from the
``microbit`` module that represents the device's physical display (we say
"object" instead of "thingy", "whatsit" or "doodah"). We can tell the display
to do things with a full-stop ``.`` followed by what looks like a command (in
fact it's something we call a *method*). In this case we're using the
``scroll`` method. Since ``scroll`` needs to know what characters to scroll
across the physical display we specify them between double quotes (``"``)
within parenthesis (``(`` and ``)``). These are called the *arguments*. So,
``display.scroll("Hello, World!")`` means, in English, "I want you to use the
display to scroll the text 'Hello, World!'". If a method doesn't need any
arguments we make this clear by using empty parenthesis like this: ``()``.

Copy the "Hello, World!" code into your editor and flash it onto the device.
Can you work out how to change the message? Can you make it say hello to you?
For example, I might make it say "Hello, Nicholas!". Here's a clue, you need to
change the scroll method's argument.

.. warning::

    It may not work. :-)

    This is where things get fun and MicroPython tries to be helpful. If
    it encounters an error it will scroll a helpful message on the micro:bit's
    display. If it can, it will tell you the line number for where the error
    can be found.

    Python expects you to type **EXACTLY** the right thing. So, for instance,
    ``Microbit``, ``microbit`` and ``microBit`` are all different things to
    Python. If MicroPython complains about a ``NameError`` it's probably
    because you've typed something inaccurately. It's like the difference
    between referring to "Nicholas" and "Nicolas". They're two different people
    but their names look very similar.

    If MicroPython complains about a ``SyntaxError`` you've simply typed code
    in a way that MicroPython can't understand. Check you're not missing any
    special characters like ``"`` or ``:``. It's like putting. a full stop in
    the middle of a sentence. It's hard to understand exactly what you mean.

    Your microbit may stop responding: you cannot flash new code to it or
    enter commands into the REPL. If this happens, try power cycling it. That
    is, unplug the USB cable (and battery cable if it's connected), then plug
    the cable back in again. You may also need to quit and re-start your code
    editor application.


================================================
FILE: micropython/docs/tutorials/images.rst
================================================
Images
------

MicroPython is about as good at art as you can be if the only thing you have is
a 5x5 grid of red LEDs (light emitting diodes - the things that light up on the
front of the device). MicroPython gives you quite a lot of control over the
display so you can create all sorts of interesting effects.

MicroPython comes with lots of built-in pictures to show on the display.
For example, to make the device appear happy you type::

    from microbit import *
    display.show(Image.HAPPY)

I suspect you can remember what the first line does. The second line uses the
``display`` object to ``show`` a built-in image. The happy image we want to
display is a part of the ``Image`` object and called ``HAPPY``. We tell
``show`` to use it by putting it between the parenthesis (``(`` and ``)``).

.. image:: happy.png

Here's a list of the built-in images:

    * ``Image.HEART``
    * ``Image.HEART_SMALL``
    * ``Image.HAPPY``
    * ``Image.SMILE``
    * ``Image.SAD``
    * ``Image.CONFUSED``
    * ``Image.ANGRY``
    * ``Image.ASLEEP``
    * ``Image.SURPRISED``
    * ``Image.SILLY``
    * ``Image.FABULOUS``
    * ``Image.MEH``
    * ``Image.YES``
    * ``Image.NO``
    * ``Image.CLOCK12``, ``Image.CLOCK11``, ``Image.CLOCK10``, ``Image.CLOCK9``,
      ``Image.CLOCK8``, ``Image.CLOCK7``, ``Image.CLOCK6``, ``Image.CLOCK5``,
      ``Image.CLOCK4``, ``Image.CLOCK3``, ``Image.CLOCK2``, ``Image.CLOCK1``
    * ``Image.ARROW_N``, ``Image.ARROW_NE``, ``Image.ARROW_E``,
      ``Image.ARROW_SE``, ``Image.ARROW_S``, ``Image.ARROW_SW``,
      ``Image.ARROW_W``, ``Image.ARROW_NW``
    * ``Image.TRIANGLE``
    * ``Image.TRIANGLE_LEFT``
    * ``Image.CHESSBOARD``
    * ``Image.DIAMOND``
    * ``Image.DIAMOND_SMALL``
    * ``Image.SQUARE``
    * ``Image.SQUARE_SMALL``
    * ``Image.RABBIT``
    * ``Image.COW``
    * ``Image.MUSIC_CROTCHET``
    * ``Image.MUSIC_QUAVER``
    * ``Image.MUSIC_QUAVERS``
    * ``Image.PITCHFORK``
    * ``Image.XMAS``
    * ``Image.PACMAN``
    * ``Image.TARGET``
    * ``Image.TSHIRT``
    * ``Image.ROLLERSKATE``
    * ``Image.DUCK``
    * ``Image.HOUSE``
    * ``Image.TORTOISE``
    * ``Image.BUTTERFLY``
    * ``Image.STICKFIGURE``
    * ``Image.GHOST``
    * ``Image.SWORD``
    * ``Image.GIRAFFE``
    * ``Image.SKULL``
    * ``Image.UMBRELLA``
    * ``Image.SNAKE``

There's quite a lot! Why not modify the code that makes the micro:bit look
happy to see what some of the other built-in images look like? (Just replace
``Image.HAPPY`` with one of the built-in images listed above.)

DIY Images
++++++++++

Of course, you want to make your own image to display on the micro:bit, right?

That's easy.

Each LED pixel on the physical display can be set to one of ten values. If a
pixel is set to ``0`` (zero) then it's off. It literally has zero brightness.
However, if it is set to ``9`` then it is at its brightest level. The values
``1`` to ``8`` represent the brightness levels between off (``0``) and full on
(``9``).

Armed with this information, it's possible to create a new image like this::

    from microbit import *

    boat = Image("05050:"
                 "05050:"
                 "05050:"
                 "99999:"
                 "09990")

    display.show(boat)

(When run, the device should display an old-fashioned "Blue Peter" sailing ship
with the masts dimmer than the boat's hull.)

Have you figured out how to draw a picture? Have you noticed that each line of
the physical display is represented by a line of numbers ending in ``:`` and
enclosed between ``"`` double quotes? Each number specifies a brightness.
There are five lines of five numbers so it's possible to specify the individual
brightness for each of the five pixels on each of the five lines on the
physical display. That's how to create a new image.

Simple!

In fact, you don't need to write this over several lines. If you think you can
keep track of each line, you can rewrite it like this::

    boat = Image("05050:05050:05050:99999:09990")

Animation
+++++++++

Static images are fun, but it's even more fun to make them move. This is also
amazingly simple to do with MicroPython ~ just use a list of images!

Here is a shopping list::

    Eggs
    Bacon
    Tomatoes

Here's how you'd represent this list in Python::

    shopping = ["Eggs", "Bacon", "Tomatoes" ]

I've simply created a list called ``shopping`` and it contains three items.
Python knows it's a list because it's enclosed in square brackets (``[`` and
``]``). Items in the list are separated by a comma (``,``) and in this instance
the items are three strings of characters: ``"Eggs"``, ``"Bacon"`` and
``"Tomatoes"``. We know they are strings of characters because they're enclosed
in quotation marks ``"``.

You can store anything in a list with Python. Here's a list of numbers::

    primes = [2, 3, 5, 7, 11, 13, 17, 19]


.. note::

    Numbers don't need to be quoted since they represent a value (rather than a
    string of characters). It's the difference between ``2`` (the numeric value
    2) and ``"2"`` (the character/digit representing the number 2). Don't worry
    if this doesn't make sense right now. You'll soon get used to it.

It's even possible to store different sorts of things in the same list::

    mixed_up_list = ["hello!", 1.234, Image.HAPPY]

Notice that last item? It was an image!

We can tell MicroPython to animate a list of images. Luckily we have a
couple of lists of images already built in. They're called ``Image.ALL_CLOCKS``
and ``Image.ALL_ARROWS``::

    from microbit import *

    display.show(Image.ALL_CLOCKS, loop=True, delay=100)

As with a single image, we use ``display.show`` to show it on the
device's display. However, we tell MicroPython to use ``Image.ALL_CLOCKS`` and
it understands that it needs to show each image in the list, one after the
other. We also tell MicroPython to keep looping over the list of images (so
the animation lasts forever) by saying ``loop=True``. Furthermore, we tell it
that we want the delay between each image to be only 100 milliseconds (a tenth
of a second) with the argument ``delay=100``.

Can you work out how to animate over the ``Image.ALL_ARROWS`` list? How do you
avoid looping forever (hint: the opposite of ``True`` is ``False`` although
the default value for ``loop`` is ``False``)? Can you change the speed of the
animation?

Finally, here's how to create your own animation. In my example I'm going to
make my boat sink into the bottom of the display::

    from microbit import *

    boat1 = Image("05050:"
                  "05050:"
                  "05050:"
                  "99999:"
                  "09990")

    boat2 = Image("00000:"
                  "05050:"
                  "05050:"
                  "05050:"
                  "99999")

    boat3 = Image("00000:"
                  "00000:"
                  "05050:"
                  "05050:"
                  "05050")

    boat4 = Image("00000:"
                  "00000:"
                  "00000:"
                  "05050:"
                  "05050")

    boat5 = Image("00000:"
                  "00000:"
                  "00000:"
                  "00000:"
                  "05050")

    boat6 = Image("00000:"
                  "00000:"
                  "00000:"
                  "00000:"
                  "00000")

    all_boats = [boat1, boat2, boat3, boat4, boat5, boat6]
    display.show(all_boats, delay=200)

Here's how the code works:

* I create six ``boat`` images in exactly the same way I described above.
* Then, I put them all into a list that I call ``all_boats``.
* Finally, I ask ``display.show`` to animate the list with a delay of 200 milliseconds.
* Since I've not set ``loop=True`` the boat will only sink once (thus making my animation scientifically accurate). :-)

What would you animate? Can you animate special effects? How would you make an
image fade out and then fade in again?


================================================
FILE: micropython/docs/tutorials/introduction.rst
================================================
Introduction
------------

We suggest you download and use the `mu editor <http://codewith.mu/>`_ when
working through these tutorials. Instructions for downloading and installing
Mu are on its website. You may need to install a driver, depending on your
platform (instruction are on the website).

Mu works with Windows, OSX and Linux.

Once Mu is installed connect your micro:bit to your computer via a USB lead.

Write your script in the editor window and click the "Flash" button to transfer
it to the micro:bit. If it doesn't work, make sure your micro:bit appears as
a USB storage device in your file system explorer.

.. toctree::
    :maxdepth: 2
    :caption: Tutorials

    hello
    images
    buttons
    io
    music
    random
    movement
    gestures
    direction
    storage
    speech
    network
    radio
    next

Python is one of the `world's most popular <http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html>`_ programming languages. Every day, without
realising, you probably use software written using Python. All sorts of
companies and organisations use Python for a diverse range of applications.
Google, NASA, Bank of America, Disney, CERN, YouTube, Mozilla, The Guardian -
the list goes on and covers all sectors of the economy, science and the arts.

For example, do you remember the announcement of the `discovery of gravitational waves <http://www.bbc.co.uk/news/science-environment-35552207>`_? The instruments used to make the measurements were controlled `with Python <https://www.reddit.com/r/IAmA/comments/45g8qu/we_are_the_ligo_scientific_collaboration_and_we/czxnlux>`_.

Put simply, if you teach or learn Python, you are developing a highly valuable
skill that applies to all areas of human endeavour.

One such area is the BBC's amazing micro:bit device. It runs a version of
Python called MicroPython that's designed to run on small computers like the BBC
micro:bit. It's a full implementation of Python 3 so when you move onto other
things (such as programming Python on a Raspberry Pi) you'll use exactly the
same language.

MicroPython does not include all the standard code libraries that come with
"regular" Python. However, we have created a special ``microbit`` module in
MicroPython that lets you control the device.

Python and MicroPython are free software. Not only does this mean you don't pay
anything to use Python, but you are also free to contribute back to the Python
community. This may be in the form of code, documentation, bug reports, running
a community group or writing tutorials (like this one). In fact, all the Python
related resources for the BBC micro:bit have been created by an international
team of volunteers working in their free time.

These lessons introduce MicroPython and the BBC
micro:bit in easy-to-follow steps. Feel free to adopt and adapt them for
classroom based lessons, or perhaps just follow them on your own at home.

You'll have most success if you explore, experiment and play. You can't break
a BBC micro:bit by writing incorrect code. Just dive in!

A word of warning: *you will fail many times*, and that is fine. **Failure is
how good software developers learn**. Those of us who work as software
developers have a lot of fun tracking down bugs and avoiding the repetition of
mistakes.

If in doubt, remember the Zen of MicroPython::

    Code,
    Hack it,
    Less is more,
    Keep it simple,
    Small is beautiful,

    Be brave! Break things! Learn and have fun!
    Express yourself with MicroPython.

    Happy hacking! :-)

Best of luck!


================================================
FILE: micropython/docs/tutorials/io.rst
================================================
Input/Output
------------

There are strips of metal along the bottom edge of the BBC micro:bit that make
it look as if the device has teeth. These are the input/output pins (or I/O pins
for short).

.. image:: blue-microbit.png

Some of the pins are bigger than others so it's possible to attach crocodile
clips to them. These are the ones labelled 0, 1, 2, 3V and GND (computers
always start counting from zero). If you attach an edge connector board to the
device it's possible to plug in wires connected to the other (smaller) pins.

Each pin on the BBC micro:bit is represented by an *object* called ``pinN``
where ``N`` is the pin number. So, for example, to do things with the pin
labelled with a 0 (zero), use the object called ``pin0``.

Simple!

These objects have various *methods* associated with them depending upon what
the specific pin is capable of.

Ticklish Python
+++++++++++++++

The simplest example of input via the pins is a check to see if they are
touched. So, you can tickle your device to make it laugh like this::

    from microbit import *

    while True:
        if pin0.is_touched():
            display.show(Image.HAPPY)
        else:
            display.show(Image.SAD)

With one hand, hold your device by the GND pin. Then, with your other hand,
touch (or tickle) the 0 (zero) pin. You should see the display change from
grumpy to happy!

This is a form of very basic input measurement. However, the fun really starts
when you plug in circuits and other devices via the pins.

Bleeps and Bloops
+++++++++++++++++

The simplest thing we can attach to the device is a Piezo buzzer. We're going
to use it for output.

.. image:: piezo_buzzer.jpg

These small devices play a high-pitched bleep when connected to a circuit. To
attach one to your BBC micro:bit you should attach crocodile clips to pin 0 and
GND (as shown below).

.. image:: pin0-gnd.png

The wire from pin 0 should be attached to the positive connector on the buzzer
and the wire from GND to the negative connector.

The following program will cause the buzzer to make a sound::

    from microbit import *

    pin0.write_digital(1)

This is fun for about 5 seconds and then you'll want to make the horrible
squeaking stop. Let's improve our example and make the device bleep::

    from microbit import *

    while True:
        pin0.write_digital(1)
        sleep(20)
        pin0.write_digital(0)
        sleep(480)

Can you work out how this script works? Remember that ``1`` is "on" and ``0``
is "off" in the digital world.

The device is put into an infinite loop and immediately switches pin 0 on. This
causes the buzzer to emit a beep. While the buzzer is beeping, the device
sleeps for twenty milliseconds and then switches pin 0 off. This gives the
effect of a short bleep. Finally, the device sleeps for 480 milliseconds before
looping back and starting all over again. This means you'll get two bleeps per
second (one every 500 milliseconds).

We've made a very simple metronome!

.. footer:: The image of the pizeo buzzer is CC BY-NC-SA 3.0 from https://www.flickr.com/photos/tronixstuff/4821350094


================================================
FILE: micropython/docs/tutorials/movement.rst
================================================
Movement
--------

Your BBC micro:bit comes with an accelerometer. It measures movement along
three axes:

* X - tilting from left to right.
* Y - tilting forwards and backwards.
* Z - moving up and down.

There is a method for each axis that returns a positive or negative number
indicating a measurement in milli-g's. When the reading is 0 you are "level"
along that particular axis.

For example, here's a very simple spirit-level that uses ``get_x`` to measure
how level the device is along the X axis::

    from microbit import *

    while True:
        reading = accelerometer.get_x()
        if reading > 20:
            display.show("R")
        elif reading < -20:
            display.show("L")
        else:
            display.show("-")

If you hold the device flat it should display ``-``; however, rotate it left or
right and it'll show ``L`` and ``R`` respectively.

We want the device to constantly react to change, so we use an
infinite ``while`` loop. The first thing to happen *within the body of the
loop* is a measurement along the X axis which is called ``reading``. Because
the accelerometer is *so* sensitive I've made level +/-20 in range. It's why
the ``if`` and ``elif`` conditionals check for ``> 20`` and ``< -20``. The
``else`` statement means that if the ``reading`` is between -20 and 20 then
we consider it level. For each of these conditions we use the display to show
the appropriate character.

There is also a ``get_y`` method for the Y axis and a ``get_z`` method for the
Z axis.

If you've ever wondered how a mobile phone knows which up to show the images on
its screen, it's because it uses an accelerometer in exactly the same way as
the program above. Game controllers also contain accelerometers to help you
steer and move around in games.

Musical Mayhem
++++++++++++++

One of the most wonderful aspects of MicroPython on the BBC micro:bit is how it
lets you easily link different capabilities of the device together. For
example, let's turn it into a musical instrument (of sorts).

Connect a speaker as you did in the music tutorial. Use crocodile clips to
attach pin 0 and GND to the positive and negative inputs on the speaker - it
doesn't matter which way round they are connected to the speaker.

.. image:: pin0-gnd.png

What happens if we take the readings from the accelerometer and play them as
pitches? Let's find out::

    from microbit import *
    import music

    while True:
        music.pitch(accelerometer.get_y(), 10)

The key line is at the end and remarkably simple. We *nest* the reading from
the Y axis as the frequency to feed into the ``music.pitch`` method. We only
let it play for 10 milliseconds because we want the tone to change quickly as
the device is tipped. Because the device is in an infinite ``while`` loop it
is constantly reacting to changes in the Y axis measurement.

That's it!

Tip the device forwards and backwards. If the reading along the Y axis is
positive it'll change the pitch of the tone played by the micro:bit.

Imagine a whole symphony orchestra of these devices. Can you play a tune? How
would you improve the program to make the micro:bit sound more musical?


================================================
FILE: micropython/docs/tutorials/music.rst
================================================
Music
-----

MicroPython on the BBC micro:bit comes with a powerful music and sound module.
It's very easy to generate bleeps and bloops from the device *if you attach a
speaker*. Use crocodile clips to attach pin 0 and GND to the positive and
negative inputs on the speaker - it doesn't matter which way round they are
connected to the speaker.

.. image:: pin0-gnd.png

.. note::

    Do not attempt this with a Piezo buzzer - such buzzers are only able to
    play a single tone.

Let's play some music::

    import music

    music.play(music.NYAN)

Notice that we import the ``music`` module. It contains methods used to make
and control sound.

MicroPython has quite a lot of built-in melodies. Here's a complete list:

* ``music.DADADADUM``
* ``music.ENTERTAINER``
* ``music.PRELUDE``
* ``music.ODE``
* ``music.NYAN``
* ``music.RINGTONE``
* ``music.FUNK``
* ``music.BLUES``
* ``music.BIRTHDAY``
* ``music.WEDDING``
* ``music.FUNERAL``
* ``music.PUNCHLINE``
* ``music.PYTHON``
* ``music.BADDY``
* ``music.CHASE``
* ``music.BA_DING``
* ``music.WAWAWAWAA``
* ``music.JUMP_UP``
* ``music.JUMP_DOWN``
* ``music.POWER_UP``
* ``music.POWER_DOWN``

Take the example code and change the melody. Which one is your favourite? How
would you use such tunes as signals or cues?

Wolfgang Amadeus Microbit
+++++++++++++++++++++++++

Creating your own tunes is easy!

Each note has a name (like ``C#`` or ``F``), an octave (telling MicroPython how
high or low the note should be played) and a duration (how
long it lasts through time). Octaves are indicated by a number ~ 0 is the
lowest octave, 4 contains middle C and 8 is about as high as you'll ever need
unless you're making music for dogs. Durations are also expressed as numbers.
The higher the value of the duration the longer it will last. Such
values are related to each other - for instance, a duration of ``4`` will last
twice as long as a duration ``2`` (and so on). If you use the note name ``R``
then MicroPython will play a rest (i.e. silence) for the specified duration.

Each note is expressed as a string of characters like this::

    NOTE[octave][:duration]

For example, ``"A1:4"`` refers to the note named ``A`` in octave number ``1``
to be played for a duration of ``4``.

Make a list of notes to create a melody (it's equivalent to creating an
animation with a list of images). For example, here's how to make MicroPython
play opening of "Frere Jaques"::

    import music

    tune = ["C4:4", "D4:4", "E4:4", "C4:4", "C4:4", "D4:4", "E4:4", "C4:4",
            "E4:4", "F4:4", "G4:8", "E4:4", "F4:4", "G4:8"]
    music.play(tune)

.. note::

    MicroPython helps you to simplify such melodies. It'll remember the octave
    and duration values until you next change them. As a result, the example
    above can be re-written as::

        import music

        tune = ["C4:4", "D", "E", "C", "C", "D", "E", "C", "E", "F", "G:8",
                "E:4", "F", "G:8"]
        music.play(tune)

    Notice how the octave and duration values only change when they have to.
    It's a lot less typing and simpler to read.

Sound Effects
+++++++++++++

MicroPython lets you make tones that are not musical notes. For example, here's
how to create a Police siren effect::

    import music

    while True:
        for freq in range(880, 1760, 16):
            music.pitch(freq, 6)
        for freq in range(1760, 880, -16):
            music.pitch(freq, 6)


Notice how the ``music.pitch`` *method* is used in this instance. It expects a
frequency. For example, the frequency of ``440`` is the same as a concert ``A``
used to tune a symphony orchestra.

In the example above the ``range`` function is used to generate ranges of
numeric values. These numbers are used to define the pitch of the tone. The
three arguments for the ``range`` function are the start value, end value and
step size. Therefore, the first use of ``range`` is saying, in English, "create
a range of numbers between 880 and 1760 in steps of 16". The second use of
``range`` is saying, "create a range of values between 1760 and 880 in steps of
-16". This is how we get a range of frequencies that go up and down in pitch
like a siren.

Because the siren should last forever it's wrapped in an infinite ``while``
loop.

Importantly, we have introduced a new sort of a loop inside the ``while``
loop: the ``for`` loop. In English it's like saying, "for each item in some
collection, do some activity with it". Specifically in the example above, it's
saying, "for each frequency in the specified range of frequencies, play the
pitch of that frequency for 6 milliseconds". Notice how the thing to do for
each item in a for loop is indented (as discussed earlier) so Python knows
exactly which code to run to handle the individual items.


================================================
FILE: micropython/docs/tutorials/network.rst
================================================
Network
-------

It is possible to connect devices together to send and receive
messages to and from each other. This is called a network. A network of
interconnected networks is called an internet. The Internet is an internet
of all the internets.

Networking is hard and this is reflected in the program described below.
However, the beautiful thing about this project is it contains all the common
aspects of network programming you need to know about. It's also remarkably
simple and fun.

But first, let's set the scene...

Connection
++++++++++

Imagine a network as a series of layers. At the very bottom is the most
fundamental aspect of communication: there needs to be some sort of way for
a signal to get from one device to the other. Sometimes this is done via a
radio connection, but in this example we're simply going to use two wires.

.. image:: network.png

It is upon this foundation that we can build all the other layers in the
*network stack*.

As the diagram shows, blue and red micro:bits are connected via crocodile
leads. Both use pin 1 for output and pin 2 for input. The output from one
device is connected to the input on the other. It's a bit like knowing which
way round to hold a telephone handset - one end has a microphone (the input)
and the other a speaker (the output). The recording of your voice via your
microphone is played out of the other person's speaker. If you hold the
phone the wrong way up, you'll get strange results!

It's exactly the same in this instance: you must connect the wires properly!

Signal
++++++

The next layer in the *network stack* is the signal. Often this will depend
upon the characteristics of the connection. In our example it's simply
digital on and off signals sent down the wires via the IO pins.

If you remember, it's possible to use the IO pins like this::

    pin1.write_digital(1)  # switch the signal on
    pin1.write_digital(0)  # switch the signal off
    input = pin2.read_digital()  # read the value of the signal (either 1 or 0)

The next step involves describing how to use and handle a signal. For that we
need a...

Protocol
++++++++

If you ever meet the Queen there are expectations about how you ought to
behave. For example, when she arrives you may bow or curtsey, if she offers her
hand politely shake it, refer to her as "your majesty" and thereafter as
"ma'am" and so on. This set of rules is called the royal protocol. A protocol
explains how to behave given a specific situation (such as meeting the
Queen). A protocol is pre-defined to ensure everyone understands what's going
on before a given situation arises.

.. image:: queen.jpg

It is for this reason that we define and use protocols for communicating
messages via a computer network. Computers need to agree before hand how to
send and receive messages. Perhaps the best known protocol is the
hypertext transfer protocol (HTTP) used by the world wide web.

Another famous protocol for sending messages (that pre-dates computers) is
Morse code. It defines how to send character-based messages via on/off signals
of long or short durations. Often such signals are played as bleeps. Long
durations are called dashes (``-``) whereas short durations are dots (``.``).
By combining dashes and dots Morse defines a way to send characters. For
example, here's how the standard Morse alphabet is defined::

    .-    A     .---  J     ...   S     .----  1      ----.  9
    -...  B     -.-   K     -     T     ..---  2      -----  0
    -.-.  C     .-..  L     ..-   U     ...--  3
    -..   D     --    M     ...-  V     ....-  4
    .     E     -.    N     .--   W     .....  5
    ..-.  F     ---   O     -..-  X     -....  6
    --.   G     .--.  P     -.--  Y     --...  7
    ....  H     --.-  Q     --..  Z     ---..  8
    ..    I     .-.   R

Given the chart above, to send the character "H" the signal is switched on four
times for a short duration, indicating four dots (``....``). For the letter
"L" the signal is also switched on four times, but the second signal has a
longer duration (``.-..``).

Obviously, the timing of the signal is important: we need to tell a dot from a
dash. That's another point of a protocol, to agree such things so everyone's
implementation of the protocol will work with everyone elses. In this instance
we'll just say that:

* A signal with a duration less than 250 milliseconds is a dot.
* A signal with a duration from 250 milliseconds to less than 500 milliseconds is a dash.
* Any other duration of signal is ignored.
* A pause / gap in the signal of greater than 500 milliseconds indicates the end of a character.

In this way, the sending of a letter "H" is defined as four "on" signals that
last no longer than 250 milliseconds each, followed by a pause of greater than
500 milliseconds (indicating the end of the character).

Message
+++++++

We're finally at a stage where we can build a message - a message that actually
means something to us humans. This is the top-most layer of our *network
stack*.

Using the protocol defined above I can send the following sequence of signals
down the physical wire to the other micro:bit::

    ...././.-../.-../---/.--/---/.-./.-../-..

Can you work out what it says?

Application
+++++++++++

It's all very well having a network stack, but you also need a way to
interact with it - some form of application to send and receive messages.
While HTTP is interesting *most* people don't know about it and let their
web-browser handle it - the underlying *network stack* of the world wide web
is hidden (as it should be).

So, what sort of application should we write for the BBC micro:bit? How should
it work, from the user's point of view?

Obviously, to send a message you should be able to input dots and dashes (we
can use button A for that). If we want to see the message we sent or just
received we should be able to trigger it to scroll across the display (we can
use button B for that). Finally, this being Morse code, if a speaker is
attached, we should be able to play the beeps as a form of aural feedback while
the user is entering their message.

The End Result
++++++++++++++

Here's the program, in all its glory and annotated with plenty of comments so
you can see what's going on::

    from microbit import *
    import music


    # A lookup table of morse codes and associated characters.
    MORSE_CODE_LOOKUP = {
        ".-": "A",
        "-...": "B",
        "-.-.": "C",
        "-..": "D",
        ".": "E",
        "..-.": "F",
        "--.": "G",
        "....": "H",
        "..": "I",
        ".---": "J",
        "-.-": "K",
        ".-..": "L",
        "--": "M",
        "-.": "N",
        "---": "O",
        ".--.": "P",
        "--.-": "Q",
        ".-.": "R",
        "...": "S",
        "-": "T",
        "..-": "U",
        "...-": "V",
        ".--": "W",
        "-..-": "X",
        "-.--": "Y",
        "--..": "Z",
        ".----": "1",
        "..---": "2",
        "...--": "3",
        "....-": "4",
        ".....": "5",
        "-....": "6",
        "--...": "7",
        "---..": "8",
        "----.": "9",
        "-----": "0"
    }


    def decode(buffer):
        # Attempts to get the buffer of Morse code data from the lookup table. If
        # it's not there, just return a full stop.
        return MORSE_CODE_LOOKUP.get(buffer, '.')


    # How to display a single dot.
    DOT = Image("00000:"
                "00000:"
                "00900:"
                "00000:"
                "00000:")


    # How to display a single dash.
    DASH = Image("00000:"
                 "00000:"
                 "09990:"
                 "00000:"
                 "00000:")


    # To create a DOT you need to hold the button for less than 250ms.
    DOT_THRESHOLD = 250
    # To create a DASH you need to hold the button for less than 500ms.
    DASH_THRESHOLD = 500


    # Holds the incoming Morse signals.
    buffer = ''
    # Holds the translated Morse as characters.
    message = ''
    # The time from which the device has been waiting for the next keypress.
    started_to_wait = running_time()


    # Put the device in a loop to wait for and react to key presses.
    while True:
        # Work out how long the device has been waiting for a keypress.
        waiting = running_time() - started_to_wait
        # Reset the timestamp for the key_down_time.
        key_down_time = None
        # If button_a is held down, then...
        while button_a.is_pressed():
            # Play a beep - this is Morse code y'know ;-)
            music.pitch(880, 10)
            # Set pin1 (output) to "on"
            pin1.write_digital(1)
            # ...and if there's not a key_down_time then set it to now!
            if not key_down_time:
                key_down_time = running_time()
        # Alternatively, if pin2 (input) is getting a signal, pretend it's a
        # button_a key press...
        while pin2.read_digital():
            if not key_down_time:
                key_down_time = running_time()
        # Get the current time and call it key_up_time.
        key_up_time = running_time()
        # Set pin1 (output) to "off"
        pin1.write_digital(0)
        # If there's a key_down_time (created when button_a was first pressed
        # down).
        if key_down_time:
            # ... then work out for how long it was pressed.
            duration = key_up_time - key_down_time
            # If the duration is less than the max length for a "dot" press...
            if duration < DOT_THRESHOLD:
                # ... then add a dot to the buffer containing incoming Morse codes
                # and display a dot on the display.
                buffer += '.'
                display.show(DOT)
            # Else, if the duration is less than the max length for a "dash"
            # press... (but longer than that for a DOT ~ handled above)
            elif duration < DASH_THRESHOLD:
                # ... then add a dash to the buffer and display a dash.
                buffer += '-'
                display.show(DASH)
            # Otherwise, any other sort of keypress duration is ignored (this isn't
            # needed, but added for "understandability").
            else:
                pass
            # The button press has been handled, so reset the time from which the
            # device is starting to wait for a  button press.
            started_to_wait = running_time()
        # Otherwise, there hasn't been a button_a press during this c
Download .txt
gitextract_ckfa0abd/

├── .gitignore
├── README.md
├── doc/
│   └── README.md
├── examples/
│   ├── ble-advertiser/
│   │   ├── advertise.py
│   │   └── sniffer.py
│   ├── ble-conn-sniffing/
│   │   └── sniff_conn.py
│   ├── esb-sample-sniff.py/
│   │   └── wireless-keyboard-sniff.py
│   └── helloworld/
│       └── helloworld.py
├── micropython/
│   ├── .gitignore
│   ├── AUTHORS
│   ├── LICENSE
│   ├── Makefile
│   ├── README.md
│   ├── config.json
│   ├── docs/
│   │   ├── Makefile
│   │   ├── accelerometer.rst
│   │   ├── audio.rst
│   │   ├── ble.rst
│   │   ├── button.rst
│   │   ├── compass.rst
│   │   ├── conf.py
│   │   ├── devguide/
│   │   │   ├── contributing.rst
│   │   │   ├── devfaq.rst
│   │   │   ├── flashfirmware.rst
│   │   │   ├── hexformat.rst
│   │   │   ├── installation.rst
│   │   │   └── repl.rst
│   │   ├── display.rst
│   │   ├── filesystem.rst
│   │   ├── i2c.rst
│   │   ├── image.rst
│   │   ├── index.rst
│   │   ├── machine.rst
│   │   ├── make.bat
│   │   ├── microbit.rst
│   │   ├── microbit_micropython_api.rst
│   │   ├── micropython.rst
│   │   ├── music.rst
│   │   ├── neopixel.rst
│   │   ├── os.rst
│   │   ├── pin.rst
│   │   ├── radio.rst
│   │   ├── random.rst
│   │   ├── speech.rst
│   │   ├── spi.rst
│   │   ├── tutorials/
│   │   │   ├── buttons.rst
│   │   │   ├── direction.rst
│   │   │   ├── gestures.rst
│   │   │   ├── hello.rst
│   │   │   ├── images.rst
│   │   │   ├── introduction.rst
│   │   │   ├── io.rst
│   │   │   ├── movement.rst
│   │   │   ├── music.rst
│   │   │   ├── network.rst
│   │   │   ├── next.rst
│   │   │   ├── radio.rst
│   │   │   ├── random.rst
│   │   │   ├── speech.rst
│   │   │   └── storage.rst
│   │   ├── uart.rst
│   │   └── utime.rst
│   ├── examples/
│   │   ├── analog_watch.py
│   │   ├── asmleds.py
│   │   ├── bubble_level_2d.py
│   │   ├── compass.py
│   │   ├── conway.py
│   │   ├── counter.py
│   │   ├── digital_water.py
│   │   ├── dodge_game.py
│   │   ├── flame_simulation.py
│   │   ├── flappybit.py
│   │   ├── four_buttons.py
│   │   ├── i_feel_today.py
│   │   ├── led_dance.py
│   │   ├── magic8.py
│   │   ├── maze.py
│   │   ├── music.py
│   │   ├── neopixel_random.py
│   │   ├── play_file.py
│   │   ├── pomodoro.py
│   │   ├── radio.py
│   │   ├── reverb.py
│   │   ├── simple_slalom.py
│   │   ├── speech.py
│   │   ├── tiltmusic.py
│   │   ├── watch.py
│   │   └── waveforms.py
│   ├── inc/
│   │   ├── extmod/
│   │   │   ├── machine_mem.h
│   │   │   ├── machine_pulse.h
│   │   │   └── utime_mphal.h
│   │   ├── genhdr/
│   │   │   ├── mpversion.h
│   │   │   └── qstrdefs.generated.h
│   │   ├── lib/
│   │   │   ├── iters.h
│   │   │   ├── mp-readline/
│   │   │   │   └── readline.h
│   │   │   ├── pwm.h
│   │   │   ├── ticker.h
│   │   │   └── utils/
│   │   │       ├── interrupt_char.h
│   │   │       └── pyexec.h
│   │   ├── microbit/
│   │   │   ├── MicroBitCustomConfig.h
│   │   │   ├── filesystem.h
│   │   │   ├── memory.h
│   │   │   ├── microbit_image.h
│   │   │   ├── microbitdal.h
│   │   │   ├── modaudio.h
│   │   │   ├── modmicrobit.h
│   │   │   ├── modmusic.h
│   │   │   ├── mpconfigport.h
│   │   │   ├── mphalport.h
│   │   │   └── qstrdefsport.h
│   │   └── py/
│   │       ├── asmarm.h
│   │       ├── asmbase.h
│   │       ├── asmthumb.h
│   │       ├── asmx64.h
│   │       ├── asmx86.h
│   │       ├── asmxtensa.h
│   │       ├── bc.h
│   │       ├── bc0.h
│   │       ├── binary.h
│   │       ├── builtin.h
│   │       ├── compile.h
│   │       ├── emit.h
│   │       ├── emitglue.h
│   │       ├── formatfloat.h
│   │       ├── frozenmod.h
│   │       ├── gc.h
│   │       ├── grammar.h
│   │       ├── lexer.h
│   │       ├── misc.h
│   │       ├── mpconfig.h
│   │       ├── mperrno.h
│   │       ├── mphal.h
│   │       ├── mpprint.h
│   │       ├── mpstate.h
│   │       ├── mpthread.h
│   │       ├── mpz.h
│   │       ├── nlr.h
│   │       ├── obj.h
│   │       ├── objarray.h
│   │       ├── objexcept.h
│   │       ├── objfun.h
│   │       ├── objgenerator.h
│   │       ├── objint.h
│   │       ├── objlist.h
│   │       ├── objmodule.h
│   │       ├── objstr.h
│   │       ├── objstringio.h
│   │       ├── objtuple.h
│   │       ├── objtype.h
│   │       ├── parse.h
│   │       ├── parse2.h
│   │       ├── parsenum.h
│   │       ├── parsenumbase.h
│   │       ├── persistentcode.h
│   │       ├── qstr.h
│   │       ├── qstrdefs.h
│   │       ├── reader.h
│   │       ├── repl.h
│   │       ├── ringbuf.h
│   │       ├── runtime.h
│   │       ├── runtime0.h
│   │       ├── scope.h
│   │       ├── smallint.h
│   │       ├── stackctrl.h
│   │       ├── stream.h
│   │       ├── unicode.h
│   │       └── vmentrytable.h
│   ├── module.json
│   ├── source/
│   │   ├── extmod/
│   │   │   ├── machine_mem.c
│   │   │   ├── machine_pulse.c
│   │   │   └── utime_mphal.c
│   │   ├── lib/
│   │   │   ├── iters.c
│   │   │   ├── mp-readline/
│   │   │   │   └── readline.c
│   │   │   ├── neopixelsend.s
│   │   │   ├── pwm.c
│   │   │   ├── sam/
│   │   │   │   ├── ReciterTabs.h
│   │   │   │   ├── RenderTabs.h
│   │   │   │   ├── SamTabs.h
│   │   │   │   ├── debug.c
│   │   │   │   ├── debug.h
│   │   │   │   ├── main.c
│   │   │   │   ├── reciter.c
│   │   │   │   ├── reciter.h
│   │   │   │   ├── render.c
│   │   │   │   ├── render.h
│   │   │   │   ├── sam.c
│   │   │   │   └── sam.h
│   │   │   ├── ticker.c
│   │   │   └── utils/
│   │   │       ├── interrupt_char.c
│   │   │       └── pyexec.c
│   │   ├── microbit/
│   │   │   ├── display_readme.md
│   │   │   ├── events.cpp
│   │   │   ├── fileobj.c
│   │   │   ├── filesystem.c
│   │   │   ├── gccollect.c
│   │   │   ├── help.c
│   │   │   ├── main.cpp
│   │   │   ├── microbitaccelerometer.cpp
│   │   │   ├── microbitbutton.cpp
│   │   │   ├── microbitcompass.cpp
│   │   │   ├── microbitconstimage.cpp
│   │   │   ├── microbitconstimagetuples.c
│   │   │   ├── microbitdisplay.cpp
│   │   │   ├── microbiti2c.cpp
│   │   │   ├── microbitimage.cpp
│   │   │   ├── microbitpin.cpp
│   │   │   ├── microbitpinmode.c
│   │   │   ├── microbitspi.cpp
│   │   │   ├── microbituart.cpp
│   │   │   ├── modantigravity.cpp
│   │   │   ├── modaudio.cpp
│   │   │   ├── modlove.cpp
│   │   │   ├── modmachine.c
│   │   │   ├── modmicrobit.cpp
│   │   │   ├── modmusic.cpp
│   │   │   ├── modmusictunes.c
│   │   │   ├── modneopixel.cpp
│   │   │   ├── modos.c
│   │   │   ├── modradio.cpp
│   │   │   ├── modrandom.cpp
│   │   │   ├── modspeech.c
│   │   │   ├── modthis.cpp
│   │   │   ├── modutime.c
│   │   │   ├── mphalport.cpp
│   │   │   └── persistent.c
│   │   └── py/
│   │       ├── argcheck.c
│   │       ├── asmarm.c
│   │       ├── asmbase.c
│   │       ├── asmthumb.c
│   │       ├── asmx64.c
│   │       ├── asmx86.c
│   │       ├── asmxtensa.c
│   │       ├── bc.c
│   │       ├── binary.c
│   │       ├── builtinevex.c
│   │       ├── builtinhelp.c
│   │       ├── builtinimport.c
│   │       ├── compile.c
│   │       ├── compile2.c
│   │       ├── emitbc.c
│   │       ├── emitcommon.c
│   │       ├── emitglue.c
│   │       ├── emitinlinethumb.c
│   │       ├── emitinlinextensa.c
│   │       ├── emitnative.c
│   │       ├── formatfloat.c
│   │       ├── frozenmod.c
│   │       ├── gc.c
│   │       ├── lexer.c
│   │       ├── makeqstrdata.py
│   │       ├── makeqstrdefs.py
│   │       ├── makeversionhdr.py
│   │       ├── malloc.c
│   │       ├── map.c
│   │       ├── modarray.c
│   │       ├── modbuiltins.c
│   │       ├── modcmath.c
│   │       ├── modcollections.c
│   │       ├── modgc.c
│   │       ├── modio.c
│   │       ├── modmath.c
│   │       ├── modmicropython.c
│   │       ├── modstruct.c
│   │       ├── modsys.c
│   │       ├── modthread.c
│   │       ├── moduerrno.c
│   │       ├── mpprint.c
│   │       ├── mpstate.c
│   │       ├── mpz.c
│   │       ├── nativeglue.c
│   │       ├── nlrsetjmp.c
│   │       ├── nlrthumb.c
│   │       ├── nlrx64.c
│   │       ├── nlrx86.c
│   │       ├── nlrxtensa.c
│   │       ├── obj.c
│   │       ├── objarray.c
│   │       ├── objattrtuple.c
│   │       ├── objbool.c
│   │       ├── objboundmeth.c
│   │       ├── objcell.c
│   │       ├── objclosure.c
│   │       ├── objcomplex.c
│   │       ├── objdict.c
│   │       ├── objenumerate.c
│   │       ├── objexcept.c
│   │       ├── objfilter.c
│   │       ├── objfloat.c
│   │       ├── objfun.c
│   │       ├── objgenerator.c
│   │       ├── objgetitemiter.c
│   │       ├── objint.c
│   │       ├── objint_longlong.c
│   │       ├── objint_mpz.c
│   │       ├── objlist.c
│   │       ├── objmap.c
│   │       ├── objmodule.c
│   │       ├── objnamedtuple.c
│   │       ├── objnone.c
│   │       ├── objobject.c
│   │       ├── objpolyiter.c
│   │       ├── objproperty.c
│   │       ├── objrange.c
│   │       ├── objreversed.c
│   │       ├── objset.c
│   │       ├── objsingleton.c
│   │       ├── objslice.c
│   │       ├── objstr.c
│   │       ├── objstringio.c
│   │       ├── objstrunicode.c
│   │       ├── objtuple.c
│   │       ├── objtype.c
│   │       ├── objzip.c
│   │       ├── opmethods.c
│   │       ├── parse.c
│   │       ├── parse2.c
│   │       ├── parsenum.c
│   │       ├── parsenumbase.c
│   │       ├── persistentcode.c
│   │       ├── qstr.c
│   │       ├── reader.c
│   │       ├── repl.c
│   │       ├── runtime.c
│   │       ├── runtime_utils.c
│   │       ├── scheduler.c
│   │       ├── scope.c
│   │       ├── sequence.c
│   │       ├── showbc.c
│   │       ├── smallint.c
│   │       ├── stackctrl.c
│   │       ├── stream.c
│   │       ├── unicode.c
│   │       ├── vm.c
│   │       ├── vstr.c
│   │       └── warning.c
│   ├── tests/
│   │   ├── README.md
│   │   ├── exercise.py
│   │   ├── radio_audio.py
│   │   ├── sample.raw
│   │   ├── test_files.py
│   │   ├── test_files2.py
│   │   ├── test_files3.py
│   │   ├── test_image.py
│   │   ├── test_music.py
│   │   ├── test_pins.py
│   │   ├── test_pwm.py
│   │   ├── test_random.py
│   │   └── test_speech.py
│   └── tools/
│       ├── adduicr.py
│       ├── hexlifyscript.js
│       ├── hexlifyscript.py
│       ├── makecombinedhex.py
│       ├── makeqstrhdr.sh
│       ├── makeversionhdr.py
│       ├── pyboard.py
│       └── upload.py
├── precompiled/
│   └── radiobit.hex
└── tools/
    ├── cheerson-cx10/
    │   ├── README.md
    │   └── cxp0wn.py
    ├── ubit-sniffer/
    │   ├── README.md
    │   ├── middleware/
    │   │   └── ubit-sniffer-mw.py
    │   └── ubit-sniffer.py
    └── wireless-keylogger/
        ├── README.md
        └── msft-keylogger.py
Download .txt
Showing preview only (261K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2793 symbols across 233 files)

FILE: micropython/examples/analog_watch.py
  function fiveticks (line 13) | def fiveticks():
  function ticks (line 22) | def ticks():

FILE: micropython/examples/asmleds.py
  function led_cycle (line 12) | def led_cycle():

FILE: micropython/examples/bubble_level_2d.py
  function clamp (line 10) | def clamp(number, min, max):

FILE: micropython/examples/conway.py
  function show (line 13) | def show():
  function conway_step (line 21) | def conway_step():

FILE: micropython/examples/digital_water.py
  function clamp (line 24) | def clamp(minimum, n, maximum):
  function rescale (line 29) | def rescale(src_scale, dest_scale, x):
  function light (line 48) | def light(brightness, filter):
  function fade_display (line 57) | def fade_display():
  function paint_water (line 70) | def paint_water():

FILE: micropython/examples/dodge_game.py
  class Enemy (line 11) | class Enemy:
    method __init__ (line 15) | def __init__(self):
    method get_positions (line 18) | def get_positions(self):
    method move (line 21) | def move(self):
    method draw (line 25) | def draw(self):
  class Player (line 30) | class Player:
    method __init__ (line 40) | def __init__(self):
    method get_position (line 47) | def get_position(self):
    method die (line 50) | def die(self):
    method move (line 58) | def move(self):
    method draw (line 73) | def draw(self):
    method act_on_input (line 81) | def act_on_input(self):
  class Game (line 91) | class Game:
    method __init__ (line 92) | def __init__(self):
    method detect_collisions (line 97) | def detect_collisions(self):
    method do_frame (line 103) | def do_frame(self):

FILE: micropython/examples/flame_simulation.py
  function generate_line (line 26) | def generate_line(start=MIN_BRIGHTNESS, end=MAX_BRIGHTNESS):
  function shift_up (line 31) | def shift_up(grid, newline):
  function interpolate_frame (line 42) | def interpolate_frame(screen, pcnt, grid, line):

FILE: micropython/examples/four_buttons.py
  function clamp (line 19) | def clamp(minimum, n, maximum):
  function light (line 27) | def light(brightness, filter):
  function light_column (line 36) | def light_column(column):
  function light_row (line 45) | def light_row(row):
  function fade_display (line 54) | def fade_display():
  function paint_box (line 66) | def paint_box(top=0, bottom=DISPLAY_HEIGHT-1, left=0, right=DISPLAY_WIDT...
  function pin_is_touched (line 81) | def pin_is_touched(n):
  function four_buttons (line 90) | def four_buttons():

FILE: micropython/examples/led_dance.py
  function led_dance (line 15) | def led_dance(delay):

FILE: micropython/examples/maze.py
  function get_maze (line 31) | def get_maze(x, y):
  function draw (line 37) | def draw(x, y, tick):
  function main (line 47) | def main():

FILE: micropython/examples/play_file.py
  function audio_generator (line 4) | def audio_generator(file, frame):
  function play_file (line 10) | def play_file(name, pin=None, return_pin=None):

FILE: micropython/examples/pomodoro.py
  function index_to_xy (line 18) | def index_to_xy(i):
  function show_alarm (line 24) | def show_alarm():
  function run_timer (line 32) | def run_timer(seconds, LED_state):

FILE: micropython/examples/reverb.py
  function from_file (line 3) | def from_file(file, frame):
  function reverb_gen (line 9) | def reverb_gen(src, buckets, reflect, fadeout):
  function reverb (line 31) | def reverb(src, delay, reflect):
  function play_file (line 44) | def play_file(name, delay=80, reflect=0.5):

FILE: micropython/examples/watch.py
  function decode_time (line 62) | def decode_time(milliseconds):
  function show_time (line 69) | def show_time(time):
  function show_colon (line 80) | def show_colon(visible):
  function get_clock_time (line 85) | def get_clock_time():
  function plot_LED_column (line 93) | def plot_LED_column(column, number):

FILE: micropython/examples/waveforms.py
  function repeated_frame (line 5) | def repeated_frame(frame, count):
  function show_wave (line 10) | def show_wave(name, frame, duration=1500):
  function repeated_frames (line 58) | def repeated_frames(frames, count):

FILE: micropython/inc/extmod/machine_mem.h
  type machine_mem_obj_t (line 31) | typedef struct _machine_mem_obj_t {

FILE: micropython/inc/lib/utils/pyexec.h
  type pyexec_mode_kind_t (line 29) | typedef enum {

FILE: micropython/inc/microbit/filesystem.h
  function persistent_page_size (line 37) | static inline uint32_t persistent_page_size(void) {
  type file_descriptor_obj (line 57) | typedef struct _file_descriptor_obj {
  type file_header (line 83) | typedef struct _file_header {
  type file_chunk (line 89) | typedef struct _file_chunk {
  type persistent_config_t (line 98) | typedef struct _persistent_config_t {

FILE: micropython/inc/microbit/microbit_image.h
  type image_base_t (line 46) | typedef struct _image_base_t {
  type monochrome_5by5_t (line 50) | typedef struct _monochrome_5by5_t {
  type greyscale_t (line 60) | typedef struct _greyscale_t {
  type microbit_image_obj_t (line 73) | typedef union _microbit_image_obj_t {

FILE: micropython/inc/microbit/microbitdal.h
  function class (line 33) | class MicroPythonI2C : public MicroBitI2C {
  function i2c_t (line 42) | i2c_t *get_i2c_obj() {

FILE: micropython/inc/microbit/modaudio.h
  type microbit_audio_frame_obj_t (line 17) | typedef struct _microbit_audio_frame_obj_t {

FILE: micropython/inc/microbit/modmicrobit.h
  type microbit_pin_obj_t (line 59) | typedef struct _microbit_pin_obj_t {
  type microbit_pinmode_t (line 68) | typedef struct _pinmode {
  type _microbit_pin_obj_t (line 79) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 80) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 81) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 82) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 83) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 84) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 85) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 86) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 87) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 88) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 89) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 90) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 91) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 92) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 93) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 94) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 95) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 96) | struct _microbit_pin_obj_t
  type _microbit_pin_obj_t (line 97) | struct _microbit_pin_obj_t
  type microbit_image_obj_t (line 123) | typedef union _microbit_image_obj_t microbit_image_obj_t;
  type _monochrome_5by5_t (line 128) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 129) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 130) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 131) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 132) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 133) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 134) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 135) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 136) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 137) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 138) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 139) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 140) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 141) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 142) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 143) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 144) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 145) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 146) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 147) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 148) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 149) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 150) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 151) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 152) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 153) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 154) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 155) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 156) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 157) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 158) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 159) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 160) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 161) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 162) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 163) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 164) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 165) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 166) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 167) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 168) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 169) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 170) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 171) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 172) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 173) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 174) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 175) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 176) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 177) | struct _monochrome_5by5_t
  type _mp_obj_tuple_t (line 178) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 179) | struct _mp_obj_tuple_t
  type _monochrome_5by5_t (line 180) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 181) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 182) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 183) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 184) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 185) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 186) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 187) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 188) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 189) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 190) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 191) | struct _monochrome_5by5_t
  type _monochrome_5by5_t (line 192) | struct _monochrome_5by5_t
  type microbit_display_obj_t (line 197) | typedef struct _microbit_display_obj_t microbit_display_obj_t;
  type _microbit_compass_obj_t (line 217) | struct _microbit_compass_obj_t
  type _microbit_accelerometer_obj_t (line 228) | struct _microbit_accelerometer_obj_t
  type _microbit_button_obj_t (line 235) | struct _microbit_button_obj_t
  type _microbit_button_obj_t (line 236) | struct _microbit_button_obj_t
  type _microbit_i2c_obj_t (line 243) | struct _microbit_i2c_obj_t
  type _microbit_uart_obj_t (line 244) | struct _microbit_uart_obj_t
  type _microbit_spi_obj_t (line 245) | struct _microbit_spi_obj_t

FILE: micropython/inc/microbit/modmusic.h
  type _mp_obj_tuple_t (line 31) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 32) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 33) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 34) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 35) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 36) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 37) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 38) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 39) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 40) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 41) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 42) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 43) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 44) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 45) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 46) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 47) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 48) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 49) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 50) | struct _mp_obj_tuple_t
  type _mp_obj_tuple_t (line 51) | struct _mp_obj_tuple_t

FILE: micropython/inc/microbit/mpconfigport.h
  type _mp_obj_module_t (line 108) | struct _mp_obj_module_t
  type _mp_obj_module_t (line 109) | struct _mp_obj_module_t
  type _mp_obj_module_t (line 110) | struct _mp_obj_module_t
  type _mp_obj_module_t (line 111) | struct _mp_obj_module_t
  type _mp_obj_module_t (line 112) | struct _mp_obj_module_t
  type _mp_obj_module_t (line 113) | struct _mp_obj_module_t
  type _mp_obj_module_t (line 114) | struct _mp_obj_module_t
  type _mp_obj_module_t (line 115) | struct _mp_obj_module_t
  type _mp_obj_module_t (line 116) | struct _mp_obj_module_t
  type _mp_obj_module_t (line 117) | struct _mp_obj_module_t
  type _mp_obj_module_t (line 118) | struct _mp_obj_module_t
  type _mp_obj_module_t (line 119) | struct _mp_obj_module_t
  type _mp_obj_module_t (line 120) | struct _mp_obj_module_t
  type mp_int_t (line 157) | typedef intptr_t mp_int_t;
  type mp_uint_t (line 158) | typedef uintptr_t mp_uint_t;
  type mp_off_t (line 159) | typedef long mp_off_t;

FILE: micropython/inc/py/asmarm.h
  type asm_arm_t (line 69) | typedef struct _asm_arm_t {

FILE: micropython/inc/py/asmbase.h
  type mp_asm_base_t (line 35) | typedef struct _mp_asm_base_t {
  function mp_asm_base_get_code_pos (line 53) | static inline size_t mp_asm_base_get_code_pos(mp_asm_base_t *as) {
  function mp_asm_base_get_code_size (line 57) | static inline size_t mp_asm_base_get_code_size(mp_asm_base_t *as) {

FILE: micropython/inc/py/asmthumb.h
  type asm_thumb_t (line 65) | typedef struct _asm_thumb_t {
  function asm_thumb_it_cc (line 96) | static inline void asm_thumb_it_cc(asm_thumb_t *as, uint cc, uint mask)
  function asm_thumb_format_1 (line 108) | static inline void asm_thumb_format_1(asm_thumb_t *as, uint op, uint rlo...
  function asm_thumb_format_2 (line 124) | static inline void asm_thumb_format_2(asm_thumb_t *as, uint op, uint rlo...
  function asm_thumb_add_rlo_rlo_rlo (line 130) | static inline void asm_thumb_add_rlo_rlo_rlo(asm_thumb_t *as, uint rlo_d...
  function asm_thumb_add_rlo_rlo_i3 (line 132) | static inline void asm_thumb_add_rlo_rlo_i3(asm_thumb_t *as, uint rlo_de...
  function asm_thumb_sub_rlo_rlo_rlo (line 134) | static inline void asm_thumb_sub_rlo_rlo_rlo(asm_thumb_t *as, uint rlo_d...
  function asm_thumb_sub_rlo_rlo_i3 (line 136) | static inline void asm_thumb_sub_rlo_rlo_i3(asm_thumb_t *as, uint rlo_de...
  function asm_thumb_format_3 (line 149) | static inline void asm_thumb_format_3(asm_thumb_t *as, uint op, uint rlo...
  function asm_thumb_mov_rlo_i8 (line 154) | static inline void asm_thumb_mov_rlo_i8(asm_thumb_t *as, uint rlo, int i...
  function asm_thumb_cmp_rlo_i8 (line 155) | static inline void asm_thumb_cmp_rlo_i8(asm_thumb_t *as, uint rlo, int i...
  function asm_thumb_add_rlo_i8 (line 156) | static inline void asm_thumb_add_rlo_i8(asm_thumb_t *as, uint rlo, int i...
  function asm_thumb_sub_rlo_i8 (line 157) | static inline void asm_thumb_sub_rlo_i8(asm_thumb_t *as, uint rlo, int i...
  function asm_thumb_cmp_rlo_rlo (line 180) | static inline void asm_thumb_cmp_rlo_rlo(asm_thumb_t *as, uint rlo_dest,...
  function asm_thumb_format_9_10 (line 200) | static inline void asm_thumb_format_9_10(asm_thumb_t *as, uint op, uint ...
  function asm_thumb_str_rlo_rlo_i5 (line 203) | static inline void asm_thumb_str_rlo_rlo_i5(asm_thumb_t *as, uint rlo_sr...
  function asm_thumb_strb_rlo_rlo_i5 (line 205) | static inline void asm_thumb_strb_rlo_rlo_i5(asm_thumb_t *as, uint rlo_s...
  function asm_thumb_strh_rlo_rlo_i5 (line 207) | static inline void asm_thumb_strh_rlo_rlo_i5(asm_thumb_t *as, uint rlo_s...
  function asm_thumb_ldr_rlo_rlo_i5 (line 209) | static inline void asm_thumb_ldr_rlo_rlo_i5(asm_thumb_t *as, uint rlo_de...
  function asm_thumb_ldrb_rlo_rlo_i5 (line 211) | static inline void asm_thumb_ldrb_rlo_rlo_i5(asm_thumb_t *as, uint rlo_d...
  function asm_thumb_ldrh_rlo_rlo_i5 (line 213) | static inline void asm_thumb_ldrh_rlo_rlo_i5(asm_thumb_t *as, uint rlo_d...

FILE: micropython/inc/py/asmx64.h
  type asm_x64_t (line 73) | typedef struct _asm_x64_t {
  function asm_x64_end_pass (line 78) | static inline void asm_x64_end_pass(asm_x64_t *as) {

FILE: micropython/inc/py/asmx86.h
  type asm_x86_t (line 76) | typedef struct _asm_x86_t {
  function asm_x86_end_pass (line 81) | static inline void asm_x86_end_pass(asm_x86_t *as) {

FILE: micropython/inc/py/asmxtensa.h
  type asm_xtensa_t (line 98) | typedef struct _asm_xtensa_t {
  function asm_xtensa_op_add (line 116) | static inline void asm_xtensa_op_add(asm_xtensa_t *as, uint reg_dest, ui...
  function asm_xtensa_op_addi (line 120) | static inline void asm_xtensa_op_addi(asm_xtensa_t *as, uint reg_dest, u...
  function asm_xtensa_op_and (line 124) | static inline void asm_xtensa_op_and(asm_xtensa_t *as, uint reg_dest, ui...
  function asm_xtensa_op_bcc (line 128) | static inline void asm_xtensa_op_bcc(asm_xtensa_t *as, uint cond, uint r...
  function asm_xtensa_op_bccz (line 132) | static inline void asm_xtensa_op_bccz(asm_xtensa_t *as, uint cond, uint ...
  function asm_xtensa_op_callx0 (line 136) | static inline void asm_xtensa_op_callx0(asm_xtensa_t *as, uint reg) {
  function asm_xtensa_op_j (line 140) | static inline void asm_xtensa_op_j(asm_xtensa_t *as, int32_t rel18) {
  function asm_xtensa_op_jx (line 144) | static inline void asm_xtensa_op_jx(asm_xtensa_t *as, uint reg) {
  function asm_xtensa_op_l8ui (line 148) | static inline void asm_xtensa_op_l8ui(asm_xtensa_t *as, uint reg_dest, u...
  function asm_xtensa_op_l16ui (line 152) | static inline void asm_xtensa_op_l16ui(asm_xtensa_t *as, uint reg_dest, ...
  function asm_xtensa_op_l32i (line 156) | static inline void asm_xtensa_op_l32i(asm_xtensa_t *as, uint reg_dest, u...
  function asm_xtensa_op_l32i_n (line 160) | static inline void asm_xtensa_op_l32i_n(asm_xtensa_t *as, uint reg_dest,...
  function asm_xtensa_op_l32r (line 164) | static inline void asm_xtensa_op_l32r(asm_xtensa_t *as, uint reg_dest, u...
  function asm_xtensa_op_mov_n (line 168) | static inline void asm_xtensa_op_mov_n(asm_xtensa_t *as, uint reg_dest, ...
  function asm_xtensa_op_movi (line 172) | static inline void asm_xtensa_op_movi(asm_xtensa_t *as, uint reg_dest, i...
  function asm_xtensa_op_movi_n (line 176) | static inline void asm_xtensa_op_movi_n(asm_xtensa_t *as, uint reg_dest,...
  function asm_xtensa_op_mull (line 180) | static inline void asm_xtensa_op_mull(asm_xtensa_t *as, uint reg_dest, u...
  function asm_xtensa_op_or (line 184) | static inline void asm_xtensa_op_or(asm_xtensa_t *as, uint reg_dest, uin...
  function asm_xtensa_op_ret_n (line 188) | static inline void asm_xtensa_op_ret_n(asm_xtensa_t *as) {
  function asm_xtensa_op_s8i (line 192) | static inline void asm_xtensa_op_s8i(asm_xtensa_t *as, uint reg_src, uin...
  function asm_xtensa_op_s16i (line 196) | static inline void asm_xtensa_op_s16i(asm_xtensa_t *as, uint reg_src, ui...
  function asm_xtensa_op_s32i (line 200) | static inline void asm_xtensa_op_s32i(asm_xtensa_t *as, uint reg_src, ui...
  function asm_xtensa_op_s32i_n (line 204) | static inline void asm_xtensa_op_s32i_n(asm_xtensa_t *as, uint reg_src, ...
  function asm_xtensa_op_sll (line 208) | static inline void asm_xtensa_op_sll(asm_xtensa_t *as, uint reg_dest, ui...
  function asm_xtensa_op_sra (line 212) | static inline void asm_xtensa_op_sra(asm_xtensa_t *as, uint reg_dest, ui...
  function asm_xtensa_op_ssl (line 216) | static inline void asm_xtensa_op_ssl(asm_xtensa_t *as, uint reg_src) {
  function asm_xtensa_op_ssr (line 220) | static inline void asm_xtensa_op_ssr(asm_xtensa_t *as, uint reg_src) {
  function asm_xtensa_op_sub (line 224) | static inline void asm_xtensa_op_sub(asm_xtensa_t *as, uint reg_dest, ui...
  function asm_xtensa_op_xor (line 228) | static inline void asm_xtensa_op_xor(asm_xtensa_t *as, uint reg_dest, ui...

FILE: micropython/inc/py/bc.h
  type mp_exc_stack_t (line 64) | typedef struct _mp_exc_stack_t {
  type mp_code_state_t (line 73) | typedef struct _mp_code_state_t {

FILE: micropython/inc/py/emit.h
  type pass_kind_t (line 43) | typedef enum {
  type emit_t (line 59) | typedef struct _emit_t emit_t;
  type mp_emit_method_table_id_ops_t (line 61) | typedef struct _mp_emit_method_table_id_ops_t {
  type emit_method_table_t (line 68) | typedef struct _emit_method_table_t {
  type emit_inline_asm_t (line 261) | typedef struct _emit_inline_asm_t emit_inline_asm_t;
  type emit_inline_asm_method_table_t (line 263) | typedef struct _emit_inline_asm_method_table_t {

FILE: micropython/inc/py/emitglue.h
  type mp_raw_code_kind_t (line 33) | typedef enum {
  type mp_raw_code_t (line 42) | typedef struct _mp_raw_code_t {

FILE: micropython/inc/py/gc.h
  type gc_info_t (line 53) | typedef struct _gc_info_t {

FILE: micropython/inc/py/lexer.h
  type mp_token_kind_t (line 41) | typedef enum _mp_token_kind_t {
  type mp_lexer_t (line 148) | typedef struct _mp_lexer_t {
  type mp_import_stat_t (line 182) | typedef enum {

FILE: micropython/inc/py/misc.h
  type byte (line 37) | typedef unsigned char byte;
  type uint (line 38) | typedef unsigned int uint;
  type unichar (line 115) | typedef uint32_t unichar;
  type uint (line 119) | typedef uint unichar;
  type vstr_t (line 142) | typedef struct _vstr_t {
  type _mp_print_t (line 155) | struct _mp_print_t
  type _mp_print_t (line 156) | struct _mp_print_t
  function vstr_reset (line 160) | static inline void vstr_reset(vstr_t *vstr) { vstr->len = 0; }
  function vstr_len (line 162) | static inline size_t vstr_len(vstr_t *vstr) { return vstr->len; }
  function mp_uint_t (line 205) | static inline mp_uint_t count_lead_ones(byte val) {

FILE: micropython/inc/py/mpconfig.h
  type mp_longint_impl_t (line 512) | typedef long long mp_longint_impl_t;
  type mp_float_t (line 555) | typedef float mp_float_t;
  type mp_float_t (line 560) | typedef double mp_float_t;

FILE: micropython/inc/py/mpprint.h
  type mp_print_t (line 50) | typedef struct _mp_print_t {

FILE: micropython/inc/py/mpstate.h
  type mp_dynamic_compiler_t (line 45) | typedef struct mp_dynamic_compiler_t {
  type mp_sched_item_t (line 58) | typedef struct _mp_sched_item_t {
  type mp_state_mem_t (line 64) | typedef struct _mp_state_mem_t {
  type mp_state_vm_t (line 108) | typedef struct _mp_state_vm_t {
  type mp_state_thread_t (line 210) | typedef struct _mp_state_thread_t {
  type mp_state_ctx_t (line 229) | typedef struct _mp_state_ctx_t {

FILE: micropython/inc/py/mpthread.h
  type _mp_state_thread_t (line 39) | struct _mp_state_thread_t
  type _mp_state_thread_t (line 41) | struct _mp_state_thread_t

FILE: micropython/inc/py/mpz.h
  type mpz_dig_t (line 58) | typedef uint32_t mpz_dig_t;
  type mpz_dbl_dig_t (line 59) | typedef uint64_t mpz_dbl_dig_t;
  type mpz_dbl_dig_signed_t (line 60) | typedef int64_t mpz_dbl_dig_signed_t;
  type mpz_dig_t (line 62) | typedef uint16_t mpz_dig_t;
  type mpz_dbl_dig_t (line 63) | typedef uint32_t mpz_dbl_dig_t;
  type mpz_dbl_dig_signed_t (line 64) | typedef int32_t mpz_dbl_dig_signed_t;
  type mpz_dig_t (line 66) | typedef uint8_t mpz_dig_t;
  type mpz_dbl_dig_t (line 67) | typedef uint16_t mpz_dbl_dig_t;
  type mpz_dbl_dig_signed_t (line 68) | typedef int16_t mpz_dbl_dig_signed_t;
  type mpz_dig_t (line 70) | typedef uint8_t mpz_dig_t;
  type mpz_dbl_dig_t (line 71) | typedef uint8_t mpz_dbl_dig_t;
  type mpz_dbl_dig_signed_t (line 72) | typedef int8_t mpz_dbl_dig_signed_t;
  type mpz_t (line 89) | typedef struct _mpz_t {
  function mpz_is_zero (line 114) | static inline bool mpz_is_zero(const mpz_t *z) { return z->len == 0; }
  function mpz_is_neg (line 115) | static inline bool mpz_is_neg(const mpz_t *z) { return z->len != 0 && z-...
  function mpz_max_num_bits (line 133) | static inline size_t mpz_max_num_bits(const mpz_t *z) { return z->len * ...

FILE: micropython/inc/py/nlr.h
  type nlr_buf_t (line 38) | typedef struct _nlr_buf_t nlr_buf_t;
  type _nlr_buf_t (line 39) | struct _nlr_buf_t {

FILE: micropython/inc/py/obj.h
  type mp_obj_t (line 38) | typedef uint64_t mp_obj_t;
  type mp_const_obj_t (line 39) | typedef uint64_t mp_const_obj_t;
  type mp_obj_type_t (line 47) | typedef struct _mp_obj_type_t mp_obj_type_t;
  type _mp_obj_base_t (line 51) | struct _mp_obj_base_t {
  type mp_obj_base_t (line 54) | typedef struct _mp_obj_base_t mp_obj_base_t;
  function MP_OBJ_IS_SMALL_INT (line 83) | static inline bool MP_OBJ_IS_SMALL_INT(mp_const_obj_t o)
  function MP_OBJ_IS_QSTR (line 88) | static inline bool MP_OBJ_IS_QSTR(mp_const_obj_t o)
  type _mp_obj_float_t (line 96) | struct _mp_obj_float_t
  type _mp_obj_float_t (line 97) | struct _mp_obj_float_t
  function MP_OBJ_IS_OBJ (line 104) | static inline bool MP_OBJ_IS_OBJ(mp_const_obj_t o)
  function MP_OBJ_IS_SMALL_INT (line 109) | static inline bool MP_OBJ_IS_SMALL_INT(mp_const_obj_t o)
  function MP_OBJ_IS_QSTR (line 114) | static inline bool MP_OBJ_IS_QSTR(mp_const_obj_t o)
  type _mp_obj_float_t (line 122) | struct _mp_obj_float_t
  type _mp_obj_float_t (line 123) | struct _mp_obj_float_t
  function MP_OBJ_IS_OBJ (line 130) | static inline bool MP_OBJ_IS_OBJ(mp_const_obj_t o)
  function MP_OBJ_IS_SMALL_INT (line 135) | static inline bool MP_OBJ_IS_SMALL_INT(mp_const_obj_t o)
  function mp_obj_is_float (line 143) | static inline bool mp_obj_is_float(mp_const_obj_t o)
  function mp_float_t (line 145) | static inline mp_float_t mp_obj_float_get(mp_const_obj_t o) {
  function mp_obj_t (line 152) | static inline mp_obj_t mp_obj_new_float(mp_float_t f) {
  function MP_OBJ_IS_QSTR (line 160) | static inline bool MP_OBJ_IS_QSTR(mp_const_obj_t o)
  function MP_OBJ_IS_OBJ (line 165) | static inline bool MP_OBJ_IS_OBJ(mp_const_obj_t o)
  function MP_OBJ_IS_SMALL_INT (line 170) | static inline bool MP_OBJ_IS_SMALL_INT(mp_const_obj_t o)
  function MP_OBJ_IS_QSTR (line 175) | static inline bool MP_OBJ_IS_QSTR(mp_const_obj_t o)
  function mp_obj_is_float (line 184) | static inline bool mp_obj_is_float(mp_const_obj_t o) {
  function mp_float_t (line 187) | static inline mp_float_t mp_obj_float_get(mp_const_obj_t o) {
  function mp_obj_t (line 194) | static inline mp_obj_t mp_obj_new_float(mp_float_t f) {
  function MP_OBJ_IS_OBJ (line 203) | static inline bool MP_OBJ_IS_OBJ(mp_const_obj_t o)
  type mp_rom_obj_t (line 209) | typedef union _mp_rom_obj_t { uint64_t u64; struct { const void *lo, *hi...
  type mp_const_obj_t (line 238) | typedef mp_const_obj_t mp_rom_obj_t;
  function mp_obj_is_integer (line 266) | static inline bool mp_obj_is_integer(mp_const_obj_t o) { return MP_OBJ_I...
  type mp_map_elem_t (line 343) | typedef struct _mp_map_elem_t {
  type mp_rom_map_elem_t (line 348) | typedef struct _mp_rom_map_elem_t {
  type mp_map_t (line 358) | typedef struct _mp_map_t {
  type mp_map_lookup_kind_t (line 368) | typedef enum _mp_map_lookup_kind_t {
  function MP_MAP_SLOT_IS_FILLED (line 377) | static inline bool MP_MAP_SLOT_IS_FILLED(const mp_map_t *map, size_t pos...
  type mp_set_t (line 390) | typedef struct _mp_set_t {
  function MP_SET_SLOT_IS_FILLED (line 396) | static inline bool MP_SET_SLOT_IS_FILLED(const mp_set_t *set, size_t pos...
  type mp_obj_t (line 405) | typedef mp_obj_t (*mp_fun_0_t)(void);
  type mp_obj_t (line 406) | typedef mp_obj_t (*mp_fun_1_t)(mp_obj_t);
  type mp_obj_t (line 407) | typedef mp_obj_t (*mp_fun_2_t)(mp_obj_t, mp_obj_t);
  type mp_obj_t (line 408) | typedef mp_obj_t (*mp_fun_3_t)(mp_obj_t, mp_obj_t, mp_obj_t);
  type mp_obj_t (line 409) | typedef mp_obj_t (*mp_fun_var_t)(size_t n, const mp_obj_t *);
  type mp_obj_t (line 412) | typedef mp_obj_t (*mp_fun_kw_t)(size_t n, const mp_obj_t *, mp_map_t *);
  type mp_print_kind_t (line 414) | typedef enum {
  type mp_obj_iter_buf_t (line 423) | typedef struct _mp_obj_iter_buf_t {
  type mp_obj_t (line 433) | typedef mp_obj_t (*mp_make_new_fun_t)(const mp_obj_type_t *type, size_t ...
  type mp_obj_t (line 434) | typedef mp_obj_t (*mp_call_fun_t)(mp_obj_t fun, size_t n_args, size_t n_...
  type mp_obj_t (line 435) | typedef mp_obj_t (*mp_unary_op_fun_t)(mp_uint_t op, mp_obj_t);
  type mp_obj_t (line 436) | typedef mp_obj_t (*mp_binary_op_fun_t)(mp_uint_t op, mp_obj_t, mp_obj_t);
  type mp_obj_t (line 438) | typedef mp_obj_t (*mp_subscr_fun_t)(mp_obj_t self_in, mp_obj_t index, mp...
  type mp_obj_t (line 439) | typedef mp_obj_t (*mp_getiter_fun_t)(mp_obj_t self_in, mp_obj_iter_buf_t...
  type mp_buffer_info_t (line 442) | typedef struct _mp_buffer_info_t {
  type mp_buffer_p_t (line 459) | typedef struct _mp_buffer_p_t {
  type mp_stream_p_t (line 466) | typedef struct _mp_stream_p_t {
  type _mp_obj_type_t (line 475) | struct _mp_obj_type_t {
  type _mp_obj_none_t (line 621) | struct _mp_obj_none_t
  type _mp_obj_bool_t (line 622) | struct _mp_obj_bool_t
  type _mp_obj_bool_t (line 623) | struct _mp_obj_bool_t
  type _mp_obj_str_t (line 624) | struct _mp_obj_str_t
  type _mp_obj_tuple_t (line 625) | struct _mp_obj_tuple_t
  type _mp_obj_singleton_t (line 626) | struct _mp_obj_singleton_t
  type _mp_obj_singleton_t (line 627) | struct _mp_obj_singleton_t
  type _mp_obj_exception_t (line 628) | struct _mp_obj_exception_t
  type _mp_obj_exception_t (line 629) | struct _mp_obj_exception_t
  function mp_obj_t (line 635) | static inline mp_obj_t mp_obj_new_bool(mp_int_t x) { return x ? mp_const...
  function mp_int_t (line 738) | static inline mp_int_t mp_float_hash(mp_float_t val) { return (mp_int_t)...
  type _mp_obj_list_t (line 755) | struct _mp_obj_list_t
  type _mp_obj_list_t (line 756) | struct _mp_obj_list_t
  type mp_obj_dict_t (line 765) | typedef struct _mp_obj_dict_t {
  type mp_obj_fun_builtin_fixed0_t (line 784) | typedef struct _mp_obj_fun_builtin_fixed0_t {
  type mp_obj_fun_builtin_fixed1_t (line 789) | typedef struct _mp_obj_fun_builtin_fixed1_t {
  type mp_obj_fun_builtin_fixed2_t (line 794) | typedef struct _mp_obj_fun_builtin_fixed2_t {
  type mp_obj_fun_builtin_fixed3_t (line 799) | typedef struct _mp_obj_fun_builtin_fixed3_t {
  type mp_obj_fun_builtin_var_t (line 806) | typedef struct _mp_obj_fun_builtin_var_t {
  type mp_obj_fun_builtin_kw_t (line 814) | typedef struct _mp_obj_fun_builtin_kw_t {
  type mp_obj_module_t (line 830) | typedef struct _mp_obj_module_t {
  type mp_obj_static_class_method_t (line 840) | typedef struct _mp_obj_static_class_method_t {
  type mp_rom_obj_static_class_method_t (line 844) | typedef struct _mp_rom_obj_static_class_method_t {
  type mp_bound_slice_t (line 855) | typedef struct {

FILE: micropython/inc/py/objarray.h
  type mp_obj_array_t (line 32) | typedef struct _mp_obj_array_t {

FILE: micropython/inc/py/objexcept.h
  type mp_obj_exception_t (line 32) | typedef struct _mp_obj_exception_t {

FILE: micropython/inc/py/objfun.h
  type mp_obj_fun_bc_t (line 31) | typedef struct _mp_obj_fun_bc_t {

FILE: micropython/inc/py/objint.h
  type mp_obj_int_t (line 32) | typedef struct _mp_obj_int_t {

FILE: micropython/inc/py/objlist.h
  type mp_obj_list_t (line 31) | typedef struct _mp_obj_list_t {

FILE: micropython/inc/py/objstr.h
  type mp_obj_str_t (line 31) | typedef struct _mp_obj_str_t {

FILE: micropython/inc/py/objstringio.h
  type mp_obj_stringio_t (line 31) | typedef struct _mp_obj_stringio_t {

FILE: micropython/inc/py/objtuple.h
  type mp_obj_tuple_t (line 31) | typedef struct _mp_obj_tuple_t {
  type mp_rom_obj_tuple_t (line 37) | typedef struct _mp_rom_obj_tuple_t {

FILE: micropython/inc/py/objtype.h
  type mp_obj_instance_t (line 33) | typedef struct _mp_obj_instance_t {

FILE: micropython/inc/py/parse.h
  type _mp_lexer_t (line 37) | struct _mp_lexer_t
  type mp_parse_node_t (line 55) | typedef uintptr_t mp_parse_node_t;
  type mp_parse_node_struct_t (line 57) | typedef struct _mp_parse_node_struct_t {
  function mp_parse_node_t (line 82) | static inline mp_parse_node_t mp_parse_node_new_small_int(mp_int_t val) {
  function mp_parse_node_t (line 85) | static inline mp_parse_node_t mp_parse_node_new_leaf(size_t kind, mp_int...
  type mp_parse_input_kind_t (line 94) | typedef enum {
  type mp_parse_tree_t (line 100) | typedef struct _mp_parse_t {
  type _mp_lexer_t (line 107) | struct _mp_lexer_t

FILE: micropython/inc/py/parse2.h
  type _mp_lexer_t (line 36) | struct _mp_lexer_t
  type byte (line 50) | typedef const byte *mp_parse_node_t;
  function byte (line 54) | static inline const byte *pt_tok_extract(const byte *p, byte *tok) {
  function pt_is_null (line 61) | static inline bool pt_is_null(const byte *p) {
  function pt_is_null_with_top (line 65) | static inline bool pt_is_null_with_top(const byte *p, const byte *ptop) {
  function pt_is_small_int (line 69) | static inline bool pt_is_small_int(const byte *p) {
  function pt_is_any_rule (line 73) | static inline bool pt_is_any_rule(const byte *p) {
  function mp_uint_t (line 77) | static inline mp_uint_t pt_rule_extract_rule_id(const byte *p) {
  function pt_is_any_id (line 81) | static inline bool pt_is_any_id(const byte *p) {
  function pt_is_id (line 85) | static inline bool pt_is_id(const byte *p, qstr qst) {
  function pt_is_any_tok (line 90) | static inline bool pt_is_any_tok(const byte *p) {
  function pt_is_tok (line 94) | static inline bool pt_is_tok(const byte *p, int tok) {
  function pt_is_rule (line 98) | static inline bool pt_is_rule(const byte *p, int rule) {
  function byte (line 106) | static inline const byte *pt_extract_id(const byte *p, qstr *qst) {
  type mp_parse_input_kind_t (line 123) | typedef enum {
  type mp_parse_tree_t (line 129) | typedef struct _mp_parse_t {
  type _mp_lexer_t (line 137) | struct _mp_lexer_t

FILE: micropython/inc/py/qstr.h
  type qstr (line 48) | typedef size_t qstr;
  type qstr_pool_t (line 50) | typedef struct _qstr_pool_t {

FILE: micropython/inc/py/reader.h
  type mp_reader_t (line 36) | typedef struct _mp_reader_t {

FILE: micropython/inc/py/ringbuf.h
  type ringbuf_t (line 29) | typedef struct _ringbuf_t {
  function ringbuf_get (line 48) | static inline int ringbuf_get(ringbuf_t *r) {
  function ringbuf_put (line 59) | static inline int ringbuf_put(ringbuf_t *r, uint8_t v) {

FILE: micropython/inc/py/runtime.h
  type mp_vm_return_kind_t (line 32) | typedef enum {
  type mp_arg_flag_t (line 38) | typedef enum {
  type mp_arg_val_t (line 47) | typedef union _mp_arg_val_t {
  type mp_arg_t (line 54) | typedef struct _mp_arg_t {
  function mp_sched_num_pending (line 73) | static inline unsigned int mp_sched_num_pending(void) { return MP_STATE_...
  function mp_obj_dict_t (line 86) | static inline mp_obj_dict_t *mp_locals_get(void) { return MP_STATE_THREA...
  function mp_locals_set (line 87) | static inline void mp_locals_set(mp_obj_dict_t *d) { MP_STATE_THREAD(dic...
  function mp_obj_dict_t (line 88) | static inline mp_obj_dict_t *mp_globals_get(void) { return MP_STATE_THRE...
  function mp_globals_set (line 89) | static inline void mp_globals_set(mp_obj_dict_t *d) { MP_STATE_THREAD(di...
  type mp_call_args_t (line 113) | typedef struct _mp_call_args_t {

FILE: micropython/inc/py/runtime0.h
  type mp_unary_op_t (line 45) | typedef enum {
  type mp_binary_op_t (line 56) | typedef enum {
  type mp_fun_kind_t (line 103) | typedef enum {

FILE: micropython/inc/py/scope.h
  type id_info_t (line 46) | typedef struct _id_info_t {
  type scope_kind_t (line 58) | typedef enum {
  type scope_t (line 69) | typedef struct _scope_t {

FILE: micropython/inc/py/stream.h
  type mp_stream_seek_t (line 52) | struct mp_stream_seek_t {

FILE: micropython/source/extmod/machine_mem.c
  function STATIC (line 42) | STATIC uintptr_t machine_mem_get_addr(mp_obj_t addr_o, uint align) {
  function STATIC (line 57) | STATIC void machine_mem_print(const mp_print_t *print, mp_obj_t self_in,...
  function STATIC (line 63) | STATIC mp_obj_t machine_mem_subscr(mp_obj_t self_in, mp_obj_t index, mp_...

FILE: micropython/source/extmod/machine_pulse.c
  function mp_uint_t (line 33) | mp_uint_t machine_time_pulse_us(mp_hal_pin_obj_t pin, int pulse_level, m...
  function STATIC (line 49) | STATIC mp_obj_t machine_time_pulse_us_(size_t n_args, const mp_obj_t *ar...

FILE: micropython/source/extmod/utime_mphal.c
  function STATIC (line 39) | STATIC mp_obj_t time_sleep(mp_obj_t seconds_o) {
  function STATIC (line 49) | STATIC mp_obj_t time_sleep_ms(mp_obj_t arg) {
  function STATIC (line 58) | STATIC mp_obj_t time_sleep_us(mp_obj_t arg) {
  function STATIC (line 67) | STATIC mp_obj_t time_ticks_ms(void) {
  function STATIC (line 72) | STATIC mp_obj_t time_ticks_us(void) {
  function STATIC (line 77) | STATIC mp_obj_t time_ticks_cpu(void) {
  function STATIC (line 82) | STATIC mp_obj_t time_ticks_diff(mp_obj_t end_in, mp_obj_t start_in) {
  function STATIC (line 94) | STATIC mp_obj_t time_ticks_add(mp_obj_t ticks_in, mp_obj_t delta_in) {

FILE: micropython/source/lib/iters.c
  type repeat_iterator_t (line 31) | typedef struct _repeat_iterator_t {
  function mp_obj_t (line 37) | static mp_obj_t microbit_repeat_iter_next(mp_obj_t iter_in) {
  function mp_obj_t (line 60) | mp_obj_t microbit_repeat_iterator(mp_obj_t iterable) {

FILE: micropython/source/lib/mp-readline/readline.c
  function readline_init0 (line 47) | void readline_init0(void) {
  function STATIC (line 51) | STATIC char *str_dup_maybe(const char *str) {
  function STATIC (line 68) | STATIC void mp_hal_move_cursor_back(uint pos) {
  function STATIC (line 83) | STATIC void mp_hal_erase_line_from_cursor(uint n_chars_to_erase) {
  type readline_t (line 89) | typedef struct _readline_t {
  function readline_process_char (line 101) | int readline_process_char(int c) {
  function STATIC (line 357) | STATIC void readline_auto_indent(void) {
  function readline_note_newline (line 398) | void readline_note_newline(const char *prompt) {
  function readline_init (line 408) | void readline_init(vstr_t *line, const char *prompt) {
  function readline (line 422) | int readline(vstr_t *line, const char *prompt) {
  function readline_push_history (line 433) | void readline_push_history(const char *line) {

FILE: micropython/source/lib/pwm.c
  type pwm_event (line 42) | typedef struct _pwm_event {
  type pwm_events (line 47) | typedef struct _pwm_events {
  function pwm_init (line 77) | void pwm_init(void) {
  function pwm_get_period_ticks (line 83) | static inline int32_t pwm_get_period_ticks(void) {
  function pwm_dump_events (line 91) | void pwm_dump_events(const pwm_events *events) {
  function pwm_dump_state (line 99) | void pwm_dump_state(void) {
  function pwm_events (line 105) | static pwm_events *get_pending_for_update(void) {
  function find_pin_in_events (line 134) | static int find_pin_in_events(const pwm_events *events, uint32_t pin) {
  function sort_events (line 142) | static void sort_events(pwm_events *events) {
  function pwm_callback (line 154) | int32_t pwm_callback(void) {
  function pwm_start (line 181) | void pwm_start(void) {
  function pwm_stop (line 185) | void pwm_stop(void) {
  function pwm_set_period_ticks (line 189) | static void pwm_set_period_ticks(int32_t ticks) {
  function pwm_set_period_us (line 195) | int pwm_set_period_us(int32_t us) {
  function pwm_get_period_us (line 204) | int32_t pwm_get_period_us(void) {
  function pwm_set_duty_cycle (line 208) | void pwm_set_duty_cycle(int32_t pin, uint32_t value) {
  function pwm_release (line 251) | void pwm_release(int32_t pin) {

FILE: micropython/source/lib/sam/debug.c
  function PrintPhonemes (line 7) | void PrintPhonemes(char* title, phoneme_t *phonemes)
  function PrintOutput (line 37) | void PrintOutput(unsigned char *flags, render_freq_amp_t *frames, unsign...

FILE: micropython/source/lib/sam/main.c
  function PrintUsage (line 10) | void PrintUsage()

FILE: micropython/source/lib/sam/reciter.c
  function Code37055 (line 10) | void Code37055(reciter_memory* mem, unsigned char mem59)
  function Code37066 (line 20) | void Code37066(reciter_memory* mem, unsigned char mem58)
  function GetRuleByte (line 30) | unsigned char GetRuleByte(unsigned short mem62, unsigned char Y)
  function TextToPhonemes (line 43) | int TextToPhonemes(reciter_memory* mem) // Code36484

FILE: micropython/source/lib/sam/reciter.h
  type reciter_memory (line 6) | typedef struct _reciter_memory {

FILE: micropython/source/lib/sam/render.c
  function Output (line 30) | void Output(int index, unsigned char A)
  function Read (line 49) | unsigned char Read(sam_memory* sam, unsigned char p, unsigned char Y)
  function Write (line 69) | void Write(sam_memory* sam, unsigned char p, unsigned char Y, unsigned c...
  function RenderSample (line 145) | unsigned char RenderSample(sam_memory* sam, unsigned char *mem66, unsign...
  function Render (line 319) | void Render(sam_memory* sam)
  function OutputFrames (line 717) | void OutputFrames(sam_memory *sam, unsigned char frame_count) {
  function AddInflection (line 844) | void AddInflection(sam_memory* sam, unsigned char mem48, unsigned char p...
  function trans (line 880) | static inline unsigned char trans(unsigned char mem39212, unsigned char ...
  function get_freq1 (line 912) | unsigned char get_freq1(unsigned char pos, unsigned char mouth) {
  function get_freq2 (line 929) | unsigned char get_freq2(unsigned char pos, unsigned char throat) {

FILE: micropython/source/lib/sam/sam.c
  function SetInput (line 17) | void SetInput(sam_memory* sam, const char *_input, unsigned int l)
  function Init (line 44) | void Init(sam_memory* sam)
  function ClearInput (line 90) | void  ClearInput(sam_memory* sam) {
  function SAMMain (line 95) | int SAMMain(sam_memory* sam)
  function PrepareOutput (line 141) | void PrepareOutput(sam_memory* sam)
  function InsertBreath (line 185) | void InsertBreath(sam_memory* sam)
  function CopyStress (line 231) | void CopyStress(sam_memory* sam)
  function Insert (line 274) | void Insert(sam_memory* sam, unsigned char position/*var57*/, unsigned c...
  function Parser1 (line 340) | int Parser1(sam_memory* sam)
  function SetPhonemeLength (line 511) | void SetPhonemeLength(sam_memory* sam)
  function Code41240 (line 531) | void Code41240(sam_memory* sam)
  function Parser2 (line 598) | void Parser2(sam_memory* sam)
  function AdjustLengths (line 1046) | void AdjustLengths(sam_memory* sam)

FILE: micropython/source/lib/sam/sam.h
  type phoneme_t (line 10) | typedef struct _phoneme_t {
  type prepare_memory (line 28) | typedef struct _prepare_memory {
  type common_memory (line 35) | typedef struct _common_memory {
  type render_freq_amp_t (line 44) | typedef struct _render_freq_amp_t {
  type render_memory (line 53) | typedef struct _render_memory {
  type sam_memory (line 59) | typedef struct _sam_memory {

FILE: micropython/source/lib/ticker.c
  function ticker_init (line 46) | void ticker_init(callback_ptr slow_ticker_callback) {
  function ticker_start (line 70) | void ticker_start(void) {
  function ticker_stop (line 76) | void ticker_stop(void) {
  function noop (line 82) | int32_t noop(void) {
  function FastTicker_IRQHandler (line 88) | void FastTicker_IRQHandler(void) {
  function set_ticker_callback (line 118) | int set_ticker_callback(uint32_t index, ticker_callback_ptr func, int32_...
  function clear_ticker_callback (line 137) | int clear_ticker_callback(uint32_t index) {
  function SlowTicker_IRQHandler (line 145) | void SlowTicker_IRQHandler(void)
  function LowPriority_IRQHandler (line 153) | void LowPriority_IRQHandler(void)
  function set_low_priority_callback (line 164) | int set_low_priority_callback(callback_ptr callback, int id) {

FILE: micropython/source/lib/utils/interrupt_char.c
  function mp_hal_set_interrupt_char (line 34) | void mp_hal_set_interrupt_char(int c) {
  function mp_keyboard_interrupt (line 41) | void mp_keyboard_interrupt(void) {

FILE: micropython/source/lib/utils/pyexec.c
  function STATIC (line 62) | STATIC int parse_compile_execute(const void *source, mp_parse_input_kind...
  type repl_t (line 134) | typedef struct _repl_t {
  function pyexec_event_repl_init (line 148) | void pyexec_event_repl_init(void) {
  function STATIC (line 160) | STATIC int pyexec_raw_repl_process_char(int c) {
  function STATIC (line 206) | STATIC int pyexec_friendly_repl_process_char(int c) {
  function pyexec_event_repl_process_char (line 286) | int pyexec_event_repl_process_char(int c) {
  function pyexec_raw_repl (line 300) | int pyexec_raw_repl(void) {
  function pyexec_friendly_repl (line 350) | int pyexec_friendly_repl(void) {
  function pyexec_file (line 476) | int pyexec_file(const char *filename) {
  function pyexec_frozen_module (line 481) | int pyexec_frozen_module(const char *name) {

FILE: micropython/source/microbit/events.cpp
  class MicroPythonEventHandler (line 35) | class MicroPythonEventHandler : public EventModel {

FILE: micropython/source/microbit/fileobj.c
  function mp_obj_t (line 32) | static mp_obj_t microbit_file_writable(mp_obj_t self) {
  function mp_obj_t (line 39) | static mp_obj_t microbit_file_close_func(mp_obj_t self_in) {
  function STATIC (line 45) | STATIC mp_obj_t file___exit__(size_t n_args, const mp_obj_t *args) {
  function mp_obj_t (line 112) | static mp_obj_t mp_builtin_open(size_t n_args, const mp_obj_t *args) {

FILE: micropython/source/microbit/filesystem.c
  function init_limits (line 88) | static void init_limits(void) {
  function randomise_start_index (line 101) | static void randomise_start_index(void) {
  function microbit_filesystem_init (line 114) | void microbit_filesystem_init(void) {
  function copy_page (line 128) | static void copy_page(void *dest, void *src) {
  function filesystem_sweep (line 151) | void filesystem_sweep(void) {
  function microbit_find_file (line 185) | uint8_t microbit_find_file(const char *name, int name_len) {
  function find_chunk_and_erase (line 209) | static uint8_t find_chunk_and_erase(void) {
  function mp_obj_t (line 257) | mp_obj_t microbit_file_name(file_descriptor_obj *fd) {
  function clear_file (line 263) | static void clear_file(uint8_t chunk) {
  function file_descriptor_obj (line 271) | file_descriptor_obj *microbit_file_open(const char *name, uint32_t name_...
  function file_descriptor_obj (line 296) | static file_descriptor_obj *microbit_file_descriptor_new(uint8_t start_c...
  function mp_obj_t (line 312) | mp_obj_t microbit_remove(mp_obj_t filename) {
  function check_file_open (line 323) | static void check_file_open(file_descriptor_obj *self) {
  function advance (line 329) | static int advance(file_descriptor_obj *self, uint32_t n, bool write) {
  function mp_uint_t (line 351) | mp_uint_t microbit_file_read(mp_obj_t obj, void *buf, mp_uint_t size, in...
  function mp_uint_t (line 381) | mp_uint_t microbit_file_write(mp_obj_t obj, const void *buf, mp_uint_t s...
  function microbit_file_close (line 404) | void microbit_file_close(file_descriptor_obj *fd) {
  function mp_obj_t (line 411) | mp_obj_t microbit_file_list(void) {
  function mp_obj_t (line 422) | mp_obj_t microbit_file_size(mp_obj_t filename) {
  function mp_uint_t (line 441) | static mp_uint_t file_read_byte(void *fd_in) {
  function mp_lexer_t (line 454) | mp_lexer_t *microbit_file_lexer(qstr src_name, file_descriptor_obj *fd) {
  function mp_lexer_t (line 459) | mp_lexer_t *mp_lexer_new_from_file(const char *filename) {

FILE: micropython/source/microbit/gccollect.c
  function gc_helper_get_regs_and_sp (line 30) | __attribute__((naked)) uint32_t gc_helper_get_regs_and_sp(uint32_t *regs) {
  function gc_collect (line 56) | void gc_collect(void) {

FILE: micropython/source/microbit/help.c
  type mp_doc_t (line 61) | typedef struct _mp_doc_t {
  function mp_plat_specific_help (line 185) | bool mp_plat_specific_help(mp_obj_t args0) {

FILE: micropython/source/microbit/main.cpp
  function reset_button_handler (line 31) | void reset_button_handler(uint32_t data, gpio_irq_event event) {
  function microbit_ticker (line 38) | void microbit_ticker(void) {
  function microbit_display_exception (line 58) | static void microbit_display_exception(mp_obj_t exc_in) {
  function do_lexer (line 92) | static void do_lexer(mp_lexer_t *lex) {
  function do_strn (line 123) | static void do_strn(const char *src, size_t len) {
  function do_file (line 128) | static void do_file(file_descriptor_obj *fd) {
  type _appended_script_t (line 133) | struct _appended_script_t {
  function main (line 141) | int main(void) {
  function mp_import_stat_t (line 224) | mp_import_stat_t mp_import_stat(const char *path) {
  function NORETURN (line 231) | NORETURN void nlr_jump_fail(void *val) {
  function __register_exitproc (line 240) | void __register_exitproc() {

FILE: micropython/source/microbit/microbitaccelerometer.cpp
  type _microbit_accelerometer_obj_t (line 34) | struct _microbit_accelerometer_obj_t {
  function update (line 49) | static void update(microbit_accelerometer_obj_t *self) {
  function microbit_accelerometer_event_handler (line 64) | void microbit_accelerometer_event_handler(const MicroBitEvent *evt) {
  function mp_obj_t (line 80) | mp_obj_t microbit_accelerometer_get_x(mp_obj_t self_in) {
  function mp_obj_t (line 86) | mp_obj_t microbit_accelerometer_get_y(mp_obj_t self_in) {
  function mp_obj_t (line 92) | mp_obj_t microbit_accelerometer_get_z(mp_obj_t self_in) {
  function mp_obj_t (line 98) | mp_obj_t microbit_accelerometer_get_values(mp_obj_t self_in) {
  function STATIC (line 124) | STATIC uint32_t gesture_from_obj(mp_obj_t gesture_in) {
  function mp_obj_t (line 134) | mp_obj_t microbit_accelerometer_current_gesture(mp_obj_t self_in) {
  function mp_obj_t (line 141) | mp_obj_t microbit_accelerometer_is_gesture(mp_obj_t self_in, mp_obj_t ge...
  function mp_obj_t (line 149) | mp_obj_t microbit_accelerometer_was_gesture(mp_obj_t self_in, mp_obj_t g...
  function mp_obj_t (line 160) | mp_obj_t microbit_accelerometer_get_gestures(mp_obj_t self_in) {

FILE: micropython/source/microbit/microbitbutton.cpp
  type _microbit_button_obj_t (line 33) | struct _microbit_button_obj_t {
  function mp_obj_t (line 44) | mp_obj_t microbit_button_is_pressed(mp_obj_t self_in) {
  function mp_obj_t (line 52) | mp_obj_t microbit_button_get_presses(mp_obj_t self_in) {
  function mp_obj_t (line 60) | mp_obj_t microbit_button_was_pressed(mp_obj_t self_in) {
  type PinTransition (line 107) | enum PinTransition
  function PinTransition (line 115) | static PinTransition update(const microbit_pin_obj_t *pin) {
  function microbit_button_tick (line 151) | void microbit_button_tick(void) {
  function microbit_pin_high_debounced (line 166) | bool microbit_pin_high_debounced(microbit_pin_obj_t *pin) {

FILE: micropython/source/microbit/microbitcompass.cpp
  type _microbit_compass_obj_t (line 38) | struct _microbit_compass_obj_t {
  function microbit_compass_init (line 42) | void microbit_compass_init(void) {
  function mp_obj_t (line 54) | mp_obj_t microbit_compass_is_calibrated(mp_obj_t self_in) {
  function mp_obj_t (line 60) | mp_obj_t microbit_compass_calibrate(mp_obj_t self_in) {
  function mp_obj_t (line 90) | mp_obj_t microbit_compass_clear_calibration(mp_obj_t self_in) {
  function update (line 100) | static void update(microbit_compass_obj_t *self) {
  function mp_obj_t (line 115) | mp_obj_t microbit_compass_heading(mp_obj_t self_in) {
  function mp_obj_t (line 129) | mp_obj_t microbit_compass_get_x(mp_obj_t self_in) {
  function mp_obj_t (line 135) | mp_obj_t microbit_compass_get_y(mp_obj_t self_in) {
  function mp_obj_t (line 141) | mp_obj_t microbit_compass_get_z(mp_obj_t self_in) {
  function mp_obj_t (line 147) | mp_obj_t microbit_compass_get_field_strength(mp_obj_t self_in) {

FILE: micropython/source/microbit/microbitdisplay.cpp
  type _microbit_display_obj_t (line 48) | struct _microbit_display_obj_t {
  function microbit_display_show (line 63) | void microbit_display_show(microbit_display_obj_t *display, microbit_ima...
  function mp_obj_t (line 90) | mp_obj_t microbit_display_show_func(mp_uint_t n_args, const mp_obj_t *po...
  function STATIC (line 163) | STATIC void async_stop(void) {
  function STATIC (line 174) | STATIC void wait_for_event() {
  type DisplayPoint (line 186) | struct DisplayPoint {
  function light_sensor_read (line 307) | static int light_sensor_read(void) {
  function light_sensor_busy (line 338) | static bool light_sensor_busy(void) {
  function light_sensor_update (line 348) | static void light_sensor_update(void) {
  function callback (line 357) | static int32_t callback(void) {
  function draw_object (line 372) | static void draw_object(mp_obj_t obj) {
  function microbit_display_update (line 397) | static void microbit_display_update(void) {
  function microbit_display_tick (line 446) | void microbit_display_tick(void) {
  function microbit_display_animate (line 470) | void microbit_display_animate(microbit_display_obj_t *self, mp_obj_t ite...
  function microbit_display_scroll (line 493) | void microbit_display_scroll(microbit_display_obj_t *self, const char* s...
  function mp_obj_t (line 499) | mp_obj_t microbit_display_scroll_func(mp_uint_t n_args, const mp_obj_t *...
  function mp_obj_t (line 523) | mp_obj_t microbit_display_on_func(mp_obj_t obj) {
  function mp_obj_t (line 541) | mp_obj_t microbit_display_off_func(mp_obj_t obj) {
  function mp_obj_t (line 562) | mp_obj_t microbit_display_is_on_func(mp_obj_t obj) {
  function mp_obj_t (line 573) | mp_obj_t microbit_display_read_light_level(mp_obj_t obj) {
  function microbit_display_clear (line 579) | void microbit_display_clear(void) {
  function mp_obj_t (line 587) | mp_obj_t microbit_display_clear_func(mp_obj_t self) {
  function microbit_display_set_pixel (line 594) | void microbit_display_set_pixel(microbit_display_obj_t *display, mp_int_...
  function STATIC (line 605) | STATIC mp_obj_t microbit_display_set_pixel_func(mp_uint_t n_args, const ...
  function mp_int_t (line 613) | mp_int_t microbit_display_get_pixel(microbit_display_obj_t *display, mp_...
  function STATIC (line 620) | STATIC mp_obj_t microbit_display_get_pixel_func(mp_obj_t self_in, mp_obj...
  function microbit_display_init (line 669) | void microbit_display_init(void) {

FILE: micropython/source/microbit/microbiti2c.cpp
  type _microbit_i2c_obj_t (line 34) | struct _microbit_i2c_obj_t {
  function STATIC (line 39) | STATIC mp_obj_t microbit_i2c_init(mp_uint_t n_args, const mp_obj_t *pos_...
  function STATIC (line 73) | STATIC bool i2c_probe(i2c_t *obj, uint8_t address) {
  function STATIC (line 88) | STATIC mp_obj_t microbit_i2c_scan(mp_obj_t self_in) {
  function STATIC (line 102) | STATIC mp_obj_t microbit_i2c_read(mp_uint_t n_args, const mp_obj_t *pos_...
  function STATIC (line 126) | STATIC mp_obj_t microbit_i2c_write(mp_uint_t n_args, const mp_obj_t *pos...

FILE: micropython/source/microbit/microbitimage.cpp
  function STATIC (line 46) | STATIC void microbit_image_print(const mp_print_t *print, mp_obj_t self_...
  function mp_int_t (line 104) | mp_int_t microbit_image_obj_t::width() {
  function mp_int_t (line 111) | mp_int_t microbit_image_obj_t::height() {
  function STATIC (line 118) | STATIC greyscale_t *greyscale_new(mp_int_t w, mp_int_t h) {
  function greyscale_t (line 127) | greyscale_t *microbit_image_obj_t::copy() {
  function greyscale_t (line 139) | greyscale_t *microbit_image_obj_t::invert() {
  function STATIC (line 151) | STATIC microbit_image_obj_t *image_from_parsed_str(const char *s, mp_int...
  function STATIC (line 208) | STATIC mp_obj_t microbit_image_make_new(const mp_obj_type_t *type_in, mp...
  function clear_rect (line 269) | static void clear_rect(greyscale_t *img, mp_int_t x0, mp_int_t y0,mp_int...
  function STATIC (line 277) | STATIC void image_blit(microbit_image_obj_t *src, greyscale_t *dest, mp_...
  function greyscale_t (line 324) | greyscale_t *image_shift(microbit_image_obj_t *self, mp_int_t x, mp_int_...
  function STATIC (line 330) | STATIC microbit_image_obj_t *image_crop(microbit_image_obj_t *img, mp_in...
  function mp_obj_t (line 340) | mp_obj_t microbit_image_width(mp_obj_t self_in) {
  function mp_obj_t (line 346) | mp_obj_t microbit_image_height(mp_obj_t self_in) {
  function mp_obj_t (line 352) | mp_obj_t microbit_image_get_pixel(mp_obj_t self_in, mp_obj_t x_in, mp_ob...
  function check_mutability (line 367) | static void check_mutability(microbit_image_obj_t *self) {
  function mp_obj_t (line 374) | mp_obj_t microbit_image_set_pixel(mp_uint_t n_args, const mp_obj_t *args) {
  function mp_obj_t (line 395) | mp_obj_t microbit_image_fill(mp_obj_t self_in, mp_obj_t n_in) {
  function mp_obj_t (line 407) | mp_obj_t microbit_image_blit(mp_uint_t n_args, const mp_obj_t *args) {
  function mp_obj_t (line 439) | mp_obj_t microbit_image_crop(mp_uint_t n_args, const mp_obj_t *args) {
  function mp_obj_t (line 450) | mp_obj_t microbit_image_shift_left(mp_obj_t self_in, mp_obj_t n_in) {
  function mp_obj_t (line 457) | mp_obj_t microbit_image_shift_right(mp_obj_t self_in, mp_obj_t n_in) {
  function mp_obj_t (line 464) | mp_obj_t microbit_image_shift_up(mp_obj_t self_in, mp_obj_t n_in) {
  function mp_obj_t (line 471) | mp_obj_t microbit_image_shift_down(mp_obj_t self_in, mp_obj_t n_in) {
  function mp_obj_t (line 478) | mp_obj_t microbit_image_copy(mp_obj_t self_in) {
  function mp_obj_t (line 484) | mp_obj_t microbit_image_invert(mp_obj_t self_in) {
  function STATIC (line 580) | STATIC const unsigned char *get_font_data_from_char(char c) {
  function STATIC (line 588) | STATIC mp_int_t get_pixel_from_font_data(const unsigned char *data, int ...
  function microbit_image_set_from_char (line 593) | void microbit_image_set_from_char(greyscale_t *img, char c) {
  function microbit_image_obj_t (line 603) | microbit_image_obj_t *microbit_image_for_char(char c) {
  function microbit_image_obj_t (line 609) | microbit_image_obj_t *microbit_image_dim(microbit_image_obj_t *lhs, mp_f...
  function microbit_image_obj_t (line 622) | microbit_image_obj_t *microbit_image_sum(microbit_image_obj_t *lhs, micr...
  function STATIC (line 644) | STATIC mp_obj_t image_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t ...
  type _scrolling_string_t (line 685) | struct _scrolling_string_t {
  type _scrolling_string_iterator_t (line 694) | struct _scrolling_string_iterator_t {
  function mp_obj_t (line 711) | mp_obj_t scrolling_string_image_iterable(const char* str, mp_uint_t len,...
  function STATIC (line 722) | STATIC int font_column_non_blank(const unsigned char *font_data, unsigne...
  function rightmost_non_blank_column (line 732) | STATIC unsigned int rightmost_non_blank_column(const unsigned char *font...
  function restart (line 742) | static void restart(scrolling_string_iterator_t *iter) {
  function STATIC (line 758) | STATIC mp_obj_t get_microbit_scrolling_string_iter(mp_obj_t o_in, mp_obj...
  function STATIC (line 773) | STATIC mp_obj_t microbit_scrolling_string_iter_next(mp_obj_t o_in) {
  type _string_image_facade_t (line 861) | struct _string_image_facade_t {
  function mp_obj_t (line 867) | static mp_obj_t string_image_facade_subscr(mp_obj_t self_in, mp_obj_t in...
  function mp_obj_t (line 881) | static mp_obj_t facade_unary_op(mp_uint_t op, mp_obj_t self_in) {
  type _facade_iterator_t (line 911) | struct _facade_iterator_t {
  function mp_obj_t (line 918) | mp_obj_t microbit_string_facade(mp_obj_t string) {
  function mp_obj_t (line 926) | static mp_obj_t microbit_facade_iter_next(mp_obj_t iter_in) {
  function mp_obj_t (line 956) | static mp_obj_t microbit_facade_iterator(mp_obj_t iterable_in, mp_obj_it...

FILE: micropython/source/microbit/microbitpin.cpp
  function mp_obj_t (line 58) | static mp_obj_t microbit_pin_get_mode_func(mp_obj_t self_in) {
  function mp_obj_t (line 64) | mp_obj_t microbit_pin_write_digital(mp_obj_t self_in, mp_obj_t value_in) {
  function mp_obj_t (line 81) | mp_obj_t microbit_pin_read_digital(mp_obj_t self_in) {
  function mp_obj_t (line 93) | mp_obj_t microbit_pin_set_pull(mp_obj_t self_in, mp_obj_t pull_in) {
  function mp_obj_t (line 108) | mp_obj_t microbit_pin_get_pull(mp_obj_t self_in) {
  function mp_obj_t (line 120) | mp_obj_t microbit_pin_write_analog(mp_obj_t self_in, mp_obj_t value_in) {
  function mp_obj_t (line 142) | mp_obj_t microbit_pin_read_analog(mp_obj_t self_in) {
  function mp_obj_t (line 153) | mp_obj_t microbit_pin_set_analog_period(mp_obj_t self_in, mp_obj_t perio...
  function mp_obj_t (line 163) | mp_obj_t microbit_pin_set_analog_period_microseconds(mp_obj_t self_in, m...
  function mp_obj_t (line 173) | mp_obj_t microbit_pin_get_analog_period_microseconds(mp_obj_t self_in) {
  function mp_obj_t (line 180) | mp_obj_t microbit_pin_is_touched(mp_obj_t self_in) {
  function microbit_pin_init (line 297) | void microbit_pin_init(void) {
  function microbit_pin_obj_t (line 303) | const microbit_pin_obj_t *microbit_obj_get_pin(mp_obj_t o) {
  function microbit_obj_get_pin_name (line 312) | uint8_t microbit_obj_get_pin_name(mp_obj_t o) {

FILE: micropython/source/microbit/microbitpinmode.c
  function microbit_pinmode_t (line 36) | const microbit_pinmode_t *microbit_pin_get_mode(const microbit_pin_obj_t...
  function set_mode (line 50) | static void set_mode(uint32_t pin, const microbit_pinmode_t *mode) {
  function microbit_obj_pin_free (line 56) | void microbit_obj_pin_free(const microbit_pin_obj_t *pin) {
  function microbit_obj_pin_can_be_acquired (line 62) | bool microbit_obj_pin_can_be_acquired(const microbit_pin_obj_t *pin) {
  function microbit_obj_pin_acquire (line 67) | bool microbit_obj_pin_acquire(const microbit_pin_obj_t *pin, const micro...
  function noop (line 84) | static void noop(const microbit_pin_obj_t *pin) {
  function pinmode_error (line 88) | void pinmode_error(const microbit_pin_obj_t *pin) {
  function analog_release (line 93) | static void analog_release(const microbit_pin_obj_t *pin) {

FILE: micropython/source/microbit/microbitspi.cpp
  type _microbit_spi_obj_t (line 33) | struct _microbit_spi_obj_t {
  function STATIC (line 38) | STATIC void microbit_spi_check_initialised(microbit_spi_obj_t *self) {
  function STATIC (line 45) | STATIC mp_obj_t microbit_spi_init(mp_uint_t n_args, const mp_obj_t *pos_...
  function STATIC (line 93) | STATIC mp_obj_t microbit_spi_write(mp_obj_t self_in, mp_obj_t buf_in) {
  function STATIC (line 106) | STATIC mp_obj_t microbit_spi_read(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 122) | STATIC mp_obj_t microbit_spi_write_readinto(mp_obj_t self_in, mp_obj_t w...

FILE: micropython/source/microbit/microbituart.cpp
  type _microbit_uart_obj_t (line 42) | struct _microbit_uart_obj_t {
  function STATIC (line 49) | STATIC mp_obj_t microbit_uart_init(mp_uint_t n_args, const mp_obj_t *pos...
  function STATIC (line 115) | STATIC mp_obj_t microbit_uart_any(mp_obj_t self_in) {
  function STATIC (line 142) | STATIC bool microbit_uart_rx_wait(uint32_t timeout_ms) {
  function STATIC (line 154) | STATIC mp_uint_t microbit_uart_read(mp_obj_t self_in, void *buf_in, mp_u...
  function STATIC (line 181) | STATIC mp_uint_t microbit_uart_write(mp_obj_t self_in, const void *buf_i...

FILE: micropython/source/microbit/modantigravity.cpp
  function STATIC (line 39) | STATIC void antigravity_output_char(char c) {
  function antigravity_print_rle (line 44) | static void antigravity_print_rle(const char *s) {
  function antigravity (line 75) | void antigravity(uint8_t interval = 200 /* ms */) {
  function STATIC (line 202) | STATIC mp_obj_t antigravity__init__(void) {

FILE: micropython/source/microbit/modaudio.cpp
  function disable_gpiote (line 59) | static void disable_gpiote(uint8_t channel)
  function audio_gpiote_init (line 66) | static void audio_gpiote_init(uint32_t pin, uint8_t channel)
  function audio_ppi_disconnect (line 80) | static void audio_ppi_disconnect(void) {
  function audio_ppi_init (line 86) | static void audio_ppi_init(uint8_t channel0, uint8_t channel1) {
  function timer_stop (line 112) | static inline void timer_stop(void) {
  function timer_start (line 122) | static inline void timer_start(void) {
  function audio_stop (line 140) | void audio_stop(void) {
  function init_pin (line 163) | static void init_pin(const microbit_pin_obj_t *p0) {
  function init_pins (line 172) | static void init_pins(const microbit_pin_obj_t *p0, const microbit_pin_o...
  function audio_data_fetcher (line 187) | static void audio_data_fetcher(bool lock) {
  function audio_data_fetcher_no_gc (line 247) | static void audio_data_fetcher_no_gc(void) {
  function audio_data_fetcher_allow_gc (line 251) | static void audio_data_fetcher_allow_gc(void) {
  function set_gpiote_output_pulses (line 260) | static inline void set_gpiote_output_pulses(int32_t val1, int32_t val2) {
  function audio_ticker (line 297) | static int32_t audio_ticker(void) {
  function audio_set_pins (line 325) | static void audio_set_pins(mp_obj_t pin0_obj, mp_obj_t pin1_obj) {
  function pin_read_digital (line 335) | static int32_t pin_read_digital(const microbit_pin_obj_t *pin) {
  function audio_auto_set_pins (line 344) | static void audio_auto_set_pins(void) {
  function audio_init (line 388) | static void audio_init(void) {
  function audio_play_source (line 407) | void audio_play_source(mp_obj_t src, mp_obj_t pin1, mp_obj_t pin2, bool ...
  function STATIC (line 441) | STATIC mp_obj_t stop() {
  function STATIC (line 447) | STATIC mp_obj_t play(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_...
  function microbit_audio_is_playing (line 465) | bool microbit_audio_is_playing(void) {
  function mp_obj_t (line 469) | mp_obj_t is_playing(void) {
  function STATIC (line 477) | STATIC mp_obj_t microbit_audio_frame_new(const mp_obj_type_t *type_in, m...
  function STATIC (line 484) | STATIC mp_obj_t audio_frame_subscr(mp_obj_t self_in, mp_obj_t index_in, ...
  function mp_obj_t (line 506) | static mp_obj_t audio_frame_unary_op(mp_uint_t op, mp_obj_t self_in) {
  function mp_int_t (line 514) | static mp_int_t audio_frame_get_buffer(mp_obj_t self_in, mp_buffer_info_...
  function add_into (line 523) | static void add_into(microbit_audio_frame_obj_t *self, microbit_audio_fr...
  function microbit_audio_frame_obj_t (line 535) | static microbit_audio_frame_obj_t *copy(microbit_audio_frame_obj_t *self) {
  function mp_obj_t (line 543) | mp_obj_t copyfrom(mp_obj_t self_in, mp_obj_t other) {
  function float_to_fixed (line 561) | int32_t float_to_fixed(float f, uint32_t scale) {
  function mult (line 582) | static void mult(microbit_audio_frame_obj_t *self, float f) {
  function STATIC (line 593) | STATIC mp_obj_t audio_frame_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_...
  function microbit_audio_frame_obj_t (line 642) | microbit_audio_frame_obj_t *new_microbit_audio_frame(void) {

FILE: micropython/source/microbit/modlove.cpp
  function love (line 40) | void love(int interval = 25 /* ms */) {
  function STATIC (line 65) | STATIC mp_obj_t love_badaboom(void) {

FILE: micropython/source/microbit/modmachine.c
  function STATIC (line 37) | STATIC mp_obj_t machine_unique_id(void) {
  function STATIC (line 46) | STATIC mp_obj_t machine_freq(void) {
  function STATIC (line 52) | STATIC mp_obj_t machine_disable_irq(void) {
  function STATIC (line 60) | STATIC mp_obj_t machine_enable_irq(mp_obj_t state_in) {

FILE: micropython/source/microbit/modmicrobit.cpp
  function STATIC (line 37) | STATIC mp_obj_t microbit_reset_(void) {
  function STATIC (line 43) | STATIC mp_obj_t microbit_sleep(mp_obj_t ms_in) {
  function STATIC (line 57) | STATIC mp_obj_t microbit_running_time(void) {
  function STATIC (line 62) | STATIC mp_obj_t microbit_panic(mp_uint_t n_args, const mp_obj_t *args) {
  function STATIC (line 73) | STATIC mp_obj_t microbit_temperature(void) {

FILE: micropython/source/microbit/modmusic.cpp
  type _music_data_t (line 43) | struct _music_data_t {
  function microbit_music_tick (line 71) | void microbit_music_tick(void) {
  function STATIC (line 127) | STATIC void wait_async_music_idle(void) {
  function STATIC (line 139) | STATIC uint32_t start_note(const char *note_str, size_t note_len, const ...
  function STATIC (line 249) | STATIC mp_obj_t microbit_music_reset(void) {
  function STATIC (line 259) | STATIC mp_obj_t microbit_music_get_tempo(void) {
  function STATIC (line 269) | STATIC mp_obj_t microbit_music_stop(mp_uint_t n_args, const mp_obj_t *ar...
  function STATIC (line 287) | STATIC mp_obj_t microbit_music_play(mp_uint_t n_args, const mp_obj_t *po...
  function STATIC (line 347) | STATIC mp_obj_t microbit_music_pitch(mp_uint_t n_args, const mp_obj_t *p...
  function STATIC (line 399) | STATIC mp_obj_t microbit_music_set_tempo(mp_uint_t n_args, const mp_obj_...
  function mp_obj_t (line 422) | static mp_obj_t music_init(void) {

FILE: micropython/source/microbit/modneopixel.cpp
  type _neopixel_obj_t (line 48) | struct _neopixel_obj_t {
  function neopixel_clear_data (line 57) | static inline void neopixel_clear_data(neopixel_obj_t *self) {
  function STATIC (line 61) | STATIC mp_obj_t neopixel_make_new(const mp_obj_type_t *type_in, mp_uint_...
  function STATIC (line 85) | STATIC mp_obj_t neopixel_unary_op(mp_uint_t op, mp_obj_t self_in) {
  function STATIC (line 93) | STATIC mp_obj_t neopixel_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_...
  function STATIC (line 125) | STATIC mp_obj_t neopixel_clear_(mp_obj_t self_in) {
  function STATIC (line 133) | STATIC mp_obj_t neopixel_show_(mp_obj_t self_in) {

FILE: micropython/source/microbit/modos.c
  function STATIC (line 51) | STATIC MP_DEFINE_ATTRTUPLE(

FILE: micropython/source/microbit/modradio.cpp
  type _radio_state_t (line 67) | struct _radio_state_t {
  function bytewise_bit_swap (line 88) | static uint32_t bytewise_bit_swap(uint32_t inp)
  function crc_update (line 96) | uint16_t crc_update(uint16_t crc, uint8_t byte, uint8_t bits)
  function bit_reverse (line 121) | uint8_t bit_reverse(uint8_t b_in)
  function crc16_update (line 133) | uint16_t crc16_update(uint16_t crc, unsigned char a)
  function channel_resolver_get_frequency (line 150) | uint8_t channel_resolver_get_frequency(uint8_t channel)
  function RADIO_IRQHandler (line 173) | void RADIO_IRQHandler(void) {
  function ensure_enabled (line 353) | static void ensure_enabled(void) {
  function radio_disable (line 359) | static void radio_disable(void) {
  function radio_enable (line 371) | static void radio_enable(void) {
  function radio_enable_sniff (line 443) | static void radio_enable_sniff(void) {
  function radio_enable_esb (line 530) | static void radio_enable_esb(void) {
  function radio_enable_sb (line 612) | static void radio_enable_sb(void) {
  function radio_enable_cx (line 692) | static void radio_enable_cx(void) {
  function radio_enable_ble (line 717) | void radio_enable_ble(void) {
  function radio_enable_ble_ll (line 808) | void radio_enable_ble_ll(void) {
  function radio_send (line 894) | void radio_send(const void *buf, size_t len, const void *buf2, size_t le...
  function radio_ping (line 1021) | int radio_ping() {
  function radio_find (line 1105) | int radio_find() {
  function mp_obj_t (line 1196) | static mp_obj_t radio_receive(bool typed_packet) {
  function mp_obj_t (line 1316) | static mp_obj_t radio_sniff(void) {
  function STATIC (line 1365) | STATIC mp_obj_t mod_radio_reset(void) {
  function STATIC (line 1379) | STATIC mp_obj_t mod_radio_config(size_t n_args, const mp_obj_t *pos_args...
  function STATIC (line 1534) | STATIC mp_obj_t mod_radio_on(void) {
  function STATIC (line 1540) | STATIC mp_obj_t mod_radio_sniff_on(void) {
  function STATIC (line 1546) | STATIC mp_obj_t mod_radio_esb(void) {
  function STATIC (line 1552) | STATIC mp_obj_t mod_radio_sb(void) {
  function STATIC (line 1558) | STATIC mp_obj_t mod_radio_cx(void) {
  function STATIC (line 1564) | STATIC mp_obj_t mod_radio_ble(void) {
  function STATIC (line 1570) | STATIC mp_obj_t mod_radio_off(void) {
  function STATIC (line 1576) | STATIC mp_obj_t mod_radio_send_bytes(mp_obj_t buf_in) {
  function STATIC (line 1584) | STATIC mp_obj_t mod_radio_ping(void) {
  function STATIC (line 1591) | STATIC mp_obj_t mod_radio_find(void) {
  function STATIC (line 1602) | STATIC mp_obj_t mod_radio_receive_bytes(void) {
  function STATIC (line 1607) | STATIC mp_obj_t mod_radio_send(mp_obj_t buf_in) {
  function STATIC (line 1624) | STATIC mp_obj_t mod_radio_receive(void) {
  function STATIC (line 1634) | STATIC mp_obj_t mod_radio_sniff(void) {

FILE: micropython/source/microbit/modrandom.cpp
  function STATIC (line 41) | STATIC mp_obj_t mod_random_getrandbits(mp_obj_t num_in) {
  function STATIC (line 53) | STATIC mp_obj_t mod_random_seed(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 64) | STATIC mp_obj_t mod_random_randrange(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 103) | STATIC mp_obj_t mod_random_randint(mp_obj_t a_in, mp_obj_t b_in) {
  function STATIC (line 114) | STATIC mp_obj_t mod_random_choice(mp_obj_t seq) {
  function STATIC (line 127) | STATIC mp_float_t randfloat(void) {
  function STATIC (line 151) | STATIC mp_obj_t mod_random_random(void) {
  function STATIC (line 156) | STATIC mp_obj_t mod_random_uniform(mp_obj_t a_in, mp_obj_t b_in) {

FILE: micropython/source/microbit/modspeech.c
  function SamOutputByte (line 47) | void SamOutputByte(unsigned int pos, unsigned char b) {
  type speech_iterator_t (line 70) | typedef struct _speech_iterator_t {
  function mp_obj_t (line 78) | static mp_obj_t next(mp_obj_t iter) {
  function mp_obj_t (line 109) | static mp_obj_t make_speech_iter(void) {
  function mp_obj_t (line 117) | static mp_obj_t translate(mp_obj_t words) {
  function mp_obj_t (line 148) | static mp_obj_t articulate(mp_obj_t phonemes, mp_uint_t n_args, const mp...
  function mp_obj_t (line 202) | static mp_obj_t say(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t...
  function mp_obj_t (line 208) | static mp_obj_t pronounce(mp_uint_t n_args, const mp_obj_t *pos_args, mp...
  function mp_obj_t (line 213) | static mp_obj_t sing(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_...

FILE: micropython/source/microbit/modthis.cpp
  function STATIC (line 34) | STATIC mp_obj_t this__init__(void) {
  function STATIC (line 53) | STATIC mp_obj_t this_authors(void) {

FILE: micropython/source/microbit/mphalport.cpp
  function uart_rx_irq (line 46) | void uart_rx_irq(void) {
  function mp_hal_init (line 63) | void mp_hal_init(void) {
  function mp_hal_stdin_rx_any (line 69) | int mp_hal_stdin_rx_any(void) {
  function mp_hal_stdin_rx_chr (line 73) | int mp_hal_stdin_rx_chr(void) {
  function mp_hal_stdout_tx_str (line 82) | void mp_hal_stdout_tx_str(const char *str) {
  function mp_hal_stdout_tx_strn (line 86) | void mp_hal_stdout_tx_strn(const char *str, size_t len) {
  function mp_hal_stdout_tx_strn_cooked (line 92) | void mp_hal_stdout_tx_strn_cooked(const char *str, size_t len) {
  function STATIC (line 101) | STATIC void mp_hal_print_many(const char chrs[8], unsigned int total) {
  function mp_hal_move_cursor_back (line 112) | void mp_hal_move_cursor_back(unsigned int pos) {
  function mp_hal_erase_line_from_cursor (line 116) | void mp_hal_erase_line_from_cursor(unsigned int n_chars) {
  function mp_hal_display_string (line 121) | void mp_hal_display_string(const char *str) {
  function mp_hal_delay_us (line 125) | void mp_hal_delay_us(mp_uint_t us) {
  function mp_hal_delay_ms (line 129) | void mp_hal_delay_ms(mp_uint_t ms) {
  function mp_uint_t (line 143) | mp_uint_t mp_hal_ticks_us(void) {
  function mp_uint_t (line 147) | mp_uint_t mp_hal_ticks_ms(void) {

FILE: micropython/source/microbit/persistent.c
  function persistent_write_byte_unchecked (line 44) | void persistent_write_byte_unchecked(const uint8_t *dest, const uint8_t ...
  function persistent_write_unchecked (line 58) | void persistent_write_unchecked(const void *dest, const void *src, uint3...
  function can_write (line 86) | static inline bool can_write(const int8_t *dest, const int8_t *src, uint...
  function persistent_erase_page (line 100) | void persistent_erase_page(const void *page) {
  function is_persistent_page_aligned (line 108) | bool is_persistent_page_aligned(const void *ptr) {
  function persistent_write (line 112) | int persistent_write(const void *dst, const void *src, uint32_t len) {
  function persistent_write_byte (line 146) | int persistent_write_byte(const uint8_t *dest, const uint8_t val) {

FILE: micropython/source/py/argcheck.c
  function mp_arg_check_num (line 33) | void mp_arg_check_num(size_t n_args, size_t n_kw, size_t n_args_min, siz...
  function mp_arg_parse_all (line 75) | void mp_arg_parse_all(size_t n_pos, const mp_obj_t *pos, mp_map_t *kws, ...
  function mp_arg_parse_all_kw_array (line 131) | void mp_arg_parse_all_kw_array(size_t n_pos, size_t n_kw, const mp_obj_t...
  function NORETURN (line 138) | NORETURN void mp_arg_error_terse_mismatch(void) {
  function NORETURN (line 144) | NORETURN void mp_arg_error_unimpl_kw(void) {

FILE: micropython/source/py/asmarm.c
  function asm_arm_end_pass (line 41) | void asm_arm_end_pass(asm_arm_t *as) {
  function STATIC (line 57) | STATIC void emit(asm_arm_t *as, uint op) {
  function STATIC (line 65) | STATIC void emit_al(asm_arm_t *as, uint op) {
  function STATIC (line 70) | STATIC uint asm_arm_op_push(uint reglist) {
  function STATIC (line 75) | STATIC uint asm_arm_op_pop(uint reglist) {
  function STATIC (line 80) | STATIC uint asm_arm_op_mov_reg(uint rd, uint rn) {
  function STATIC (line 85) | STATIC uint asm_arm_op_mov_imm(uint rd, uint imm) {
  function STATIC (line 90) | STATIC uint asm_arm_op_mvn_imm(uint rd, uint imm) {
  function STATIC (line 95) | STATIC uint asm_arm_op_add_imm(uint rd, uint rn, uint imm) {
  function STATIC (line 100) | STATIC uint asm_arm_op_add_reg(uint rd, uint rn, uint rm) {
  function STATIC (line 105) | STATIC uint asm_arm_op_sub_imm(uint rd, uint rn, uint imm) {
  function STATIC (line 110) | STATIC uint asm_arm_op_sub_reg(uint rd, uint rn, uint rm) {
  function STATIC (line 115) | STATIC uint asm_arm_op_mul_reg(uint rd, uint rm, uint rs) {
  function STATIC (line 121) | STATIC uint asm_arm_op_and_reg(uint rd, uint rn, uint rm) {
  function STATIC (line 126) | STATIC uint asm_arm_op_eor_reg(uint rd, uint rn, uint rm) {
  function STATIC (line 131) | STATIC uint asm_arm_op_orr_reg(uint rd, uint rn, uint rm) {
  function asm_arm_bkpt (line 136) | void asm_arm_bkpt(asm_arm_t *as) {
  function asm_arm_entry (line 152) | void asm_arm_entry(asm_arm_t *as, int num_locals) {
  function asm_arm_exit (line 183) | void asm_arm_exit(asm_arm_t *as) {
  function asm_arm_push (line 191) | void asm_arm_push(asm_arm_t *as, uint reglist) {
  function asm_arm_pop (line 195) | void asm_arm_pop(asm_arm_t *as, uint reglist) {
  function asm_arm_mov_reg_reg (line 199) | void asm_arm_mov_reg_reg(asm_arm_t *as, uint reg_dest, uint reg_src) {
  function asm_arm_mov_reg_i32 (line 203) | void asm_arm_mov_reg_i32(asm_arm_t *as, uint rd, int imm) {
  function asm_arm_mov_local_reg (line 218) | void asm_arm_mov_local_reg(asm_arm_t *as, int local_num, uint rd) {
  function asm_arm_mov_reg_local (line 223) | void asm_arm_mov_reg_local(asm_arm_t *as, uint rd, int local_num) {
  function asm_arm_cmp_reg_i8 (line 228) | void asm_arm_cmp_reg_i8(asm_arm_t *as, uint rd, int imm) {
  function asm_arm_cmp_reg_reg (line 233) | void asm_arm_cmp_reg_reg(asm_arm_t *as, uint rd, uint rn) {
  function asm_arm_setcc_reg (line 238) | void asm_arm_setcc_reg(asm_arm_t *as, uint rd, uint cond) {
  function asm_arm_add_reg_reg_reg (line 243) | void asm_arm_add_reg_reg_reg(asm_arm_t *as, uint rd, uint rn, uint rm) {
  function asm_arm_sub_reg_reg_reg (line 248) | void asm_arm_sub_reg_reg_reg(asm_arm_t *as, uint rd, uint rn, uint rm) {
  function asm_arm_mul_reg_reg_reg (line 253) | void asm_arm_mul_reg_reg_reg(asm_arm_t *as, uint rd, uint rs, uint rm) {
  function asm_arm_and_reg_reg_reg (line 259) | void asm_arm_and_reg_reg_reg(asm_arm_t *as, uint rd, uint rn, uint rm) {
  function asm_arm_eor_reg_reg_reg (line 264) | void asm_arm_eor_reg_reg_reg(asm_arm_t *as, uint rd, uint rn, uint rm) {
  function asm_arm_orr_reg_reg_reg (line 269) | void asm_arm_orr_reg_reg_reg(asm_arm_t *as, uint rd, uint rn, uint rm) {
  function asm_arm_mov_reg_local_addr (line 274) | void asm_arm_mov_reg_local_addr(asm_arm_t *as, uint rd, int local_num) {
  function asm_arm_lsl_reg_reg (line 279) | void asm_arm_lsl_reg_reg(asm_arm_t *as, uint rd, uint rs) {
  function asm_arm_asr_reg_reg (line 284) | void asm_arm_asr_reg_reg(asm_arm_t *as, uint rd, uint rs) {
  function asm_arm_ldr_reg_reg (line 289) | void asm_arm_ldr_reg_reg(asm_arm_t *as, uint rd, uint rn, uint byte_offs...
  function asm_arm_ldrh_reg_reg (line 294) | void asm_arm_ldrh_reg_reg(asm_arm_t *as, uint rd, uint rn) {
  function asm_arm_ldrb_reg_reg (line 299) | void asm_arm_ldrb_reg_reg(asm_arm_t *as, uint rd, uint rn) {
  function asm_arm_str_reg_reg (line 304) | void asm_arm_str_reg_reg(asm_arm_t *as, uint rd, uint rm, uint byte_offs...
  function asm_arm_strh_reg_reg (line 309) | void asm_arm_strh_reg_reg(asm_arm_t *as, uint rd, uint rm) {
  function asm_arm_strb_reg_reg (line 314) | void asm_arm_strb_reg_reg(asm_arm_t *as, uint rd, uint rm) {
  function asm_arm_str_reg_reg_reg (line 319) | void asm_arm_str_reg_reg_reg(asm_arm_t *as, uint rd, uint rm, uint rn) {
  function asm_arm_strh_reg_reg_reg (line 324) | void asm_arm_strh_reg_reg_reg(asm_arm_t *as, uint rd, uint rm, uint rn) {
  function asm_arm_strb_reg_reg_reg (line 330) | void asm_arm_strb_reg_reg_reg(asm_arm_t *as, uint rd, uint rm, uint rn) {
  function asm_arm_bcc_label (line 335) | void asm_arm_bcc_label(asm_arm_t *as, int cond, uint label) {
  function asm_arm_b_label (line 349) | void asm_arm_b_label(asm_arm_t *as, uint label) {
  function asm_arm_bl_ind (line 353) | void asm_arm_bl_ind(asm_arm_t *as, void *fun_ptr, uint fun_id, uint reg_...

FILE: micropython/source/py/asmbase.c
  function mp_asm_base_init (line 36) | void mp_asm_base_init(mp_asm_base_t *as, size_t max_num_labels) {
  function mp_asm_base_deinit (line 41) | void mp_asm_base_deinit(mp_asm_base_t *as, bool free_code) {
  function mp_asm_base_start_pass (line 48) | void mp_asm_base_start_pass(mp_asm_base_t *as, int pass) {
  function mp_asm_base_label_assign (line 74) | void mp_asm_base_label_assign(mp_asm_base_t *as, size_t label) {
  function mp_asm_base_align (line 87) | void mp_asm_base_align(mp_asm_base_t* as, unsigned int align) {
  function mp_asm_base_data (line 92) | void mp_asm_base_data(mp_asm_base_t* as, unsigned int bytesize, uintptr_...

FILE: micropython/source/py/asmthumb.c
  function byte (line 46) | static inline byte *asm_thumb_get_cur_to_write_bytes(asm_thumb_t *as, in...
  function asm_thumb_end_pass (line 50) | void asm_thumb_end_pass(asm_thumb_t *as) {
  function asm_thumb_entry (line 106) | void asm_thumb_entry(asm_thumb_t *as, int num_locals) {
  function asm_thumb_exit (line 152) | void asm_thumb_exit(asm_thumb_t *as) {
  function STATIC (line 159) | STATIC mp_uint_t get_label_dest(asm_thumb_t *as, uint label) {
  function asm_thumb_op16 (line 164) | void asm_thumb_op16(asm_thumb_t *as, uint op) {
  function asm_thumb_op32 (line 173) | void asm_thumb_op32(asm_thumb_t *as, uint op1, uint op2) {
  function asm_thumb_format_4 (line 186) | void asm_thumb_format_4(asm_thumb_t *as, uint op, uint rlo_dest, uint rl...
  function asm_thumb_mov_reg_reg (line 192) | void asm_thumb_mov_reg_reg(asm_thumb_t *as, uint reg_dest, uint reg_src) {
  function asm_thumb_mov_reg_i16 (line 209) | void asm_thumb_mov_reg_i16(asm_thumb_t *as, uint mov_op, uint reg_dest, ...
  function asm_thumb_b_n_label (line 217) | bool asm_thumb_b_n_label(asm_thumb_t *as, uint label) {
  function asm_thumb_bcc_nw_label (line 231) | bool asm_thumb_bcc_nw_label(asm_thumb_t *as, int cond, uint label, bool ...
  function asm_thumb_bl_label (line 247) | bool asm_thumb_bl_label(asm_thumb_t *as, uint label) {
  function asm_thumb_mov_reg_i32 (line 255) | void asm_thumb_mov_reg_i32(asm_thumb_t *as, uint reg_dest, mp_uint_t i32) {
  function asm_thumb_mov_reg_i32_optimised (line 263) | void asm_thumb_mov_reg_i32_optimised(asm_thumb_t *as, uint reg_dest, int...
  function asm_thumb_mov_reg_i32_aligned (line 275) | void asm_thumb_mov_reg_i32_aligned(asm_thumb_t *as, uint reg_dest, int i...
  function asm_thumb_mov_local_reg (line 291) | void asm_thumb_mov_local_reg(asm_thumb_t *as, int local_num, uint rlo_sr...
  function asm_thumb_mov_reg_local (line 298) | void asm_thumb_mov_reg_local(asm_thumb_t *as, uint rlo_dest, int local_n...
  function asm_thumb_mov_reg_local_addr (line 307) | void asm_thumb_mov_reg_local_addr(asm_thumb_t *as, uint rlo_dest, int lo...
  function asm_thumb_b_label (line 318) | void asm_thumb_b_label(asm_thumb_t *as, uint label) {
  function asm_thumb_bcc_label (line 337) | void asm_thumb_bcc_label(asm_thumb_t *as, int cond, uint label) {
  function asm_thumb_bl_ind (line 359) | void asm_thumb_bl_ind(asm_thumb_t *as, void *fun_ptr, uint fun_id, uint ...

FILE: micropython/source/py/asmx64.c
  function byte (line 119) | static inline byte *asm_x64_get_cur_to_write_bytes(asm_x64_t *as, int n) {
  function STATIC (line 123) | STATIC void asm_x64_write_byte_1(asm_x64_t *as, byte b1) {
  function STATIC (line 130) | STATIC void asm_x64_write_byte_2(asm_x64_t *as, byte b1, byte b2) {
  function STATIC (line 138) | STATIC void asm_x64_write_byte_3(asm_x64_t *as, byte b1, byte b2, byte b...
  function STATIC (line 147) | STATIC void asm_x64_write_word32(asm_x64_t *as, int w32) {
  function STATIC (line 157) | STATIC void asm_x64_write_word64(asm_x64_t *as, int64_t w64) {
  function STATIC (line 183) | STATIC void asm_x64_write_r64_disp(asm_x64_t *as, int r64, int disp_r64,...
  function STATIC (line 203) | STATIC void asm_x64_generic_r64_r64(asm_x64_t *as, int dest_r64, int src...
  function asm_x64_nop (line 207) | void asm_x64_nop(asm_x64_t *as) {
  function asm_x64_push_r64 (line 211) | void asm_x64_push_r64(asm_x64_t *as, int src_r64) {
  function asm_x64_pop_r64 (line 234) | void asm_x64_pop_r64(asm_x64_t *as, int dest_r64) {
  function STATIC (line 242) | STATIC void asm_x64_ret(asm_x64_t *as) {
  function asm_x64_mov_r64_r64 (line 246) | void asm_x64_mov_r64_r64(asm_x64_t *as, int dest_r64, int src_r64) {
  function asm_x64_mov_r8_to_mem8 (line 250) | void asm_x64_mov_r8_to_mem8(asm_x64_t *as, int src_r64, int dest_r64, in...
  function asm_x64_mov_r16_to_mem16 (line 259) | void asm_x64_mov_r16_to_mem16(asm_x64_t *as, int src_r64, int dest_r64, ...
  function asm_x64_mov_r32_to_mem32 (line 268) | void asm_x64_mov_r32_to_mem32(asm_x64_t *as, int src_r64, int dest_r64, ...
  function asm_x64_mov_r64_to_mem64 (line 277) | void asm_x64_mov_r64_to_mem64(asm_x64_t *as, int src_r64, int dest_r64, ...
  function asm_x64_mov_mem8_to_r64zx (line 283) | void asm_x64_mov_mem8_to_r64zx(asm_x64_t *as, int src_r64, int src_disp,...
  function asm_x64_mov_mem16_to_r64zx (line 293) | void asm_x64_mov_mem16_to_r64zx(asm_x64_t *as, int src_r64, int src_disp...
  function asm_x64_mov_mem32_to_r64zx (line 303) | void asm_x64_mov_mem32_to_r64zx(asm_x64_t *as, int src_r64, int src_disp...
  function asm_x64_mov_mem64_to_r64 (line 313) | void asm_x64_mov_mem64_to_r64(asm_x64_t *as, int src_r64, int src_disp, ...
  function STATIC (line 319) | STATIC void asm_x64_lea_disp_to_r64(asm_x64_t *as, int src_r64, int src_...
  function STATIC (line 334) | STATIC void asm_x64_mov_i32_to_r64(asm_x64_t *as, int src_i32, int dest_...
  function asm_x64_mov_i64_to_r64 (line 344) | void asm_x64_mov_i64_to_r64(asm_x64_t *as, int64_t src_i64, int dest_r64) {
  function asm_x64_mov_i64_to_r64_optimised (line 353) | void asm_x64_mov_i64_to_r64_optimised(asm_x64_t *as, int64_t src_i64, in...
  function asm_x64_mov_i64_to_r64_aligned (line 365) | void asm_x64_mov_i64_to_r64_aligned(asm_x64_t *as, int64_t src_i64, int ...
  function asm_x64_and_r64_r64 (line 373) | void asm_x64_and_r64_r64(asm_x64_t *as, int dest_r64, int src_r64) {
  function asm_x64_or_r64_r64 (line 377) | void asm_x64_or_r64_r64(asm_x64_t *as, int dest_r64, int src_r64) {
  function asm_x64_xor_r64_r64 (line 381) | void asm_x64_xor_r64_r64(asm_x64_t *as, int dest_r64, int src_r64) {
  function asm_x64_shl_r64_cl (line 385) | void asm_x64_shl_r64_cl(asm_x64_t* as, int dest_r64) {
  function asm_x64_sar_r64_cl (line 389) | void asm_x64_sar_r64_cl(asm_x64_t* as, int dest_r64) {
  function asm_x64_add_r64_r64 (line 393) | void asm_x64_add_r64_r64(asm_x64_t *as, int dest_r64, int src_r64) {
  function asm_x64_sub_r64_r64 (line 397) | void asm_x64_sub_r64_r64(asm_x64_t *as, int dest_r64, int src_r64) {
  function asm_x64_mul_r64_r64 (line 401) | void asm_x64_mul_r64_r64(asm_x64_t *as, int dest_r64, int src_r64) {
  function STATIC (line 421) | STATIC void asm_x64_sub_r64_i32(asm_x64_t *as, int dest_r64, int src_i32) {
  function asm_x64_cmp_r64_with_r64 (line 451) | void asm_x64_cmp_r64_with_r64(asm_x64_t *as, int src_r64_a, int src_r64_...
  function asm_x64_test_r8_with_r8 (line 467) | void asm_x64_test_r8_with_r8(asm_x64_t *as, int src_r64_a, int src_r64_b) {
  function asm_x64_setcc_r8 (line 474) | void asm_x64_setcc_r8(asm_x64_t *as, int jcc_type, int dest_r8) {
  function STATIC (line 479) | STATIC mp_uint_t get_label_dest(asm_x64_t *as, mp_uint_t label) {
  function asm_x64_jmp_label (line 484) | void asm_x64_jmp_label(asm_x64_t *as, mp_uint_t label) {
  function asm_x64_jcc_label (line 506) | void asm_x64_jcc_label(asm_x64_t *as, int jcc_type, mp_uint_t label) {
  function asm_x64_entry (line 528) | void asm_x64_entry(asm_x64_t *as, int num_locals) {
  function asm_x64_exit (line 542) | void asm_x64_exit(asm_x64_t *as) {
  function STATIC (line 561) | STATIC int asm_x64_local_offset_from_ebp(asm_x64_t *as, int local_num) {
  function asm_x64_mov_local_to_r64 (line 565) | void asm_x64_mov_local_to_r64(asm_x64_t *as, int src_local_num, int dest...
  function asm_x64_mov_r64_to_local (line 569) | void asm_x64_mov_r64_to_local(asm_x64_t *as, int src_r64, int dest_local...
  function asm_x64_mov_local_addr_to_r64 (line 573) | void asm_x64_mov_local_addr_to_r64(asm_x64_t *as, int local_num, int des...
  function asm_x64_call_ind (line 615) | void asm_x64_call_ind(asm_x64_t *as, void *ptr, int temp_r64) {

FILE: micropython/source/py/asmx86.c
  function STATIC (line 103) | STATIC void asm_x86_write_byte_1(asm_x86_t *as, byte b1) {
  function STATIC (line 110) | STATIC void asm_x86_write_byte_2(asm_x86_t *as, byte b1, byte b2) {
  function STATIC (line 118) | STATIC void asm_x86_write_byte_3(asm_x86_t *as, byte b1, byte b2, byte b...
  function STATIC (line 127) | STATIC void asm_x86_write_word32(asm_x86_t *as, int w32) {
  function STATIC (line 137) | STATIC void asm_x86_write_r32_disp(asm_x86_t *as, int r32, int disp_r32,...
  function STATIC (line 150) | STATIC void asm_x86_generic_r32_r32(asm_x86_t *as, int dest_r32, int src...
  function STATIC (line 154) | STATIC void asm_x86_nop(asm_x86_t *as) {
  function STATIC (line 158) | STATIC void asm_x86_push_r32(asm_x86_t *as, int src_r32) {
  function asm_x86_push_i32 (line 163) | void asm_x86_push_i32(asm_x86_t *as, int src_i32) {
  function asm_x86_push_disp (line 168) | void asm_x86_push_disp(asm_x86_t *as, int src_r32, int src_offset) {
  function STATIC (line 174) | STATIC void asm_x86_pop_r32(asm_x86_t *as, int dest_r32) {
  function STATIC (line 178) | STATIC void asm_x86_ret(asm_x86_t *as) {
  function asm_x86_mov_r32_r32 (line 182) | void asm_x86_mov_r32_r32(asm_x86_t *as, int dest_r32, int src_r32) {
  function asm_x86_mov_r8_to_mem8 (line 186) | void asm_x86_mov_r8_to_mem8(asm_x86_t *as, int src_r32, int dest_r32, in...
  function asm_x86_mov_r16_to_mem16 (line 191) | void asm_x86_mov_r16_to_mem16(asm_x86_t *as, int src_r32, int dest_r32, ...
  function asm_x86_mov_r32_to_mem32 (line 196) | void asm_x86_mov_r32_to_mem32(asm_x86_t *as, int src_r32, int dest_r32, ...
  function asm_x86_mov_mem8_to_r32zx (line 201) | void asm_x86_mov_mem8_to_r32zx(asm_x86_t *as, int src_r32, int src_disp,...
  function asm_x86_mov_mem16_to_r32zx (line 206) | void asm_x86_mov_mem16_to_r32zx(asm_x86_t *as, int src_r32, int src_disp...
  function asm_x86_mov_mem32_to_r32 (line 211) | void asm_x86_mov_mem32_to_r32(asm_x86_t *as, int src_r32, int src_disp, ...
  function STATIC (line 216) | STATIC void asm_x86_lea_disp_to_r32(asm_x86_t *as, int src_r32, int src_...
  function asm_x86_mov_i8_to_r8 (line 222) | void asm_x86_mov_i8_to_r8(asm_x86_t *as, int src_i8, int dest_r32) {
  function asm_x86_mov_i32_to_r32 (line 227) | void asm_x86_mov_i32_to_r32(asm_x86_t *as, int32_t src_i32, int dest_r32) {
  function asm_x86_mov_i32_to_r32_aligned (line 233) | void asm_x86_mov_i32_to_r32_aligned(asm_x86_t *as, int32_t src_i32, int ...
  function asm_x86_and_r32_r32 (line 241) | void asm_x86_and_r32_r32(asm_x86_t *as, int dest_r32, int src_r32) {
  function asm_x86_or_r32_r32 (line 245) | void asm_x86_or_r32_r32(asm_x86_t *as, int dest_r32, int src_r32) {
  function asm_x86_xor_r32_r32 (line 249) | void asm_x86_xor_r32_r32(asm_x86_t *as, int dest_r32, int src_r32) {
  function asm_x86_shl_r32_cl (line 253) | void asm_x86_shl_r32_cl(asm_x86_t* as, int dest_r32) {
  function asm_x86_sar_r32_cl (line 257) | void asm_x86_sar_r32_cl(asm_x86_t* as, int dest_r32) {
  function asm_x86_add_r32_r32 (line 261) | void asm_x86_add_r32_r32(asm_x86_t *as, int dest_r32, int src_r32) {
  function STATIC (line 265) | STATIC void asm_x86_add_i32_to_r32(asm_x86_t *as, int src_i32, int dest_...
  function asm_x86_sub_r32_r32 (line 275) | void asm_x86_sub_r32_r32(asm_x86_t *as, int dest_r32, int src_r32) {
  function STATIC (line 279) | STATIC void asm_x86_sub_r32_i32(asm_x86_t *as, int dest_r32, int src_i32) {
  function asm_x86_mul_r32_r32 (line 291) | void asm_x86_mul_r32_r32(asm_x86_t *as, int dest_r32, int src_r32) {
  function asm_x86_shl_r32_by_imm (line 298) | void asm_x86_shl_r32_by_imm(asm_x86_t *as, int r32, int imm) {
  function asm_x86_shr_r32_by_imm (line 303) | void asm_x86_shr_r32_by_imm(asm_x86_t *as, int r32, int imm) {
  function asm_x86_sar_r32_by_imm (line 308) | void asm_x86_sar_r32_by_imm(asm_x86_t *as, int r32, int imm) {
  function asm_x86_cmp_r32_with_r32 (line 314) | void asm_x86_cmp_r32_with_r32(asm_x86_t *as, int src_r32_a, int src_r32_...
  function asm_x86_cmp_i32_with_r32 (line 319) | void asm_x86_cmp_i32_with_r32(asm_x86_t *as, int src_i32, int src_r32) {
  function asm_x86_test_r8_with_r8 (line 330) | void asm_x86_test_r8_with_r8(asm_x86_t *as, int src_r32_a, int src_r32_b) {
  function asm_x86_setcc_r8 (line 337) | void asm_x86_setcc_r8(asm_x86_t *as, mp_uint_t jcc_type, int dest_r8) {
  function STATIC (line 341) | STATIC mp_uint_t get_label_dest(asm_x86_t *as, mp_uint_t label) {
  function asm_x86_jmp_label (line 346) | void asm_x86_jmp_label(asm_x86_t *as, mp_uint_t label) {
  function asm_x86_jcc_label (line 368) | void asm_x86_jcc_label(asm_x86_t *as, mp_uint_t jcc_type, mp_uint_t labe...
  function asm_x86_entry (line 390) | void asm_x86_entry(asm_x86_t *as, mp_uint_t num_locals) {
  function asm_x86_exit (line 403) | void asm_x86_exit(asm_x86_t *as) {
  function asm_x86_push_arg (line 412) | void asm_x86_push_arg(asm_x86_t *as, int src_arg_num) {
  function asm_x86_mov_arg_to_r32 (line 417) | void asm_x86_mov_arg_to_r32(asm_x86_t *as, int src_arg_num, int dest_r32) {
  function asm_x86_mov_r32_to_arg (line 422) | void asm_x86_mov_r32_to_arg(asm_x86_t *as, int src_r32, int dest_arg_num) {
  function STATIC (line 438) | STATIC int asm_x86_local_offset_from_ebp(asm_x86_t *as, int local_num) {
  function asm_x86_mov_local_to_r32 (line 442) | void asm_x86_mov_local_to_r32(asm_x86_t *as, int src_local_num, int dest...
  function asm_x86_mov_r32_to_local (line 446) | void asm_x86_mov_r32_to_local(asm_x86_t *as, int src_r32, int dest_local...
  function asm_x86_mov_local_addr_to_r32 (line 450) | void asm_x86_mov_local_addr_to_r32(asm_x86_t *as, int local_num, int des...
  function asm_x86_push_local (line 460) | void asm_x86_push_local(asm_x86_t *as, int local_num) {
  function asm_x86_push_local_addr (line 464) | void asm_x86_push_local_addr(asm_x86_t *as, int local_num, int temp_r32)
  function asm_x86_call_ind (line 472) | void asm_x86_call_ind(asm_x86_t *as, void *ptr, mp_uint_t n_args, int te...

FILE: micropython/source/py/asmxtensa.c
  function asm_xtensa_end_pass (line 41) | void asm_xtensa_end_pass(asm_xtensa_t *as) {
  function asm_xtensa_entry (line 64) | void asm_xtensa_entry(asm_xtensa_t *as, int num_locals) {
  function asm_xtensa_exit (line 81) | void asm_xtensa_exit(asm_xtensa_t *as) {
  function STATIC (line 93) | STATIC uint32_t get_label_dest(asm_xtensa_t *as, uint label) {
  function asm_xtensa_op16 (line 98) | void asm_xtensa_op16(asm_xtensa_t *as, uint16_t op) {
  function asm_xtensa_op24 (line 106) | void asm_xtensa_op24(asm_xtensa_t *as, uint32_t op) {
  function asm_xtensa_j_label (line 115) | void asm_xtensa_j_label(asm_xtensa_t *as, uint label) {
  function asm_xtensa_bccz_reg_label (line 122) | void asm_xtensa_bccz_reg_label(asm_xtensa_t *as, uint cond, uint reg, ui...
  function asm_xtensa_bcc_reg_reg_label (line 131) | void asm_xtensa_bcc_reg_reg_label(asm_xtensa_t *as, uint cond, uint reg1...
  function asm_xtensa_setcc_reg_reg_reg (line 141) | void asm_xtensa_setcc_reg_reg_reg(asm_xtensa_t *as, uint cond, uint reg_...
  function asm_xtensa_mov_reg_i32 (line 147) | void asm_xtensa_mov_reg_i32(asm_xtensa_t *as, uint reg_dest, uint32_t i3...
  function asm_xtensa_mov_local_reg (line 161) | void asm_xtensa_mov_local_reg(asm_xtensa_t *as, int local_num, uint reg_...
  function asm_xtensa_mov_reg_local (line 165) | void asm_xtensa_mov_reg_local(asm_xtensa_t *as, uint reg_dest, int local...
  function asm_xtensa_mov_reg_local_addr (line 169) | void asm_xtensa_mov_reg_local_addr(asm_xtensa_t *as, uint reg_dest, int ...

FILE: micropython/source/py/bc.c
  function mp_uint_t (line 45) | mp_uint_t mp_decode_uint(const byte **ptr) {
  function mp_uint_t (line 63) | mp_uint_t mp_decode_uint_value(const byte *ptr) {
  function byte (line 69) | const byte *mp_decode_uint_skip(const byte *ptr) {
  function fun_pos_args_mismatch (line 75) | void fun_pos_args_mismatch(mp_obj_fun_bc_t *f, size_t expected, size_t g...
  function STATIC (line 94) | STATIC void dump_args(const mp_obj_t *a, size_t sz) {
  function mp_setup_code_state (line 110) | void mp_setup_code_state(mp_code_state_t *code_state, size_t n_args, siz...
  function uint (line 387) | uint mp_opcode_format(const byte *ip, size_t *opcode_size) {

FILE: micropython/source/py/binary.c
  function mp_binary_get_size (line 44) | size_t mp_binary_get_size(char struct_type, char val_type, mp_uint_t *pa...
  function mp_obj_t (line 115) | mp_obj_t mp_binary_get_val_array(char typecode, void *p, mp_uint_t index) {
  function mp_binary_get_int (line 164) | long long mp_binary_get_int(mp_uint_t size, bool is_signed, bool big_end...
  function mp_obj_t (line 187) | mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte **ptr) {
  function mp_binary_set_int (line 233) | void mp_binary_set_int(mp_uint_t val_sz, bool big_endian, byte *dest, mp...
  function mp_binary_set_val (line 252) | void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in,...
  function mp_binary_set_val_array (line 317) | void mp_binary_set_val_array(char typecode, void *p, mp_uint_t index, mp...
  function mp_binary_set_val_array_from_int (line 344) | void mp_binary_set_val_array_from_int(char typecode, void *p, mp_uint_t ...

FILE: micropython/source/py/builtinevex.c
  type mp_obj_code_t (line 37) | typedef struct _mp_obj_code_t {
  function STATIC (line 47) | STATIC mp_obj_t code_execute(mp_obj_code_t *self, mp_obj_dict_t *globals...
  function STATIC (line 77) | STATIC mp_obj_t mp_builtin_compile(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 112) | STATIC mp_obj_t eval_exec_helper(size_t n_args, const mp_obj_t *args, mp...
  function STATIC (line 150) | STATIC mp_obj_t mp_builtin_eval(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 155) | STATIC mp_obj_t mp_builtin_exec(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 163) | STATIC mp_obj_t mp_builtin_execfile(size_t n_args, const mp_obj_t *args) {

FILE: micropython/source/py/builtinhelp.c
  function STATIC (line 50) | STATIC void mp_help_print_info_about_object(mp_obj_t name_o, mp_obj_t va...
  function STATIC (line 59) | STATIC void mp_help_add_from_map(mp_obj_t list, const mp_map_t *map) {
  function STATIC (line 68) | STATIC void mp_help_add_from_names(mp_obj_t list, const char *name) {
  function STATIC (line 78) | STATIC void mp_help_print_modules(void) {
  function STATIC (line 131) | STATIC void mp_help_print_obj(mp_obj_t obj) {
  function STATIC (line 178) | STATIC mp_obj_t mp_builtin_help(size_t n_args, const mp_obj_t *args) {

FILE: micropython/source/py/builtinimport.c
  function mp_obj_is_package (line 50) | bool mp_obj_is_package(mp_obj_t module) {
  function STATIC (line 58) | STATIC mp_import_stat_t mp_import_stat_any(const char *path) {
  function STATIC (line 68) | STATIC mp_import_stat_t stat_file_py_or_mpy(vstr_t *path) {
  function STATIC (line 85) | STATIC mp_import_stat_t stat_dir_or_file(vstr_t *path) {
  function STATIC (line 97) | STATIC mp_import_stat_t find_file(const char *file_str, uint file_len, v...
  function STATIC (line 133) | STATIC void do_load_from_lexer(mp_obj_t module_obj, mp_lexer_t *lex) {
  function STATIC (line 146) | STATIC void do_execute_raw_code(mp_obj_t module_obj, mp_raw_code_t *raw_...
  function STATIC (line 182) | STATIC void do_load(mp_obj_t module_obj, vstr_t *file) {
  function STATIC (line 236) | STATIC void chop_component(const char *start, const char **end) {
  function mp_obj_t (line 247) | mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args) {

FILE: micropython/source/py/compile.c
  type compiler_t (line 115) | typedef struct _compiler_t {
  function STATIC (line 150) | STATIC void compile_error_set_line(compiler_t *comp, mp_parse_node_t pn) {
  function STATIC (line 157) | STATIC void compile_syntax_error(compiler_t *comp, mp_parse_node_t pn, c...
  function STATIC (line 169) | STATIC uint comp_next_label(compiler_t *comp) {
  function STATIC (line 173) | STATIC void compile_increase_except_level(compiler_t *comp) {
  function STATIC (line 180) | STATIC void compile_decrease_except_level(compiler_t *comp) {
  function STATIC (line 185) | STATIC scope_t *scope_new_and_link(compiler_t *comp, scope_kind_t kind, ...
  function STATIC (line 203) | STATIC void apply_to_single_or_list(compiler_t *comp, mp_parse_node_t pn...
  function STATIC (line 215) | STATIC void compile_generic_all_nodes(compiler_t *comp, mp_parse_node_st...
  function STATIC (line 227) | STATIC void compile_load_id(compiler_t *comp, qstr qst) {
  function STATIC (line 239) | STATIC void compile_store_id(compiler_t *comp, qstr qst) {
  function STATIC (line 251) | STATIC void compile_delete_id(compiler_t *comp, qstr qst) {
  function STATIC (line 263) | STATIC void c_tuple(compiler_t *comp, mp_parse_node_t pn, mp_parse_node_...
  function STATIC (line 279) | STATIC void compile_generic_tuple(compiler_t *comp, mp_parse_node_struct...
  function STATIC (line 284) | STATIC void c_if_cond(compiler_t *comp, mp_parse_node_t pn, bool jump_if...
  type assign_kind_t (line 346) | typedef enum { ASSIGN_STORE, ASSIGN_AUG_LOAD, ASSIGN_AUG_STORE } assign_...
  function STATIC (line 349) | STATIC void c_assign_atom_expr(compiler_t *comp, mp_parse_node_struct_t ...
  function STATIC (line 404) | STATIC void c_assign_tuple(compiler_t *comp, mp_parse_node_t node_head, ...
  function STATIC (line 444) | STATIC void c_assign(compiler_t *comp, mp_parse_node_t pn, assign_kind_t...
  function STATIC (line 552) | STATIC void close_over_variables_etc(compiler_t *comp, scope_t *this_sco...
  function STATIC (line 589) | STATIC void compile_funcdef_lambdef_param(compiler_t *comp, mp_parse_nod...
  function STATIC (line 680) | STATIC void compile_funcdef_lambdef(compiler_t *comp, scope_t *scope, mp...
  function STATIC (line 716) | STATIC qstr compile_funcdef_helper(compiler_t *comp, mp_parse_node_struc...
  function STATIC (line 736) | STATIC qstr compile_classdef_helper(compiler_t *comp, mp_parse_node_stru...
  function STATIC (line 768) | STATIC bool compile_built_in_decorator(compiler_t *comp, int name_len, m...
  function STATIC (line 798) | STATIC void compile_decorated(compiler_t *comp, mp_parse_node_struct_t *...
  function STATIC (line 866) | STATIC void compile_funcdef(compiler_t *comp, mp_parse_node_struct_t *pn...
  function STATIC (line 872) | STATIC void c_del_stmt(compiler_t *comp, mp_parse_node_t pn) {
  function STATIC (line 949) | STATIC void compile_del_stmt(compiler_t *comp, mp_parse_node_struct_t *p...
  function STATIC (line 953) | STATIC void compile_break_stmt(compiler_t *comp, mp_parse_node_struct_t ...
  function STATIC (line 961) | STATIC void compile_continue_stmt(compiler_t *comp, mp_parse_node_struct...
  function STATIC (line 969) | STATIC void compile_return_stmt(compiler_t *comp, mp_parse_node_struct_t...
  function STATIC (line 995) | STATIC void compile_yield_stmt(compiler_t *comp, mp_parse_node_struct_t ...
  function STATIC (line 1000) | STATIC void compile_raise_stmt(compiler_t *comp, mp_parse_node_struct_t ...
  function STATIC (line 1020) | STATIC void do_import_name(compiler_t *comp, mp_parse_node_t pn, qstr *q...
  function STATIC (line 1075) | STATIC void compile_dotted_as_name(compiler_t *comp, mp_parse_node_t pn) {
  function STATIC (line 1083) | STATIC void compile_import_name(compiler_t *comp, mp_parse_node_struct_t...
  function STATIC (line 1087) | STATIC void compile_import_from(compiler_t *comp, mp_parse_node_struct_t...
  function STATIC (line 1168) | STATIC void compile_declare_global(compiler_t *comp, mp_parse_node_t pn,...
  function STATIC (line 1184) | STATIC void compile_global_stmt(compiler_t *comp, mp_parse_node_struct_t...
  function STATIC (line 1194) | STATIC void compile_declare_nonlocal(compiler_t *comp, mp_parse_node_t p...
  function STATIC (line 1207) | STATIC void compile_nonlocal_stmt(compiler_t *comp, mp_parse_node_struct...
  function STATIC (line 1221) | STATIC void compile_assert_stmt(compiler_t *comp, mp_parse_node_struct_t...
  function STATIC (line 1239) | STATIC void compile_if_stmt(compiler_t *comp, mp_parse_node_struct_t *pn...
  function STATIC (line 1316) | STATIC void compile_while_stmt(compiler_t *comp, mp_parse_node_struct_t ...
  function STATIC (line 1354) | STATIC void compile_for_stmt_optimised_range(compiler_t *comp, mp_parse_...
  function STATIC (line 1436) | STATIC void compile_for_stmt(compiler_t *comp, mp_parse_node_struct_t *p...
  function STATIC (line 1518) | STATIC void compile_try_except(compiler_t *comp, mp_parse_node_t pn_body...
  function STATIC (line 1610) | STATIC void compile_try_finally(compiler_t *comp, mp_parse_node_t pn_bod...
  function STATIC (line 1633) | STATIC void compile_try_stmt(compiler_t *comp, mp_parse_node_struct_t *p...
  function STATIC (line 1660) | STATIC void compile_with_stmt_helper(compiler_t *comp, int n, mp_parse_n...
  function STATIC (line 1693) | STATIC void compile_with_stmt(compiler_t *comp, mp_parse_node_struct_t *...
  function STATIC (line 1703) | STATIC void compile_yield_from(compiler_t *comp) {
  function STATIC (line 1710) | STATIC void compile_await_object_method(compiler_t *comp, qstr method) {
  function STATIC (line 1716) | STATIC void compile_async_for_stmt(compiler_t *comp, mp_parse_node_struc...
  function STATIC (line 1771) | STATIC void compile_async_with_stmt_helper(compiler_t *comp, int n, mp_p...
  function STATIC (line 1855) | STATIC void compile_async_with_stmt(compiler_t *comp, mp_parse_node_stru...
  function STATIC (line 1865) | STATIC void compile_async_stmt(compiler_t *comp, mp_parse_node_struct_t ...
  function STATIC (line 1884) | STATIC void compile_expr_stmt(compiler_t *comp, mp_parse_node_struct_t *...
  function STATIC (line 1994) | STATIC void c_binary_op(compiler_t *comp, mp_parse_node_struct_t *pns, m...
  function STATIC (line 2003) | STATIC void compile_test_if_expr(compiler_t *comp, mp_parse_node_struct_...
  function STATIC (line 2018) | STATIC void compile_lambdef(compiler_t *comp, mp_parse_node_struct_t *pn...
  function STATIC (line 2033) | STATIC void compile_or_and_test(compiler_t *comp, mp_parse_node_struct_t...
  function STATIC (line 2045) | STATIC void compile_or_test(compiler_t *comp, mp_parse_node_struct_t *pn...
  function STATIC (line 2049) | STATIC void compile_and_test(compiler_t *comp, mp_parse_node_struct_t *p...
  function STATIC (line 2053) | STATIC void compile_not_test_2(compiler_t *comp, mp_parse_node_struct_t ...
  function STATIC (line 2058) | STATIC void compile_comparison(compiler_t *comp, mp_parse_node_struct_t ...
  function STATIC (line 2114) | STATIC void compile_star_expr(compiler_t *comp, mp_parse_node_struct_t *...
  function STATIC (line 2118) | STATIC void compile_expr(compiler_t *comp, mp_parse_node_struct_t *pns) {
  function STATIC (line 2122) | STATIC void compile_xor_expr(compiler_t *comp, mp_parse_node_struct_t *p...
  function STATIC (line 2126) | STATIC void compile_and_expr(compiler_t *comp, mp_parse_node_struct_t *p...
  function STATIC (line 2130) | STATIC void compile_term(compiler_t *comp, mp_parse_node_struct_t *pns) {
  function STATIC (line 2154) | STATIC void compile_factor_2(compiler_t *comp, mp_parse_node_struct_t *p...
  function STATIC (line 2169) | STATIC void compile_atom_expr_normal(compiler_t *comp, mp_parse_node_str...
  function STATIC (line 2251) | STATIC void compile_power(compiler_t *comp, mp_parse_node_struct_t *pns) {
  function STATIC (line 2256) | STATIC void compile_trailer_paren_helper(compiler_t *comp, mp_parse_node...
  function STATIC (line 2343) | STATIC void compile_comprehension(compiler_t *comp, mp_parse_node_struct...
  function STATIC (line 2368) | STATIC void compile_atom_paren(compiler_t *comp, mp_parse_node_struct_t ...
  function STATIC (line 2400) | STATIC void compile_atom_bracket(compiler_t *comp, mp_parse_node_struct_...
  function STATIC (line 2439) | STATIC void compile_atom_brace(compiler_t *comp, mp_parse_node_struct_t ...
  function STATIC (line 2535) | STATIC void compile_trailer_paren(compiler_t *comp, mp_parse_node_struct...
  function STATIC (line 2539) | STATIC void compile_trailer_bracket(compiler_t *comp, mp_parse_node_stru...
  function STATIC (line 2545) | STATIC void compile_trailer_period(compiler_t *comp, mp_parse_node_struc...
  function STATIC (line 2551) | STATIC void compile_subscript_3_helper(compiler_t *comp, mp_parse_node_s...
  function STATIC (line 2596) | STATIC void compile_subscript_2(compiler_t *comp, mp_parse_node_struct_t...
  function STATIC (line 2602) | STATIC void compile_subscript_3(compiler_t *comp, mp_parse_node_struct_t...
  function STATIC (line 2608) | STATIC void compile_dictorsetmaker_item(compiler_t *comp, mp_parse_node_...
  function STATIC (line 2614) | STATIC void compile_classdef(compiler_t *comp, mp_parse_node_struct_t *p...
  function STATIC (line 2620) | STATIC void compile_yield_expr(compiler_t *comp, mp_parse_node_struct_t ...
  function STATIC (line 2639) | STATIC void compile_atom_expr_await(compiler_t *comp, mp_parse_node_stru...
  function STATIC (line 2649) | STATIC mp_obj_t get_const_object(mp_parse_node_struct_t *pns) {
  function STATIC (line 2658) | STATIC void compile_const_object(compiler_t *comp, mp_parse_node_struct_...
  function STATIC (line 2804) | STATIC void compile_scope_func_param(compiler_t *comp, mp_parse_node_t p...
  function STATIC (line 2808) | STATIC void compile_scope_lambda_param(compiler_t *comp, mp_parse_node_t...
  function STATIC (line 2813) | STATIC void compile_scope_func_annotations(compiler_t *comp, mp_parse_no...
  function STATIC (line 2855) | STATIC void compile_scope_comp_iter(compiler_t *comp, mp_parse_node_stru...
  function STATIC (line 2893) | STATIC void check_for_doc_string(compiler_t *comp, mp_parse_node_t pn) {
  function STATIC (line 2938) | STATIC void compile_scope(compiler_t *comp, scope_t *scope, pass_kind_t ...
  function STATIC (line 3113) | STATIC void compile_scope_inline_asm(compiler_t *comp, scope_t *scope, p...
  function STATIC (line 3272) | STATIC void scope_compute_things(scope_t *scope) {
  function mp_raw_code_t (line 3355) | mp_raw_code_t *mp_compile_to_raw_code(mp_parse_tree_t *parse_tree, qstr ...
  function mp_obj_t (line 3511) | mp_obj_t mp_compile(mp_parse_tree_t *parse_tree, qstr source_file, uint ...

FILE: micropython/source/py/compile2.c
  type compiler_t (line 102) | typedef struct _compiler_t {
  function STATIC (line 140) | STATIC void compile_error_set_line(compiler_t *comp, const byte *p) {
  function STATIC (line 150) | STATIC void compile_syntax_error(compiler_t *comp, const byte *p, const ...
  function STATIC (line 162) | STATIC uint comp_next_label(compiler_t *comp) {
  function STATIC (line 166) | STATIC void compile_increase_except_level(compiler_t *comp) {
  function STATIC (line 173) | STATIC void compile_decrease_except_level(compiler_t *comp) {
  function STATIC (line 178) | STATIC void scope_new_and_link(compiler_t *comp, size_t scope_idx, scope...
  function STATIC (line 186) | STATIC void apply_to_single_or_list(compiler_t *comp, const byte *p, pn_...
  function STATIC (line 199) | STATIC void compile_generic_all_nodes(compiler_t *comp, const byte *p, c...
  function STATIC (line 206) | STATIC void compile_load_id(compiler_t *comp, qstr qst) {
  function STATIC (line 218) | STATIC void compile_store_id(compiler_t *comp, qstr qst) {
  function STATIC (line 230) | STATIC void compile_delete_id(compiler_t *comp, qstr qst) {
  function STATIC (line 242) | STATIC void c_tuple(compiler_t *comp, const byte *p, const byte *p_list,...
  function STATIC (line 255) | STATIC void compile_generic_tuple(compiler_t *comp, const byte *p, const...
  function STATIC (line 260) | STATIC bool node_is_const_false(const byte *p) {
  function STATIC (line 265) | STATIC bool node_is_const_true(const byte *p) {
  function STATIC (line 270) | STATIC const byte *c_if_cond(compiler_t *comp, const byte *p, bool jump_...
  type assign_kind_t (line 332) | typedef enum { ASSIGN_STORE, ASSIGN_AUG_LOAD, ASSIGN_AUG_STORE } assign_...
  function STATIC (line 335) | STATIC void c_assign_atom_expr(compiler_t *comp, const byte *p_orig, ass...
  function STATIC (line 402) | STATIC void c_assign_tuple(compiler_t *comp, const byte *p_head, const b...
  function STATIC (line 444) | STATIC void c_assign(compiler_t *comp, const byte *p, assign_kind_t assi...
  function STATIC (line 557) | STATIC void close_over_variables_etc(compiler_t *comp, scope_t *this_sco...
  function STATIC (line 594) | STATIC void compile_funcdef_lambdef_param(compiler_t *comp, const byte *...
  function STATIC (line 693) | STATIC void compile_funcdef_lambdef(compiler_t *comp, scope_t *scope, co...
  function STATIC (line 729) | STATIC qstr compile_funcdef_helper(compiler_t *comp, const byte *p, uint...
  function STATIC (line 752) | STATIC qstr compile_classdef_helper(compiler_t *comp, const byte *p, uin...
  function STATIC (line 785) | STATIC bool compile_built_in_decorator(compiler_t *comp, const byte *p, ...
  function STATIC (line 818) | STATIC void compile_decorated(compiler_t *comp, const byte *p, const byt...
  function STATIC (line 883) | STATIC void compile_funcdef(compiler_t *comp, const byte *p, const byte ...
  function STATIC (line 890) | STATIC void c_del_stmt(compiler_t *comp, const byte *p) {
  function STATIC (line 971) | STATIC void compile_del_stmt(compiler_t *comp, const byte *p, const byte...
  function STATIC (line 976) | STATIC void compile_break_stmt(compiler_t *comp, const byte *p, const by...
  function STATIC (line 985) | STATIC void compile_continue_stmt(compiler_t *comp, const byte *p, const...
  function STATIC (line 994) | STATIC void compile_return_stmt(compiler_t *comp, const byte *p, const b...
  function STATIC (line 1022) | STATIC void compile_yield_stmt(compiler_t *comp, const byte *p, const by...
  function STATIC (line 1028) | STATIC void compile_raise_stmt(compiler_t *comp, const byte *p, const by...
  function STATIC (line 1048) | STATIC void do_import_name(compiler_t *comp, const byte *p, qstr *q_base) {
  function STATIC (line 1112) | STATIC void compile_dotted_as_name(compiler_t *comp, const byte *p) {
  function STATIC (line 1120) | STATIC void compile_import_name(compiler_t *comp, const byte *p, const b...
  function STATIC (line 1125) | STATIC void compile_import_from(compiler_t *comp, const byte *p, const b...
  function STATIC (line 1210) | STATIC void compile_declare_global(compiler_t *comp, const byte *p_for_e...
  function STATIC (line 1226) | STATIC void compile_global_stmt(compiler_t *comp, const byte *p, const b...
  function STATIC (line 1238) | STATIC void compile_declare_nonlocal(compiler_t *comp, const byte *p_for...
  function STATIC (line 1251) | STATIC void compile_nonlocal_stmt(compiler_t *comp, const byte *p, const...
  function STATIC (line 1267) | STATIC void compile_assert_stmt(compiler_t *comp, const byte *p, const b...
  function STATIC (line 1285) | STATIC void compile_if_stmt(compiler_t *comp, const byte *p, const byte ...
  function STATIC (line 1377) | STATIC void compile_while_stmt(compiler_t *comp, const byte *p, const by...
  function STATIC (line 1420) | STATIC void compile_for_stmt_optimised_range(compiler_t *comp, const byt...
  function STATIC (line 1504) | STATIC void compile_for_stmt(compiler_t *comp, const byte *p, const byte...
  function STATIC (line 1601) | STATIC void compile_try_except(compiler_t *comp, const byte *p_body, con...
  function STATIC (line 1694) | STATIC void compile_try_finally(compiler_t *comp, const byte *p_body, co...
  function STATIC (line 1719) | STATIC void compile_try_stmt(compiler_t *comp, const byte *p, const byte...
  function STATIC (line 1744) | STATIC void compile_with_stmt_helper(compiler_t *comp, const byte *n_pre...
  function STATIC (line 1778) | STATIC void compile_with_stmt(compiler_t *comp, const byte *p, const byt...
  function STATIC (line 1786) | STATIC void compile_expr_stmt(compiler_t *comp, const byte *p, const byt...
  function STATIC (line 1910) | STATIC void compile_test_if_expr(compiler_t *comp, const byte *p, const ...
  function STATIC (line 1927) | STATIC void compile_lambdef(compiler_t *comp, const byte *p, const byte ...
  function STATIC (line 1944) | STATIC void compile_or_and_test(compiler_t *comp, const byte *p, const b...
  function STATIC (line 1955) | STATIC void compile_or_test(compiler_t *comp, const byte *p, const byte ...
  function STATIC (line 1959) | STATIC void compile_and_test(compiler_t *comp, const byte *p, const byte...
  function STATIC (line 1963) | STATIC void compile_not_test_2(compiler_t *comp, const byte *p, const by...
  function STATIC (line 1969) | STATIC void compile_comparison(compiler_t *comp, const byte *p, const by...
  function STATIC (line 2029) | STATIC void compile_star_expr(compiler_t *comp, const byte *p, const byt...
  function STATIC (line 2034) | STATIC void c_binary_op(compiler_t *comp, const byte *p, const byte *pto...
  function STATIC (line 2042) | STATIC void compile_expr(compiler_t *comp, const byte *p, const byte *pt...
  function STATIC (line 2046) | STATIC void compile_xor_expr(compiler_t *comp, const byte *p, const byte...
  function STATIC (line 2050) | STATIC void compile_and_expr(compiler_t *comp, const byte *p, const byte...
  function STATIC (line 2054) | STATIC void compile_term(compiler_t *comp, const byte *p, const byte *pt...
  function STATIC (line 2078) | STATIC void compile_factor_2(compiler_t *comp, const byte *p, const byte...
  function STATIC (line 2093) | STATIC void compile_atom_expr_normal(compiler_t *comp, const byte *p, co...
  function STATIC (line 2179) | STATIC void compile_power(compiler_t *comp, const byte *p, const byte *p...
  function STATIC (line 2185) | STATIC void compile_trailer_paren_helper(compiler_t *comp, const byte *p...
  function STATIC (line 2279) | STATIC void compile_comprehension(compiler_t *comp, const byte *p, scope...
  function STATIC (line 2305) | STATIC void compile_atom_paren(compiler_t *comp, const byte *p, const by...
  function STATIC (line 2326) | STATIC void compile_atom_bracket(compiler_t *comp, const byte *p, const ...
  function STATIC (line 2355) | STATIC void compile_atom_brace(compiler_t *comp, const byte *p, const by...
  function STATIC (line 2439) | STATIC void compile_trailer_paren(compiler_t *comp, const byte *p, const...
  function STATIC (line 2446) | STATIC void compile_trailer_bracket(compiler_t *comp, const byte *p, con...
  function STATIC (line 2453) | STATIC void compile_trailer_period(compiler_t *comp, const byte *p, cons...
  function STATIC (line 2463) | STATIC void compile_subscript_3_helper(compiler_t *comp, const byte *p, ...
  function STATIC (line 2498) | STATIC void compile_subscript_2(compiler_t *comp, const byte *p, const b...
  function STATIC (line 2504) | STATIC void compile_subscript_3(compiler_t *comp, const byte *p, const b...
  function STATIC (line 2510) | STATIC void compile_dictorsetmaker_item(compiler_t *comp, const byte *p,...
  function STATIC (line 2517) | STATIC void compile_classdef(compiler_t *comp, const byte *p, const byte...
  function STATIC (line 2524) | STATIC void compile_yield_expr(compiler_t *comp, const byte *p, const by...
  function STATIC (line 2544) | STATIC mp_obj_t get_const_object(compiler_t *comp, const byte *p) {
  function STATIC (line 2550) | STATIC void compile_const_object(compiler_t *comp, const byte *p, const ...
  function STATIC (line 2567) | STATIC const byte *compile_node(compiler_t *comp, const byte *p) {
  function STATIC (line 2646) | STATIC void compile_scope_func_lambda_param(compiler_t *comp, const byte...
  function STATIC (line 2717) | STATIC void compile_scope_func_param(compiler_t *comp, const byte *p) {
  function STATIC (line 2721) | STATIC void compile_scope_lambda_param(compiler_t *comp, const byte *p) {
  function STATIC (line 2726) | STATIC void compile_scope_func_annotations(compiler_t *comp, const byte ...
  function STATIC (line 2771) | STATIC void compile_scope_comp_iter(compiler_t *comp, const byte *p_comp...
  function STATIC (line 2811) | STATIC void check_for_doc_string(compiler_t *comp, mp_parse_node_t pn) {
  function STATIC (line 2856) | STATIC void compile_scope(compiler_t *comp, scope_t *scope, pass_kind_t ...
  function STATIC (line 3035) | STATIC void compile_scope_inline_asm(compiler_t *comp, scope_t *scope, p...
  function STATIC (line 3210) | STATIC void scope_compute_things(scope_t *scope) {
  function mp_raw_code_t (line 3293) | mp_raw_code_t *mp_compile_to_raw_code(mp_parse_tree_t *parse_tree, qstr ...
  function mp_obj_t (line 3498) | mp_obj_t mp_compile(mp_parse_tree_t *parse_tree, qstr source_file, uint ...

FILE: micropython/source/py/emitbc.c
  type _emit_t (line 42) | struct _emit_t {
  function emit_t (line 75) | emit_t *emit_bc_new(void) {
  function emit_bc_set_max_num_labels (line 80) | void emit_bc_set_max_num_labels(emit_t *emit, mp_uint_t max_num_labels) {
  function emit_bc_free (line 85) | void emit_bc_free(emit_t *emit) {
  type byte (line 90) | typedef byte *(*emit_allocator_t)(emit_t *emit, int nbytes);
  function STATIC (line 92) | STATIC void emit_write_uint(emit_t *emit, emit_allocator_t allocator, mp...
  function STATIC (line 109) | STATIC byte *emit_get_cur_to_write_code_info(emit_t *emit, int num_bytes...
  function STATIC (line 122) | STATIC void emit_write_code_info_byte(emit_t* emit, byte val) {
  function STATIC (line 126) | STATIC void emit_write_code_info_uint(emit_t* emit, mp_uint_t val) {
  function STATIC (line 130) | STATIC void emit_write_code_info_qstr(emit_t *emit, qstr qst) {
  function STATIC (line 142) | STATIC void emit_write_code_info_bytes_lines(emit_t *emit, mp_uint_t byt...
  function STATIC (line 172) | STATIC byte *emit_get_cur_to_write_bytecode(emit_t *emit, int num_bytes_...
  function STATIC (line 185) | STATIC void emit_write_bytecode_byte(emit_t *emit, byte b1) {
  function STATIC (line 190) | STATIC void emit_write_bytecode_byte_byte(emit_t* emit, byte b1, byte b2) {
  function STATIC (line 197) | STATIC void emit_write_bytecode_byte_int(emit_t *emit, byte b1, mp_int_t...
  function STATIC (line 223) | STATIC void emit_write_bytecode_byte_uint(emit_t *emit, byte b, mp_uint_...
  function STATIC (line 229) | STATIC void emit_write_bytecode_byte_const(emit_t *emit, byte b, mp_uint...
  function STATIC (line 237) | STATIC void emit_write_bytecode_byte_qstr(emit_t* emit, byte b, qstr qst) {
  function STATIC (line 249) | STATIC void emit_write_bytecode_byte_obj(emit_t *emit, byte b, mp_obj_t ...
  function STATIC (line 265) | STATIC void emit_write_bytecode_byte_raw_code(emit_t *emit, byte b, mp_r...
  function STATIC (line 282) | STATIC void emit_write_bytecode_byte_unsigned_label(emit_t *emit, byte b...
  function STATIC (line 296) | STATIC void emit_write_bytecode_byte_signed_label(emit_t *emit, byte b1,...
  function mp_emit_bc_start_pass (line 309) | void mp_emit_bc_start_pass(emit_t *emit, pass_kind_t pass, scope_t *scop...
  function mp_emit_bc_end_pass (line 400) | void mp_emit_bc_end_pass(emit_t *emit) {
  function mp_emit_bc_last_emit_was_return_value (line 446) | bool mp_emit_bc_last_emit_was_return_value(emit_t *emit) {
  function mp_emit_bc_adjust_stack_size (line 450) | void mp_emit_bc_adjust_stack_size(emit_t *emit, mp_int_t delta) {
  function emit_bc_pre (line 462) | static inline void emit_bc_pre(emit_t *emit, mp_int_t stack_size_delta) {
  function mp_emit_bc_set_source_line (line 466) | void mp_emit_bc_set_source_line(emit_t *emit, mp_uint_t source_line) {
  function mp_emit_bc_label_assign (line 486) | void mp_emit_bc_label_assign(emit_t *emit, mp_uint_t l) {
  function mp_emit_bc_import_name (line 503) | void mp_emit_bc_import_name(emit_t *emit, qstr qst) {
  function mp_emit_bc_import_from (line 508) | void mp_emit_bc_import_from(emit_t *emit, qstr qst) {
  function mp_emit_bc_import_star (line 513) | void mp_emit_bc_import_star(emit_t *emit) {
  function mp_emit_bc_load_const_tok (line 518) | void mp_emit_bc_load_const_tok(emit_t *emit, mp_token_kind_t tok) {
  function mp_emit_bc_load_const_small_int (line 531) | void mp_emit_bc_load_const_small_int(emit_t *emit, mp_int_t arg) {
  function mp_emit_bc_load_const_str (line 540) | void mp_emit_bc_load_const_str(emit_t *emit, qstr qst) {
  function mp_emit_bc_load_const_obj (line 545) | void mp_emit_bc_load_const_obj(emit_t *emit, mp_obj_t obj) {
  function mp_emit_bc_load_null (line 550) | void mp_emit_bc_load_null(emit_t *emit) {
  function mp_emit_bc_load_fast (line 555) | void mp_emit_bc_load_fast(emit_t *emit, qstr qst, mp_uint_t local_num) {
  function mp_emit_bc_load_deref (line 565) | void mp_emit_bc_load_deref(emit_t *emit, qstr qst, mp_uint_t local_num) {
  function mp_emit_bc_load_name (line 571) | void mp_emit_bc_load_name(emit_t *emit, qstr qst) {
  function mp_emit_bc_load_global (line 580) | void mp_emit_bc_load_global(emit_t *emit, qstr qst) {
  function mp_emit_bc_load_attr (line 589) | void mp_emit_bc_load_attr(emit_t *emit, qstr qst) {
  function mp_emit_bc_load_method (line 597) | void mp_emit_bc_load_method(emit_t *emit, qstr qst, bool is_super) {
  function mp_emit_bc_load_build_class (line 602) | void mp_emit_bc_load_build_class(emit_t *emit) {
  function mp_emit_bc_load_subscr (line 607) | void mp_emit_bc_load_subscr(emit_t *emit) {
  function mp_emit_bc_store_fast (line 612) | void mp_emit_bc_store_fast(emit_t *emit, qstr qst, mp_uint_t local_num) {
  function mp_emit_bc_store_deref (line 622) | void mp_emit_bc_store_deref(emit_t *emit, qstr qst, mp_uint_t local_num) {
  function mp_emit_bc_store_name (line 628) | void mp_emit_bc_store_name(emit_t *emit, qstr qst) {
  function mp_emit_bc_store_global (line 633) | void mp_emit_bc_store_global(emit_t *emit, qstr qst) {
  function mp_emit_bc_store_attr (line 638) | void mp_emit_bc_store_attr(emit_t *emit, qstr qst) {
  function mp_emit_bc_store_subscr (line 646) | void mp_emit_bc_store_subscr(emit_t *emit) {
  function mp_emit_bc_delete_fast (line 651) | void mp_emit_bc_delete_fast(emit_t *emit, qstr qst, mp_uint_t local_num) {
  function mp_emit_bc_delete_deref (line 656) | void mp_emit_bc_delete_deref(emit_t *emit, qstr qst, mp_uint_t local_num) {
  function mp_emit_bc_delete_name (line 661) | void mp_emit_bc_delete_name(emit_t *emit, qstr qst) {
  function mp_emit_bc_delete_global (line 666) | void mp_emit_bc_delete_global(emit_t *emit, qstr qst) {
  function mp_emit_bc_delete_attr (line 671) | void mp_emit_bc_delete_attr(emit_t *emit, qstr qst) {
  function mp_emit_bc_delete_subscr (line 677) | void mp_emit_bc_delete_subscr(emit_t *emit) {
  function mp_emit_bc_dup_top (line 683) | void mp_emit_bc_dup_top(emit_t *emit) {
  function mp_emit_bc_dup_top_two (line 688) | void mp_emit_bc_dup_top_two(emit_t *emit) {
  function mp_emit_bc_pop_top (line 693) | void mp_emit_bc_pop_top(emit_t *emit) {
  function mp_emit_bc_rot_two (line 698) | void mp_emit_bc_rot_two(emit_t *emit) {
  function mp_emit_bc_rot_three (line 703) | void mp_emit_bc_rot_three(emit_t *emit) {
  function mp_emit_bc_jump (line 708) | void mp_emit_bc_jump(emit_t *emit, mp_uint_t label) {
  function mp_emit_bc_pop_jump_if (line 713) | void mp_emit_bc_pop_jump_if(emit_t *emit, bool cond, mp_uint_t label) {
  function mp_emit_bc_jump_if_or_pop (line 722) | void mp_emit_bc_jump_if_or_pop(emit_t *emit, bool cond, mp_uint_t label) {
  function mp_emit_bc_unwind_jump (line 731) | void mp_emit_bc_unwind_jump(emit_t *emit, mp_uint_t label, mp_uint_t exc...
  function mp_emit_bc_setup_with (line 749) | void mp_emit_bc_setup_with(emit_t *emit, mp_uint_t label) {
  function mp_emit_bc_with_cleanup (line 756) | void mp_emit_bc_with_cleanup(emit_t *emit, mp_uint_t label) {
  function mp_emit_bc_setup_except (line 765) | void mp_emit_bc_setup_except(emit_t *emit, mp_uint_t label) {
  function mp_emit_bc_setup_finally (line 770) | void mp_emit_bc_setup_finally(emit_t *emit, mp_uint_t label) {
  function mp_emit_bc_end_finally (line 775) | void mp_emit_bc_end_finally(emit_t *emit) {
  function mp_emit_bc_get_iter (line 780) | void mp_emit_bc_get_iter(emit_t *emit, bool use_stack) {
  function mp_emit_bc_for_iter (line 785) | void mp_emit_bc_for_iter(emit_t *emit, mp_uint_t label) {
  function mp_emit_bc_for_iter_end (line 790) | void mp_emit_bc_for_iter_end(emit_t *emit) {
  function mp_emit_bc_pop_block (line 794) | void mp_emit_bc_pop_block(emit_t *emit) {
  function mp_emit_bc_pop_except (line 799) | void mp_emit_bc_pop_except(emit_t *emit) {
  function mp_emit_bc_unary_op (line 804) | void mp_emit_bc_unary_op(emit_t *emit, mp_unary_op_t op) {
  function mp_emit_bc_binary_op (line 809) | void mp_emit_bc_binary_op(emit_t *emit, mp_binary_op_t op) {
  function mp_emit_bc_build_tuple (line 826) | void mp_emit_bc_build_tuple(emit_t *emit, mp_uint_t n_args) {
  function mp_emit_bc_build_list (line 831) | void mp_emit_bc_build_list(emit_t *emit, mp_uint_t n_args) {
  function mp_emit_bc_build_map (line 836) | void mp_emit_bc_build_map(emit_t *emit, mp_uint_t n_args) {
  function mp_emit_bc_store_map (line 841) | void mp_emit_bc_store_map(emit_t *emit) {
  function mp_emit_bc_build_set (line 847) | void mp_emit_bc_build_set(emit_t *emit, mp_uint_t n_args) {
  function mp_emit_bc_build_slice (line 854) | void mp_emit_bc_build_slice(emit_t *emit, mp_uint_t n_args) {
  function mp_emit_bc_store_comp (line 860) | void mp_emit_bc_store_comp(emit_t *emit, scope_kind_t kind, mp_uint_t co...
  function mp_emit_bc_unpack_sequence (line 878) | void mp_emit_bc_unpack_sequence(emit_t *emit, mp_uint_t n_args) {
  function mp_emit_bc_unpack_ex (line 883) | void mp_emit_bc_unpack_ex(emit_t *emit, mp_uint_t n_left, mp_uint_t n_ri...
  function mp_emit_bc_make_function (line 888) | void mp_emit_bc_make_function(emit_t *emit, scope_t *scope, mp_uint_t n_...
  function mp_emit_bc_make_closure (line 898) | void mp_emit_bc_make_closure(emit_t *emit, scope_t *scope, mp_uint_t n_c...
  function STATIC (line 911) | STATIC void emit_bc_call_function_method_helper(emit_t *emit, mp_int_t s...
  function mp_emit_bc_call_function (line 921) | void mp_emit_bc_call_function(emit_t *emit, mp_uint_t n_positional, mp_u...
  function mp_emit_bc_call_method (line 925) | void mp_emit_bc_call_method(emit_t *emit, mp_uint_t n_positional, mp_uin...
  function mp_emit_bc_return_value (line 929) | void mp_emit_bc_return_value(emit_t *emit) {
  function mp_emit_bc_raise_varargs (line 935) | void mp_emit_bc_raise_varargs(emit_t *emit, mp_uint_t n_args) {
  function mp_emit_bc_yield_value (line 941) | void mp_emit_bc_yield_value(emit_t *emit) {
  function mp_emit_bc_yield_from (line 947) | void mp_emit_bc_yield_from(emit_t *emit) {
  function mp_emit_bc_start_except_handler (line 953) | void mp_emit_bc_start_except_handler(emit_t *emit) {
  function mp_emit_bc_end_except_handler (line 957) | void mp_emit_bc_end_except_handler(emit_t *emit) {

FILE: micropython/source/py/emitcommon.c
  function mp_emit_common_get_id_for_load (line 33) | void mp_emit_common_get_id_for_load(scope_t *scope, qstr qst) {
  function mp_emit_common_get_id_for_modification (line 42) | void mp_emit_common_get_id_for_modification(scope_t *scope, qstr qst) {
  function mp_emit_common_id_op (line 58) | void mp_emit_common_id_op(emit_t *emit, const mp_emit_method_table_id_op...

FILE: micropython/source/py/emitglue.c
  function mp_raw_code_t (line 52) | mp_raw_code_t *mp_emit_glue_new_raw_code(void) {
  function mp_emit_glue_assign_bytecode (line 58) | void mp_emit_glue_assign_bytecode(mp_raw_code_t *rc, const byte *code, m...
  function mp_emit_glue_assign_native (line 87) | void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t ki...
  function mp_obj_t (line 117) | mp_obj_t mp_make_function_from_raw_code(const mp_raw_code_t *rc, mp_obj_...
  function mp_obj_t (line 158) | mp_obj_t mp_make_closure_from_raw_code(const mp_raw_code_t *rc, mp_uint_...

FILE: micropython/source/py/emitinlinethumb.c
  type _emit_inline_asm_t (line 54) | struct _emit_inline_asm_t {
  function STATIC (line 63) | STATIC void emit_inline_thumb_error_msg(emit_inline_asm_t *emit, const c...
  function STATIC (line 67) | STATIC void emit_inline_thumb_error_exc(emit_inline_asm_t *emit, mp_obj_...
  function emit_inline_asm_t (line 71) | emit_inline_asm_t *emit_inline_thumb_new(mp_uint_t *co_data, mp_uint_t m...
  function emit_inline_thumb_free (line 81) | void emit_inline_thumb_free(emit_inline_asm_t *emit) {
  function STATIC (line 87) | STATIC void emit_inline_thumb_start_pass(emit_inline_asm_t *emit, pass_k...
  function STATIC (line 97) | STATIC void emit_inline_thumb_end_pass(emit_inline_asm_t *emit, mp_uint_...
  function STATIC (line 102) | STATIC mp_uint_t emit_inline_thumb_count_params(emit_inline_asm_t *emit,...
  function STATIC (line 124) | STATIC bool emit_inline_thumb_label(emit_inline_asm_t *emit, mp_uint_t l...
  type reg_name_t (line 139) | typedef struct _reg_name_t { byte reg; byte name[3]; } reg_name_t;
  type special_reg_name_t (line 165) | typedef struct _special_reg_name_t { byte reg; char name[MAX_SPECIAL_REG...
  function STATIC (line 173) | STATIC const char *get_arg_str(mp_parse_node_t pn) {
  function STATIC (line 183) | STATIC mp_uint_t get_arg_reg(emit_inline_asm_t *emit, const char *op, mp...
  function STATIC (line 207) | STATIC mp_uint_t get_arg_special_reg(emit_inline_asm_t *emit, const char...
  function STATIC (line 222) | STATIC mp_uint_t get_arg_vfpreg(emit_inline_asm_t *emit, const char *op,...
  function STATIC (line 250) | STATIC mp_uint_t get_arg_reglist(emit_inline_asm_t *emit, const char *op...
  function STATIC (line 302) | STATIC uint32_t get_arg_i(emit_inline_asm_t *emit, const char *op, mp_pa...
  function STATIC (line 316) | STATIC bool get_arg_addr(emit_inline_asm_t *emit, const char *op, mp_par...
  function STATIC (line 342) | STATIC int get_arg_label(emit_inline_asm_t *emit, const char *op, mp_par...
  type cc_name_t (line 361) | typedef struct _cc_name_t { byte cc; byte name[2]; } cc_name_t;
  type format_4_op_t (line 379) | typedef struct _format_4_op_t { byte op; char name[3]; } format_4_op_t;
  type format_9_10_op_t (line 401) | typedef struct _format_9_10_op_t { uint16_t op; uint16_t name; } format_...
  type format_vfp_op_t (line 415) | typedef struct _format_vfp_op_t { byte op; char name[3]; } format_vfp_op_t;
  function STATIC (line 427) | STATIC void emit_inline_thumb_op(emit_inline_asm_t *emit, qstr op, mp_ui...

FILE: micropython/source/py/emitinlinextensa.c
  type _emit_inline_asm_t (line 38) | struct _emit_inline_asm_t {
  function STATIC (line 46) | STATIC void emit_inline_xtensa_error_msg(emit_inline_asm_t *emit, const ...
  function STATIC (line 50) | STATIC void emit_inline_xtensa_error_exc(emit_inline_asm_t *emit, mp_obj...
  function emit_inline_asm_t (line 54) | emit_inline_asm_t *emit_inline_xtensa_new(mp_uint_t max_num_labels) {
  function emit_inline_xtensa_free (line 63) | void emit_inline_xtensa_free(emit_inline_asm_t *emit) {
  function STATIC (line 69) | STATIC void emit_inline_xtensa_start_pass(emit_inline_asm_t *emit, pass_...
  function STATIC (line 79) | STATIC void emit_inline_xtensa_end_pass(emit_inline_asm_t *emit, mp_uint...
  function STATIC (line 84) | STATIC mp_uint_t emit_inline_xtensa_count_params(emit_inline_asm_t *emit...
  function STATIC (line 103) | STATIC bool emit_inline_xtensa_label(emit_inline_asm_t *emit, mp_uint_t ...
  type reg_name_t (line 118) | typedef struct _reg_name_t { byte reg; byte name[3]; } reg_name_t;
  function STATIC (line 140) | STATIC const char *get_arg_str(mp_parse_node_t pn) {
  function STATIC (line 149) | STATIC mp_uint_t get_arg_reg(emit_inline_asm_t *emit, const char *op, mp...
  function STATIC (line 166) | STATIC uint32_t get_arg_i(emit_inline_asm_t *emit, const char *op, mp_pa...
  function STATIC (line 180) | STATIC int get_arg_label(emit_inline_asm_t *emit, const char *op, mp_par...
  type opcode_table_3arg_t (line 202) | typedef struct _opcode_table_3arg_t {
  function STATIC (line 243) | STATIC void emit_inline_xtensa_op(emit_inline_asm_t *emit, qstr op, mp_u...

FILE: micropython/source/py/emitnative.c
  type stack_info_kind_t (line 160) | typedef enum {
  type vtype_kind_t (line 168) | typedef enum {
  function STATIC (line 184) | STATIC qstr vtype_to_qstr(vtype_kind_t vtype) {
  type stack_info_t (line 198) | typedef struct _stack_info_t {
  type _emit_t (line 207) | struct _emit_t {
  function emit_t (line 235) | emit_t *EXPORT_FUN(new)(mp_obj_t *error_slot, mp_uint_t max_num_labels) {
  function STATIC (line 251) | STATIC void emit_native_set_native_type(emit_t *emit, mp_uint_t op, mp_u...
  function STATIC (line 288) | STATIC void emit_native_start_pass(emit_t *emit, pass_kind_t pass, scope...
  function STATIC (line 460) | STATIC void emit_native_end_pass(emit_t *emit) {
  function STATIC (line 538) | STATIC bool emit_native_last_emit_was_return_value(emit_t *emit) {
  function STATIC (line 542) | STATIC void adjust_stack(emit_t *emit, mp_int_t stack_size_delta) {
  function STATIC (line 558) | STATIC void emit_native_adjust_stack_size(emit_t *emit, mp_int_t delta) {
  function STATIC (line 579) | STATIC void emit_native_set_source_line(emit_t *emit, mp_uint_t source_l...
  function STATIC (line 585) | STATIC void emit_native_pre(emit_t *emit) {
  function STATIC (line 590) | STATIC stack_info_t *peek_stack(emit_t *emit, mp_uint_t depth) {
  function STATIC (line 595) | STATIC vtype_kind_t peek_vtype(emit_t *emit, mp_uint_t depth) {
  function STATIC (line 601) | STATIC void need_reg_single(emit_t *emit, int reg_needed, int skip_stack...
  function STATIC (line 614) | STATIC void need_reg_all(emit_t *emit) {
  function STATIC (line 624) | STATIC void need_stack_settled(emit_t *emit) {
  function STATIC (line 645) | STATIC void emit_access_stack(emit_t *emit, int pos, vtype_kind_t *vtype...
  function STATIC (line 668) | STATIC void emit_fold_stack_top(emit_t *emit, int reg_dest) {
  function STATIC (line 682) | STATIC void emit_pre_pop_reg_flexible(emit_t *emit, vtype_kind_t *vtype,...
  function STATIC (line 695) | STATIC void emit_pre_pop_discard(emit_t *emit) {
  function STATIC (line 700) | STATIC void emit_pre_pop_reg(emit_t *emit, vtype_kind_t *vtype, int reg_...
  function STATIC (line 706) | STATIC void emit_pre_pop_reg_reg(emit_t *emit, vtype_kind_t *vtypea, int...
  function STATIC (line 711) | STATIC void emit_pre_pop_reg_reg_reg(emit_t *emit, vtype_kind_t *vtypea,...
  function STATIC (line 717) | STATIC void emit_post(emit_t *emit) {
  function STATIC (line 721) | STATIC void emit_post_top_set_vtype(emit_t *emit, vtype_kind_t new_vtype) {
  function STATIC (line 726) | STATIC void emit_post_push_reg(emit_t *emit, vtype_kind_t vtype, int reg) {
  function STATIC (line 734) | STATIC void emit_post_push_imm(emit_t *emit, vtype_kind_t vtype, mp_int_...
  function STATIC (line 742) | STATIC void emit_post_push_reg_reg(emit_t *emit, vtype_kind_t vtypea, in...
  function STATIC (line 747) | STATIC void emit_post_push_reg_reg_reg(emit_t *emit, vtype_kind_t vtypea...
  function STATIC (line 753) | STATIC void emit_post_push_reg_reg_reg_reg(emit_t *emit, vtype_kind_t vt...
  function STATIC (line 760) | STATIC void emit_call(emit_t *emit, mp_fun_kind_t fun_kind) {
  function STATIC (line 765) | STATIC void emit_call_with_imm_arg(emit_t *emit, mp_fun_kind_t fun_kind,...
  function STATIC (line 772) | STATIC void emit_call_with_imm_arg_aligned(emit_t *emit, mp_fun_kind_t f...
  function STATIC (line 778) | STATIC void emit_call_with_2_imm_args(emit_t *emit, mp_fun_kind_t fun_ki...
  function STATIC (line 786) | STATIC void emit_call_with_3_imm_args_and_first_aligned(emit_t *emit, mp...
  function STATIC (line 798) | STATIC void emit_get_stack_pointer_to_reg_for_pop(emit_t *emit, mp_uint_...
  function STATIC (line 854) | STATIC void emit_get_stack_pointer_to_reg_for_push(emit_t *emit, mp_uint...
  function STATIC (line 864) | STATIC void emit_native_label_assign(emit_t *emit, mp_uint_t l) {
  function STATIC (line 873) | STATIC void emit_native_import_name(emit_t *emit, qstr qst) {
  function STATIC (line 908) | STATIC void emit_native_import_from(emit_t *emit, qstr qst) {
  function STATIC (line 918) | STATIC void emit_native_import_star(emit_t *emit) {
  function STATIC (line 927) | STATIC void emit_native_load_const_tok(emit_t *emit, mp_token_kind_t tok) {
  function STATIC (line 955) | STATIC void emit_native_load_const_small_int(emit_t *emit, mp_int_t arg) {
  function STATIC (line 965) | STATIC void emit_native_load_const_str(emit_t *emit, qstr qst) {
  function STATIC (line 980) | STATIC void emit_native_load_const_obj(emit_t *emit, mp_obj_t obj) {
  function STATIC (line 987) | STATIC void emit_native_load_null(emit_t *emit) {
  function STATIC (line 992) | STATIC void emit_native_load_fast(emit_t *emit, qstr qst, mp_uint_t loca...
  function STATIC (line 1016) | STATIC void emit_native_load_deref(emit_t *emit, qstr qst, mp_uint_t loc...
  function STATIC (line 1028) | STATIC void emit_native_load_name(emit_t *emit, qstr qst) {
  function STATIC (line 1035) | STATIC void emit_native_load_global(emit_t *emit, qstr qst) {
  function STATIC (line 1057) | STATIC void emit_native_load_attr(emit_t *emit, qstr qst) {
  function STATIC (line 1069) | STATIC void emit_native_load_method(emit_t *emit, qstr qst, bool is_supe...
  function STATIC (line 1083) | STATIC void emit_native_load_build_class(emit_t *emit) {
  function STATIC (line 1089) | STATIC void emit_native_load_subscr(emit_t *emit) {
  function STATIC (line 1224) | STATIC void emit_native_store_fast(emit_t *emit, qstr qst, mp_uint_t loc...
  function STATIC (line 1254) | STATIC void emit_native_store_deref(emit_t *emit, qstr qst, mp_uint_t lo...
  function STATIC (line 1268) | STATIC void emit_native_store_name(emit_t *emit, qstr qst) {
  function STATIC (line 1277) | STATIC void emit_native_store_global(emit_t *emit, qstr qst) {
  function STATIC (line 1290) | STATIC void emit_native_store_attr(emit_t *emit, qstr qst) {
  function STATIC (line 1299) | STATIC void emit_native_store_subscr(emit_t *emit) {
  function STATIC (line 1479) | STATIC void emit_native_delete_fast(emit_t *emit, qstr qst, mp_uint_t lo...
  function STATIC (line 1487) | STATIC void emit_native_delete_deref(emit_t *emit, qstr qst, mp_uint_t l...
  function STATIC (line 1494) | STATIC void emit_native_delete_name(emit_t *emit, qstr qst) {
  function STATIC (line 1500) | STATIC void emit_native_delete_global(emit_t *emit, qstr qst) {
  function STATIC (line 1506) | STATIC void emit_native_delete_attr(emit_t *emit, qstr qst) {
  function STATIC (line 1514) | STATIC void emit_native_delete_subscr(emit_t *emit) {
  function STATIC (line 1522) | STATIC void emit_native_dup_top(emit_t *emit) {
  function STATIC (line 1530) | STATIC void emit_native_dup_top_two(emit_t *emit) {
  function STATIC (line 1536) | STATIC void emit_native_pop_top(emit_t *emit) {
  function STATIC (line 1542) | STATIC void emit_native_rot_two(emit_t *emit) {
  function STATIC (line 1549) | STATIC void emit_native_rot_three(emit_t *emit) {
  function STATIC (line 1556) | STATIC void emit_native_jump(emit_t *emit, mp_uint_t label) {
  function STATIC (line 1565) | STATIC void emit_native_jump_helper(emit_t *emit, bool pop) {
  function STATIC (line 1592) | STATIC void emit_native_pop_jump_if(emit_t *emit, bool cond, mp_uint_t l...
  function STATIC (line 1603) | STATIC void emit_native_jump_if_or_pop(emit_t *emit, bool cond, mp_uint_...
  function STATIC (line 1615) | STATIC void emit_native_break_loop(emit_t *emit, mp_uint_t label, mp_uin...
  function STATIC (line 1620) | STATIC void emit_native_continue_loop(emit_t *emit, mp_uint_t label, mp_...
  function STATIC (line 1625) | STATIC void emit_native_setup_with(emit_t *emit, mp_uint_t label) {
  function STATIC (line 1667) | STATIC void emit_native_with_cleanup(emit_t *emit, mp_uint_t label) {
  function STATIC (line 1736) | STATIC void emit_native_setup_except(emit_t *emit, mp_uint_t label) {
  function STATIC (line 1746) | STATIC void emit_native_setup_finally(emit_t *emit, mp_uint_t label) {
  function STATIC (line 1750) | STATIC void emit_native_end_finally(emit_t *emit) {
  function STATIC (line 1763) | STATIC void emit_native_get_iter(emit_t *emit, bool use_stack) {
  function STATIC (line 1781) | STATIC void emit_native_for_iter(emit_t *emit, mp_uint_t label) {
  function STATIC (line 1791) | STATIC void emit_native_for_iter_end(emit_t *emit) {
  function STATIC (line 1798) | STATIC void emit_native_pop_block(emit_t *emit) {
  function STATIC (line 1805) | STATIC void emit_native_pop_except(emit_t *emit) {
  function STATIC (line 1809) | STATIC void emit_native_unary_op(emit_t *emit, mp_unary_op_t op) {
  function STATIC (line 1822) | STATIC void emit_native_binary_op(emit_t *emit, mp_binary_op_t op) {
  function STATIC (line 1985) | STATIC void emit_native_build_tuple(emit_t *emit, mp_uint_t n_args) {
  function STATIC (line 1994) | STATIC void emit_native_build_list(emit_t *emit, mp_uint_t n_args) {
  function STATIC (line 2001) | STATIC void emit_native_build_map(emit_t *emit, mp_uint_t n_args) {
  function STATIC (line 2007) | STATIC void emit_native_store_map(emit_t *emit) {
  function STATIC (line 2018) | STATIC void emit_native_build_set(emit_t *emit, mp_uint_t n_args) {
  function STATIC (line 2027) | STATIC void emit_native_build_slice(emit_t *emit, mp_uint_t n_args) {
  function STATIC (line 2049) | STATIC void emit_native_store_comp(emit_t *emit, scope_kind_t kind, mp_u...
  function STATIC (line 2078) | STATIC void emit_native_unpack_sequence(emit_t *emit, mp_uint_t n_args) {
  function STATIC (line 2087) | STATIC void emit_native_unpack_ex(emit_t *emit, mp_uint_t n_left, mp_uin...
  function STATIC (line 2096) | STATIC void emit_native_make_function(emit_t *emit, scope_t *scope, mp_u...
  function STATIC (line 2111) | STATIC void emit_native_make_closure(emit_t *emit, scope_t *scope, mp_ui...
  function STATIC (line 2125) | STATIC void emit_native_call_function(emit_t *emit, mp_uint_t n_position...
  function STATIC (line 2180) | STATIC void emit_native_call_method(emit_t *emit, mp_uint_t n_positional...
  function STATIC (line 2193) | STATIC void emit_native_return_value(emit_t *emit) {
  function STATIC (line 2221) | STATIC void emit_native_raise_varargs(emit_t *emit, mp_uint_t n_args) {
  function STATIC (line 2232) | STATIC void emit_native_yield_value(emit_t *emit) {
  function STATIC (line 2237) | STATIC void emit_native_yield_from(emit_t *emit) {
  function STATIC (line 2243) | STATIC void emit_native_start_except_handler(emit_t *emit) {
  function STATIC (line 2254) | STATIC void emit_native_end_except_handler(emit_t *emit) {

FILE: micropython/source/py/formatfloat.c
  function fp_signbit (line 70) | static inline int fp_signbit(float x) { union floatbits fb = {x}; return...
  function fp_isspecial (line 71) | static inline int fp_isspecial(float x) { union floatbits fb = {x}; retu...
  function fp_isinf (line 72) | static inline int fp_isinf(float x) { union floatbits fb = {x}; return (...
  function fp_iszero (line 73) | static inline int fp_iszero(float x) { union floatbits fb = {x}; return ...
  function fp_isless1 (line 74) | static inline int fp_isless1(float x) { union floatbits fb = {x}; return...
  function mp_format_float (line 108) | int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int ...

FILE: micropython/source/py/frozenmod.c
  function STATIC (line 63) | STATIC mp_lexer_t *mp_lexer_frozen_str(const char *str, size_t len) {
  function STATIC (line 85) | STATIC const mp_raw_code_t *mp_find_frozen_mpy(const char *str, size_t l...
  function STATIC (line 101) | STATIC mp_import_stat_t mp_frozen_stat_helper(const char *name, const ch...
  function mp_import_stat_t (line 118) | mp_import_stat_t mp_frozen_stat(const char *str) {
  function mp_find_frozen_module (line 138) | int mp_find_frozen_module(const char *str, size_t len, void **data) {

FILE: micropython/source/py/gc.c
  function gc_init (line 106) | void gc_init(void *start, void *end) {
  function gc_lock (line 173) | void gc_lock(void) {
  function gc_unlock (line 179) | void gc_unlock(void) {
  function gc_is_locked (line 185) | bool gc_is_locked(void) {
  function gc_drain_stack (line 214) | void gc_drain_stack(void) {
  function STATIC (line 234) | STATIC void gc_deal_with_stack_overflow(void) {
  function STATIC (line 250) | STATIC void gc_sweep(void) {
  function gc_collect_start (line 302) | void gc_collect_start(void) {
  function gc_collect_root (line 317) | void gc_collect_root(void **ptrs, size_t len) {
  function gc_collect_end (line 325) | void gc_collect_end(void) {
  function gc_info (line 333) | void gc_info(gc_info_t *info) {
  function gc_free (line 529) | void gc_free(void *ptr) {
  function gc_nbytes (line 570) | size_t gc_nbytes(const void *ptr) {
  function gc_dump_info (line 763) | void gc_dump_info(void) {
  function gc_dump_alloc_table (line 772) | void gc_dump_alloc_table(void) {
  function gc_test (line 883) | void gc_test(void) {

FILE: micropython/source/py/lexer.c
  function STATIC (line 46) | STATIC bool is_end(mp_lexer_t *lex) {
  function STATIC (line 50) | STATIC bool is_physical_newline(mp_lexer_t *lex) {
  function STATIC (line 54) | STATIC bool is_char(mp_lexer_t *lex, byte c) {
  function STATIC (line 58) | STATIC bool is_char_or(mp_lexer_t *lex, byte c1, byte c2) {
  function STATIC (line 62) | STATIC bool is_char_or3(mp_lexer_t *lex, byte c1, byte c2, byte c3) {
  function STATIC (line 66) | STATIC bool is_char_following(mp_lexer_t *lex, byte c) {
  function STATIC (line 70) | STATIC bool is_char_following_or(mp_lexer_t *lex, byte c1, byte c2) {
  function STATIC (line 74) | STATIC bool is_char_following_following_or(mp_lexer_t *lex, byte c1, byt...
  function STATIC (line 78) | STATIC bool is_char_and(mp_lexer_t *lex, byte c1, byte c2) {
  function STATIC (line 82) | STATIC bool is_whitespace(mp_lexer_t *lex) {
  function STATIC (line 86) | STATIC bool is_letter(mp_lexer_t *lex) {
  function STATIC (line 90) | STATIC bool is_digit(mp_lexer_t *lex) {
  function STATIC (line 94) | STATIC bool is_following_digit(mp_lexer_t *lex) {
  function STATIC (line 98) | STATIC bool is_following_base_char(mp_lexer_t *lex) {
  function STATIC (line 103) | STATIC bool is_following_odigit(mp_lexer_t *lex) {
  function STATIC (line 107) | STATIC bool is_string_or_bytes(mp_lexer_t *lex) {
  function STATIC (line 115) | STATIC bool is_head_of_identifier(mp_lexer_t *lex) {
  function STATIC (line 119) | STATIC bool is_tail_of_identifier(mp_lexer_t *lex) {
  function STATIC (line 123) | STATIC void next_char(mp_lexer_t *lex) {
  function STATIC (line 155) | STATIC void indent_push(mp_lexer_t *lex, size_t indent) {
  function STATIC (line 163) | STATIC size_t indent_top(mp_lexer_t *lex) {
  function STATIC (line 167) | STATIC void indent_pop(mp_lexer_t *lex) {
  function STATIC (line 258) | STATIC bool get_hex(mp_lexer_t *lex, size_t num_digits, mp_uint_t *resul...
  function STATIC (line 272) | STATIC void parse_string_literal(mp_lexer_t *lex, bool is_raw) {
  function STATIC (line 403) | STATIC bool skip_whitespace(mp_lexer_t *lex, bool stop_at_newline) {
  function mp_lexer_to_next (line 431) | void mp_lexer_to_next(mp_lexer_t *lex) {
  function mp_lexer_t (line 669) | mp_lexer_t *mp_lexer_new(qstr src_name, mp_reader_t reader) {
  function mp_lexer_t (line 705) | mp_lexer_t *mp_lexer_new_from_str_len(qstr src_name, const char *str, si...
  function mp_lexer_t (line 713) | mp_lexer_t *mp_lexer_new_from_file(const char *filename) {
  function mp_lexer_t (line 721) | mp_lexer_t *mp_lexer_new_from_fd(qstr filename, int fd, bool close_fd) {
  function mp_lexer_free (line 731) | void mp_lexer_free(mp_lexer_t *lex) {
  function mp_lexer_show_token (line 743) | void mp_lexer_show_token(const mp_lexer_t *lex) {

FILE: micropython/source/py/makeqstrdata.py
  function compute_hash (line 55) | def compute_hash(qstr, bytes_hash):
  function qstr_escape (line 62) | def qstr_escape(qst):
  function parse_input_headers (line 72) | def parse_input_headers(infiles):
  function make_bytes (line 119) | def make_bytes(cfg_bytes_len, cfg_bytes_hash, qstr):
  function print_qstr_data (line 136) | def print_qstr_data(qcfgs, qstrs):
  function do_work (line 153) | def do_work(infiles):

FILE: micropython/source/py/makeqstrdefs.py
  function write_out (line 19) | def write_out(fname, output):
  function process_file (line 26) | def process_file(f):
  function cat_together (line 51) | def cat_together():
  class Args (line 93) | class Args:

FILE: micropython/source/py/makeversionhdr.py
  function get_version_info_from_git (line 14) | def get_version_info_from_git():
  function get_version_info_from_docs_conf (line 59) | def get_version_info_from_docs_conf():
  function make_version_header (line 71) | def make_version_header(filename):

FILE: micropython/source/py/malloc.c
  function STATIC (line 62) | STATIC void *realloc_ext(void *ptr, size_t n_bytes, bool allow_move) {
  function m_free (line 178) | void m_free(void *ptr) {
  function m_get_total_bytes_allocated (line 188) | size_t m_get_total_bytes_allocated(void) {
  function m_get_current_bytes_allocated (line 192) | size_t m_get_current_bytes_allocated(void) {
  function m_get_peak_bytes_allocated (line 196) | size_t m_get_peak_bytes_allocated(void) {

FILE: micropython/source/py/map.c
  function STATIC (line 59) | STATIC size_t get_hash_alloc_greater_or_equal_to(size_t x) {
  function mp_map_init (line 73) | void mp_map_init(mp_map_t *map, size_t n) {
  function mp_map_init_fixed_table (line 87) | void mp_map_init_fixed_table(mp_map_t *map, size_t n, const mp_obj_t *ta...
  function mp_map_t (line 96) | mp_map_t *mp_map_new(size_t n) {
  function mp_map_deinit (line 103) | void mp_map_deinit(mp_map_t *map) {
  function mp_map_free (line 110) | void mp_map_free(mp_map_t *map) {
  function mp_map_clear (line 115) | void mp_map_clear(mp_map_t *map) {
  function STATIC (line 126) | STATIC void mp_map_rehash(mp_map_t *map) {
  function mp_map_elem_t (line 150) | mp_map_elem_t *mp_map_lookup(mp_map_t *map, mp_obj_t index, mp_map_looku...
  function mp_set_init (line 304) | void mp_set_init(mp_set_t *set, size_t n) {
  function STATIC (line 310) | STATIC void mp_set_rehash(mp_set_t *set) {
  function mp_obj_t (line 324) | mp_obj_t mp_set_lookup(mp_set_t *set, mp_obj_t index, mp_map_lookup_kind...
  function mp_obj_t (line 397) | mp_obj_t mp_set_remove_first(mp_set_t *set) {
  function mp_set_clear (line 415) | void mp_set_clear(mp_set_t *set) {
  function mp_map_dump (line 425) | void mp_map_dump(mp_map_t *map) {

FILE: micropython/source/py/modbuiltins.c
  type _mp_dummy_t (line 45) | struct _mp_dummy_t
  function STATIC (line 51) | STATIC mp_obj_t mp_builtin___build_class__(size_t n_args, const mp_obj_t...
  function STATIC (line 93) | STATIC mp_obj_t mp_builtin_abs(mp_obj_t o_in) {
  function STATIC (line 117) | STATIC mp_obj_t mp_builtin_all(mp_obj_t o_in) {
  function STATIC (line 130) | STATIC mp_obj_t mp_builtin_any(mp_obj_t o_in) {
  function STATIC (line 143) | STATIC mp_obj_t mp_builtin_bin(mp_obj_t o_in) {
  function STATIC (line 149) | STATIC mp_obj_t mp_builtin_callable(mp_obj_t o_in) {
  function STATIC (line 158) | STATIC mp_obj_t mp_builtin_chr(mp_obj_t o_in) {
  function STATIC (line 196) | STATIC mp_obj_t mp_builtin_dir(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 244) | STATIC mp_obj_t mp_builtin_divmod(mp_obj_t o1_in, mp_obj_t o2_in) {
  function STATIC (line 249) | STATIC mp_obj_t mp_builtin_hash(mp_obj_t o_in) {
  function STATIC (line 255) | STATIC mp_obj_t mp_builtin_hex(mp_obj_t o_in) {
  function STATIC (line 270) | STATIC mp_obj_t mp_builtin_input(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 289) | STATIC mp_obj_t mp_builtin_iter(mp_obj_t o_in) {
  function STATIC (line 296) | STATIC mp_obj_t mp_builtin_min_max(size_t n_args, const mp_obj_t *args, ...
  function STATIC (line 338) | STATIC mp_obj_t mp_builtin_max(size_t n_args, const mp_obj_t *args, mp_m...
  function STATIC (line 343) | STATIC mp_obj_t mp_builtin_min(size_t n_args, const mp_obj_t *args, mp_m...
  function STATIC (line 350) | STATIC mp_obj_t mp_builtin_next(mp_obj_t o) {
  function STATIC (line 360) | STATIC mp_obj_t mp_builtin_oct(mp_obj_t o_in) {
  function STATIC (line 365) | STATIC mp_obj_t mp_builtin_ord(mp_obj_t o_in) {
  function STATIC (line 407) | STATIC mp_obj_t mp_builtin_pow(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 422) | STATIC mp_obj_t mp_builtin_print(size_t n_args, const mp_obj_t *args, mp...
  function STATIC (line 467) | STATIC mp_obj_t mp_builtin___repl_print__(mp_obj_t o) {
  function STATIC (line 481) | STATIC mp_obj_t mp_builtin_repr(mp_obj_t o_in) {
  function STATIC (line 490) | STATIC mp_obj_t mp_builtin_round(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 515) | STATIC mp_obj_t mp_builtin_sum(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 531) | STATIC mp_obj_t mp_builtin_sorted(size_t n_args, const mp_obj_t *args, m...
  function mp_obj_t (line 543) | static inline mp_obj_t mp_load_attr_default(mp_obj_t base, qstr attr, mp...
  function STATIC (line 558) | STATIC mp_obj_t mp_builtin_getattr(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 567) | STATIC mp_obj_t mp_builtin_setattr(mp_obj_t base, mp_obj_t attr, mp_obj_...
  function STATIC (line 574) | STATIC mp_obj_t mp_builtin_delattr(mp_obj_t base, mp_obj_t attr) {
  function STATIC (line 580) | STATIC mp_obj_t mp_builtin_hasattr(mp_obj_t object_in, mp_obj_t attr_in) {
  function STATIC (line 594) | STATIC mp_obj_t mp_builtin_globals(void) {
  function STATIC (line 599) | STATIC mp_obj_t mp_builtin_locals(void) {

FILE: micropython/source/py/modcmath.c
  function STATIC (line 40) | STATIC mp_obj_t mp_cmath_phase(mp_obj_t z_obj) {
  function STATIC (line 49) | STATIC mp_obj_t mp_cmath_polar(mp_obj_t z_obj) {
  function STATIC (line 62) | STATIC mp_obj_t mp_cmath_rect(mp_obj_t r_obj, mp_obj_t phi_obj) {
  function STATIC (line 71) | STATIC mp_obj_t mp_cmath_exp(mp_obj_t z_obj) {
  function STATIC (line 82) | STATIC mp_obj_t mp_cmath_log(mp_obj_t z_obj) {
  function STATIC (line 92) | STATIC mp_obj_t mp_cmath_log10(mp_obj_t z_obj) {
  function STATIC (line 102) | STATIC mp_obj_t mp_cmath_sqrt(mp_obj_t z_obj) {
  function STATIC (line 113) | STATIC mp_obj_t mp_cmath_cos(mp_obj_t z_obj) {
  function STATIC (line 122) | STATIC mp_obj_t mp_cmath_sin(mp_obj_t z_obj) {

FILE: micropython/source/py/modgc.c
  function STATIC (line 37) | STATIC mp_obj_t py_gc_collect(void) {
  function STATIC (line 49) | STATIC mp_obj_t gc_disable(void) {
  function STATIC (line 57) | STATIC mp_obj_t gc_enable(void) {
  function STATIC (line 63) | STATIC mp_obj_t gc_isenabled(void) {
  function STATIC (line 70) | STATIC mp_obj_t gc_mem_free(void) {
  function STATIC (line 79) | STATIC mp_obj_t gc_mem_alloc(void) {
  function STATIC (line 87) | STATIC mp_obj_t gc_threshold(size_t n_args, const mp_obj_t *args) {

FILE: micropython/source/py/modio.c
  type mp_obj_bufwriter_t (line 42) | typedef struct _mp_obj_bufwriter_t {
  function STATIC (line 50) | STATIC mp_obj_t bufwriter_make_new(const mp_obj_type_t *type, size_t n_a...
  function STATIC (line 61) | STATIC mp_uint_t bufwriter_write(mp_obj_t self_in, const void *buf, mp_u...
  function STATIC (line 96) | STATIC mp_obj_t bufwriter_flush(mp_obj_t self_in) {
  function STATIC (line 135) | STATIC mp_obj_t resource_stream(mp_obj_t package_in, mp_obj_t path_in) {

FILE: micropython/source/py/modmath.c
  function math_error (line 43) | void math_error(void) {
  function STATIC (line 159) | STATIC mp_obj_t mp_math_log(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 183) | STATIC mp_obj_t mp_math_frexp(mp_obj_t x_obj) {
  function STATIC (line 194) | STATIC mp_obj_t mp_math_modf(mp_obj_t x_obj) {
  function STATIC (line 207) | STATIC mp_obj_t mp_math_radians(mp_obj_t x_obj) {
  function STATIC (line 213) | STATIC mp_obj_t mp_math_degrees(mp_obj_t x_obj) {

FILE: micropython/source/py/modmicropython.c
  function STATIC (line 39) | STATIC mp_obj_t mp_micropython_opt_level(size_t n_args, const mp_obj_t *...
  function STATIC (line 52) | STATIC mp_obj_t mp_micropython_mem_total(void) {
  function STATIC (line 57) | STATIC mp_obj_t mp_micropython_mem_current(void) {
  function STATIC (line 62) | STATIC mp_obj_t mp_micropython_mem_peak(void) {
  function mp_obj_t (line 68) | mp_obj_t mp_micropython_mem_info(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 93) | STATIC mp_obj_t mp_micropython_qstr_info(size_t n_args, const mp_obj_t *...
  function STATIC (line 108) | STATIC mp_obj_t mp_micropython_stack_use(void) {
  function STATIC (line 117) | STATIC mp_obj_t mp_micropython_heap_lock(void) {
  function STATIC (line 123) | STATIC mp_obj_t mp_micropython_heap_unlock(void) {
  function STATIC (line 135) | STATIC mp_obj_t mp_micropython_kbd_intr(mp_obj_t int_chr_in) {
  function STATIC (line 143) | STATIC mp_obj_t mp_micropython_schedule(mp_obj_t function, mp_obj_t arg) {

FILE: micropython/source/py/modstruct.c
  function STATIC (line 55) | STATIC char get_fmt_type(const char **fmt) {
  function STATIC (line 74) | STATIC mp_uint_t get_fmt_num(const char **p) {
  function STATIC (line 85) | STATIC uint calcsize_items(const char *fmt) {
  function STATIC (line 101) | STATIC mp_obj_t struct_calcsize(mp_obj_t fmt_in) {
  function STATIC (line 127) | STATIC mp_obj_t struct_unpack_from(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 180) | STATIC void struct_pack_into_internal(mp_obj_t fmt_in, byte *p, byte* en...
  function STATIC (line 217) | STATIC mp_obj_t struct_pack(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 230) | STATIC mp_obj_t struct_pack_into(size_t n_args, const mp_obj_t *args) {

FILE: micropython/source/py/modsys.c
  type _mp_dummy_t (line 48) | struct _mp_dummy_t
  type _mp_dummy_t (line 49) | struct _mp_dummy_t
  type _mp_dummy_t (line 50) | struct _mp_dummy_t
  function STATIC (line 73) | STATIC MP_DEFINE_ATTRTUPLE(
  function STATIC (line 112) | STATIC mp_obj_t mp_sys_print_exception(size_t n_args, const mp_obj_t *ar...
  function STATIC (line 131) | STATIC mp_obj_t mp_sys_exc_info(void) {
  function STATIC (line 150) | STATIC mp_obj_t mp_sys_getsizeof(mp_obj_t obj) {

FILE: micropython/source/py/modthread.c
  type mp_obj_thread_lock_t (line 50) | typedef struct _mp_obj_thread_lock_t {
  function STATIC (line 56) | STATIC mp_obj_thread_lock_t *mp_obj_new_thread_lock(void) {
  function STATIC (line 64) | STATIC mp_obj_t thread_lock_acquire(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 85) | STATIC mp_obj_t thread_lock_release(mp_obj_t self_in) {
  function STATIC (line 98) | STATIC mp_obj_t thread_lock_locked(mp_obj_t self_in) {
  function STATIC (line 104) | STATIC mp_obj_t thread_lock___exit__(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 131) | STATIC mp_obj_t mod_thread_get_ident(void) {
  function STATIC (line 136) | STATIC mp_obj_t mod_thread_stack_size(size_t n_args, const mp_obj_t *arg...
  type thread_entry_args_t (line 147) | typedef struct _thread_entry_args_t {
  function STATIC (line 157) | STATIC void *thread_entry(void *args_in) {
  function STATIC (line 212) | STATIC mp_obj_t mod_thread_start_new_thread(size_t n_args, const mp_obj_...
  function STATIC (line 267) | STATIC mp_obj_t mod_thread_exit(void) {
  function STATIC (line 272) | STATIC mp_obj_t mod_thread_allocate_lock(void) {

FILE: micropython/source/py/moduerrno.c
  function qstr (line 102) | qstr mp_errno_to_str(mp_obj_t errno_val) {

FILE: micropython/source/py/mpprint.c
  function STATIC (line 46) | STATIC void plat_print_strn(void *env, const char *str, size_t len) {
  function mp_print_str (line 53) | int mp_print_str(const mp_print_t *print, const char *str) {
  function mp_print_strn (line 61) | int mp_print_strn(const mp_print_t *print, const char *str, size_t len, ...
  function STATIC (line 130) | STATIC int mp_print_int(const mp_print_t *print, mp_uint_t x, int sgn, i...
  function mp_print_mp_int (line 204) | int mp_print_mp_int(const mp_print_t *print, mp_obj_t x, int base, int b...
  function mp_print_float (line 343) | int mp_print_float(const mp_print_t *print, mp_float_t f, char fmt, int ...
  function mp_printf (line 380) | int mp_printf(const mp_print_t *print, const char *fmt, ...) {
  function mp_vprintf (line 388) | int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) {

FILE: micropython/source/py/mpz.c
  function STATIC (line 52) | STATIC size_t mpn_remove_trailing_zeros(mpz_dig_t *oidig, mpz_dig_t *idi...
  function STATIC (line 62) | STATIC int mpn_cmp(const mpz_dig_t *idig, size_t ilen, const mpz_dig_t *...
  function STATIC (line 80) | STATIC size_t mpn_shl(mpz_dig_t *idig, mpz_dig_t *jdig, size_t jlen, mp_...
  function STATIC (line 119) | STATIC size_t mpn_shr(mpz_dig_t *idig, mpz_dig_t *jdig, size_t jlen, mp_...
  function STATIC (line 151) | STATIC size_t mpn_add(mpz_dig_t *idig, const mpz_dig_t *jdig, size_t jle...
  function STATIC (line 181) | STATIC size_t mpn_sub(mpz_dig_t *idig, const mpz_dig_t *jdig, size_t jle...
  function STATIC (line 209) | STATIC size_t mpn_and(mpz_dig_t *idig, const mpz_dig_t *jdig, const mpz_...
  function STATIC (line 230) | STATIC size_t mpn_and_neg(mpz_dig_t *idig, const mpz_dig_t *jdig, size_t...
  function STATIC (line 261) | STATIC size_t mpn_or(mpz_dig_t *idig, const mpz_dig_t *jdig, size_t jlen...
  function STATIC (line 291) | STATIC size_t mpn_or_neg(mpz_dig_t *idig, const mpz_dig_t *jdig, size_t ...
  function STATIC (line 321) | STATIC size_t mpn_or_neg(mpz_dig_t *idig, const mpz_dig_t *jdig, size_t ...
  function STATIC (line 353) | STATIC size_t mpn_xor(mpz_dig_t *idig, const mpz_dig_t *jdig, size_t jle...
  function STATIC (line 380) | STATIC size_t mpn_xor_neg(mpz_dig_t *idig, const mpz_dig_t *jdig, size_t...
  function STATIC (line 405) | STATIC size_t mpn_mul_dig_add_dig(mpz_dig_t *idig, size_t ilen, mpz_dig_...
  function STATIC (line 427) | STATIC size_t mpn_mul(mpz_dig_t *idig, mpz_dig_t *jdig, size_t jlen, mpz...
  function STATIC (line 458) | STATIC void mpn_div(mpz_dig_t *num_dig, size_t *num_len, const mpz_dig_t...
  function mpz_init_zero (line 648) | void mpz_init_zero(mpz_t *z) {
  function mpz_init_from_int (line 656) | void mpz_init_from_int(mpz_t *z, mp_int_t val) {
  function mpz_init_fixed_from_int (line 661) | void mpz_init_fixed_from_int(mpz_t *z, mpz_dig_t *dig, size_t alloc, mp_...
  function mpz_deinit (line 670) | void mpz_deinit(mpz_t *z) {
  function mpz_t (line 679) | mpz_t *mpz_zero(void) {
  function mpz_t (line 685) | mpz_t *mpz_from_int(mp_int_t val) {
  function mpz_t (line 691) | mpz_t *mpz_from_ll(long long val, bool is_signed) {
  function mpz_t (line 698) | mpz_t *mpz_from_float(mp_float_t val) {
  function mpz_t (line 705) | mpz_t *mpz_from_str(const char *str, size_t len, bool neg, unsigned int ...
  function STATIC (line 712) | STATIC void mpz_free(mpz_t *z) {
  function STATIC (line 719) | STATIC void mpz_need_dig(mpz_t *z, size_t need) {
  function STATIC (line 733) | STATIC mpz_t *mpz_clone(const mpz_t *src) {
  function mpz_set (line 751) | void mpz_set(mpz_t *dest, const mpz_t *src) {
  function mpz_set_from_int (line 758) | void mpz_set_from_int(mpz_t *z, mp_int_t val) {
  function mpz_set_from_ll (line 782) | void mpz_set_from_ll(mpz_t *z, long long val, bool is_signed) {
  function mpz_set_from_float (line 802) | void mpz_set_from_float(mpz_t *z, mp_float_t src) {
  function mpz_set_from_str (line 873) | size_t mpz_set_from_str(mpz_t *z, const char *str, size_t len, bool neg,...
  function mpz_set_from_bytes (line 909) | void mpz_set_from_bytes(mpz_t *z, bool big_endian, size_t len, const byt...
  function mpz_is_pos (line 945) | bool mpz_is_pos(const mpz_t *z) {
  function mpz_is_odd (line 949) | bool mpz_is_odd(const mpz_t *z) {
  function mpz_is_even (line 953) | bool mpz_is_even(const mpz_t *z) {
  function mpz_cmp (line 958) | int mpz_cmp(const mpz_t *z1, const mpz_t *z2) {
  function mp_int_t (line 977) | mp_int_t mpz_cmp_sml_int(const mpz_t *z, mp_int_t sml_int) {
  function mpz_t (line 1011) | mpz_t *mpz_abs(const mpz_t *z) {
  function mpz_t (line 1019) | mpz_t *mpz_neg(const mpz_t *z) {
  function mpz_t (line 1028) | mpz_t *mpz_add(const mpz_t *lhs, const mpz_t *rhs) {
  function mpz_t (line 1037) | mpz_t *mpz_sub(const mpz_t *lhs, const mpz_t *rhs) {
  function mpz_t (line 1046) | mpz_t *mpz_mul(const mpz_t *lhs, const mpz_t *rhs) {
  function mpz_t (line 1055) | mpz_t *mpz_pow(const mpz_t *lhs, const mpz_t *rhs) {
  function mpz_divmod (line 1066) | void mpz_divmod(const mpz_t *lhs, const mpz_t *rhs, mpz_t **quo, mpz_t *...
  function mpz_abs_inpl (line 1076) | void mpz_abs_inpl(mpz_t *dest, const mpz_t *z) {
  function mpz_neg_inpl (line 1086) | void mpz_neg_inpl(mpz_t *dest, const mpz_t *z) {
  function mpz_not_inpl (line 1096) | void mpz_not_inpl(mpz_t *dest, const mpz_t *z) {
  function mpz_shl_inpl (line 1120) | void mpz_shl_inpl(mpz_t *dest, const mpz_t *lhs, mp_uint_t rhs) {
  function mpz_shr_inpl (line 1133) | void mpz_shr_inpl(mpz_t *dest, const mpz_t *lhs, mp_uint_t rhs) {
  function mpz_add_inpl (line 1171) | void mpz_add_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs) {
  function mpz_sub_inpl (line 1192) | void mpz_sub_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs) {
  function mpz_and_inpl (line 1220) | void mpz_and_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs) {
  function mpz_or_inpl (line 1254) | void mpz_or_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs) {
  function mpz_xor_inpl (line 1288) | void mpz_xor_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs) {
  function mpz_mul_inpl (line 1326) | void mpz_mul_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs) {
  function mpz_pow_inpl (line 1358) | void mpz_pow_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs) {
  function mpz_pow3_inpl (line 1392) | void mpz_pow3_inpl(mpz_t *dest, const mpz_t *lhs, const mpz_t *rhs, cons...
  function mpz_t (line 1436) | mpz_t *mpz_gcd(const mpz_t *z1, const mpz_t *z2) {
  function mpz_t (line 1490) | mpz_t *mpz_lcm(const mpz_t *z1, const mpz_t *z2) {
  function mpz_divmod_inpl (line 1513) | void mpz_divmod_inpl(mpz_t *dest_quo, mpz_t *dest_rem, const mpz_t *lhs,...
  function mpz_t (line 1540) | mpz_t *mpz_div(const mpz_t *lhs, const mpz_t *rhs) {
  function mpz_t (line 1551) | mpz_t *mpz_mod(const mpz_t *lhs, const mpz_t *rhs) {
  function mp_int_t (line 1561) | mp_int_t mpz_hash(const mpz_t *z) {
  function mpz_as_int_checked (line 1576) | bool mpz_as_int_checked(const mpz_t *i, mp_int_t *value) {
  function mpz_as_uint_checked (line 1596) | bool mpz_as_uint_checked(const mpz_t *i, mp_uint_t *value) {
  function mpz_as_bytes (line 1618) | void mpz_as_bytes(const mpz_t *z, bool big_endian, size_t len, byte *buf) {
  function mp_float_t (line 1652) | mp_float_t mpz_as_float(const mpz_t *i) {
  function mpz_as_str_inpl (line 1679) | size_t mpz_as_str_inpl(const mpz_t *i, unsigned int base, const char *pr...

FILE: micropython/source/py/nativeglue.c
  function mp_uint_t (line 46) | mp_uint_t mp_convert_obj_to_native(mp_obj_t obj, mp_uint_t type) {
  function mp_obj_t (line 70) | mp_obj_t mp_convert_native_to_obj(mp_uint_t val, mp_uint_t type) {
  function mp_obj_t (line 89) | mp_obj_t mp_native_call_function_n_kw(mp_obj_t fun_in, size_t n_args_kw,...
  function mp_native_raise (line 95) | void mp_native_raise(mp_obj_t o) {
  function STATIC (line 102) | STATIC mp_obj_t mp_native_getiter(mp_obj_t obj, mp_obj_iter_buf_t *iter) {
  function STATIC (line 117) | STATIC mp_obj_t mp_native_iternext(mp_obj_iter_buf_t *iter) {

FILE: micropython/source/py/nlrsetjmp.c
  function nlr_setjmp_jump (line 31) | void nlr_setjmp_jump(void *val) {

FILE: micropython/source/py/nlrthumb.c
  function nlr_push_tail (line 83) | __attribute__((used)) unsigned int nlr_push_tail(nlr_buf_t *nlr) {
  function nlr_pop (line 90) | void nlr_pop(void) {
  function NORETURN (line 95) | NORETURN __attribute__((naked)) void nlr_jump(void *val) {

FILE: micropython/source/py/nlrx64.c
  function nlr_push_tail (line 88) | __attribute__((used)) unsigned int nlr_push_tail(nlr_buf_t *nlr) {
  function nlr_pop (line 95) | void nlr_pop(void) {
  function NORETURN (line 100) | NORETURN void nlr_jump(void *val) {

FILE: micropython/source/py/nlrx86.c
  function nlr_push (line 46) | unsigned int nlr_push(nlr_buf_t *nlr) {
  function nlr_push_tail (line 71) | __attribute__((used)) unsigned int nlr_push_tail(nlr_buf_t *nlr) {
  function nlr_pop (line 78) | void nlr_pop(void) {
  function NORETURN (line 83) | NORETURN void nlr_jump(void *val) {

FILE: micropython/source/py/nlrxtensa.c
  function nlr_push (line 40) | unsigned int nlr_push(nlr_buf_t *nlr) {
  function nlr_push_tail (line 59) | __attribute__((used)) unsigned int nlr_push_tail(nlr_buf_t *nlr) {
  function nlr_pop (line 66) | void nlr_pop(void) {
  function NORETURN (line 71) | NORETURN void nlr_jump(void *val) {

FILE: micropython/source/py/obj.c
  function mp_obj_type_t (line 42) | mp_obj_type_t *mp_obj_get_type(mp_const_obj_t o_in) {
  function mp_obj_print_helper (line 61) | void mp_obj_print_helper(const mp_print_t *print, mp_obj_t o_in, mp_prin...
  function mp_obj_print (line 78) | void mp_obj_print(mp_obj_t o_in, mp_print_kind_t kind) {
  function mp_obj_print_exception (line 83) | void mp_obj_print_exception(const mp_print_t *print, mp_obj_t exc) {
  function mp_obj_is_true (line 110) | bool mp_obj_is_true(mp_obj_t arg) {
  function mp_obj_is_callable (line 143) | bool mp_obj_is_callable(mp_obj_t o_in) {
  function mp_obj_equal (line 164) | bool mp_obj_equal(mp_obj_t o1, mp_obj_t o2) {
  function mp_int_t (line 218) | mp_int_t mp_obj_get_int(mp_const_obj_t arg) {
  function mp_int_t (line 240) | mp_int_t mp_obj_get_int_truncated(mp_const_obj_t arg) {
  function mp_obj_get_int_maybe (line 251) | bool mp_obj_get_int_maybe(mp_const_obj_t arg, mp_int_t *value) {
  function mp_float_t (line 267) | mp_float_t mp_obj_get_float(mp_obj_t arg) {
  function mp_obj_get_complex (line 291) | void mp_obj_get_complex(mp_obj_t arg, mp_float_t *real, mp_float_t *imag) {
  function mp_obj_get_array (line 324) | void mp_obj_get_array(mp_obj_t o, size_t *len, mp_obj_t **items) {
  function mp_obj_get_array_fixed_n (line 340) | void mp_obj_get_array_fixed_n(mp_obj_t o, size_t len, mp_obj_t **items) {
  function mp_get_index (line 354) | size_t mp_get_index(const mp_obj_type_t *type, size_t len, mp_obj_t inde...
  function mp_obj_t (line 392) | mp_obj_t mp_obj_id(mp_obj_t o_in) {
  function mp_obj_t (line 411) | mp_obj_t mp_obj_len(mp_obj_t o_in) {
  function mp_obj_t (line 445) | mp_obj_t mp_obj_subscr(mp_obj_t base, mp_obj_t index, mp_obj_t value) {
  function mp_obj_t (line 480) | mp_obj_t mp_identity(mp_obj_t self) {
  function mp_obj_t (line 485) | mp_obj_t mp_identity_getiter(mp_obj_t self, mp_obj_iter_buf_t *iter_buf) {
  function mp_get_buffer (line 490) | bool mp_get_buffer(mp_obj_t obj, mp_buffer_info_t *bufinfo, mp_uint_t fl...
  function mp_get_buffer_raise (line 502) | void mp_get_buffer_raise(mp_obj_t obj, mp_buffer_info_t *bufinfo, mp_uin...
  function mp_obj_t (line 508) | mp_obj_t mp_generic_unary_op(mp_uint_t op, mp_obj_t o_in) {

FILE: micropython/source/py/objarray.c
  function STATIC (line 71) | STATIC void array_print(const mp_print_t *print, mp_obj_t o_in, mp_print...
  function STATIC (line 95) | STATIC mp_obj_array_t *array_new(char typecode, size_t n) {
  function STATIC (line 114) | STATIC mp_obj_t array_construct(char typecode, mp_obj_t initializer) {
  function STATIC (line 160) | STATIC mp_obj_t array_make_new(const mp_obj_type_t *type_in, size_t n_ar...
  function STATIC (line 178) | STATIC mp_obj_t bytearray_make_new(const mp_obj_type_t *type_in, size_t ...
  function mp_obj_t (line 200) | mp_obj_t mp_obj_new_memoryview(byte typecode, size_t nitems, void *items) {
  function STATIC (line 210) | STATIC mp_obj_t memoryview_make_new(const mp_obj_type_t *type_in, size_t...
  function STATIC (line 234) | STATIC mp_obj_t array_unary_op(mp_uint_t op, mp_obj_t o_in) {
  function STATIC (line 243) | STATIC mp_obj_t array_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t ...
  function STATIC (line 313) | STATIC mp_obj_t array_append(mp_obj_t self_in, mp_obj_t arg) {
  function STATIC (line 334) | STATIC mp_obj_t array_extend(mp_obj_t self_in, mp_obj_t arg_in) {
  function STATIC (line 367) | STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj...
  function STATIC (line 495) | STATIC mp_int_t array_get_buffer(mp_obj_t o_in, mp_buffer_info_t *bufinf...
  function mp_obj_t (line 574) | mp_obj_t mp_obj_new_bytearray(size_t n, void *items) {
  function mp_obj_t (line 581) | mp_obj_t mp_obj_new_bytearray_by_ref(size_t n, void *items) {
  type mp_obj_array_it_t (line 595) | typedef struct _mp_obj_array_it_t {
  function STATIC (line 602) | STATIC mp_obj_t array_it_iternext(mp_obj_t self_in) {
  function STATIC (line 618) | STATIC mp_obj_t array_iterator_new(mp_obj_t array_in, mp_obj_iter_buf_t ...

FILE: micropython/source/py/objattrtuple.c
  function mp_obj_attrtuple_print_helper (line 35) | void mp_obj_attrtuple_print_helper(const mp_print_t *print, const qstr *...
  function STATIC (line 51) | STATIC void mp_obj_attrtuple_print(const mp_print_t *print, mp_obj_t o_i...
  function STATIC (line 58) | STATIC void mp_obj_attrtuple_attr(mp_obj_t self_in, qstr attr, mp_obj_t ...
  function mp_obj_t (line 73) | mp_obj_t mp_obj_new_attrtuple(const qstr *fields, size_t n, const mp_obj...

FILE: micropython/source/py/objbool.c
  type mp_obj_bool_t (line 33) | typedef struct _mp_obj_bool_t {
  function STATIC (line 38) | STATIC void bool_print(const mp_print_t *print, mp_obj_t self_in, mp_pri...
  function STATIC (line 55) | STATIC mp_obj_t bool_make_new(const mp_obj_type_t *type_in, size_t n_arg...
  function STATIC (line 66) | STATIC mp_obj_t bool_unary_op(mp_uint_t op, mp_obj_t o_in) {
  function STATIC (line 74) | STATIC mp_obj_t bool_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t r...

FILE: micropython/source/py/objboundmeth.c
  type mp_obj_bound_meth_t (line 32) | typedef struct _mp_obj_bound_meth_t {
  function STATIC (line 39) | STATIC void bound_meth_print(const mp_print_t *print, mp_obj_t o_in, mp_...
  function mp_obj_t (line 50) | mp_obj_t mp_call_method_self_n_kw(mp_obj_t meth, mp_obj_t self, size_t n...
  function STATIC (line 73) | STATIC mp_obj_t bound_meth_call(mp_obj_t self_in, size_t n_args, size_t ...
  function STATIC (line 79) | STATIC void bound_meth_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
  function mp_obj_t (line 103) | mp_obj_t mp_obj_new_bound_meth(mp_obj_t meth, mp_obj_t self) {

FILE: micropython/source/py/objcell.c
  type mp_obj_cell_t (line 29) | typedef struct _mp_obj_cell_t {
  function mp_obj_t (line 34) | mp_obj_t mp_obj_cell_get(mp_obj_t self_in) {
  function mp_obj_cell_set (line 39) | void mp_obj_cell_set(mp_obj_t self_in, mp_obj_t obj) {
  function STATIC (line 45) | STATIC void cell_print(const mp_print_t *print, mp_obj_t o_in, mp_print_...
  function mp_obj_t (line 66) | mp_obj_t mp_obj_new_cell(mp_obj_t obj) {

FILE: micropython/source/py/objclosure.c
  type mp_obj_closure_t (line 32) | typedef struct _mp_obj_closure_t {
  function STATIC (line 39) | STATIC mp_obj_t closure_call(mp_obj_t self_in, size_t n_args, size_t n_k...
  function STATIC (line 63) | STATIC void closure_print(const mp_print_t *print, mp_obj_t o_in, mp_pri...
  function mp_obj_t (line 90) | mp_obj_t mp_obj_new_closure(mp_obj_t fun, size_t n_closed_over, const mp...

FILE: micropython/source/py/objcomplex.c
  type mp_obj_complex_t (line 42) | typedef struct _mp_obj_complex_t {
  function STATIC (line 48) | STATIC void complex_print(const mp_print_t *print, mp_obj_t o_in, mp_pri...
  function STATIC (line 76) | STATIC mp_obj_t complex_make_new(const mp_obj_type_t *type_in, size_t n_...
  function STATIC (line 120) | STATIC mp_obj_t complex_unary_op(mp_uint_t op, mp_obj_t o_in) {
  function STATIC (line 131) | STATIC mp_obj_t complex_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_...
  function STATIC (line 136) | STATIC void complex_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
  function mp_obj_t (line 159) | mp_obj_t mp_obj_new_complex(mp_float_t real, mp_float_t imag) {
  function mp_obj_complex_get (line 167) | void mp_obj_complex_get(mp_obj_t self_in, mp_float_t *real, mp_float_t *...
  function mp_obj_t (line 174) | mp_obj_t mp_obj_complex_binary_op(mp_uint_t op, mp_float_t lhs_real, mp_...

FILE: micropython/source/py/objdict.c
  function STATIC (line 44) | STATIC mp_map_elem_t *dict_iter_next(mp_obj_dict_t *dict, size_t *cur) {
  function STATIC (line 58) | STATIC void dict_print(const mp_print_t *print, mp_obj_t self_in, mp_pri...
  function STATIC (line 85) | STATIC mp_obj_t dict_make_new(const mp_obj_type_t *type, size_t n_args, ...
  function STATIC (line 103) | STATIC mp_obj_t dict_unary_op(mp_uint_t op, mp_obj_t self_in) {
  function STATIC (line 118) | STATIC mp_obj_t dict_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t r...
  function mp_obj_t (line 167) | mp_obj_t mp_obj_dict_get(mp_obj_t self_in, mp_obj_t index) {
  function STATIC (line 177) | STATIC mp_obj_t dict_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t v...
  type mp_obj_dict_it_t (line 201) | typedef struct _mp_obj_dict_it_t {
  function STATIC (line 208) | STATIC mp_obj_t dict_it_iternext(mp_obj_t self_in) {
  function STATIC (line 219) | STATIC mp_obj_t dict_getiter(mp_obj_t self_in, mp_obj_iter_buf_t *iter_b...
  function STATIC (line 232) | STATIC mp_obj_t dict_clear(mp_obj_t self_in) {
  function STATIC (line 242) | STATIC mp_obj_t dict_copy(mp_obj_t self_in) {
  function STATIC (line 258) | STATIC mp_obj_t dict_fromkeys(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 287) | STATIC mp_obj_t dict_get_helper(size_t n_args, const mp_obj_t *args, mp_...
  function STATIC (line 314) | STATIC mp_obj_t dict_get(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 319) | STATIC mp_obj_t dict_pop(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 324) | STATIC mp_obj_t dict_setdefault(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 329) | STATIC mp_obj_t dict_popitem(mp_obj_t self_in) {
  function STATIC (line 347) | STATIC mp_obj_t dict_update(size_t n_args, const mp_obj_t *args, mp_map_...
  type mp_dict_view_kind_t (line 403) | typedef enum _mp_dict_view_kind_t {
  type mp_obj_dict_view_it_t (line 411) | typedef struct _mp_obj_dict_view_it_t {
  type mp_obj_dict_view_t (line 418) | typedef struct _mp_obj_dict_view_t {
  function STATIC (line 424) | STATIC mp_obj_t dict_view_it_iternext(mp_obj_t self_in) {
  function STATIC (line 453) | STATIC mp_obj_t dict_view_getiter(mp_obj_t view_in, mp_obj_iter_buf_t *i...
  function STATIC (line 465) | STATIC void dict_view_print(const mp_print_t *print, mp_obj_t self_in, m...
  function STATIC (line 485) | STATIC mp_obj_t dict_view_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_ob...
  function STATIC (line 505) | STATIC mp_obj_t mp_obj_new_dict_view(mp_obj_t dict, mp_dict_view_kind_t ...
  function STATIC (line 513) | STATIC mp_obj_t dict_view(mp_obj_t self_in, mp_dict_view_kind_t kind) {
  function STATIC (line 518) | STATIC mp_obj_t dict_items(mp_obj_t self_in) {
  function STATIC (line 523) | STATIC mp_obj_t dict_keys(mp_obj_t self_in) {
  function STATIC (line 528) | STATIC mp_obj_t dict_values(mp_obj_t self_in) {
  function mp_obj_dict_init (line 582) | void mp_obj_dict_init(mp_obj_dict_t *dict, size_t n_args) {
  function mp_obj_t (line 587) | mp_obj_t mp_obj_new_dict(size_t n_args) {
  function mp_obj_dict_len (line 593) | size_t mp_obj_dict_len(mp_obj_t self_in) {
  function mp_obj_t (line 598) | mp_obj_t mp_obj_dict_store(mp_obj_t self_in, mp_obj_t key, mp_obj_t valu...
  function mp_obj_t (line 605) | mp_obj_t mp_obj_dict_delete(mp_obj_t self_in, mp_obj_t key) {
  function mp_map_t (line 611) | mp_map_t *mp_obj_dict_get_map(mp_obj_t self_in) {

FILE: micropython/source/py/objenumerate.c
  type mp_obj_enumerate_t (line 34) | typedef struct _mp_obj_enumerate_t {
  function STATIC (line 42) | STATIC mp_obj_t enumerate_make_new(const mp_obj_type_t *type, size_t n_a...
  function STATIC (line 80) | STATIC mp_obj_t enumerate_iternext(mp_obj_t self_in) {

FILE: micropython/source/py/objexcept.c
  function mp_init_emergency_exception_buf (line 50) | void mp_init_emergency_exception_buf(void) {
  function mp_init_emergency_exception_buf (line 59) | void mp_init_emergency_exception_buf(void) {
  function mp_obj_t (line 64) | mp_obj_t mp_alloc_emergency_exception_buf(mp_obj_t size_in) {
  function STATIC (line 94) | STATIC void mp_obj_exception_print(const mp_print_t *print, mp_obj_t o_i...
  function mp_obj_t (line 128) | mp_obj_t mp_obj_exception_make_new(const mp_obj_type_t *type, size_t n_a...
  function mp_obj_t (line 145) | mp_obj_t mp_obj_exception_get_value(mp_obj_t self_in) {
  function STATIC (line 154) | STATIC void exception_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
  function STATIC (line 177) | STATIC mp_obj_t exc___init__(size_t n_args, const mp_obj_t *args) {
  function mp_obj_t (line 291) | mp_obj_t mp_obj_new_exception(const mp_obj_type_t *exc_type) {
  function mp_obj_t (line 296) | mp_obj_t mp_obj_new_exception_arg1(const mp_obj_type_t *exc_type, mp_obj...
  function mp_obj_t (line 300) | mp_obj_t mp_obj_new_exception_args(const mp_obj_type_t *exc_type, size_t...
  function mp_obj_t (line 305) | mp_obj_t mp_obj_new_exception_msg(const mp_obj_type_t *exc_type, const c...
  function mp_obj_t (line 309) | mp_obj_t mp_obj_new_exception_msg_varg(const mp_obj_type_t *exc_type, co...
  function mp_obj_is_exception_type (line 393) | bool mp_obj_is_exception_type(mp_obj_t self_in) {
  function mp_obj_is_exception_instance (line 405) | bool mp_obj_is_exception_instance(mp_obj_t self_in) {
  function mp_obj_exception_match (line 412) | bool mp_obj_exception_match(mp_obj_t exc, mp_const_obj_t exc_type) {
  function mp_obj_exception_clear_traceback (line 432) | void mp_obj_exception_clear_traceback(mp_obj_t self_in) {
  function mp_obj_exception_add_traceback (line 439) | void mp_obj_exception_add_traceback(mp_obj_t self_in, qstr file, size_t ...
  function mp_obj_exception_get_traceback (line 469) | void mp_obj_exception_get_traceback(mp_obj_t self_in, size_t *n, size_t ...

FILE: micropython/source/py/objfilter.c
  type mp_obj_filter_t (line 31) | typedef struct _mp_obj_filter_t {
  function STATIC (line 37) | STATIC mp_obj_t filter_make_new(const mp_obj_type_t *type, size_t n_args...
  function STATIC (line 46) | STATIC mp_obj_t filter_iternext(mp_obj_t self_in) {

FILE: micropython/source/py/objfloat.c
  type mp_obj_float_t (line 52) | typedef struct _mp_obj_float_t {
  function mp_int_t (line 64) | mp_int_t mp_float_hash(mp_float_t src) {
  function STATIC (line 111) | STATIC void float_print(const mp_print_t *print, mp_obj_t o_in, mp_print...
  function STATIC (line 133) | STATIC mp_obj_t float_make_new(const mp_obj_type_t *type_in, size_t n_ar...
  function STATIC (line 158) | STATIC mp_obj_t float_unary_op(mp_uint_t op, mp_obj_t o_in) {
  function STATIC (line 169) | STATIC mp_obj_t float_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t ...
  function mp_obj_t (line 192) | mp_obj_t mp_obj_new_float(mp_float_t value) {
  function mp_float_t (line 199) | mp_float_t mp_obj_float_get(mp_obj_t self_in) {
  function STATIC (line 207) | STATIC void mp_obj_float_divmod(mp_float_t *x, mp_float_t *y) {
  function mp_obj_t (line 242) | mp_obj_t mp_obj_float_binary_op(mp_uint_t op, mp_float_t lhs_val, mp_obj...

FILE: micropython/source/py/objfun.c
  function STATIC (line 53) | STATIC mp_obj_t fun_builtin_0_call(mp_obj_t self_in, size_t n_args, size...
  function STATIC (line 68) | STATIC mp_obj_t fun_builtin_1_call(mp_obj_t self_in, size_t n_args, size...
  function STATIC (line 82) | STATIC mp_obj_t fun_builtin_2_call(mp_obj_t self_in, size_t n_args, size...
  function STATIC (line 96) | STATIC mp_obj_t fun_builtin_3_call(mp_obj_t self_in, size_t n_args, size...
  function STATIC (line 110) | STATIC mp_obj_t fun_builtin_var_call(mp_obj_t self_in, size_t n_args, si...
  function qstr (line 143) | qstr mp_obj_code_get_name(const byte *code_info) {
  function qstr (line 156) | qstr mp_obj_fun_get_name(mp_const_obj_t fun_in) {
  function STATIC (line 176) | STATIC void fun_bc_print(const mp_print_t *print, mp_obj_t o_in, mp_prin...
  function STATIC (line 184) | STATIC void dump_args(const mp_obj_t *a, size_t sz) {
  function mp_code_state_t (line 204) | mp_code_state_t *mp_obj_fun_bc_prepare_codestate(mp_obj_t self_in, size_...
  function STATIC (line 232) | STATIC mp_obj_t fun_bc_call(mp_obj_t self_in, size_t n_args, size_t n_kw...
  function STATIC (line 322) | STATIC void fun_bc_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
  function mp_obj_t (line 346) | mp_obj_t mp_obj_new_fun_bc(mp_obj_t def_args_in, mp_obj_t def_kw_args, c...
  function STATIC (line 377) | STATIC mp_obj_t fun_native_call(mp_obj_t self_in, size_t n_args, size_t ...
  function mp_obj_t (line 391) | mp_obj_t mp_obj_new_fun_native(mp_obj_t def_args_in, mp_obj_t def_kw_arg...
  type mp_obj_fun_viper_t (line 404) | typedef struct _mp_obj_fun_viper_t {
  type mp_uint_t (line 411) | typedef mp_uint_t (*viper_fun_0_t)(void);
  type mp_uint_t (line 412) | typedef mp_uint_t (*viper_fun_1_t)(mp_uint_t);
  type mp_uint_t (line 413) | typedef mp_uint_t (*viper_fun_2_t)(mp_uint_t, mp_uint_t);
  type mp_uint_t (line 414) | typedef mp_uint_t (*viper_fun_3_t)(mp_uint_t, mp_uint_t, mp_uint_t);
  type mp_uint_t (line 415) | typedef mp_uint_t (*viper_fun_4_t)(mp_uint_t, mp_uint_t, mp_uint_t, mp_u...
  function STATIC (line 417) | STATIC mp_obj_t fun_viper_call(mp_obj_t self_in, size_t n_args, size_t n...
  function mp_obj_t (line 454) | mp_obj_t mp_obj_new_fun_viper(size_t n_args, void *fun_data, mp_uint_t t...
  type mp_obj_fun_asm_t (line 470) | typedef struct _mp_obj_fun_asm_t {
  type mp_uint_t (line 477) | typedef mp_uint_t (*inline_asm_fun_0_t)(void);
  type mp_uint_t (line 478) | typedef mp_uint_t (*inline_asm_fun_1_t)(mp_uint_t);
  type mp_uint_t (line 479) | typedef mp_uint_t (*inline_asm_fun_2_t)(mp_uint_t, mp_uint_t);
  type mp_uint_t (line 480) | typedef mp_uint_t (*inline_asm_fun_3_t)(mp_uint_t, mp_uint_t, mp_uint_t);
  type mp_uint_t (line 481) | typedef mp_uint_t (*inline_asm_fun_4_t)(mp_uint_t, mp_uint_t, mp_uint_t,...
  function STATIC (line 484) | STATIC mp_uint_t convert_obj_for_inline_asm(mp_obj_t obj) {
  function STATIC (line 527) | STATIC mp_obj_t fun_asm_call(mp_obj_t self_in, size_t n_args, size_t n_k...
  function mp_obj_t (line 564) | mp_obj_t mp_obj_new_fun_asm(size_t n_args, void *fun_data, mp_uint_t typ...

FILE: micropython/source/py/objgenerator.c
  type mp_obj_gen_wrap_t (line 41) | typedef struct _mp_obj_gen_wrap_t {
  type mp_obj_gen_instance_t (line 46) | typedef struct _mp_obj_gen_instance_t {
  function STATIC (line 52) | STATIC mp_obj_t gen_wrap_call(mp_obj_t self_in, size_t n_args, size_t n_...
  function mp_obj_t (line 80) | mp_obj_t mp_obj_new_gen_wrap(mp_obj_t fun) {
  function STATIC (line 90) | STATIC void gen_instance_print(const mp_print_t *print, mp_obj_t self_in...
  function mp_vm_return_kind_t (line 96) | mp_vm_return_kind_t mp_obj_gen_resume(mp_obj_t self_in, mp_obj_t send_va...
  function STATIC (line 146) | STATIC mp_obj_t gen_resume_and_raise(mp_obj_t self_in, mp_obj_t send_val...
  function STATIC (line 175) | STATIC mp_obj_t gen_instance_iternext(mp_obj_t self_in) {
  function STATIC (line 179) | STATIC mp_obj_t gen_instance_send(mp_obj_t self_in, mp_obj_t send_value) {
  function STATIC (line 191) | STATIC mp_obj_t gen_instance_throw(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 204) | STATIC mp_obj_t gen_instance_close(mp_obj_t self_in) {

FILE: micropython/source/py/objgetitemiter.c
  type mp_obj_getitem_iter_t (line 34) | typedef struct _mp_obj_getitem_iter_t {
  function STATIC (line 39) | STATIC mp_obj_t it_iternext(mp_obj_t self_in) {
  function mp_obj_t (line 69) | mp_obj_t mp_obj_new_getitem_iter(mp_obj_t *args, mp_obj_iter_buf_t *iter...

FILE: micropython/source/py/objint.c
  function STATIC (line 45) | STATIC mp_obj_t mp_obj_int_make_new(const mp_obj_type_t *type_in, size_t...
  type mp_fp_as_int_class_t (line 84) | typedef enum {
  function STATIC (line 90) | STATIC mp_fp_as_int_class_t mp_classify_fp_as_int(mp_float_t val) {
  function mp_obj_t (line 141) | mp_obj_t mp_obj_new_int_from_float(mp_float_t val) {
  type mp_longint_impl_t (line 172) | typedef mp_longint_impl_t fmt_int_t;
  type fmt_uint_t (line 173) | typedef unsigned long long fmt_uint_t;
  type mp_int_t (line 175) | typedef mp_int_t fmt_int_t;
  type mp_uint_t (line 176) | typedef mp_uint_t fmt_uint_t;
  function mp_obj_int_print (line 179) | void mp_obj_int_print(const mp_print_t *print, mp_obj_t self_in, mp_prin...
  function mp_int_format_size (line 209) | size_t mp_int_format_size(size_t num_bits, int base, const char *prefix,...
  function mp_obj_int_sign (line 306) | int mp_obj_int_sign(mp_obj_t self_in) {
  function mp_obj_t (line 319) | mp_obj_t mp_obj_int_abs(mp_obj_t self_in) {
  function mp_obj_t (line 328) | mp_obj_t mp_obj_int_unary_op(mp_uint_t op, mp_obj_t o_in) {
  function mp_obj_t (line 333) | mp_obj_t mp_obj_int_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rh...
  function mp_obj_t (line 338) | mp_obj_t mp_obj_new_int_from_str_len(const char **str, size_t len, bool ...
  function mp_obj_t (line 344) | mp_obj_t mp_obj_new_int_from_ll(long long val) {
  function mp_obj_t (line 350) | mp_obj_t mp_obj_new_int_from_ull(unsigned long long val) {
  function mp_obj_t (line 355) | mp_obj_t mp_obj_new_int_from_uint(mp_uint_t value) {
  function mp_obj_t (line 365) | mp_obj_t mp_obj_new_int(mp_int_t value) {
  function mp_int_t (line 373) | mp_int_t mp_obj_int_get_truncated(mp_const_obj_t self_in) {
  function mp_int_t (line 377) | mp_int_t mp_obj_int_get_checked(mp_const_obj_t self_in) {
  function mp_obj_t (line 385) | mp_obj_t mp_obj_int_binary_op_extra_cases(mp_uint_t op, mp_obj_t lhs_in,...
  function STATIC (line 402) | STATIC mp_obj_t int_from_bytes(size_t n_args, const mp_obj_t *args) {
  function STATIC (line 434) | STATIC mp_obj_t int_to_bytes(size_t n_args, const mp_obj_t *args) {

FILE: micropython/source/py/objint_longlong.c
  function mp_obj_t (line 48) | mp_obj_t mp_obj_int_from_bytes_impl(bool big_endian, size_t len, const b...
  function mp_obj_int_to_bytes_impl (line 62) | void mp_obj_int_to_bytes_impl(mp_obj_t self_in, bool big_endian, size_t ...
  function mp_obj_int_sign (line 80) | int mp_obj_int_sign(mp_obj_t self_in) {
  function mp_obj_t (line 99) | mp_obj_t mp_obj_int_abs(mp_obj_t self_in) {
  function mp_obj_t (line 121) | mp_obj_t mp_obj_int_unary_op(mp_uint_t op, mp_obj_t o_in) {
  function mp_obj_t (line 137) | mp_obj_t mp_obj_int_binary_op(mp_uint_t op, mp_obj_t lhs_in, mp_obj_t rh...
  function mp_obj_t (line 231) | mp_obj_t mp_obj_new_int(mp_int_t value) {
  function mp_obj_t (line 238) | mp_obj_t mp_obj_new_int_from_uint(mp_uint_t value) {
  function mp_obj_t (line 247) | mp_obj_t mp_obj_new_int_from_ll(long long val) {
  function mp_obj_t (line 254) | mp_obj_t mp_obj_new_int_from_ull(unsigned long long val) {
  function mp_obj_t (line 265) | mp_obj_t mp_obj_new_int_from_str_len(const char **str, size_t len, bool ...
  function mp_int_t (line 276) | mp_int_t mp_obj_int_get_truncated(mp_const_obj_t self_in) {
  function mp_int_t (line 285) | mp_int_t mp_obj_int_get_checked(mp_const_obj_t self_in) {
  function mp_float_t (line 291) | mp_float_t mp_obj_int_as_float_impl(mp_obj_t self_in) {

FILE: micropython/source/py/objint_mpz.c
  function mp_obj_int_t (line 77) | mp_obj_int_t *mp_obj_int_new_mpz(void) {
  function mp_obj_t (line 110) | mp_obj_t mp_obj_int_from_bytes_impl(bool big_endian, size_t len, const b...
  function mp_obj_int_to_bytes_impl (line 116) | void mp_obj_int_to_bytes_impl(mp_obj_t self_in, bool big_endian, size_t ...
  function mp_obj_int_sign (line 123) | int mp_obj_int_sign(mp_obj_t self_in) {
  function mp_obj_t (line 146) | mp_obj_t mp_obj_int_abs(mp_obj_t self_in) {
  function mp_obj_t (line 165) | mp_obj_t mp_obj_int_unary_op(mp_uint_t op, mp_obj_t o_in) {
  function mp_
Condensed preview — 364 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,838K chars).
[
  {
    "path": ".gitignore",
    "chars": 271,
    "preview": "# ignore Micropython build firmware\nmicropython/build/\n\n# ignore Micropython yotta_modules\nmicropython/yotta_modules/\n\n#"
  },
  {
    "path": "README.md",
    "chars": 4000,
    "preview": "Radiobit, a BBC Micro:Bit RF firmware\n=====================================\n\nIntroduction\n------------\n\nRadiobit is comp"
  },
  {
    "path": "doc/README.md",
    "chars": 2456,
    "preview": "How to use Radiobit's radio module ?\n====================================\n\nRadiobit's *radio* module exposes multiple me"
  },
  {
    "path": "examples/ble-advertiser/advertise.py",
    "chars": 568,
    "preview": "\"\"\"\nBLE advertising example\n\nThis example uses a little hack to send BLE scan responses\nin time: it sends it straight fo"
  },
  {
    "path": "examples/ble-advertiser/sniffer.py",
    "chars": 491,
    "preview": "from microbit import *\nimport radio\n\nradio.on()\nradio.config(channel=38)\nradio.ble()\n\nwhile True:\n    pkt = radio.receiv"
  },
  {
    "path": "examples/ble-conn-sniffing/sniff_conn.py",
    "chars": 1091,
    "preview": "\"\"\"\nThis script simply loops on advertising channels and\nsniffs BLE connection requests.\n\"\"\"\nimport radio\nfrom microbit "
  },
  {
    "path": "examples/esb-sample-sniff.py/wireless-keyboard-sniff.py",
    "chars": 376,
    "preview": "\"\"\"\nQuick'n'dirty ESB sniffer listening on channel 74 at 2MBit/s\n\"\"\"\nimport radio\n\nradio.on()\nradio.config(data_rate=rad"
  },
  {
    "path": "examples/helloworld/helloworld.py",
    "chars": 58,
    "preview": "import microbit\n\nmicrobit.display.scroll('Hello world !')\n"
  },
  {
    "path": "micropython/.gitignore",
    "chars": 146,
    "preview": ".yotta.json\nbuild/*\nyotta_modules/*\nyotta_targets/*\n*.swp\n__pycache__\n\n# This file is generated by the build process\ninc"
  },
  {
    "path": "micropython/AUTHORS",
    "chars": 268,
    "preview": "Damien P. George (@dpgeorge)\nNicholas H. Tollervey (@ntoll)\nMatthew Else (@matthewelse)\nAlan M. Jackson (@alanmjackson)\n"
  },
  {
    "path": "micropython/LICENSE",
    "chars": 1155,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2013-2016 The MicroPython-on-micro:bit Developers, as listed\nin the accompanying AU"
  },
  {
    "path": "micropython/Makefile",
    "chars": 861,
    "preview": "ECHO = @echo\n\nHEX_SRC = build/bbc-microbit-classic-gcc-nosd/source/microbit-micropython.hex\nHEX_FINAL = build/firmware.h"
  },
  {
    "path": "micropython/README.md",
    "chars": 2265,
    "preview": "MicroPython for the BBC micro:bit\n=================================\n\nThis is the source code for MicroPython running on "
  },
  {
    "path": "micropython/config.json",
    "chars": 90,
    "preview": "{\n    \"microbit\" : {\n        \"configfile\" : \"inc/microbit/MicroBitCustomConfig.h\"\n    }\n}\n"
  },
  {
    "path": "micropython/docs/Makefile",
    "chars": 6826,
    "preview": "# Makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line.\nSPHINXOPTS    =\nSPHINXBUILD "
  },
  {
    "path": "micropython/docs/accelerometer.rst",
    "chars": 3159,
    "preview": "Accelerometer\n*************\n\n.. py:module:: microbit.accelerometer\n\nThis object gives you access to the on-board acceler"
  },
  {
    "path": "micropython/docs/audio.rst",
    "chars": 2280,
    "preview": "Audio\n*******\n\n.. py:module:: audio\n\nThis module allows you play sounds from a speaker attached to the Microbit.\nIn orde"
  },
  {
    "path": "micropython/docs/ble.rst",
    "chars": 601,
    "preview": "Bluetooth\n*********\n\nWhile the BBC micro:bit has hardware capable of allowing the device to work as\na Bluetooth Low Ener"
  },
  {
    "path": "micropython/docs/button.rst",
    "chars": 1609,
    "preview": "Buttons\n*******\n\n.. py::module:: microbit\n\nThere are two buttons on the board, called ``button_a`` and ``button_b``.\n\nAt"
  },
  {
    "path": "micropython/docs/compass.rst",
    "chars": 1932,
    "preview": "Compass\n*******\n\n.. py:module:: microbit.compass\n\nThis module lets you access the built-in electronic compass. Before us"
  },
  {
    "path": "micropython/docs/conf.py",
    "chars": 11276,
    "preview": "# -*- coding: utf-8 -*-\n#\n# BBC Microbit Micropython documentation build configuration file, created by\n# sphinx-quickst"
  },
  {
    "path": "micropython/docs/devguide/contributing.rst",
    "chars": 1556,
    "preview": "Contributing\n------------\n\nHey! Many thanks for wanting to improve MicroPython on the micro:bit.\n\nContributions are welc"
  },
  {
    "path": "micropython/docs/devguide/devfaq.rst",
    "chars": 283,
    "preview": ".. _devfaq:\n\n=============\nDeveloper FAQ\n=============\n\n.. note::\n\n    This project is under active development. Please "
  },
  {
    "path": "micropython/docs/devguide/flashfirmware.rst",
    "chars": 1204,
    "preview": ".. _flashfirmware:\n\n=================\nFlashing Firmware\n=================\n\nBuilding firmware\n-----------------\nUse yotta"
  },
  {
    "path": "micropython/docs/devguide/hexformat.rst",
    "chars": 3171,
    "preview": ".. _hexformat:\n\n=================\nFirmware Hex File\n=================\n\nWhen MicroPython is built, the compiler produces "
  },
  {
    "path": "micropython/docs/devguide/installation.rst",
    "chars": 1926,
    "preview": ".. _install-dev:\n\n============\nInstallation\n============\n\nThis section will help you set up the tools and programs neede"
  },
  {
    "path": "micropython/docs/devguide/repl.rst",
    "chars": 3591,
    "preview": ".. _dev-repl:\n\n==================\nAccessing the REPL\n==================\n\nREPL (Read-Evaluate-Print-Loop) allows the micr"
  },
  {
    "path": "micropython/docs/display.rst",
    "chars": 3224,
    "preview": "Display\n*******\n\n.. py:module:: microbit.display\n\nThis module controls the 5×5 LED display on the front of your board. I"
  },
  {
    "path": "micropython/docs/filesystem.rst",
    "chars": 5295,
    "preview": "Local Persistent File System\n****************************\n\nIt is useful to store data in a persistent manner so that it "
  },
  {
    "path": "micropython/docs/i2c.rst",
    "chars": 2193,
    "preview": "I²C\n***\n\n.. py:module:: microbit.i2c\n\nThe ``i2c`` module lets you communicate with devices connected to your board\nusing"
  },
  {
    "path": "micropython/docs/image.rst",
    "chars": 6280,
    "preview": "Image\n*****\n\n.. py:module:: microbit\n\nThe ``Image`` class is used to create images that can be displayed easily on\nthe d"
  },
  {
    "path": "micropython/docs/index.rst",
    "chars": 2466,
    "preview": ".. BBC Microbit Micropython documentation master file, created by\n   sphinx-quickstart on Tue Oct 20 10:41:30 2015.\n   Y"
  },
  {
    "path": "micropython/docs/machine.rst",
    "chars": 3788,
    "preview": "..\n   MicroPython license information\n   ===============================\n\n   The MIT License (MIT)\n\n   Copyright (c) 201"
  },
  {
    "path": "micropython/docs/make.bat",
    "chars": 6733,
    "preview": "@ECHO OFF\r\n\r\nREM Command file for Sphinx documentation\r\n\r\nif \"%SPHINXBUILD%\" == \"\" (\r\n\tset SPHINXBUILD=sphinx-build\r\n)\r\n"
  },
  {
    "path": "micropython/docs/microbit.rst",
    "chars": 1131,
    "preview": "Microbit Module\n***************\n\n.. py:module:: microbit\n\n\nThe ``microbit`` module gives you access to all the hardware "
  },
  {
    "path": "micropython/docs/microbit_micropython_api.rst",
    "chars": 9524,
    "preview": "micro:bit Micropython API\n*************************\n\nThe microbit module\n===================\n\nEverything directly relate"
  },
  {
    "path": "micropython/docs/micropython.rst",
    "chars": 4415,
    "preview": "..\n   MicroPython license information\n   ===============================\n\n   The MIT License (MIT)\n\n   Copyright (c) 201"
  },
  {
    "path": "micropython/docs/music.rst",
    "chars": 6988,
    "preview": "Music\n*****\n\n.. py:module:: music\n\nThis is the ``music`` module. You can use it to play simple tunes, provided\nthat you "
  },
  {
    "path": "micropython/docs/neopixel.rst",
    "chars": 3763,
    "preview": "NeoPixel\n********\n\n.. py:module:: neopixel\n\nThe ``neopixel`` module lets you use NeoPixel (WS2812) individually addressa"
  },
  {
    "path": "micropython/docs/os.rst",
    "chars": 1660,
    "preview": "The ``os``  Module\n******************\n\n.. py:module:: os\n\nMicroPython contains an ``os`` module based upon the ``os`` mo"
  },
  {
    "path": "micropython/docs/pin.rst",
    "chars": 8057,
    "preview": "Input/Output Pins\n*****************\n\n.. py:module:: microbit\n\nThe pins are your board's way to communicate with external"
  },
  {
    "path": "micropython/docs/radio.rst",
    "chars": 6547,
    "preview": "Radio\n*****\n\n.. py:module:: radio\n\nThe ``radio`` module allows devices to work together via simple wireless\nnetworks.\n\nT"
  },
  {
    "path": "micropython/docs/random.rst",
    "chars": 1668,
    "preview": "Random Number Generation\n************************\n\n.. py:module:: random\n\nThis module is based upon the ``random`` modul"
  },
  {
    "path": "micropython/docs/speech.rst",
    "chars": 14720,
    "preview": "Speech\n******\n\n.. warning::\n\n    WARNING! This is still work in progress; we reserve the right to change this API as dev"
  },
  {
    "path": "micropython/docs/spi.rst",
    "chars": 2580,
    "preview": "SPI\n***\n\n.. py:module:: microbit.spi\n\nThe ``spi`` module lets you talk to a device connected to your board using\na seria"
  },
  {
    "path": "micropython/docs/tutorials/buttons.rst",
    "chars": 7015,
    "preview": "Buttons\n-------\n\nSo far we have created code that makes the device do something. This is called\n*output*. However, we al"
  },
  {
    "path": "micropython/docs/tutorials/direction.rst",
    "chars": 1139,
    "preview": "Direction\n---------\n\nThere is a compass on the BBC micro:bit. If you ever make a weather station\nuse the device to work "
  },
  {
    "path": "micropython/docs/tutorials/gestures.rst",
    "chars": 3403,
    "preview": "Gestures\n--------\n\nThe really interesting side-effect of having an accelerometer is gesture\ndetection. If you move your "
  },
  {
    "path": "micropython/docs/tutorials/hello.rst",
    "chars": 3361,
    "preview": "Hello, World!\n-------------\n\nThe traditional way to start programming in a new language is to get your\ncomputer to say, "
  },
  {
    "path": "micropython/docs/tutorials/images.rst",
    "chars": 7903,
    "preview": "Images\n------\n\nMicroPython is about as good at art as you can be if the only thing you have is\na 5x5 grid of red LEDs (l"
  },
  {
    "path": "micropython/docs/tutorials/introduction.rst",
    "chars": 3558,
    "preview": "Introduction\n------------\n\nWe suggest you download and use the `mu editor <http://codewith.mu/>`_ when\nworking through t"
  },
  {
    "path": "micropython/docs/tutorials/io.rst",
    "chars": 3112,
    "preview": "Input/Output\n------------\n\nThere are strips of metal along the bottom edge of the BBC micro:bit that make\nit look as if "
  },
  {
    "path": "micropython/docs/tutorials/movement.rst",
    "chars": 3165,
    "preview": "Movement\n--------\n\nYour BBC micro:bit comes with an accelerometer. It measures movement along\nthree axes:\n\n* X - tilting"
  },
  {
    "path": "micropython/docs/tutorials/music.rst",
    "chars": 4767,
    "preview": "Music\n-----\n\nMicroPython on the BBC micro:bit comes with a powerful music and sound module.\nIt's very easy to generate b"
  },
  {
    "path": "micropython/docs/tutorials/network.rst",
    "chars": 11778,
    "preview": "Network\n-------\n\nIt is possible to connect devices together to send and receive\nmessages to and from each other. This is"
  },
  {
    "path": "micropython/docs/tutorials/next.rst",
    "chars": 1583,
    "preview": "Next Steps\n----------\n\nThese tutorials are only the first steps in using MicroPython with the\nBBC micro:bit. A musical a"
  },
  {
    "path": "micropython/docs/tutorials/radio.rst",
    "chars": 7848,
    "preview": "Radio\n-----\n\nInteraction at a distance feels like magic.\n\nMagic might be useful if you're an elf, wizard or unicorn, but"
  },
  {
    "path": "micropython/docs/tutorials/random.rst",
    "chars": 3516,
    "preview": "Random\n------\n\nSometimes you want to leave things to chance, or mix it up a little: you want\nthe device to act randomly."
  },
  {
    "path": "micropython/docs/tutorials/speech.rst",
    "chars": 8028,
    "preview": "Speech\n------\n\n.. warning::\n\n    WARNING! THIS IS ALPHA CODE.\n\n    We reserve the right to change this API as developmen"
  },
  {
    "path": "micropython/docs/tutorials/storage.rst",
    "chars": 10506,
    "preview": "Storage\n-------\n\nSometimes you need to store useful information. Such information is stored as\ndata: representation of i"
  },
  {
    "path": "micropython/docs/uart.rst",
    "chars": 4350,
    "preview": "UART\n****\n\n.. py:module:: microbit.uart\n\nThe ``uart`` module lets you talk to a device connected to your board using\na s"
  },
  {
    "path": "micropython/docs/utime.rst",
    "chars": 4619,
    "preview": "..\n   MicroPython license information\n   ===============================\n\n   The MIT License (MIT)\n\n   Copyright (c) 201"
  },
  {
    "path": "micropython/examples/analog_watch.py",
    "chars": 876,
    "preview": "from microbit import *\n\nhands = Image.ALL_CLOCKS\n\n#A centre dot of brightness 2.\nticker_image = Image(\"2\\n\").crop(-2,-2,"
  },
  {
    "path": "micropython/examples/asmleds.py",
    "chars": 1665,
    "preview": "\"\"\"\nThis script uses the inline assembler to make the LEDs light up\nin a pattern based on how they are multiplexed in ro"
  },
  {
    "path": "micropython/examples/bubble_level_2d.py",
    "chars": 777,
    "preview": "\"\"\"\nTwo-dimensional bubble level which uses the accelerometer.\n\"\"\"\n\nfrom microbit import *\n\nsensitivity = 'medium'  # Ch"
  },
  {
    "path": "micropython/examples/compass.py",
    "chars": 460,
    "preview": "\"\"\"\n    compass.py\n    ~~~~~~~~~~\n\n    Creates a compass.\n\n    The user will need to calibrate the compass first. The co"
  },
  {
    "path": "micropython/examples/conway.py",
    "chars": 1842,
    "preview": "'''\nConway's Game Of Life for the micro:bit\n\nPress button A or tap the micro:bit to generate a fresh layout.\n'''\n\nimport"
  },
  {
    "path": "micropython/examples/counter.py",
    "chars": 587,
    "preview": "\"\"\"\n    counter.py\n    ~~~~~~~~~~\n    Creates a counter that increments on pressing button a.\n    Scrolls the current co"
  },
  {
    "path": "micropython/examples/digital_water.py",
    "chars": 3893,
    "preview": "\"\"\"\nDigital Water - your micro water simulator. By Tom Viner\n\nExplanation and see running:\nhttps://www.youtube.com/watch"
  },
  {
    "path": "micropython/examples/dodge_game.py",
    "chars": 3447,
    "preview": "\"\"\"\nDodge game\n\nGet the player back and forth across the screen while dodging the enemy\n\"\"\"\n\nfrom microbit import *\nimpo"
  },
  {
    "path": "micropython/examples/flame_simulation.py",
    "chars": 3378,
    "preview": "### Flame simulation on the Microbit.\r\n### Author: M. Schafer 2016\r\n# This program has been placed into the public domai"
  },
  {
    "path": "micropython/examples/flappybit.py",
    "chars": 1551,
    "preview": "'''\nFlappy Bit\n\nControl the bit by tilting the micro:bit\n\nAvoid the obstacles\n\nCreate your own terrain by editing the te"
  },
  {
    "path": "micropython/examples/four_buttons.py",
    "chars": 3389,
    "preview": "\"\"\"Four buttons - 2 buttons + 2 more \"buttons\"!\nA little example of using pins 1 & 2 an extra 2 buttons. By Tom Viner\n\nE"
  },
  {
    "path": "micropython/examples/i_feel_today.py",
    "chars": 587,
    "preview": "\"\"\"\nProgram that shows different emotions.\nPush button \"A\" to become sadder and \"B\" to become happier.\n\"\"\"\n\nfrom microbi"
  },
  {
    "path": "micropython/examples/led_dance.py",
    "chars": 664,
    "preview": "# Light LEDs at random and make them fade over time\n#\n# Usage:\n#\n#    led_dance(delay)\n#\n# 'delay' is the time between e"
  },
  {
    "path": "micropython/examples/magic8.py",
    "chars": 856,
    "preview": "# Magic 8 ball by Nicholas Tollervey. February 2016.\n#\n# Ask a question then shake.\n#\n# This program has been placed int"
  },
  {
    "path": "micropython/examples/maze.py",
    "chars": 1699,
    "preview": "\"\"\"\nA simple maze program.  You are the flashing dot and can walk around\nusing the accelerometer.\n\"\"\"\n\nimport microbit\n\n"
  },
  {
    "path": "micropython/examples/music.py",
    "chars": 1315,
    "preview": "\"\"\"\n    music.py\n    ~~~~~~~~\n\n    Plays a simple tune using the Micropython music module.\n    This example requires a s"
  },
  {
    "path": "micropython/examples/neopixel_random.py",
    "chars": 765,
    "preview": "\"\"\"\n    neopixel_random.py\n    \n    Repeatedly displays random colours onto the LED strip.\n    This example requires a s"
  },
  {
    "path": "micropython/examples/play_file.py",
    "chars": 415,
    "preview": "#Plays a file on the specified pins.\nimport audio\n\ndef audio_generator(file, frame):\n    ln = -1\n    while ln:\n        l"
  },
  {
    "path": "micropython/examples/pomodoro.py",
    "chars": 1456,
    "preview": "\"\"\"\nA simple pomodoro timer.\nIt times a 25 minute work session then 5 minutes rest.\nPress the reset button to restart th"
  },
  {
    "path": "micropython/examples/radio.py",
    "chars": 985,
    "preview": "# A micro:bit Firefly.\n# By Nicholas H.Tollervey. Released to the public domain.\nimport radio\nimport random\nfrom microbi"
  },
  {
    "path": "micropython/examples/reverb.py",
    "chars": 1345,
    "preview": "import audio\n\ndef from_file(file, frame):\n    ln = -1\n    while ln:\n        ln = file.readinto(frame)\n        yield fram"
  },
  {
    "path": "micropython/examples/simple_slalom.py",
    "chars": 3260,
    "preview": "# Simple Slalom by Larry Hastings, September 2015\r\n#\r\n# This program has been placed into the public domain.\r\n\r\nimport m"
  },
  {
    "path": "micropython/examples/speech.py",
    "chars": 904,
    "preview": "import speech\nfrom microbit import sleep\n\n# The say method attempts to convert English into phonemes.\nspeech.say(\"I can "
  },
  {
    "path": "micropython/examples/tiltmusic.py",
    "chars": 1342,
    "preview": "# TiltMusic by Alex \"Chozabu\" P-B. September 2016.\n#\n# Tilt Y to change Pitch\n# press A to turn sound on or off\n# hold B"
  },
  {
    "path": "micropython/examples/watch.py",
    "chars": 4203,
    "preview": "######################################################\n# A watch (as in a small clock for your wrist or pocket)\n# \n# But"
  },
  {
    "path": "micropython/examples/waveforms.py",
    "chars": 1595,
    "preview": "from microbit import display, sleep, button_a\nimport audio\nimport math\n\ndef repeated_frame(frame, count):\n    for i in r"
  },
  {
    "path": "micropython/inc/extmod/machine_mem.h",
    "chars": 1960,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/extmod/machine_pulse.h",
    "chars": 1576,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/extmod/utime_mphal.h",
    "chars": 1840,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/genhdr/mpversion.h",
    "chars": 316,
    "preview": "// This file was generated by py/makeversionhdr.py\n#define MICROPY_GIT_TAG \"v1.9.2-34-gd64154c73\"\n#define MICROPY_GIT_HA"
  },
  {
    "path": "micropython/inc/genhdr/qstrdefs.generated.h",
    "chars": 43027,
    "preview": "// This file was automatically generated by makeqstrdata.py\n\nQDEF(MP_QSTR_NULL, (const byte*)\"\\x00\\x00\" \"\")\nQDEF(MP_QSTR"
  },
  {
    "path": "micropython/inc/lib/iters.h",
    "chars": 80,
    "preview": "\n#include \"py/runtime.h\"\n\nmp_obj_t microbit_repeat_iterator(mp_obj_t iterable);\n"
  },
  {
    "path": "micropython/inc/lib/mp-readline/readline.h",
    "chars": 1894,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/lib/pwm.h",
    "chars": 407,
    "preview": "#ifndef __MICROPY_INCLUDED_LIB_PWM_H__\n#define __MICROPY_INCLUDED_LIB_PWM_H__\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nv"
  },
  {
    "path": "micropython/inc/lib/ticker.h",
    "chars": 1043,
    "preview": "#ifndef __MICROPY_INCLUDED_LIB_TICKER_H__\n#define __MICROPY_INCLUDED_LIB_TICKER_H__\n\n/**********************************"
  },
  {
    "path": "micropython/inc/lib/utils/interrupt_char.h",
    "chars": 1493,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/lib/utils/pyexec.h",
    "chars": 2154,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/microbit/MicroBitCustomConfig.h",
    "chars": 782,
    "preview": "/**\n  * MicroBitCustomConfig.h\n  *\n  * This file is automatically included by the microbit DAL compilation\n  * process. "
  },
  {
    "path": "micropython/inc/microbit/filesystem.h",
    "chars": 4488,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/microbit/memory.h",
    "chars": 2318,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/microbit/microbit_image.h",
    "chars": 4501,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/microbit/microbitdal.h",
    "chars": 2027,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/microbit/modaudio.h",
    "chars": 756,
    "preview": "\n#ifndef __MICROPY_INCLUDED_MICROBIT_AUDIO_H__\n#define __MICROPY_INCLUDED_MICROBIT_AUDIO_H__\n\n#include \"nrf.h\"\n#include "
  },
  {
    "path": "micropython/inc/microbit/modmicrobit.h",
    "chars": 16225,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/microbit/modmusic.h",
    "chars": 2864,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/microbit/mpconfigport.h",
    "chars": 7127,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/microbit/mphalport.h",
    "chars": 1987,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/microbit/qstrdefsport.h",
    "chars": 4563,
    "preview": "// qstrs specific to this port\n\nQ(help)\nQ(input)\nQ(collections)\nQ(struct)\n\nQ(microbit)\nQ(reset)\nQ(sleep)\nQ(running_time)"
  },
  {
    "path": "micropython/inc/py/asmarm.h",
    "chars": 9008,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/asmbase.h",
    "chars": 2526,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/asmthumb.h",
    "chars": 15542,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/asmx64.h",
    "chars": 9407,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/asmx86.h",
    "chars": 9437,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/asmxtensa.h",
    "chars": 14619,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/bc.h",
    "chars": 4953,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/bc0.h",
    "chars": 5428,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/binary.h",
    "chars": 2285,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/builtin.h",
    "chars": 5670,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/compile.h",
    "chars": 2189,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/emit.h",
    "chars": 14113,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/emitglue.h",
    "chars": 2982,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/formatfloat.h",
    "chars": 1517,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/frozenmod.h",
    "chars": 1622,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/gc.h",
    "chars": 2298,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/grammar.h",
    "chars": 22944,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/lexer.h",
    "chars": 5747,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/misc.h",
    "chars": 9137,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/mpconfig.h",
    "chars": 40749,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/mperrno.h",
    "chars": 6234,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/mphal.h",
    "chars": 2483,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/mpprint.h",
    "chars": 2915,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/mpstate.h",
    "chars": 7858,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/mpthread.h",
    "chars": 2274,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/mpz.h",
    "chars": 5901,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/nlr.h",
    "chars": 3810,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/obj.h",
    "chars": 39974,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/objarray.h",
    "chars": 1699,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/objexcept.h",
    "chars": 1640,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/objfun.h",
    "chars": 1998,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/objgenerator.h",
    "chars": 1524,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/objint.h",
    "chars": 2959,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/objlist.h",
    "chars": 1498,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/objmodule.h",
    "chars": 1573,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/objstr.h",
    "chars": 5278,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/objstringio.h",
    "chars": 1636,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/objtuple.h",
    "chars": 2510,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/objtype.h",
    "chars": 2384,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/parse.h",
    "chars": 4745,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/parse2.h",
    "chars": 4517,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/parsenum.h",
    "chars": 1701,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/parsenumbase.h",
    "chars": 1456,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/persistentcode.h",
    "chars": 1753,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/qstr.h",
    "chars": 2789,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/qstrdefs.h",
    "chars": 1773,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/reader.h",
    "chars": 1995,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/repl.h",
    "chars": 1602,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/ringbuf.h",
    "chars": 2227,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/runtime.h",
    "chars": 7547,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/runtime0.h",
    "chars": 4594,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/scope.h",
    "chars": 3549,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/smallint.h",
    "chars": 2901,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/stackctrl.h",
    "chars": 1683,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/stream.h",
    "chars": 4678,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/unicode.h",
    "chars": 1451,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/inc/py/vmentrytable.h",
    "chars": 6005,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/module.json",
    "chars": 479,
    "preview": "{\n  \"name\": \"microbit-micropython\",\n  \"version\": \"1.0.1\",\n  \"license\": \"MIT\",\n  \"description\": \"MicroPython port to the "
  },
  {
    "path": "micropython/source/extmod/machine_mem.c",
    "chars": 4200,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/source/extmod/machine_pulse.c",
    "chars": 2453,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/source/extmod/utime_mphal.c",
    "chars": 3928,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/source/lib/iters.c",
    "chars": 2319,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/source/lib/mp-readline/readline.c",
    "chars": 15704,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/source/lib/neopixelsend.s",
    "chars": 3775,
    "preview": "/*\n  Portions of this code based on code provided under MIT license from Microsoft\n  https://github.com/Microsoft/pxt-ws"
  },
  {
    "path": "micropython/source/lib/pwm.c",
    "chars": 7783,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/source/lib/sam/ReciterTabs.h",
    "chars": 29611,
    "preview": "#ifndef RECITERTABS_H\n#define RECITERTABS_H\n\n//some flags\nconst unsigned char tab36376[] =\n{\n\t0, 0, 0, 0, 0, 0, 0, 0, //"
  },
  {
    "path": "micropython/source/lib/sam/RenderTabs.h",
    "chars": 20470,
    "preview": "#ifndef RENDERTABS_H\n#define RENDERTABS_H\n\nconst unsigned char tab48426[5] = { 0x18, 0x1A, 0x17, 0x17, 0x17 };\n\nconst un"
  },
  {
    "path": "micropython/source/lib/sam/SamTabs.h",
    "chars": 5838,
    "preview": "#ifndef SAMTABS_H\r\n#define SAMTABS_H\r\n\r\n//tab40672\r\nconst unsigned char stressInputTable[] =\r\n{\r\n\t'*', '1', '2', '3', '4"
  },
  {
    "path": "micropython/source/lib/sam/debug.c",
    "chars": 1917,
    "preview": "#include<stdio.h>\n#include \"sam.h\"\n\nextern unsigned char signInputTable1[];\nextern unsigned char signInputTable2[];\n\nvoi"
  },
  {
    "path": "micropython/source/lib/sam/debug.h",
    "chars": 253,
    "preview": "#ifndef DEBUG_H\n#define DEBUG_H\n\n#include \"sam.h\"\n\nvoid PrintPhonemes(char* title, phoneme_t *phonemes);\nvoid PrintOutpu"
  },
  {
    "path": "micropython/source/lib/sam/main.c",
    "chars": 2732,
    "preview": "#include <stdio.h>\r\n#include <stdlib.h>\r\n#include <ctype.h>\r\n#include <string.h>\r\n\r\n#include \"reciter.h\"\r\n#include \"sam."
  },
  {
    "path": "micropython/source/lib/sam/reciter.c",
    "chars": 9549,
    "preview": "#include <stdio.h>\r\n#include <string.h>\r\n#include \"reciter.h\"\r\n#include \"ReciterTabs.h\"\r\n#include \"debug.h\"\r\n\r\nstatic un"
  },
  {
    "path": "micropython/source/lib/sam/reciter.h",
    "chars": 293,
    "preview": "#ifndef RECITER_C\r\n#define RECITER_C\r\n\r\n//int TextToPhonemes(char *input, char *output);\r\n\r\ntypedef struct _reciter_memo"
  },
  {
    "path": "micropython/source/lib/sam/render.c",
    "chars": 26912,
    "preview": "#include <stdio.h>\n#include <string.h>\n#include <stdlib.h>\n\n#include \"render.h\"\n#include \"RenderTabs.h\"\n\n#include \"debug"
  },
  {
    "path": "micropython/source/lib/sam/render.h",
    "chars": 381,
    "preview": "#ifndef RENDER_H\n#define RENDER_H\n\n#include \"sam.h\"\n\nvoid Render(sam_memory* sam);\nvoid SetMouthThroat(unsigned char mou"
  },
  {
    "path": "micropython/source/lib/sam/sam.c",
    "chars": 42730,
    "preview": "#include <stdio.h>\r\n#include <string.h>\r\n#include <stdlib.h>\r\n#include \"debug.h\"\r\n#include \"sam.h\"\r\n#include \"render.h\"\r"
  },
  {
    "path": "micropython/source/lib/sam/sam.h",
    "chars": 2689,
    "preview": "#ifndef SAM_H\r\n#define SAM_H\r\n\r\n#define DEFAULT_SING     false\r\n#define DEFAULT_PITCH    64\r\n#define DEFAULT_SPEED    72"
  },
  {
    "path": "micropython/source/lib/ticker.c",
    "chars": 5564,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/source/lib/utils/interrupt_char.c",
    "chars": 1803,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/source/lib/utils/pyexec.c",
    "chars": 16723,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/source/microbit/display_readme.md",
    "chars": 2012,
    "preview": "# Notes on the Display\n\nRendering of images to the display is now done entirely within MicroPython\nwithout using the DAL"
  },
  {
    "path": "micropython/source/microbit/events.cpp",
    "chars": 2327,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/source/microbit/fileobj.c",
    "chars": 5236,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/source/microbit/filesystem.c",
    "chars": 17660,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/source/microbit/gccollect.c",
    "chars": 2309,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/source/microbit/help.c",
    "chars": 16177,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/source/microbit/main.cpp",
    "chars": 8277,
    "preview": "#include \"lib/ticker.h\"\n#include \"lib/pwm.h\"\n#include \"microbit/memory.h\"\n#include \"microbit/filesystem.h\"\n#include \"mic"
  },
  {
    "path": "micropython/source/microbit/microbitaccelerometer.cpp",
    "chars": 8827,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/source/microbit/microbitbutton.cpp",
    "chars": 5831,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  },
  {
    "path": "micropython/source/microbit/microbitcompass.cpp",
    "chars": 7321,
    "preview": "/*\n * This file is part of the MicroPython project, http://micropython.org/\n *\n * The MIT License (MIT)\n *\n * Copyright "
  }
]

// ... and 164 more files (download for full content)

About this extraction

This page contains the full source code of the virtualabs/radiobit GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 364 files (3.5 MB), approximately 941.2k tokens, and a symbol index with 2793 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!