generated from pimoroni/pga
-
Notifications
You must be signed in to change notification settings - Fork 14
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
27 changed files
with
306 additions
and
301 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
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,24 @@ | ||
set(MOD_NAME portal) | ||
string(TOUPPER ${MOD_NAME} MOD_NAME_UPPER) | ||
add_library(usermod_${MOD_NAME} INTERFACE) | ||
|
||
target_sources(usermod_${MOD_NAME} INTERFACE | ||
${CMAKE_CURRENT_LIST_DIR}/${MOD_NAME}.c | ||
${CMAKE_CURRENT_LIST_DIR}/${MOD_NAME}.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_${MOD_NAME} ${CMAKE_CURRENT_LIST_DIR}/../../../drivers/st7701_portal/st7701_parallel.pio) | ||
pico_generate_pio_header(usermod_${MOD_NAME} ${CMAKE_CURRENT_LIST_DIR}/../../../drivers/st7701_portal/st7701_timing.pio) | ||
|
||
target_include_directories(usermod_${MOD_NAME} INTERFACE | ||
${CMAKE_CURRENT_LIST_DIR} | ||
${CMAKE_CURRENT_LIST_DIR}/../../../libraries/pico_graphics/ | ||
${CMAKE_CURRENT_LIST_DIR}/../../../drivers/st7701_portal/ | ||
) | ||
|
||
target_compile_definitions(usermod_${MOD_NAME} INTERFACE | ||
MODULE_PORTAL_ENABLED=1 | ||
) | ||
|
||
target_link_libraries(usermod INTERFACE usermod_${MOD_NAME}) |
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(Portal___del___obj, Portal___del__); | ||
MP_DEFINE_CONST_FUN_OBJ_2(Portal_update_obj, Portal_update); | ||
|
||
/***** Binding of Methods *****/ | ||
|
||
static const mp_rom_map_elem_t Portal_locals_dict_table[] = { | ||
{ MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&Portal___del___obj) }, | ||
{ MP_ROM_QSTR(MP_QSTR_update), MP_ROM_PTR(&Portal_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(Portal_locals_dict, Portal_locals_dict_table); | ||
|
||
|
||
MP_DEFINE_CONST_OBJ_TYPE( | ||
Portal_type, | ||
MP_QSTR_Portal, | ||
MP_TYPE_FLAG_NONE, | ||
make_new, Portal_make_new, | ||
locals_dict, (mp_obj_dict_t*)&Portal_locals_dict | ||
); | ||
|
||
/***** Globals Table *****/ | ||
static const mp_map_elem_t portal_globals_table[] = { | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_portal) }, | ||
{ MP_OBJ_NEW_QSTR(MP_QSTR_Portal), (mp_obj_t)&Portal_type }, | ||
}; | ||
|
||
static MP_DEFINE_CONST_DICT(mp_module_portal_globals, portal_globals_table); | ||
|
||
/***** Module Definition *****/ | ||
|
||
const mp_obj_module_t portal_user_cmodule = { | ||
.base = { &mp_type_module }, | ||
.globals = (mp_obj_dict_t*)&mp_module_portal_globals, | ||
}; | ||
|
||
MP_REGISTER_MODULE(MP_QSTR_portal, portal_user_cmodule); |
Oops, something went wrong.