commit
702b4a58f8
|
@ -48,7 +48,7 @@ To compile (or recompile) mpy-cross:
|
|||
|
||||
make -C mpy-cross
|
||||
|
||||
# Building
|
||||
## Building
|
||||
|
||||
There a number of ports of CircuitPython! To build for your board, change to the appropriate ports directory and build.
|
||||
|
||||
|
@ -64,7 +64,7 @@ If you aren't sure what boards exist, have a peek in the boards subdirectory of
|
|||
If you have a fast computer with many cores, consider adding `-j` to your build flags, such as `-j17` on
|
||||
a 6-core 12-thread machine.
|
||||
|
||||
# Testing
|
||||
## Testing
|
||||
|
||||
If you are working on changes to the core language, you might find it useful to run the test suite.
|
||||
The test suite in the top level `tests` directory. It needs the unix port to run.
|
||||
|
@ -84,7 +84,7 @@ A successful run will say something like
|
|||
676 tests passed
|
||||
30 tests skipped: buffered_writer builtin_help builtin_range_binop class_delattr_setattr cmd_parsetree extra_coverage framebuf1 framebuf16 framebuf2 framebuf4 framebuf8 framebuf_subclass mpy_invalid namedtuple_asdict non_compliant resource_stream schedule sys_getsizeof urandom_extra ure_groups ure_span ure_sub ure_sub_unmatched vfs_basic vfs_fat_fileio1 vfs_fat_fileio2 vfs_fat_more vfs_fat_oldproto vfs_fat_ramdisk vfs_userfs
|
||||
|
||||
# Debugging
|
||||
## Debugging
|
||||
|
||||
The easiest way to debug CircuitPython on hardware is with a JLink device, JLinkGDBServer, and an appropriate GDB.
|
||||
Instructions can be found at https://learn.adafruit.com/debugging-the-samd21-with-gdb
|
||||
|
@ -99,7 +99,7 @@ Example:
|
|||
If your port/build includes `arm-none-eabi-gdb-py`, consider using it instead, as it can be used for better register
|
||||
debugging with https://github.com/bnahill/PyCortexMDebug
|
||||
|
||||
# Code Quality Checks
|
||||
## Code Quality Checks
|
||||
|
||||
We apply code quality checks using pre-commit. Install pre-commit once per system with
|
||||
|
||||
|
|
|
@ -38,9 +38,9 @@ For SAMD21 debugging workflow tips check out [this learn guide](https://learn.ad
|
|||
Scott Shawcroft ([@tannewt](https://github.com/tannewt)) is the lead developer of CircuitPython
|
||||
and is sponsored by [Adafruit Industries LLC](https://adafruit.com). Scott is usually available
|
||||
during US West Coast working hours. Dan Halbert ([@dhalbert](https://github.com/dhalbert)) and
|
||||
Kattni Rembor ([@kattni](https://github.com/kattni)) are also sponsored by [Adafruit Industries
|
||||
LLC](https://adafruit.com) and are usually available during US East Coast daytime hours including
|
||||
some weekends.
|
||||
Jeff Epler ([@jepler](https://github.com/jepler)) are also sponsored by [Adafruit Industries
|
||||
LLC](https://adafruit.com) and are usually available during US daytime hours including some
|
||||
weekends.
|
||||
|
||||
They are all reachable on [Discord](https://adafru.it/discord), GitHub issues and the [Adafruit
|
||||
support forum](https://forums.adafruit.com/viewforum.php?f=60).
|
||||
|
|
|
@ -56,10 +56,6 @@ Specifically useful documentation when starting out:
|
|||
- `CircuitPython Essentials <https://learn.adafruit.com/circuitpython-essentials>`__
|
||||
- `Example Code <https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/master/CircuitPython_Essentials>`__
|
||||
|
||||
Code Search
|
||||
------------
|
||||
GitHub doesn't currently support code search on forks. Therefore, CircuitPython doesn't have code search through GitHub because it is a fork of MicroPython. Luckily, `SourceGraph <https://sourcegraph.com/github.com/adafruit/circuitpython>`_ has free code search for public repos like CircuitPython. So, visit `sourcegraph.com/github.com/adafruit/circuitpython <https://sourcegraph.com/github.com/adafruit/circuitpython>`_ to search the CircuitPython codebase online.
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
|
|
15
conf.py
15
conf.py
|
@ -218,12 +218,12 @@ exclude_patterns = ["**/build*",
|
|||
"ports/nrf/usb",
|
||||
"ports/raspberrypi/sdk",
|
||||
"ports/raspberrypi/lib",
|
||||
"ports/silabs",
|
||||
"ports/silabs/gecko_sdk",
|
||||
"ports/silabs/tools",
|
||||
"ports/stm/st_driver",
|
||||
"ports/stm/packages",
|
||||
"ports/stm/peripherals",
|
||||
"ports/stm/ref",
|
||||
"ports/unix",
|
||||
"py",
|
||||
"shared/*",
|
||||
"shared-bindings/util.*",
|
||||
|
@ -362,14 +362,21 @@ latex_elements = {
|
|||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
# Include 3 levels of headers in PDF ToC
|
||||
'preamble': '\setcounter{tocdepth}{2}',
|
||||
'preamble': r'''
|
||||
\setcounter{tocdepth}{2}
|
||||
\hbadness=99999
|
||||
\hfuzz=20pt
|
||||
\usepackage{pdflscape}
|
||||
''',
|
||||
}
|
||||
|
||||
# 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 = [
|
||||
(master_doc, 'CircuitPython.tex', 'CircuitPython Documentation',
|
||||
("docs/pdf", 'CircuitPython.tex', 'CircuitPython Documentation',
|
||||
'CircuitPython Contributors', 'manual'),
|
||||
("shared-bindings/support_matrix", 'SupportMatrix.tex', 'Board Support Matrix',
|
||||
'CircuitPython Contributors', 'manual'),
|
||||
]
|
||||
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
:orphan:
|
||||
|
||||
Adafruit CircuitPython API Reference
|
||||
====================================
|
||||
|
||||
Welcome to the API reference documentation for Adafruit CircuitPython.
|
||||
This contains low-level API reference docs which may link out to separate
|
||||
*"getting started"* guides. `Adafruit <https://adafruit.com>`_ has many
|
||||
excellent tutorials available through the
|
||||
`Adafruit Learning System <https://learn.adafruit.com/>`_.
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
|
||||
../README.rst
|
||||
libraries.rst
|
||||
workflows
|
||||
environment.rst
|
||||
troubleshooting.rst
|
||||
../CONTRIBUTING
|
||||
../BUILDING
|
||||
../WEBUSB_README
|
||||
supported_ports.rst
|
||||
|
||||
Design and porting reference
|
||||
----------------------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
design_guide
|
||||
porting
|
||||
common_hal
|
||||
|
||||
API Reference
|
||||
----------------------
|
||||
|
||||
.. toctree::
|
||||
:glob:
|
||||
:maxdepth: 3
|
||||
|
||||
library/index.rst
|
||||
../shared-bindings/*/index
|
||||
../shared-bindings/help
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
reference/glossary.rst
|
||||
../CODE_OF_CONDUCT
|
||||
../docs/LICENSE
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
|
@ -12,10 +12,13 @@ is limited.
|
|||
:maxdepth: 2
|
||||
|
||||
../ports/atmel-samd/README
|
||||
../ports/broadcom/README
|
||||
../ports/cxd56/README
|
||||
../ports/espressif/README
|
||||
../ports/litex/README
|
||||
../ports/mimxrt10xx/README
|
||||
../ports/nrf/README
|
||||
../ports/raspberrypi/README
|
||||
../ports/silabs/README
|
||||
../ports/stm/README
|
||||
../ports/unix/README
|
||||
|
|
|
@ -540,7 +540,7 @@ STATIC const mp_vfs_proto_t fat_vfs_proto = {
|
|||
MP_DEFINE_CONST_OBJ_TYPE(
|
||||
mp_fat_vfs_type,
|
||||
MP_QSTR_VfsFat,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
|
||||
make_new, fat_vfs_make_new,
|
||||
protocol, &fat_vfs_proto,
|
||||
locals_dict, &fat_vfs_locals_dict
|
||||
|
|
10
main.c
10
main.c
|
@ -94,6 +94,10 @@
|
|||
#include "shared-module/displayio/__init__.h"
|
||||
#endif
|
||||
|
||||
#if CIRCUITPY_EPAPERDISPLAY
|
||||
#include "shared-bindings/epaperdisplay/EPaperDisplay.h"
|
||||
#endif
|
||||
|
||||
#if CIRCUITPY_KEYPAD
|
||||
#include "shared-module/keypad/__init__.h"
|
||||
#endif
|
||||
|
@ -534,7 +538,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) {
|
|||
|
||||
// Program has finished running.
|
||||
bool printed_press_any_key = false;
|
||||
#if CIRCUITPY_DISPLAYIO
|
||||
#if CIRCUITPY_EPAPERDISPLAY
|
||||
size_t time_to_epaper_refresh = 1;
|
||||
#endif
|
||||
|
||||
|
@ -682,7 +686,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) {
|
|||
// Refresh the ePaper display if we have one. That way it'll show an error message.
|
||||
// Skip if we're about to autoreload. Otherwise we may delay when user code can update
|
||||
// the display.
|
||||
#if CIRCUITPY_DISPLAYIO
|
||||
#if CIRCUITPY_EPAPERDISPLAY
|
||||
if (time_to_epaper_refresh > 0 && !autoreload_pending()) {
|
||||
time_to_epaper_refresh = maybe_refresh_epaperdisplay();
|
||||
}
|
||||
|
@ -724,7 +728,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) {
|
|||
}
|
||||
time_to_next_change = total_time - tick_diff;
|
||||
}
|
||||
#if CIRCUITPY_DISPLAYIO
|
||||
#if CIRCUITPY_EPAPERDISPLAY
|
||||
if (time_to_epaper_refresh > 0 && time_to_next_change > 0) {
|
||||
time_to_next_change = MIN(time_to_next_change, time_to_epaper_refresh);
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ STATIC MP_DEFINE_CONST_DICT(samd_clock_locals_dict, samd_clock_locals_dict_table
|
|||
MP_DEFINE_CONST_OBJ_TYPE(
|
||||
samd_clock_type,
|
||||
MP_QSTR_Clock,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
|
||||
print, samd_clock_print,
|
||||
locals_dict, &samd_clock_locals_dict
|
||||
);
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
#include "supervisor/board.h"
|
||||
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -69,11 +69,11 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_PA28, // Command or data
|
||||
&pin_PA01, // Chip select
|
||||
|
@ -82,9 +82,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
128, // Width
|
||||
128, // Height
|
||||
|
|
|
@ -28,11 +28,12 @@
|
|||
#include "mpconfigboard.h"
|
||||
#include "hal/include/hal_gpio.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/busdisplay/BusDisplay.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -47,13 +48,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_PA01, &pin_PA00, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_PB31, // TFT_DC Command or data
|
||||
&pin_PA27, // TFT_CS Chip select
|
||||
|
@ -62,9 +63,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
240, // Width (after rotation)
|
||||
240, // Height (after rotation)
|
||||
|
|
|
@ -28,11 +28,11 @@
|
|||
#include "mpconfigboard.h"
|
||||
#include "hal/include/hal_gpio.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -48,13 +48,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA12, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_PA07, // TFT_DC Command or data
|
||||
&pin_PA06, // TFT_CS Chip select
|
||||
|
@ -63,9 +63,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
240, // Width (after rotation)
|
||||
240, // Height (after rotation)
|
||||
|
|
|
@ -28,12 +28,12 @@
|
|||
#include "mpconfigboard.h"
|
||||
#include "hal/include/hal_gpio.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/time/__init__.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
#define HEIGHT 400
|
||||
|
@ -57,13 +57,13 @@ uint8_t refresh_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_PB05, // EPD_DC Command or data
|
||||
&pin_PB07, // EPD_CS Chip select
|
||||
|
@ -72,9 +72,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_epaperdisplay_obj_t *display = &allocate_display()->epaper_display;
|
||||
display->base.type = &displayio_epaperdisplay_type;
|
||||
common_hal_displayio_epaperdisplay_construct(display,
|
||||
epaperdisplay_epaperdisplay_obj_t *display = &allocate_display()->epaper_display;
|
||||
display->base.type = &epaperdisplay_epaperdisplay_type;
|
||||
common_hal_epaperdisplay_epaperdisplay_construct(display,
|
||||
bus,
|
||||
start_sequence,
|
||||
sizeof(start_sequence),
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
#include "supervisor/board.h"
|
||||
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -46,13 +46,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_PA23, &pin_PA22, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
NULL, // Command or data
|
||||
&pin_PA19, // Chip select
|
||||
|
@ -61,9 +61,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
96, // Width
|
||||
68, // Height
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
#include "mpconfigboard.h"
|
||||
#include "hal/include/hal_gpio.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
typedef struct {
|
||||
const uint32_t *config_data;
|
||||
|
@ -97,13 +97,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_PA13, &pin_PA15, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_PA16, // TFT_DC Command or data
|
||||
&pin_PA11, // TFT_CS Chip select
|
||||
|
@ -115,9 +115,9 @@ void board_init(void) {
|
|||
uint32_t cfg0 = lookupCfg(CFG_DISPLAY_CFG0, 0x000000);
|
||||
uint32_t offX = (cfg0 >> 8) & 0xff;
|
||||
uint32_t offY = (cfg0 >> 16) & 0xff;
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
160, // Width (after rotation)
|
||||
128, // Height (after rotation)
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "mpconfigboard.h"
|
||||
#include "hal/include/hal_gpio.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "supervisor/shared/board.h"
|
||||
|
@ -68,13 +68,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_PB05, // TFT_DC Command or data
|
||||
&pin_PB07, // TFT_CS Chip select
|
||||
|
@ -83,9 +83,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
160, // Width (after rotation)
|
||||
128, // Height (after rotation)
|
||||
|
|
|
@ -28,12 +28,12 @@
|
|||
#include "mpconfigboard.h"
|
||||
#include "hal/include/hal_gpio.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "supervisor/shared/board.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -70,13 +70,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_PB13, &pin_PB15, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_PB05, // TFT_DC Command or data
|
||||
&pin_PB12, // TFT_CS Chip select
|
||||
|
@ -85,9 +85,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
160, // Width
|
||||
128, // Height
|
||||
|
|
|
@ -61,9 +61,9 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
paralleldisplay_parallelbus_obj_t *bus = &allocate_display_bus()->parallel_bus;
|
||||
bus->base.type = ¶lleldisplay_parallelbus_type;
|
||||
common_hal_paralleldisplay_parallelbus_construct(bus,
|
||||
paralleldisplaybus_parallelbus_obj_t *bus = &allocate_display_bus()->parallel_bus;
|
||||
bus->base.type = ¶lleldisplaybus_parallelbus_type;
|
||||
common_hal_paralleldisplaybus_parallelbus_construct(bus,
|
||||
&pin_PA16, // Data0
|
||||
&pin_PB05, // Command or data
|
||||
&pin_PB06, // Chip select
|
||||
|
@ -72,9 +72,9 @@ void board_init(void) {
|
|||
&pin_PA00, // Reset
|
||||
0); // Frequency
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
320, // Width
|
||||
240, // Height
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "hal/include/hal_gpio.h"
|
||||
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
@ -78,9 +78,9 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
paralleldisplay_parallelbus_obj_t *bus = &allocate_display_bus()->parallel_bus;
|
||||
bus->base.type = ¶lleldisplay_parallelbus_type;
|
||||
common_hal_paralleldisplay_parallelbus_construct(bus,
|
||||
paralleldisplaybus_parallelbus_obj_t *bus = &allocate_display_bus()->parallel_bus;
|
||||
bus->base.type = ¶lleldisplaybus_parallelbus_type;
|
||||
common_hal_paralleldisplaybus_parallelbus_construct(bus,
|
||||
&pin_PA16, // Data0
|
||||
&pin_PB05, // Command or data
|
||||
&pin_PB06, // Chip select
|
||||
|
@ -89,9 +89,9 @@ void board_init(void) {
|
|||
&pin_PA00, // Reset
|
||||
0); // Frequency
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
480, // Width
|
||||
320, // Height
|
||||
|
|
|
@ -28,12 +28,12 @@
|
|||
#include "mpconfigboard.h"
|
||||
#include "hal/include/hal_gpio.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/digitalio/DigitalInOut.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
digitalio_digitalinout_obj_t CTR_5V;
|
||||
digitalio_digitalinout_obj_t CTR_3V3;
|
||||
digitalio_digitalinout_obj_t USB_HOST_ENABLE;
|
||||
|
@ -65,13 +65,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_PB20, &pin_PB19, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_PC06, // TFT_DC Command or data
|
||||
&pin_PB21, // TFT_CS Chip select
|
||||
|
@ -80,9 +80,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
320, // Width
|
||||
240, // Height
|
||||
|
|
|
@ -28,12 +28,12 @@
|
|||
#include "supervisor/board.h"
|
||||
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -70,10 +70,10 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_PA09, // Command or data
|
||||
&pin_PA08, // Chip select
|
||||
|
@ -82,9 +82,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
128, // Width
|
||||
128, // Height
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "shared-bindings/paralleldisplay/ParallelBus.h"
|
||||
#include "shared-bindings/paralleldisplaybus/ParallelBus.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
|||
#include "shared-bindings/digitalio/DigitalInOut.h"
|
||||
#include "shared-bindings/microcontroller/__init__.h"
|
||||
|
||||
void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbus_obj_t *self,
|
||||
void common_hal_paralleldisplaybus_parallelbus_construct(paralleldisplaybus_parallelbus_obj_t *self,
|
||||
const mcu_pin_obj_t *data0, const mcu_pin_obj_t *command, const mcu_pin_obj_t *chip_select,
|
||||
const mcu_pin_obj_t *write, const mcu_pin_obj_t *read, const mcu_pin_obj_t *reset, uint32_t frequency) {
|
||||
|
||||
|
@ -87,7 +87,7 @@ void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbu
|
|||
common_hal_digitalio_digitalinout_construct(&self->reset, reset);
|
||||
common_hal_digitalio_digitalinout_switch_to_output(&self->reset, true, DRIVE_MODE_PUSH_PULL);
|
||||
never_reset_pin_number(reset->number);
|
||||
common_hal_paralleldisplay_parallelbus_reset(self);
|
||||
common_hal_paralleldisplaybus_parallelbus_reset(self);
|
||||
}
|
||||
|
||||
never_reset_pin_number(command->number);
|
||||
|
@ -98,7 +98,7 @@ void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbu
|
|||
}
|
||||
}
|
||||
|
||||
void common_hal_paralleldisplay_parallelbus_deinit(paralleldisplay_parallelbus_obj_t *self) {
|
||||
void common_hal_paralleldisplaybus_parallelbus_deinit(paralleldisplaybus_parallelbus_obj_t *self) {
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
reset_pin_number(self->data0_pin + i);
|
||||
}
|
||||
|
@ -110,8 +110,8 @@ void common_hal_paralleldisplay_parallelbus_deinit(paralleldisplay_parallelbus_o
|
|||
reset_pin_number(self->reset.pin->number);
|
||||
}
|
||||
|
||||
bool common_hal_paralleldisplay_parallelbus_reset(mp_obj_t obj) {
|
||||
paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
bool common_hal_paralleldisplaybus_parallelbus_reset(mp_obj_t obj) {
|
||||
paralleldisplaybus_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
if (self->reset.base.type == &mp_type_NoneType) {
|
||||
return false;
|
||||
}
|
||||
|
@ -122,19 +122,19 @@ bool common_hal_paralleldisplay_parallelbus_reset(mp_obj_t obj) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool common_hal_paralleldisplay_parallelbus_bus_free(mp_obj_t obj) {
|
||||
bool common_hal_paralleldisplaybus_parallelbus_bus_free(mp_obj_t obj) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool common_hal_paralleldisplay_parallelbus_begin_transaction(mp_obj_t obj) {
|
||||
paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
bool common_hal_paralleldisplaybus_parallelbus_begin_transaction(mp_obj_t obj) {
|
||||
paralleldisplaybus_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
common_hal_digitalio_digitalinout_set_value(&self->chip_select, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
void common_hal_paralleldisplay_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type,
|
||||
void common_hal_paralleldisplaybus_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type,
|
||||
display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) {
|
||||
paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
paralleldisplaybus_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
common_hal_digitalio_digitalinout_set_value(&self->command, byte_type == DISPLAY_DATA);
|
||||
uint32_t *clear_write = (uint32_t *)&self->write_group->OUTCLR.reg;
|
||||
uint32_t *set_write = (uint32_t *)&self->write_group->OUTSET.reg;
|
||||
|
@ -146,7 +146,7 @@ void common_hal_paralleldisplay_parallelbus_send(mp_obj_t obj, display_byte_type
|
|||
}
|
||||
}
|
||||
|
||||
void common_hal_paralleldisplay_parallelbus_end_transaction(mp_obj_t obj) {
|
||||
paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
void common_hal_paralleldisplaybus_parallelbus_end_transaction(mp_obj_t obj) {
|
||||
paralleldisplaybus_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
common_hal_digitalio_digitalinout_set_value(&self->chip_select, true);
|
||||
}
|
|
@ -24,8 +24,7 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H
|
||||
#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H
|
||||
#pragma once
|
||||
|
||||
#include "common-hal/digitalio/DigitalInOut.h"
|
||||
|
||||
|
@ -40,6 +39,4 @@ typedef struct {
|
|||
uint8_t data0_pin;
|
||||
PortGroup *write_group;
|
||||
uint32_t write_mask;
|
||||
} paralleldisplay_parallelbus_obj_t;
|
||||
|
||||
#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H
|
||||
} paralleldisplaybus_parallelbus_obj_t;
|
|
@ -0,0 +1,5 @@
|
|||
Broadcom
|
||||
==================
|
||||
|
||||
This port supports running CircuitPython bare-metal on Raspberry Pi single board
|
||||
computers that utilize Broadcom system-on-chips.
|
|
@ -172,7 +172,7 @@ STATIC const framebuffer_p_t videocore_framebuffer_proto = {
|
|||
MP_DEFINE_CONST_OBJ_TYPE(
|
||||
videocore_framebuffer_type,
|
||||
MP_QSTR_Framebuffer,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
|
||||
locals_dict, (mp_obj_dict_t *)&videocore_framebuffer_locals_dict,
|
||||
make_new, videocore_framebuffer_make_new,
|
||||
buffer, common_hal_videocore_framebuffer_get_buffer,
|
||||
|
|
|
@ -11,7 +11,7 @@ CIRCUITPY_COUNTIO = 0
|
|||
CIRCUITPY_FREQUENCYIO = 0
|
||||
CIRCUITPY_I2CTARGET = 0
|
||||
CIRCUITPY_NVM = 0
|
||||
CIRCUITPY_PARALLELDISPLAY = 0
|
||||
CIRCUITPY_PARALLELDISPLAYBUS = 0
|
||||
CIRCUITPY_PULSEIO = 0
|
||||
CIRCUITPY_PWMIO = 0
|
||||
CIRCUITPY_ROTARYIO = 0
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# CircuitPython port to Spresense #
|
||||
# CXD56 (Spresense) #
|
||||
|
||||
This directory contains the port of CircuitPython to Spresense. It is a compact
|
||||
development board based on Sony’s power-efficient multicore microcontroller
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CircuitPython on Espressif SoCs
|
||||
Espressif
|
||||
=======================================
|
||||
|
||||
This port adds the Espressif line of SoCs to CircuitPython.
|
||||
|
@ -10,9 +10,11 @@ Support Status:
|
|||
:header: SoC, Status
|
||||
|
||||
ESP32, "beta"
|
||||
ESP32-H2, "alpha"
|
||||
ESP32-C3, "beta"
|
||||
ESP32-C6, "alpha"
|
||||
ESP32-S2, "stable"
|
||||
ESP32-S3, "beta"
|
||||
ESP32-S3, "stable"
|
||||
|
||||
How this port is organized:
|
||||
---------------------------------------
|
||||
|
|
|
@ -995,7 +995,7 @@ STATIC MP_DEFINE_CONST_DICT(espcamera_camera_locals_dict, espcamera_camera_local
|
|||
MP_DEFINE_CONST_OBJ_TYPE(
|
||||
espcamera_camera_type,
|
||||
MP_QSTR_Camera,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
|
||||
make_new, espcamera_camera_make_new,
|
||||
locals_dict, &espcamera_camera_locals_dict
|
||||
);
|
||||
|
|
|
@ -362,7 +362,7 @@ STATIC mp_obj_t espnow_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
|
|||
MP_DEFINE_CONST_OBJ_TYPE(
|
||||
espnow_type,
|
||||
MP_QSTR_ESPNow,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
|
||||
make_new, espnow_make_new,
|
||||
locals_dict, &espnow_locals_dict,
|
||||
protocol, &espnow_stream_p,
|
||||
|
|
|
@ -225,7 +225,7 @@ STATIC MP_DEFINE_CONST_DICT(espnow_peer_locals_dict, espnow_peer_locals_dict_tab
|
|||
MP_DEFINE_CONST_OBJ_TYPE(
|
||||
espnow_peer_type,
|
||||
MP_QSTR_Peer,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
|
||||
make_new, espnow_peer_make_new,
|
||||
locals_dict, &espnow_peer_locals_dict
|
||||
);
|
||||
|
|
|
@ -175,7 +175,7 @@ STATIC MP_DEFINE_CONST_DICT(espulp_ulp_locals_dict, espulp_ulp_locals_table);
|
|||
MP_DEFINE_CONST_OBJ_TYPE(
|
||||
espulp_ulp_type,
|
||||
MP_QSTR_ULP,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
|
||||
make_new, espulp_ulp_make_new,
|
||||
locals_dict, &espulp_ulp_locals_dict
|
||||
);
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
#include "shared-bindings/displayio/I2CDisplay.h"
|
||||
#include "shared-bindings/i2cdisplaybus/I2CDisplayBus.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/busio/I2C.h"
|
||||
|
@ -59,17 +59,17 @@ void board_init(void) {
|
|||
// common_hal_busio_i2c_construct(i2c, &pin_GPIO23, &pin_GPIO22, 100000, 0);
|
||||
// common_hal_busio_i2c_never_reset(i2c);
|
||||
|
||||
displayio_i2cdisplay_obj_t *bus = &allocate_display_bus()->i2cdisplay_bus;
|
||||
bus->base.type = &displayio_i2cdisplay_type;
|
||||
common_hal_displayio_i2cdisplay_construct(bus,
|
||||
i2cdisplaybus_i2cdisplaybus_obj_t *bus = &allocate_display_bus()->i2cdisplay_bus;
|
||||
bus->base.type = &i2cdisplaybus_i2cdisplaybus_type;
|
||||
common_hal_i2cdisplaybus_i2cdisplaybus_construct(bus,
|
||||
i2c,
|
||||
0x3c,
|
||||
NULL
|
||||
);
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
72, // Width
|
||||
40, // Height
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "mpconfigboard.h"
|
||||
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
@ -38,7 +38,7 @@
|
|||
#include "esp_err.h"
|
||||
#include "driver/i2c.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -116,9 +116,9 @@ static void io_expander_backlight_init(void) {
|
|||
void board_init(void) {
|
||||
io_expander_backlight_init();
|
||||
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_GPIO40, // TFT_DC Command or data
|
||||
&pin_GPIO39, // TFT_CS Chip select
|
||||
|
@ -127,9 +127,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
240, // Width (after rotation)
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
#include "supervisor/board.h"
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -72,10 +72,10 @@ uint8_t display_init_sequence[] = {
|
|||
|
||||
void board_init(void) {
|
||||
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO40, // DC
|
||||
|
@ -85,10 +85,10 @@ void board_init(void) {
|
|||
0, // polarity
|
||||
0 // phase
|
||||
);
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
240, // width (after rotation)
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
#include "supervisor/board.h"
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -72,10 +72,10 @@ uint8_t display_init_sequence[] = {
|
|||
|
||||
void board_init(void) {
|
||||
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO39, // DC
|
||||
|
@ -85,10 +85,10 @@ void board_init(void) {
|
|||
0, // polarity
|
||||
0 // phase
|
||||
);
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
240, // width (after rotation)
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
#include "supervisor/board.h"
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -72,10 +72,10 @@ uint8_t display_init_sequence[] = {
|
|||
|
||||
void board_init(void) {
|
||||
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO40, // DC
|
||||
|
@ -85,10 +85,10 @@ void board_init(void) {
|
|||
0, // polarity
|
||||
0 // phase
|
||||
);
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
240, // width (after rotation)
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
#include "supervisor/board.h"
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -72,10 +72,10 @@ uint8_t display_init_sequence[] = {
|
|||
|
||||
void board_init(void) {
|
||||
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO39, // DC
|
||||
|
@ -85,10 +85,10 @@ void board_init(void) {
|
|||
0, // polarity
|
||||
0 // phase
|
||||
);
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
240, // width (after rotation)
|
||||
|
|
|
@ -6,7 +6,7 @@ USB_MANUFACTURER = "Adafruit"
|
|||
|
||||
IDF_TARGET = esp32s3
|
||||
|
||||
CIRCUITPY_ESP_FLASH_MODE = dio
|
||||
CIRCUITPY_ESP_FLASH_MODE = qio
|
||||
CIRCUITPY_ESP_FLASH_FREQ = 80m
|
||||
CIRCUITPY_ESP_FLASH_SIZE = 4MB
|
||||
|
||||
|
|
|
@ -28,14 +28,14 @@
|
|||
#include "mpconfigboard.h"
|
||||
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
||||
#include "esp_log.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -50,13 +50,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_GPIO36, &pin_GPIO35, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_GPIO39, // TFT_DC Command or data
|
||||
&pin_GPIO40, // TFT_CS Chip select
|
||||
|
@ -65,9 +65,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
240, // Width (after rotation)
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "supervisor/shared/board.h"
|
||||
|
@ -114,13 +114,13 @@ const uint8_t refresh_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_GPIO36, &pin_GPIO35, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_GPIO7, // EPD_DC Command or data
|
||||
&pin_GPIO8, // EPD_CS Chip select
|
||||
|
@ -129,9 +129,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_epaperdisplay_obj_t *display = &allocate_display()->epaper_display;
|
||||
display->base.type = &displayio_epaperdisplay_type;
|
||||
common_hal_displayio_epaperdisplay_construct(
|
||||
epaperdisplay_epaperdisplay_obj_t *display = &allocate_display()->epaper_display;
|
||||
display->base.type = &epaperdisplay_epaperdisplay_type;
|
||||
common_hal_epaperdisplay_epaperdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
display_start_sequence, sizeof(display_start_sequence),
|
||||
|
@ -189,10 +189,10 @@ bool espressif_board_reset_pin_number(gpio_num_t pin_number) {
|
|||
}
|
||||
|
||||
void board_deinit(void) {
|
||||
displayio_epaperdisplay_obj_t *display = &displays[0].epaper_display;
|
||||
if (display->base.type == &displayio_epaperdisplay_type) {
|
||||
epaperdisplay_epaperdisplay_obj_t *display = &displays[0].epaper_display;
|
||||
if (display->base.type == &epaperdisplay_epaperdisplay_type) {
|
||||
size_t i = 0;
|
||||
while (common_hal_displayio_epaperdisplay_get_busy(display)) {
|
||||
while (common_hal_epaperdisplay_epaperdisplay_get_busy(display)) {
|
||||
RUN_BACKGROUND_TASKS;
|
||||
i++;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
||||
|
@ -43,13 +43,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_GPIO7, &pin_GPIO6, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_GPIO4, // TFT_DC Command or data
|
||||
&pin_GPIO5, // TFT_CS Chip select
|
||||
|
@ -58,9 +58,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
320, // Width
|
||||
240, // Height
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
||||
|
@ -44,13 +44,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_GPIO7, &pin_GPIO6, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_GPIO4, // TFT_DC Command or data
|
||||
&pin_GPIO5, // TFT_CS Chip select
|
||||
|
@ -59,9 +59,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
320, // Width
|
||||
240, // Height
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
#include "supervisor/board.h"
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -71,10 +71,10 @@ uint8_t display_init_sequence[] = {
|
|||
|
||||
void board_init(void) {
|
||||
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO43, // DC
|
||||
|
@ -84,10 +84,10 @@ void board_init(void) {
|
|||
0, // polarity
|
||||
0 // phase
|
||||
);
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
240, // width (after rotation)
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
||||
|
@ -71,13 +71,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_GPIO6, &pin_GPIO7, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_GPIO4, // TFT_DC Command or data
|
||||
&pin_GPIO5, // TFT_CS Chip select
|
||||
|
@ -86,9 +86,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
240, // Width
|
||||
240, // Height
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "supervisor/board.h"
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
||||
|
@ -63,13 +63,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_GPIO18, &pin_GPIO23, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_GPIO21, // TFT_DC Command or data
|
||||
&pin_GPIO5, // TFT_CS Chip select
|
||||
|
@ -78,9 +78,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
320, // Width (after rotation)
|
||||
240, // Height (after rotation)
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
#include "supervisor/board.h"
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -72,10 +72,10 @@ uint8_t display_init_sequence[] = {
|
|||
|
||||
void board_init(void) {
|
||||
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO34, // DC
|
||||
|
@ -85,10 +85,10 @@ void board_init(void) {
|
|||
0, // polarity
|
||||
0 // phase
|
||||
);
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
240, // width (after rotation)
|
||||
|
|
|
@ -65,7 +65,7 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
static void display_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
|
||||
common_hal_busio_spi_construct(
|
||||
|
@ -77,9 +77,9 @@ static void display_init(void) {
|
|||
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO35, // DC
|
||||
|
@ -90,10 +90,10 @@ static void display_init(void) {
|
|||
0 // phase
|
||||
);
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
240, // width (after rotation)
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
||||
|
@ -43,13 +43,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_GPIO12, &pin_GPIO11, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_GPIO13, // TFT_DC Command or data
|
||||
&pin_GPIO10, // TFT_CS Chip select
|
||||
|
@ -58,9 +58,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
320, // Width
|
||||
170, // Height
|
||||
|
|
|
@ -65,7 +65,7 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
static void display_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
|
||||
common_hal_busio_spi_construct(
|
||||
|
@ -77,9 +77,9 @@ static void display_init(void) {
|
|||
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO37, // DC
|
||||
|
@ -90,10 +90,10 @@ static void display_init(void) {
|
|||
0 // phase
|
||||
);
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
240, // width (after rotation)
|
||||
|
|
|
@ -45,7 +45,7 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
static void display_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
|
||||
common_hal_busio_spi_construct(
|
||||
|
@ -57,9 +57,9 @@ static void display_init(void) {
|
|||
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO16, // DC
|
||||
|
@ -71,10 +71,10 @@ static void display_init(void) {
|
|||
0 // phase
|
||||
);
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
240, // width (after rotation)
|
||||
|
|
|
@ -48,7 +48,7 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
static void display_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
|
||||
common_hal_busio_spi_construct(
|
||||
|
@ -61,9 +61,9 @@ static void display_init(void) {
|
|||
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO27, // DC
|
||||
|
@ -74,10 +74,10 @@ static void display_init(void) {
|
|||
0 // phase
|
||||
);
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
240, // width (after rotation)
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
#include "shared-bindings/displayio/I2CDisplay.h"
|
||||
#include "shared-bindings/i2cdisplaybus/I2CDisplayBus.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/busio/I2C.h"
|
||||
|
@ -54,17 +54,17 @@ uint8_t display_init_sequence[] = { // SSD1306
|
|||
static void display_init(void) {
|
||||
busio_i2c_obj_t *i2c = common_hal_board_create_i2c(0);
|
||||
|
||||
displayio_i2cdisplay_obj_t *bus = &allocate_display_bus()->i2cdisplay_bus;
|
||||
bus->base.type = &displayio_i2cdisplay_type;
|
||||
common_hal_displayio_i2cdisplay_construct(bus,
|
||||
i2cdisplaybus_i2cdisplaybus_obj_t *bus = &allocate_display_bus()->i2cdisplay_bus;
|
||||
bus->base.type = &i2cdisplaybus_i2cdisplaybus_type;
|
||||
common_hal_i2cdisplaybus_i2cdisplaybus_construct(bus,
|
||||
i2c,
|
||||
0x3c,
|
||||
&pin_GPIO18 // reset
|
||||
);
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
128, // Width
|
||||
32, // Height
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
#include "supervisor/board.h"
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -51,14 +51,14 @@ uint8_t display_init_sequence[] = {
|
|||
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
// busio_spi_obj_t *spi = common_hal_board_create_spi(0);
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_GPIO17, &pin_GPIO21, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO33, // DC
|
||||
|
@ -68,10 +68,10 @@ void board_init(void) {
|
|||
0, // polarity
|
||||
0 // phase
|
||||
);
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
128, // width (after rotation)
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/busio/I2C.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
@ -40,7 +40,7 @@
|
|||
|
||||
#include "../../pmic/axp192/axp192.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
#define PMIC_POWER_SOURCE_USB 0
|
||||
|
@ -333,10 +333,10 @@ static bool pmic_init(busio_i2c_obj_t *i2c) {
|
|||
|
||||
static bool display_init(void) {
|
||||
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO15, // DC
|
||||
|
@ -347,10 +347,10 @@ static bool display_init(void) {
|
|||
0 // phase
|
||||
);
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
320, // width (after rotation)
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
#include "supervisor/board.h"
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
|
||||
// display init sequence according to M5Gfx
|
||||
|
@ -57,10 +57,10 @@ uint8_t display_init_sequence[] = {
|
|||
|
||||
void board_init(void) {
|
||||
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO27, // DC
|
||||
|
@ -71,10 +71,10 @@ void board_init(void) {
|
|||
0 // phase
|
||||
);
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
320, // width (after rotation)
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
#include "supervisor/board.h"
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
|
||||
// display init sequence according to M5Gfx
|
||||
|
@ -57,10 +57,10 @@ uint8_t display_init_sequence[] = {
|
|||
|
||||
void board_init(void) {
|
||||
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO27, // DC
|
||||
|
@ -71,10 +71,10 @@ void board_init(void) {
|
|||
0 // phase
|
||||
);
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
320, // width (after rotation)
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
|
@ -50,9 +50,9 @@ void board_init(void) {
|
|||
// common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
// // Set up the DisplayIO pin object
|
||||
// displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
// bus->base.type = &displayio_fourwire_type;
|
||||
// common_hal_displayio_fourwire_construct(bus,
|
||||
// fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
// bus->base.type = &fourwire_fourwire_type;
|
||||
// common_hal_fourwire_fourwire_construct(bus,
|
||||
// spi,
|
||||
// &pin_GPIO20, // EPD_DC Command or data
|
||||
// &pin_GPIO15, // EPD_CS Chip select
|
||||
|
@ -61,10 +61,10 @@ void board_init(void) {
|
|||
// 0, // Polarity
|
||||
// 0); // Phase
|
||||
|
||||
// displayio_epaperdisplay_obj_t *display = &allocate_display()->epaper_display;
|
||||
// display->base.type = &displayio_epaperdisplay_type;
|
||||
// epaperdisplay_epaperdisplay_obj_t *display = &allocate_display()->epaper_display;
|
||||
// display->base.type = &epaperdisplay_epaperdisplay_type;
|
||||
|
||||
// common_hal_displayio_epaperdisplay_construct(
|
||||
// common_hal_epaperdisplay_epaperdisplay_construct(
|
||||
// display,
|
||||
// bus,
|
||||
// display_start_sequence, sizeof(display_start_sequence),
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/busio/I2C.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
|
@ -165,14 +165,14 @@ static bool pmic_init(busio_i2c_obj_t *i2c) {
|
|||
}
|
||||
|
||||
static bool display_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_GPIO13, &pin_GPIO15, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO23, // DC
|
||||
|
@ -183,10 +183,10 @@ static bool display_init(void) {
|
|||
0 // phase
|
||||
);
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
80, // width (after rotation)
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/busio/I2C.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
|
@ -165,14 +165,14 @@ static bool pmic_init(busio_i2c_obj_t *i2c) {
|
|||
}
|
||||
|
||||
static bool display_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_GPIO13, &pin_GPIO15, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO23, // DC
|
||||
|
@ -183,10 +183,10 @@ static bool display_init(void) {
|
|||
0 // phase
|
||||
);
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
135, // width (after rotation)
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "supervisor/board.h"
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "supervisor/shared/board.h"
|
||||
|
|
|
@ -141,7 +141,7 @@ uint8_t display_init_sequence[] = {
|
|||
void board_init(void) {
|
||||
// Display
|
||||
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
|
||||
common_hal_busio_spi_construct(
|
||||
|
@ -153,9 +153,9 @@ void board_init(void) {
|
|||
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO14, // DC
|
||||
|
@ -166,9 +166,9 @@ void board_init(void) {
|
|||
0 // phase
|
||||
);
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
240, // width (after rotation)
|
||||
|
|
|
@ -64,7 +64,7 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
static void display_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
|
||||
common_hal_busio_spi_construct(
|
||||
|
@ -76,9 +76,9 @@ static void display_init(void) {
|
|||
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO18, // DC
|
||||
|
@ -89,10 +89,10 @@ static void display_init(void) {
|
|||
0 // phase
|
||||
);
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
160, // width (after rotation)
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "shared-bindings/paralleldisplay/ParallelBus.h"
|
||||
#include "shared-bindings/paralleldisplaybus/ParallelBus.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-bindings/digitalio/DigitalInOut.h"
|
||||
#include "shared-bindings/microcontroller/__init__.h"
|
||||
|
@ -43,7 +43,7 @@
|
|||
* - data0 pin must be byte aligned
|
||||
*/
|
||||
|
||||
void common_hal_paralleldisplay_parallelbus_construct_nonsequential(paralleldisplay_parallelbus_obj_t *self,
|
||||
void common_hal_paralleldisplaybus_parallelbus_construct_nonsequential(paralleldisplaybus_parallelbus_obj_t *self,
|
||||
uint8_t n_pins, const mcu_pin_obj_t **data_pins,
|
||||
const mcu_pin_obj_t *command, const mcu_pin_obj_t *chip_select,
|
||||
const mcu_pin_obj_t *write, const mcu_pin_obj_t *read, const mcu_pin_obj_t *reset, uint32_t frequency) {
|
||||
|
@ -111,7 +111,7 @@ void common_hal_paralleldisplay_parallelbus_construct_nonsequential(paralleldisp
|
|||
}
|
||||
|
||||
|
||||
void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbus_obj_t *self,
|
||||
void common_hal_paralleldisplaybus_parallelbus_construct(paralleldisplaybus_parallelbus_obj_t *self,
|
||||
const mcu_pin_obj_t *data0, const mcu_pin_obj_t *command, const mcu_pin_obj_t *chip_select,
|
||||
const mcu_pin_obj_t *write, const mcu_pin_obj_t *read, const mcu_pin_obj_t *reset, uint32_t frequency) {
|
||||
char buf[7];
|
||||
|
@ -121,11 +121,11 @@ void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbu
|
|||
data_pins[i] = validate_obj_is_free_pin(
|
||||
mp_obj_dict_get(MP_OBJ_FROM_PTR(&mcu_pin_globals), mp_obj_new_str(buf, strlen(buf))), MP_QSTR_pin);
|
||||
}
|
||||
common_hal_paralleldisplay_parallelbus_construct_nonsequential(self, 8, data_pins, command, chip_select, write, read, reset, frequency);
|
||||
common_hal_paralleldisplaybus_parallelbus_construct_nonsequential(self, 8, data_pins, command, chip_select, write, read, reset, frequency);
|
||||
}
|
||||
|
||||
|
||||
void common_hal_paralleldisplay_parallelbus_deinit(paralleldisplay_parallelbus_obj_t *self) {
|
||||
void common_hal_paralleldisplaybus_parallelbus_deinit(paralleldisplaybus_parallelbus_obj_t *self) {
|
||||
if (!self->handle) {
|
||||
return;
|
||||
}
|
||||
|
@ -145,9 +145,9 @@ void common_hal_paralleldisplay_parallelbus_deinit(paralleldisplay_parallelbus_o
|
|||
port_i2s_reset_instance(0);
|
||||
}
|
||||
|
||||
bool common_hal_paralleldisplay_parallelbus_reset(mp_obj_t obj) {
|
||||
bool common_hal_paralleldisplaybus_parallelbus_reset(mp_obj_t obj) {
|
||||
/* SNIP - same as from SAMD and NRF ports */
|
||||
paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
paralleldisplaybus_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
if (self->reset_pin_number == NO_PIN) {
|
||||
return false;
|
||||
}
|
||||
|
@ -159,13 +159,13 @@ bool common_hal_paralleldisplay_parallelbus_reset(mp_obj_t obj) {
|
|||
|
||||
}
|
||||
|
||||
bool common_hal_paralleldisplay_parallelbus_bus_free(mp_obj_t obj) {
|
||||
bool common_hal_paralleldisplaybus_parallelbus_bus_free(mp_obj_t obj) {
|
||||
/* SNIP - same as from SAMD and NRF ports */
|
||||
return true;
|
||||
}
|
||||
|
||||
bool common_hal_paralleldisplay_parallelbus_begin_transaction(mp_obj_t obj) {
|
||||
paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
bool common_hal_paralleldisplaybus_parallelbus_begin_transaction(mp_obj_t obj) {
|
||||
paralleldisplaybus_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
bool lock_acquired = false;
|
||||
i2s_lcd_acquire_nonblocking(self->handle, 1, &lock_acquired);
|
||||
if (lock_acquired) {
|
||||
|
@ -174,17 +174,17 @@ bool common_hal_paralleldisplay_parallelbus_begin_transaction(mp_obj_t obj) {
|
|||
return lock_acquired;
|
||||
}
|
||||
|
||||
void common_hal_paralleldisplay_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type,
|
||||
void common_hal_paralleldisplaybus_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type,
|
||||
display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) {
|
||||
paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
paralleldisplaybus_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
if (data_length) {
|
||||
gpio_set_level(self->config.pin_num_rs, byte_type == DISPLAY_DATA);
|
||||
i2s_lcd_write(self->handle, data, data_length);
|
||||
}
|
||||
}
|
||||
|
||||
void common_hal_paralleldisplay_parallelbus_end_transaction(mp_obj_t obj) {
|
||||
paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
void common_hal_paralleldisplaybus_parallelbus_end_transaction(mp_obj_t obj) {
|
||||
paralleldisplaybus_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
i2s_lcd_release(self->handle);
|
||||
gpio_set_level(self->config.pin_num_cs, true);
|
||||
}
|
|
@ -24,8 +24,7 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H
|
||||
#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H
|
||||
#pragma once
|
||||
|
||||
#include "common-hal/digitalio/DigitalInOut.h"
|
||||
#include "i2s_lcd_driver.h"
|
||||
|
@ -36,6 +35,4 @@ typedef struct {
|
|||
gpio_num_t reset_pin_number;
|
||||
i2s_lcd_config_t config;
|
||||
i2s_lcd_handle_t handle;
|
||||
} paralleldisplay_parallelbus_obj_t;
|
||||
|
||||
#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H
|
||||
} paralleldisplaybus_parallelbus_obj_t;
|
|
@ -37,7 +37,7 @@ CIRCUITPY_IMAGECAPTURE = 0
|
|||
CIRCUITPY_MEMORYMAP ?= 1
|
||||
CIRCUITPY_NVM ?= 1
|
||||
# Turn off because it uses the old I2S driver which conflicts with the new ADC driver.
|
||||
CIRCUITPY_PARALLELDISPLAY ?= 0
|
||||
CIRCUITPY_PARALLELDISPLAYBUS ?= 0
|
||||
CIRCUITPY_PS2IO ?= 1
|
||||
CIRCUITPY_RGBMATRIX ?= 1
|
||||
CIRCUITPY_ROTARYIO ?= 1
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# CircuitPython Port To The NXP i.MX RT10xx Series
|
||||
# NXP i.MX RT10xx Series
|
||||
|
||||
This is a port of CircuitPython to the i.MX RT10xx series of chips.
|
||||
|
|
|
@ -24,7 +24,7 @@ CIRCUITPY_COUNTIO = 0
|
|||
CIRCUITPY_FREQUENCYIO = 0
|
||||
CIRCUITPY_I2CTARGET = 0
|
||||
CIRCUITPY_NVM = 0
|
||||
CIRCUITPY_PARALLELDISPLAY = 0
|
||||
CIRCUITPY_PARALLELDISPLAYBUS = 0
|
||||
CIRCUITPY_PULSEIO = 0
|
||||
CIRCUITPY_ROTARYIO = 1
|
||||
CIRCUITPY_ROTARYIO_SOFTENCODER = 1
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# CircuitPython Port To The Nordic Semiconductor nRF52 Series
|
||||
# Nordic Semiconductor nRF52 Series
|
||||
|
||||
This is a port of CircuitPython to the Nordic Semiconductor nRF52 series of chips.
|
||||
|
||||
|
|
|
@ -28,11 +28,11 @@
|
|||
#include "mpconfigboard.h"
|
||||
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -47,13 +47,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_P0_14, &pin_P0_15, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_P0_13, // TFT_DC Command or data
|
||||
&pin_P0_12, // TFT_CS Chip select
|
||||
|
@ -62,9 +62,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
240, // Width (after rotation)
|
||||
240, // Height (after rotation)
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "mpconfigboard.h"
|
||||
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/framebufferio/FramebufferDisplay.h"
|
||||
#include "shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
|
|
|
@ -28,11 +28,11 @@
|
|||
#include "mpconfigboard.h"
|
||||
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -47,13 +47,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_P0_07, &pin_P1_08, NULL, false); // SCK, MOSI, MISO, not half-duplex
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_P0_27, // TFT_DC Command or data
|
||||
&pin_P0_05, // TFT_CS Chip select
|
||||
|
@ -63,9 +63,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
240, // Width (after rotation)
|
||||
240, // Height (after rotation)
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
#include "mpconfigboard.h"
|
||||
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -48,13 +48,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_P0_11, &pin_P0_12, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_P0_08, // TFT_DC Command or data
|
||||
&pin_P0_06, // TFT_CS Chip select
|
||||
|
@ -63,9 +63,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
240, // Width (after rotation)
|
||||
240, // Height (after rotation)
|
||||
|
|
|
@ -28,11 +28,11 @@
|
|||
#include "mpconfigboard.h"
|
||||
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -47,13 +47,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_P0_11, &pin_P0_12, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_P0_08, // TFT_DC Command or data
|
||||
&pin_P0_14, // TFT_CS Chip select
|
||||
|
@ -62,9 +62,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
240, // Width (after rotation)
|
||||
240, // Height (after rotation)
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "shared-bindings/paralleldisplay/ParallelBus.h"
|
||||
#include "shared-bindings/paralleldisplaybus/ParallelBus.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
|||
#include "shared-bindings/digitalio/DigitalInOut.h"
|
||||
#include "shared-bindings/microcontroller/__init__.h"
|
||||
|
||||
void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbus_obj_t *self,
|
||||
void common_hal_paralleldisplaybus_parallelbus_construct(paralleldisplaybus_parallelbus_obj_t *self,
|
||||
const mcu_pin_obj_t *data0, const mcu_pin_obj_t *command, const mcu_pin_obj_t *chip_select,
|
||||
const mcu_pin_obj_t *write, const mcu_pin_obj_t *read, const mcu_pin_obj_t *reset, uint32_t frequency) {
|
||||
|
||||
|
@ -94,7 +94,7 @@ void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbu
|
|||
common_hal_digitalio_digitalinout_construct(&self->reset, reset);
|
||||
common_hal_digitalio_digitalinout_switch_to_output(&self->reset, true, DRIVE_MODE_PUSH_PULL);
|
||||
never_reset_pin_number(reset->number);
|
||||
common_hal_paralleldisplay_parallelbus_reset(self);
|
||||
common_hal_paralleldisplaybus_parallelbus_reset(self);
|
||||
}
|
||||
|
||||
never_reset_pin_number(command->number);
|
||||
|
@ -106,7 +106,7 @@ void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbu
|
|||
}
|
||||
}
|
||||
|
||||
void common_hal_paralleldisplay_parallelbus_deinit(paralleldisplay_parallelbus_obj_t *self) {
|
||||
void common_hal_paralleldisplaybus_parallelbus_deinit(paralleldisplaybus_parallelbus_obj_t *self) {
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
reset_pin_number(self->data0_pin + i);
|
||||
}
|
||||
|
@ -118,8 +118,8 @@ void common_hal_paralleldisplay_parallelbus_deinit(paralleldisplay_parallelbus_o
|
|||
reset_pin_number(self->reset.pin->number);
|
||||
}
|
||||
|
||||
bool common_hal_paralleldisplay_parallelbus_reset(mp_obj_t obj) {
|
||||
paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
bool common_hal_paralleldisplaybus_parallelbus_reset(mp_obj_t obj) {
|
||||
paralleldisplaybus_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
if (self->reset.base.type == &mp_type_NoneType) {
|
||||
return false;
|
||||
}
|
||||
|
@ -130,20 +130,20 @@ bool common_hal_paralleldisplay_parallelbus_reset(mp_obj_t obj) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool common_hal_paralleldisplay_parallelbus_bus_free(mp_obj_t obj) {
|
||||
bool common_hal_paralleldisplaybus_parallelbus_bus_free(mp_obj_t obj) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool common_hal_paralleldisplay_parallelbus_begin_transaction(mp_obj_t obj) {
|
||||
paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
bool common_hal_paralleldisplaybus_parallelbus_begin_transaction(mp_obj_t obj) {
|
||||
paralleldisplaybus_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
common_hal_digitalio_digitalinout_set_value(&self->chip_select, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
// This ignores chip_select behaviour because data is clocked in by the write line toggling.
|
||||
void common_hal_paralleldisplay_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type,
|
||||
void common_hal_paralleldisplaybus_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type,
|
||||
display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) {
|
||||
paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
paralleldisplaybus_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
common_hal_digitalio_digitalinout_set_value(&self->command, byte_type == DISPLAY_DATA);
|
||||
uint32_t *clear_write = (uint32_t *)&self->write_group->OUTCLR;
|
||||
uint32_t *set_write = (uint32_t *)&self->write_group->OUTSET;
|
||||
|
@ -155,7 +155,7 @@ void common_hal_paralleldisplay_parallelbus_send(mp_obj_t obj, display_byte_type
|
|||
}
|
||||
}
|
||||
|
||||
void common_hal_paralleldisplay_parallelbus_end_transaction(mp_obj_t obj) {
|
||||
paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
void common_hal_paralleldisplaybus_parallelbus_end_transaction(mp_obj_t obj) {
|
||||
paralleldisplaybus_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
common_hal_digitalio_digitalinout_set_value(&self->chip_select, true);
|
||||
}
|
|
@ -24,8 +24,7 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H
|
||||
#define MICROPY_INCLUDED_NRF_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H
|
||||
#pragma once
|
||||
|
||||
#include "common-hal/digitalio/DigitalInOut.h"
|
||||
|
||||
|
@ -40,6 +39,4 @@ typedef struct {
|
|||
uint8_t data0_pin;
|
||||
NRF_GPIO_Type *write_group;
|
||||
uint32_t write_mask;
|
||||
} paralleldisplay_parallelbus_obj_t;
|
||||
|
||||
#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H
|
||||
} paralleldisplaybus_parallelbus_obj_t;
|
|
@ -15,4 +15,6 @@ Port Specific modules
|
|||
---------------------
|
||||
|
||||
.. toctree::
|
||||
../../shared-bindings/cyw43/index
|
||||
../../shared-bindings/picodvi/index
|
||||
../../shared-bindings/rp2pio/index
|
||||
|
|
|
@ -251,7 +251,7 @@ STATIC const framebuffer_p_t picodvi_framebuffer_proto = {
|
|||
MP_DEFINE_CONST_OBJ_TYPE(
|
||||
picodvi_framebuffer_type,
|
||||
MP_QSTR_Framebuffer,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
|
||||
locals_dict, &picodvi_framebuffer_locals_dict,
|
||||
make_new, picodvi_framebuffer_make_new,
|
||||
buffer, common_hal_picodvi_framebuffer_get_buffer,
|
||||
|
|
|
@ -862,7 +862,7 @@ STATIC MP_DEFINE_CONST_DICT(rp2pio_statemachine_locals_dict, rp2pio_statemachine
|
|||
MP_DEFINE_CONST_OBJ_TYPE(
|
||||
rp2pio_statemachine_type,
|
||||
MP_QSTR_StateMachine,
|
||||
MP_TYPE_FLAG_NONE,
|
||||
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
|
||||
make_new, rp2pio_statemachine_make_new,
|
||||
locals_dict, &rp2pio_statemachine_locals_dict
|
||||
);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
*/
|
||||
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
|
@ -34,7 +34,7 @@
|
|||
#include "supervisor/board.h"
|
||||
#include "supervisor/shared/board.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -59,13 +59,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_GPIO26, &pin_GPIO27, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_GPIO24, // Command or data
|
||||
&pin_GPIO22, // Chip select
|
||||
|
@ -74,9 +74,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
128, // Width
|
||||
64, // Height
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
#include "supervisor/board.h"
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "supervisor/shared/board.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
// display init sequence from CircuitPython library https://github.com/adafruit/Adafruit_CircuitPython_ST7735R/blob/dfae353330cf051d1f31db9e4b681c8d70900cc5/adafruit_st7735r.py
|
||||
uint8_t display_init_sequence[] = {
|
||||
|
@ -78,13 +78,13 @@ uint8_t display_init_sequence[] = {
|
|||
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_GPIO18, &pin_GPIO19, &pin_GPIO16, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_GPIO22, // DC
|
||||
&pin_GPIO20, // CS
|
||||
|
@ -93,9 +93,9 @@ void board_init(void) {
|
|||
0,
|
||||
0);
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
160, // Width
|
||||
128, // Height
|
||||
|
|
|
@ -66,7 +66,7 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
static void display_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
|
||||
common_hal_busio_spi_construct(
|
||||
|
@ -78,9 +78,9 @@ static void display_init(void) {
|
|||
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO1, // DC
|
||||
|
@ -91,10 +91,10 @@ static void display_init(void) {
|
|||
0 // phase
|
||||
);
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
|
||||
common_hal_displayio_display_construct(
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
240, // width (after rotation)
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
#include "supervisor/board.h"
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "supervisor/shared/board.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -64,13 +64,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_GPIO18, &pin_GPIO19, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_GPIO17, // TFT_DC Command or data
|
||||
&pin_GPIO21, // TFT_CS Chip select
|
||||
|
@ -79,9 +79,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
320, // Width
|
||||
240, // Height
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "supervisor/shared/board.h"
|
||||
|
@ -274,14 +274,14 @@ void board_init(void) {
|
|||
common_hal_digitalio_digitalinout_never_reset(&enable_pin_obj);
|
||||
|
||||
// Set up the SPI object used to control the display
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_GPIO18, &pin_GPIO19, &pin_GPIO16, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
// Set up the DisplayIO pin object
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_GPIO20, // EPD_DC Command or data
|
||||
&pin_GPIO17, // EPD_CS Chip select
|
||||
|
@ -291,9 +291,9 @@ void board_init(void) {
|
|||
0); // Phase
|
||||
|
||||
// Set up the DisplayIO epaper object
|
||||
displayio_epaperdisplay_obj_t *display = &allocate_display()->epaper_display;
|
||||
display->base.type = &displayio_epaperdisplay_type;
|
||||
common_hal_displayio_epaperdisplay_construct(
|
||||
epaperdisplay_epaperdisplay_obj_t *display = &allocate_display()->epaper_display;
|
||||
display->base.type = &epaperdisplay_epaperdisplay_type;
|
||||
common_hal_epaperdisplay_epaperdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
display_start_sequence, sizeof(display_start_sequence),
|
||||
|
@ -328,9 +328,9 @@ void board_init(void) {
|
|||
}
|
||||
|
||||
void board_deinit(void) {
|
||||
displayio_epaperdisplay_obj_t *display = &displays[0].epaper_display;
|
||||
if (display->base.type == &displayio_epaperdisplay_type) {
|
||||
while (common_hal_displayio_epaperdisplay_get_busy(display)) {
|
||||
epaperdisplay_epaperdisplay_obj_t *display = &displays[0].epaper_display;
|
||||
if (display->base.type == &epaperdisplay_epaperdisplay_type) {
|
||||
while (common_hal_epaperdisplay_epaperdisplay_get_busy(display)) {
|
||||
RUN_BACKGROUND_TASKS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
|
@ -279,9 +279,9 @@ void board_init(void) {
|
|||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
// Set up the DisplayIO pin object
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_GPIO20, // EPD_DC Command or data
|
||||
&pin_GPIO17, // EPD_CS Chip select
|
||||
|
@ -291,9 +291,9 @@ void board_init(void) {
|
|||
0); // Phase
|
||||
|
||||
// Set up the DisplayIO epaper object
|
||||
displayio_epaperdisplay_obj_t *display = &allocate_display()->epaper_display;
|
||||
display->base.type = &displayio_epaperdisplay_type;
|
||||
common_hal_displayio_epaperdisplay_construct(
|
||||
epaperdisplay_epaperdisplay_obj_t *display = &allocate_display()->epaper_display;
|
||||
display->base.type = &epaperdisplay_epaperdisplay_type;
|
||||
common_hal_epaperdisplay_epaperdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
display_start_sequence, sizeof(display_start_sequence),
|
||||
|
@ -328,9 +328,9 @@ void board_init(void) {
|
|||
}
|
||||
|
||||
void board_deinit(void) {
|
||||
displayio_epaperdisplay_obj_t *display = &displays[0].epaper_display;
|
||||
if (display->base.type == &displayio_epaperdisplay_type) {
|
||||
while (common_hal_displayio_epaperdisplay_get_busy(display)) {
|
||||
epaperdisplay_epaperdisplay_obj_t *display = &displays[0].epaper_display;
|
||||
if (display->base.type == &epaperdisplay_epaperdisplay_type) {
|
||||
while (common_hal_epaperdisplay_epaperdisplay_get_busy(display)) {
|
||||
RUN_BACKGROUND_TASKS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-bindings/board/__init__.h"
|
||||
|
@ -62,11 +62,11 @@ const uint8_t refresh_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_GPIO28, // EPD_DC Command or data
|
||||
&pin_GPIO17, // EPD_CS Chip select
|
||||
|
@ -75,9 +75,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_epaperdisplay_obj_t *display = &allocate_display()->epaper_display;
|
||||
display->base.type = &displayio_epaperdisplay_type;
|
||||
common_hal_displayio_epaperdisplay_construct(
|
||||
epaperdisplay_epaperdisplay_obj_t *display = &allocate_display()->epaper_display;
|
||||
display->base.type = &epaperdisplay_epaperdisplay_type;
|
||||
common_hal_epaperdisplay_epaperdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
display_start_sequence, sizeof(display_start_sequence),
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
#include "supervisor/board.h"
|
||||
#include "mpconfigboard.h"
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
#include "supervisor/shared/board.h"
|
||||
|
||||
displayio_fourwire_obj_t board_display_obj;
|
||||
fourwire_fourwire_obj_t board_display_obj;
|
||||
|
||||
#define DELAY 0x80
|
||||
|
||||
|
@ -64,13 +64,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_GPIO6, &pin_GPIO7, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_GPIO9, // TFT_DC Command or data
|
||||
&pin_GPIO5, // TFT_CS Chip select
|
||||
|
@ -79,9 +79,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
240, // Width
|
||||
240, // Height
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h"
|
||||
|
||||
#include "shared-bindings/busio/SPI.h"
|
||||
#include "shared-bindings/displayio/FourWire.h"
|
||||
#include "shared-bindings/fourwire/FourWire.h"
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#include "shared-module/displayio/mipi_constants.h"
|
||||
|
||||
|
@ -64,13 +64,13 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(spi, &pin_GPIO2, &pin_GPIO3, NULL, false);
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
spi,
|
||||
&pin_GPIO4, // TFT_DC Command or data
|
||||
&pin_GPIO5, // TFT_CS Chip select
|
||||
|
@ -79,9 +79,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
320, // Width (after rotation)
|
||||
240, // Height (after rotation)
|
||||
|
|
|
@ -63,7 +63,7 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
static void display_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
busio_spi_obj_t *spi = &bus->inline_bus;
|
||||
common_hal_busio_spi_construct(
|
||||
spi,
|
||||
|
@ -75,9 +75,9 @@ static void display_init(void) {
|
|||
|
||||
common_hal_busio_spi_never_reset(spi);
|
||||
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
|
||||
common_hal_displayio_fourwire_construct(
|
||||
common_hal_fourwire_fourwire_construct(
|
||||
bus,
|
||||
spi,
|
||||
&pin_GPIO8, // DC
|
||||
|
@ -88,9 +88,9 @@ static void display_init(void) {
|
|||
0 // phase
|
||||
);
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(
|
||||
display,
|
||||
bus,
|
||||
160, // width (after rotation)
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "shared-bindings/paralleldisplay/ParallelBus.h"
|
||||
#include "shared-bindings/paralleldisplaybus/ParallelBus.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
@ -43,7 +43,7 @@ static const uint16_t parallel_program[] = {
|
|||
// .wrap
|
||||
};
|
||||
|
||||
void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbus_obj_t *self,
|
||||
void common_hal_paralleldisplaybus_parallelbus_construct(paralleldisplaybus_parallelbus_obj_t *self,
|
||||
const mcu_pin_obj_t *data0, const mcu_pin_obj_t *command, const mcu_pin_obj_t *chip_select,
|
||||
const mcu_pin_obj_t *write, const mcu_pin_obj_t *read, const mcu_pin_obj_t *reset, uint32_t frequency) {
|
||||
|
||||
|
@ -84,7 +84,7 @@ void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbu
|
|||
common_hal_digitalio_digitalinout_construct(&self->reset, reset);
|
||||
common_hal_digitalio_digitalinout_switch_to_output(&self->reset, true, DRIVE_MODE_PUSH_PULL);
|
||||
never_reset_pin_number(reset->number);
|
||||
common_hal_paralleldisplay_parallelbus_reset(self);
|
||||
common_hal_paralleldisplaybus_parallelbus_reset(self);
|
||||
}
|
||||
|
||||
never_reset_pin_number(command->number);
|
||||
|
@ -117,7 +117,7 @@ void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbu
|
|||
common_hal_rp2pio_statemachine_never_reset(&self->state_machine);
|
||||
}
|
||||
|
||||
void common_hal_paralleldisplay_parallelbus_deinit(paralleldisplay_parallelbus_obj_t *self) {
|
||||
void common_hal_paralleldisplaybus_parallelbus_deinit(paralleldisplaybus_parallelbus_obj_t *self) {
|
||||
common_hal_rp2pio_statemachine_deinit(&self->state_machine);
|
||||
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
|
@ -135,8 +135,8 @@ void common_hal_paralleldisplay_parallelbus_deinit(paralleldisplay_parallelbus_o
|
|||
}
|
||||
}
|
||||
|
||||
bool common_hal_paralleldisplay_parallelbus_reset(mp_obj_t obj) {
|
||||
paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
bool common_hal_paralleldisplaybus_parallelbus_reset(mp_obj_t obj) {
|
||||
paralleldisplaybus_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
if (self->reset.base.type == &mp_type_NoneType) {
|
||||
return false;
|
||||
}
|
||||
|
@ -147,26 +147,26 @@ bool common_hal_paralleldisplay_parallelbus_reset(mp_obj_t obj) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool common_hal_paralleldisplay_parallelbus_bus_free(mp_obj_t obj) {
|
||||
bool common_hal_paralleldisplaybus_parallelbus_bus_free(mp_obj_t obj) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool common_hal_paralleldisplay_parallelbus_begin_transaction(mp_obj_t obj) {
|
||||
paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
bool common_hal_paralleldisplaybus_parallelbus_begin_transaction(mp_obj_t obj) {
|
||||
paralleldisplaybus_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
common_hal_digitalio_digitalinout_set_value(&self->chip_select, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
void common_hal_paralleldisplay_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type,
|
||||
void common_hal_paralleldisplaybus_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type,
|
||||
display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) {
|
||||
|
||||
paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
paralleldisplaybus_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
|
||||
common_hal_digitalio_digitalinout_set_value(&self->command, byte_type == DISPLAY_DATA);
|
||||
common_hal_rp2pio_statemachine_write(&self->state_machine, data, data_length, 1, false);
|
||||
}
|
||||
|
||||
void common_hal_paralleldisplay_parallelbus_end_transaction(mp_obj_t obj) {
|
||||
paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
void common_hal_paralleldisplaybus_parallelbus_end_transaction(mp_obj_t obj) {
|
||||
paralleldisplaybus_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj);
|
||||
common_hal_digitalio_digitalinout_set_value(&self->chip_select, true);
|
||||
}
|
|
@ -24,8 +24,7 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H
|
||||
#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H
|
||||
#pragma once
|
||||
|
||||
#include "common-hal/digitalio/DigitalInOut.h"
|
||||
#include "bindings/rp2pio/StateMachine.h"
|
||||
|
@ -40,6 +39,4 @@ typedef struct {
|
|||
uint8_t write;
|
||||
uint8_t data0_pin;
|
||||
rp2pio_statemachine_obj_t state_machine;
|
||||
} paralleldisplay_parallelbus_obj_t;
|
||||
|
||||
#endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H
|
||||
} paralleldisplaybus_parallelbus_obj_t;
|
|
@ -1,4 +1,4 @@
|
|||
# CircuitPython on EFR32 #
|
||||
# Silicon Labs EFR32 #
|
||||
|
||||
![GitHub](https://img.shields.io/badge/Technology-Bluetooth_BLE-green)
|
||||
![GitHub](https://img.shields.io/badge/CircuitPython-8.1.0--beta.0-green)
|
||||
|
@ -84,11 +84,11 @@ Flash the project by using [Simplicity Commander](https://community.silabs.com/s
|
|||
|
||||
### Connecting to the Serial Console ###
|
||||
|
||||
Connect the devkit to the PC via the USB cable. The board uses serial for REPL access and debugging because the EFR32 chips has no USB support.
|
||||
Connect the devkit to the PC via the USB cable. The board uses serial for REPL access and debugging because the EFR32 chips has no USB support.
|
||||
|
||||
#### Windows ####
|
||||
|
||||
On Windows, we need to install a serial console e.g., PuTTY, MobaXterm. The JLink CDC UART Port can be found in the Device Manager.
|
||||
On Windows, we need to install a serial console e.g., PuTTY, MobaXterm. The JLink CDC UART Port can be found in the Device Manager.
|
||||
|
||||
#### Linux ####
|
||||
|
||||
|
@ -96,17 +96,17 @@ Open a terminal and issue the following command:
|
|||
|
||||
ls /dev/ttyACM*
|
||||
|
||||
Then note down the correct name and substitute com-port-name in the following command with it:
|
||||
Then note down the correct name and substitute `com-port-name` in the following command with it:
|
||||
|
||||
screen /dev/'com-port-name'
|
||||
|
||||
### Using the REPL prompt ###
|
||||
|
||||
After flashing the firmware to the board, at your first connecting to the board, you might see a blank screen. Press enter and you should be presented with a Circuitpython prompt, >>>. If not, try to reset the board (see instructions below).
|
||||
After flashing the firmware to the board, at your first connecting to the board, you might see a blank screen. Press enter and you should be presented with a Circuitpython prompt,`>>>`. If not, try to reset the board (see instructions below).
|
||||
|
||||
You can now type in simple commands such as:
|
||||
|
||||
>>> print("Hello world!")
|
||||
>>> print("Hello world!")
|
||||
Hello world!
|
||||
|
||||
If something goes wrong with the board, you can reset it. Pressing CTRL+D when the prompt is open performs a soft reset.
|
||||
|
@ -119,13 +119,13 @@ Config serial: Tools > Options > Interpreter > Select MicroPython > Select Port
|
|||
|
||||
### Running CircuitPython scripts ###
|
||||
|
||||
At the boot stage, two scripts will be run (if not booting in safe mode). First, the file boot.py will be executed. The file **boot.py** can be used to perform the initial setup. Then, after boot.py has been completed, the file **code.py** will be executed.
|
||||
At the boot stage, two scripts will be run (if not booting in safe mode). First, the file `boot.py` will be executed. The file `boot.py` can be used to perform the initial setup. Then, after `boot.py` has been completed, the file `code.py` will be executed.
|
||||
|
||||
After code.py has finished executing, a REPL prompt will be presented on the serial port. Other files can also be executed by using the **Thonny** editors or using **Ampy** tool.
|
||||
After code.py has finished executing, a REPL prompt will be presented on the serial port. Other files can also be executed by using the **Thonny** editors or using **Ampy** tool.
|
||||
|
||||
![Thonny](./res/Thonny.png)
|
||||
|
||||
With the boards which support USB mass storage, we can drag the files to the board file system. However, because the EFR32 boards don’t support USB mass storage, we need to use a tool like **Ampy** to copy the file to the board. You can use the latest version of **Ampy** and its command to copy the module directories to the board.
|
||||
With the boards which support USB mass storage, we can drag the files to the board file system. However, because the EFR32 boards don’t support USB mass storage, we need to use a tool like **Ampy** to copy the file to the board. You can use the latest version of **Ampy** and its command to copy the module directories to the board.
|
||||
|
||||
Refer to the guide below for installing the **Ampy** tool:
|
||||
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013-2022 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.
|
|
@ -1,6 +1,6 @@
|
|||
LONGINT_IMPL ?= MPZ
|
||||
INTERNAL_LIBM ?= 1
|
||||
USB_NUM_ENDPOINT_PAIRS ?= 0
|
||||
USB_NUM_ENDPOINT_PAIRS = 0
|
||||
|
||||
CIRCUITPY_ANALOGIO ?= 1
|
||||
CIRCUITPY_BLEIO ?= 1
|
||||
|
@ -27,11 +27,11 @@ ifeq ($(MCU_SERIES),MG24)
|
|||
CIRCUITPY_I2CTARGET ?= 0
|
||||
CIRCUITPY_KEYPAD ?= 0
|
||||
CIRCUITPY_NEOPIXEL_WRITE ?= 0
|
||||
CIRCUITPY_PARALLELDISPLAY ?= 0
|
||||
CIRCUITPY_PARALLELDISPLAYBUS ?= 0
|
||||
CIRCUITPY_PULSEIO ?= 0
|
||||
CIRCUITPY_ROTARYIO ?= 0
|
||||
CIRCUITPY_TOUCHIO ?= 0
|
||||
CIRCUITPY_USB ?= 0
|
||||
CIRCUITPY_USB = 0
|
||||
endif
|
||||
|
||||
CIRCUITPY_BUILD_EXTENSIONS ?= bin
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Circuitpython on STM32 #
|
||||
# ST Microelectronics STM32 #
|
||||
|
||||
This port brings the ST Microelectronics STM32 series of MCUs to Circuitpython. STM32 chips have a wide range of capability, from <$1 low power STM32F0s to dual-core STM32H7s running at 400+ MHz. Currently, only the F4, F7, and H7 families are supported, powered by the ARM Cortex M4 and M7 processors.
|
||||
|
||||
|
|
|
@ -70,10 +70,10 @@ uint8_t display_init_sequence[] = {
|
|||
};
|
||||
|
||||
void board_init(void) {
|
||||
displayio_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &displayio_fourwire_type;
|
||||
fourwire_fourwire_obj_t *bus = &allocate_display_bus()->fourwire_bus;
|
||||
bus->base.type = &fourwire_fourwire_type;
|
||||
busio_spi_obj_t *internal_spi = &supervisor_flash_spi_bus;
|
||||
common_hal_displayio_fourwire_construct(bus,
|
||||
common_hal_fourwire_fourwire_construct(bus,
|
||||
internal_spi,
|
||||
&pin_PA08, // Command or data
|
||||
&pin_PB12, // Chip select
|
||||
|
@ -82,9 +82,9 @@ void board_init(void) {
|
|||
0, // Polarity
|
||||
0); // Phase
|
||||
|
||||
displayio_display_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &displayio_display_type;
|
||||
common_hal_displayio_display_construct(display,
|
||||
busdisplay_busdisplay_obj_t *display = &allocate_display()->display;
|
||||
display->base.type = &busdisplay_busdisplay_type;
|
||||
common_hal_busdisplay_busdisplay_construct(display,
|
||||
bus,
|
||||
160, // Width
|
||||
128, // Height
|
||||
|
|
|
@ -87,5 +87,5 @@ ifeq ($(MCU_SERIES),L4)
|
|||
UF2_FAMILY_ID ?= 0x00ff6919
|
||||
endif
|
||||
|
||||
CIRCUITPY_PARALLELDISPLAY := 0
|
||||
CIRCUITPY_PARALLELDISPLAYBUS := 0
|
||||
CIRCUITPY_BUILD_EXTENSIONS ?= bin
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
The Unix version
|
||||
----------------
|
||||
================
|
||||
|
||||
The "unix" port requires a standard Unix-like environment with gcc and GNU
|
||||
make. This includes Linux, BSD, macOS, and Windows Subsystem for Linux. The
|
||||
|
@ -46,7 +46,7 @@ Browse available modules at
|
|||
for more information about `mip`.
|
||||
|
||||
External dependencies
|
||||
---------------------
|
||||
=====================
|
||||
|
||||
The `libffi` library and `pkg-config` tool are required. On Debian/Ubuntu/Mint
|
||||
derivative Linux distros, install `build-essential`(includes toolchain and
|
||||
|
|
|
@ -593,6 +593,9 @@ MP_NOINLINE int main_(int argc, char **argv) {
|
|||
MP_DECLARE_CONST_FUN_OBJ_0(extra_cpp_coverage_obj);
|
||||
mp_store_global(MP_QSTR_extra_coverage, MP_OBJ_FROM_PTR(&extra_coverage_obj));
|
||||
mp_store_global(MP_QSTR_extra_cpp_coverage, MP_OBJ_FROM_PTR(&extra_cpp_coverage_obj));
|
||||
// CIRCUITPY-CHANGE: test native base classes work as needed by CircuitPython libraries.
|
||||
extern const mp_obj_type_t native_base_class_type;
|
||||
mp_store_global(MP_QSTR_NativeBaseClass, MP_OBJ_FROM_PTR(&native_base_class_type));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
#include "py/obj.h"
|
||||
#include "py/objproperty.h"
|
||||
#include "py/objtype.h"
|
||||
#include "py/runtime.h"
|
||||
|
||||
#if defined(MICROPY_UNIX_COVERAGE)
|
||||
|
||||
// This is a native base class that is used in tests.
|
||||
|
||||
typedef struct {
|
||||
mp_obj_base_t base;
|
||||
mp_obj_t test;
|
||||
} native_base_class_obj_t;
|
||||
|
||||
const mp_obj_type_t native_base_class_type;
|
||||
|
||||
STATIC mp_obj_t native_base_class_make_new(const mp_obj_type_t *type, size_t n_args,
|
||||
size_t n_kw, const mp_obj_t *all_args) {
|
||||
enum { ARG_test };
|
||||
static const mp_arg_t allowed_args[] = {
|
||||
{ MP_QSTR_test, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} },
|
||||
};
|
||||
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
|
||||
mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
|
||||
|
||||
native_base_class_obj_t *self = mp_obj_malloc(native_base_class_obj_t, &native_base_class_type);
|
||||
self->test = args[ARG_test].u_obj;
|
||||
return MP_OBJ_FROM_PTR(self);
|
||||
}
|
||||
|
||||
// Helper to ensure we have the native super class instead of a subclass.
|
||||
static native_base_class_obj_t *native_base(mp_obj_t unknown_obj) {
|
||||
mp_obj_t native_obj = mp_obj_cast_to_native_base(unknown_obj, &native_base_class_type);
|
||||
mp_obj_assert_native_inited(native_obj);
|
||||
return MP_OBJ_TO_PTR(native_obj);
|
||||
}
|
||||
|
||||
STATIC mp_obj_t native_base_class_obj_get_test(mp_obj_t self_in) {
|
||||
native_base_class_obj_t *self = native_base(self_in);
|
||||
return self->test;
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(native_base_class_get_test_obj, native_base_class_obj_get_test);
|
||||
|
||||
STATIC mp_obj_t native_base_class_obj_set_test(mp_obj_t self_in, mp_obj_t value) {
|
||||
mp_printf(&mp_plat_print, "native base class .test set to: ");
|
||||
mp_obj_print_helper(&mp_plat_print, value, PRINT_REPR);
|
||||
mp_printf(&mp_plat_print, "\n");
|
||||
native_base_class_obj_t *self = native_base(self_in);
|
||||
self->test = value;
|
||||
return mp_const_none;
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_2(native_base_class_set_test_obj, native_base_class_obj_set_test);
|
||||
|
||||
MP_PROPERTY_GETSET(native_base_class_test_obj,
|
||||
(mp_obj_t)&native_base_class_get_test_obj,
|
||||
(mp_obj_t)&native_base_class_set_test_obj);
|
||||
|
||||
STATIC mp_obj_t native_base_class_obj_print_subclass_attr(mp_obj_t self_in, mp_obj_t attr_name_obj) {
|
||||
if (!mp_obj_is_str(attr_name_obj)) {
|
||||
mp_raise_TypeError(NULL);
|
||||
}
|
||||
qstr attr_name = mp_obj_str_get_qstr(attr_name_obj);
|
||||
mp_obj_t value = mp_load_attr(self_in, attr_name);
|
||||
mp_printf(&mp_plat_print, "native base class .%q set to: ", attr_name);
|
||||
mp_obj_print_helper(&mp_plat_print, value, PRINT_REPR);
|
||||
mp_printf(&mp_plat_print, "\n");
|
||||
return mp_const_none;
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_2(native_base_class_print_subclass_attr_obj, native_base_class_obj_print_subclass_attr);
|
||||
|
||||
STATIC const mp_rom_map_elem_t native_base_class_locals_dict_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_test), MP_ROM_PTR(&native_base_class_test_obj) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_print_subclass_attr), MP_ROM_PTR(&native_base_class_print_subclass_attr_obj) },
|
||||
|
||||
};
|
||||
STATIC MP_DEFINE_CONST_DICT(native_base_class_locals_dict, native_base_class_locals_dict_table);
|
||||
|
||||
MP_DEFINE_CONST_OBJ_TYPE(
|
||||
native_base_class_type,
|
||||
MP_QSTR_NativeBaseClass,
|
||||
MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS,
|
||||
make_new, &native_base_class_make_new,
|
||||
locals_dict, &native_base_class_locals_dict
|
||||
);
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue