Skip to content

Commit

Permalink
Merge pull request adafruit#1757 from pewpew-game/displayio-bus
Browse files Browse the repository at this point in the history
Expose displayio.Display.bus
  • Loading branch information
tannewt authored Apr 8, 2019
2 parents 8b9e933 + 4b3cb7b commit 672a102
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions shared-bindings/displayio/Display.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,25 @@ const mp_obj_property_t displayio_display_height_obj = {
(mp_obj_t)&mp_const_none_obj},
};

//| .. attribute:: bus
//|
//| The bus being used by the display
//|
//|
STATIC mp_obj_t displayio_display_obj_get_bus(mp_obj_t self_in) {
displayio_display_obj_t *self = MP_OBJ_TO_PTR(self_in);
return self->bus;
}
MP_DEFINE_CONST_FUN_OBJ_1(displayio_display_get_bus_obj, displayio_display_obj_get_bus);

const mp_obj_property_t displayio_display_bus_obj = {
.base.type = &mp_type_property,
.proxy = {(mp_obj_t)&displayio_display_get_bus_obj,
(mp_obj_t)&mp_const_none_obj,
(mp_obj_t)&mp_const_none_obj},
};


STATIC const mp_rom_map_elem_t displayio_display_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_show), MP_ROM_PTR(&displayio_display_show_obj) },
{ MP_ROM_QSTR(MP_QSTR_refresh_soon), MP_ROM_PTR(&displayio_display_refresh_soon_obj) },
Expand All @@ -305,6 +324,7 @@ STATIC const mp_rom_map_elem_t displayio_display_locals_dict_table[] = {

{ MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&displayio_display_width_obj) },
{ MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&displayio_display_height_obj) },
{ MP_ROM_QSTR(MP_QSTR_bus), MP_ROM_PTR(&displayio_display_bus_obj) },
};
STATIC MP_DEFINE_CONST_DICT(displayio_display_locals_dict, displayio_display_locals_dict_table);

Expand Down

0 comments on commit 672a102

Please sign in to comment.