8000 expose picodvi.framebuffer.color_depth to python · cezer-io/circuitpython@c4562e1 · GitHub
[go: up one dir, main page]

Skip to content

Commit c4562e1

Browse files
committed
expose picodvi.framebuffer.color_depth to python
1 parent c5128a9 commit c4562e1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ports/raspberrypi/bindings/picodvi/Framebuffer.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,24 @@ MP_DEFINE_CONST_FUN_OBJ_1(picodvi_framebuffer_get_height_obj, picodvi_framebuffe
178178
MP_PROPERTY_GETTER(picodvi_framebuffer_height_obj,
179179
(mp_obj_t)&picodvi_framebuffer_get_height_obj);
180180

181+
//| color_depth: int
182+
//| """The width of the framebuffer, in pixels. It may be doubled for output."""
183+
static mp_obj_t picodvi_framebuffer_get_color_depth(mp_obj_t self_in) {
184+
picodvi_framebuffer_obj_t *self = (picodvi_framebuffer_obj_t *)self_in;
185+
check_for_deinit(self);
186+
return MP_OBJ_NEW_SMALL_INT(common_hal_picodvi_framebuffer_get_color_depth(self));
187+
}
188+
MP_DEFINE_CONST_FUN_OBJ_1(picodvi_framebuffer_get_color_depth_obj, picodvi_framebuffer_get_color_depth);
189+
MP_PROPERTY_GETTER(picodvi_framebuffer_color_depth_obj,
190+
(mp_obj_t)&picodvi_framebuffer_get_color_depth_obj);
191+
192+
181193
static const mp_rom_map_elem_t picodvi_framebuffer_locals_dict_table[] = {
182194
{ MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&picodvi_framebuffer_deinit_obj) },
183195

184196
{ MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&picodvi_framebuffer_width_obj) },
185197
{ MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&picodvi_framebuffer_height_obj) },
198+
{ MP_ROM_QSTR(MP_QSTR_color_depth), MP_ROM_PTR(&picodvi_framebuffer_color_depth_obj) },
186199
};
187200
static MP_DEFINE_CONST_DICT(picodvi_framebuffer_locals_dict, picodvi_framebuffer_locals_dict_table);
188201

0 commit comments

Comments
 (0)
0