generated from pimoroni/pga
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
310 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1 @@ | ||
# Pimoroni PGA Boilerplate | ||
|
||
This repository is intended to provide a baseline MicroPython build for PGA2040 | ||
and PGA2350, in addition to being a minimal example of how you might set up your | ||
own custom MicroPython flavour to support your PGA-based project. | ||
|
||
Use this repository as a boilerplate to set up your own project, and GitHub actions | ||
should automatically handle building MicroPython for you. | ||
|
||
## Contents | ||
|
||
* pga2040 - MicroPython and Pico SDK board definitions for PGA2040 | ||
* pga2350 - MicroPython and Pico SDK board definitions for PGA2350, with PSRAM variant | ||
* modules/c/example - An example MicroPython C++ module, demonstrating C class bindings | ||
* modules/py_frozen - Python files intended to be frozen into the firmware | ||
* modules/py_littlefs - Python files intended to be visible/editable in the LittleFS user filesystem | ||
# Pimoroni Presto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
add_library(usermod_presto INTERFACE) | ||
|
||
target_sources(usermod_presto INTERFACE | ||
${CMAKE_CURRENT_LIST_DIR}/presto.c | ||
${CMAKE_CURRENT_LIST_DIR}/presto.cpp | ||
${CMAKE_CURRENT_LIST_DIR}/../../../drivers/st7701_portal/st7701.cpp | ||
${CMAKE_CURRENT_LIST_DIR}/../../../libraries/pico_graphics/pico_graphics_pen_rgb565.cpp | ||
) | ||
pico_generate_pio_header(usermod_presto ${CMAKE_CURRENT_LIST_DIR}/../../../drivers/st7701_portal/st7701_parallel.pio) | ||
pico_generate_pio_header(usermod_presto ${CMAKE_CURRENT_LIST_DIR}/../../../drivers/st7701_portal/st7701_timing.pio) | ||
|
||
target_include_directories(usermod_presto INTERFACE | ||
${CMAKE_CURRENT_LIST_DIR} | ||
${CMAKE_CURRENT_LIST_DIR}/../../../libraries/pico_graphics/ | ||
${CMAKE_CURRENT_LIST_DIR}/../../../drivers/st7701_portal/ | ||
) | ||
|
||
target_compile_definitions(usermod_presto INTERFACE | ||
MODULE_PRESTO_ENABLED=1 | ||
) | ||
|
||
target_link_libraries(usermod INTERFACE usermod_presto) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#include "presto.h" | ||
|
||
|
||
/***** Methods *****/ | ||
|
||
MP_DEFINE_CONST_FUN_OBJ_1(Presto___del___obj, Presto___del__); | ||
MP_DEFINE_CONST_FUN_OBJ_2(Presto_update_obj, Presto_update); | ||
|
||
/***** Binding of Methods *****/ | ||
|
||
static const mp_rom_map_elem_t Presto_locals_dict_table[] = { | ||
{ MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&Presto___del___obj) }, | ||
{ MP_ROM_QSTR(MP_QSTR_update), MP_ROM_PTR(&Presto_update_obj) }, | ||
|
||
{ MP_ROM_QSTR(MP_QSTR_WIDTH), MP_ROM_INT(WIDTH) }, | ||
{ MP_ROM_QSTR(MP_QSTR_HEIGHT), MP_ROM_INT(HEIGHT) }, | ||
}; | ||
|
||
static MP_DEFINE_CONST_DICT(Presto_locals_dict, Presto_locals_dict_table); | ||
|
||
|
||
MP_DEFINE_CONST_OBJ_TYPE( | ||
Presto_type, | ||
MP_QSTR_Presto, | ||
MP_TYPE_FLAG_NONE, | ||
make_new, Presto_make_new, | ||
locals_dict, (mp_obj_dict_t*)&Presto_locals_dict | ||
); | ||
|
||
/***** Globals Table *****/ | ||
static const mp_map_elem_t presto_globals_table[] = { | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_presto) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_Presto), (mp_obj_t)&Presto_type }, | ||
}; | ||
|
||
static MP_DEFINE_CONST_DICT(mp_module_presto_globals, presto_globals_table); | ||
|
||
/***** Module Definition *****/ | ||
|
||
const mp_obj_module_t presto_user_cmodule = { | ||
.base = { &mp_type_module }, | ||
.globals = (mp_obj_dict_t*)&mp_module_presto_globals, | ||
}; | ||
|
||
MP_REGISTER_MODULE(MP_QSTR_presto, presto_user_cmodule); |
Oops, something went wrong.