Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • flow3r/flow3r-firmware
  • Vespasian/flow3r-firmware
  • alxndr42/flow3r-firmware
  • pl/flow3r-firmware
  • Kari/flow3r-firmware
  • raimue/flow3r-firmware
  • grandchild/flow3r-firmware
  • mu5tach3/flow3r-firmware
  • Nervengift/flow3r-firmware
  • arachnist/flow3r-firmware
  • TheNewCivilian/flow3r-firmware
  • alibi/flow3r-firmware
  • manuel_v/flow3r-firmware
  • xeniter/flow3r-firmware
  • maxbachmann/flow3r-firmware
  • yGifoom/flow3r-firmware
  • istobic/flow3r-firmware
  • EiNSTeiN_/flow3r-firmware
  • gnudalf/flow3r-firmware
  • 999eagle/flow3r-firmware
  • toerb/flow3r-firmware
  • pandark/flow3r-firmware
  • teal/flow3r-firmware
  • x42/flow3r-firmware
  • alufers/flow3r-firmware
  • dos/flow3r-firmware
  • yrlf/flow3r-firmware
  • LuKaRo/flow3r-firmware
  • ThomasElRubio/flow3r-firmware
  • ai/flow3r-firmware
  • T_X/flow3r-firmware
  • highTower/flow3r-firmware
  • beanieboi/flow3r-firmware
  • Woazboat/flow3r-firmware
  • gooniesbro/flow3r-firmware
  • marvino/flow3r-firmware
  • kressnerd/flow3r-firmware
  • quazgar/flow3r-firmware
  • aoid/flow3r-firmware
  • jkj/flow3r-firmware
  • naomi/flow3r-firmware
41 results
Select Git revision
Show changes
Showing
with 346 additions and 0 deletions
### user input
```
button_get(button_number)
```
RETURNS state of a shoulder button (0: not pressed, -1: left, 1: right, 2: down)
`button_number` (int, range 0-1)
: 0 is right shoulder button, 1 is left shoulder button
---
```
captouch_get(petal_number)
```
RETURNS 0 if captouch petal is not touched, 1 if it is touched.
note that captouch is somewhat buggy atm.
`petal_number` (int, range 0-9)
: which petal. 0 is the top petal above the USB-C port, increments ccw.
---
```
captouch_autocalib()
```
recalibrates captouch "not touched" reference
### LEDs
```
led_set_hsv(index, hue, sat, value)
```
prepares a single LED to be set to a color with the next `leds_update()` call.
`index` (int, range 0-39)
: indicates which LED is set. 0 is above the USB-C port, increments ccw. there are 8 LEDs per top petal.
`hue` (float, range 0.0-359.0)
: hue
`val` (float, range 0.0-1.0)
: value
`sat` (float, range 0.0-1.0)
: saturation
---
```
led_set_rgb(index, hue, sat, value)
```
prepares a single LED to be set to a color with the next `leds_update()` call.
`index` (int, range 0-39)
: indicates which LED is set. 0 is above the USB-C port, increments ccw. there are 8 LEDs per top petal.
`r` (int, range 0-255)
: red
`g` (int, range 0-255)
: green
`b` (int, range 0-255)
: blue
---
```
leds_update()
```
writes LED color configuration to the actual LEDs.
### display (DEPRECATED SOON)
```
display_set_pixel(x, y, col)
```
write to a single pixel in framebuffer to be set to a color with the next `display_update()` call
`x` (int, range 0-239)
: sets x coordinate (0: right)
`y` (int, range 0-239)
: sets y coordinate (0: down)
`col` (int, range 0-65535)
: color as an rgb565 number
---
```
display_get_pixel(x, y, col)
```
RETURNS color of a single pixel from the framebuffer as an rgb565 number
`x` (int, range 0-239)
: sets x coordinate (0: right)
`y` (int, range 0-239)
: sets y coordinate (0: down)
---
```
display_fill(col)
```
writes to all pixels in framebuffer to be set to a color with the next `display_update()` call
`col` (int, range 0-65535)
: color as an rgb565 number
---
```
display_update()
```
writes framebuffer to display
import copy
import glob
import os
import os.path
import re
import shutil
def action_extensions(base_actions, project_path=os.getcwd()):
"""
Implementes -g/--generation and BADGE_GENERATION in idf.py, allowing
switching between badge generations and sdkconfig default files.
"""
# Map from canonical name to user-supported names.
GENERATIONS = {
'p1': ['proto1'],
'p3': ['proto3'],
'p4': ['proto4'],
'p5': ['adi-less'],
}
def generation_callback(ctx, global_args, tasks):
"""
Implements translation from set -g/--generation and BADGE_GENERATION
into CMake cache entries.
"""
generation = global_args.generation
if generation is None:
generation = os.environ.get('BADGE_GENERATION', 'proto4')
name = None
if generation in GENERATIONS:
name = generation
else:
for gen, names in GENERATIONS.items():
if generation in names:
name = gen
break
if name is None:
supported = []
supported += GENERATIONS.keys()
for _, names in GENERATIONS.items():
supported += names
supported = sorted(supported)
raise Exception(f'Invalid generation: want one of {", ".join(supported)}')
sdkconfig_name = 'sdkconfig.' + name
sdkconfig_path = os.path.join(project_path, sdkconfig_name)
if not os.path.exists(sdkconfig_path):
raise Exception(f'Missing sdkconfig file {sdkconfig_name}')
cache_entries = {
'SDKCONFIG_DEFAULTS': sdkconfig_path,
}
print(cache_entries)
global_args.define_cache_entry = list(global_args.define_cache_entry)
global_args.define_cache_entry.extend(['%s=%s' % (k, v) for k, v in cache_entries.items()])
# Add global options
extensions = {
'global_options': [{
'names': ['-g', '--generation'],
'help': 'Specify badge generation to build for (one of: proto1, proto3, proto4, adiless). Defaults to proto4.',
'scope': 'shared',
'multiple': False,
}],
'global_action_callbacks': [generation_callback],
'actions': {},
}
return extensions
This diff is collapsed.
micropython shim module
===
This is the 'main' module from ESP-IDF, and its job is to just start
micropython and continue executing `app_main` from
`components/badge23/espan.c`.
#define MICROPY_HW_BOARD_NAME "badge23"
#define MICROPY_HW_MCU_NAME "ESP32S3"
#define MICROPY_ENABLE_FINALISER (1)
#define MICROPY_PY_MACHINE_DAC (0)
#define MICROPY_HW_I2C0_SCL (9)
#define MICROPY_HW_I2C0_SDA (8)
#define MICROPY_ESP_IDF_4 1
#define MICROPY_VFS_FAT 1
#define MICROPY_VFS_LFS2 1
// These kinda freak me out, but that's what micropython does...
#define LFS1_NO_MALLOC
#define LFS1_NO_DEBUG
#define LFS1_NO_WARN
#define LFS1_NO_ERROR
#define LFS1_NO_ASSERT
#define LFS2_NO_MALLOC
#define LFS2_NO_DEBUG
#define LFS2_NO_WARN
#define LFS2_NO_ERROR
#define LFS2_NO_ASSERT
include("micropython/ports/esp32/boards")
freeze("./python_modules")
This diff is collapsed.
This diff is collapsed.
MicroPython Code of Conduct
===========================
The MicroPython community is made up of members from around the globe with a
diverse set of skills, personalities, and experiences. It is through these
differences that our community experiences great successes and continued growth.
When you're working with members of the community, this Code of Conduct will
help steer your interactions and keep MicroPython a positive, successful, and
growing community.
Members of the MicroPython community are open, considerate, and respectful.
Behaviours that reinforce these values contribute to a positive environment, and
include: acknowledging time and effort, being respectful of differing viewpoints
and experiences, gracefully accepting constructive criticism, and using
welcoming and inclusive language.
Every member of our community has the right to have their identity respected.
The MicroPython community is dedicated to providing a positive experience for
everyone, regardless of age, gender identity and expression, sexual orientation,
disability, physical appearance, body size, ethnicity, nationality, race, or
religion (or lack thereof), education, or socio-economic status.
Unacceptable behaviour includes: harassment, trolling, deliberate intimidation,
violent threats or language directed against another person; insults, put downs,
or jokes that are based upon stereotypes, that are exclusionary, or that hold
others up for ridicule; unwelcome sexual attention or advances; sustained
disruption of community discussions; publishing others' private information
without explicit permission; and other conduct that is inappropriate for a
professional audience including people of many different backgrounds.
This code of conduct covers all online and offline presence related to the
MicroPython project, including GitHub and the forum. If a participant engages
in behaviour that violates this code of conduct, the MicroPython team may take
action as they deem appropriate, including warning the offender or expulsion
from the community. Community members asked to stop any inappropriate behaviour
are expected to comply immediately.
Thank you for helping make this a welcoming, friendly community for everyone.
If you believe that someone is violating the code of conduct, or have any other
concerns, please contact a member of the MicroPython team by emailing
contact@micropython.org.
License
-------
This Code of Conduct is licensed under the Creative Commons
Attribution-ShareAlike 3.0 Unported License.
Attributions
------------
Based on the Python code of conduct found at https://www.python.org/psf/conduct/
When reporting an issue and especially submitting a pull request, please
make sure that you are acquainted with Contributor Guidelines:
https://github.com/micropython/micropython/wiki/ContributorGuidelines
as well as the Code Conventions, which includes details of how to commit:
https://github.com/micropython/micropython/blob/master/CODECONVENTIONS.md
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
MicroPython Documentation
=========================
The MicroPython documentation can be found at:
http://docs.micropython.org/en/latest/
The documentation you see there is generated from the files in the docs tree:
https://github.com/micropython/micropython/tree/master/docs
Building the documentation locally
----------------------------------
If you're making changes to the documentation, you may want to build the
documentation locally so that you can preview your changes.
Install Sphinx, and optionally (for the RTD-styling), sphinx_rtd_theme,
preferably in a virtualenv:
pip install sphinx
pip install sphinx_rtd_theme
In `micropython/docs`, build the docs:
make html
You'll find the index page at `micropython/docs/build/html/index.html`.
Having readthedocs.org build the documentation
----------------------------------------------
If you would like to have docs for forks/branches hosted on GitHub, GitLab or
BitBucket an alternative to building the docs locally is to sign up for a free
https://readthedocs.org account. The rough steps to follow are:
1. sign-up for an account, unless you already have one
2. in your account settings: add GitHub as a connected service (assuming
you have forked this repo on github)
3. in your account projects: import your forked/cloned micropython repository
into readthedocs
4. in the project's versions: add the branches you are developing on or
for which you'd like readthedocs to auto-generate docs whenever you
push a change
PDF manual generation
---------------------
This can be achieved with:
make latexpdf
but requires a rather complete install of LaTeX with various extensions. On
Debian/Ubuntu, try (1GB+ download):
apt install texlive-latex-recommended texlive-latex-extra texlive-xetex texlive-fonts-extra cm-super xindy
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
.. _extendingmicropython:
Extending MicroPython in C
==========================
This chapter describes options for implementing additional functionality in C, but from code
written outside of the main MicroPython repository. The first approach is useful for building
your own custom firmware with some project-specific additional modules or functions that can
be accessed from Python. The second approach is for building modules that can be loaded at runtime.
Please see the :ref:`library section <internals_library>` for more information on building core modules that
live in the main MicroPython repository.
.. toctree::
:maxdepth: 3
cmodules.rst
natmod.rst
This diff is collapsed.
micropython/docs/develop/img/bitmap.png

6.24 KiB