From 56b3655f7ec10f96c5236683d4e4e0cae8df496e Mon Sep 17 00:00:00 2001 From: Glenn Ruben Bakke <glennbakke@gmail.com> Date: Sun, 15 Jan 2017 16:21:27 +0100 Subject: [PATCH] nrf5/drivers: Adding new structures to moddisplay. Adding a display_t structure to cast all other displays into, to retrieve function pointer table of a display object type. Also adding the function table structure which needs to be filled by any display object. --- nrf5/drivers/display/moddisplay.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nrf5/drivers/display/moddisplay.h b/nrf5/drivers/display/moddisplay.h index 353097710e..82ff595027 100644 --- a/nrf5/drivers/display/moddisplay.h +++ b/nrf5/drivers/display/moddisplay.h @@ -27,4 +27,20 @@ #ifndef MODDISPLAY_H__ #define MODDISPLAY_H__ +typedef struct _display_t display_t; + +typedef void (*pixel_set_callback_t)(void * p_display, + uint16_t x, + uint16_t y, + uint16_t color); + +typedef struct _display_draw_callbacks_t { + pixel_set_callback_t pixel_set; +} display_draw_callbacks_t; + +typedef struct _display_t { + mp_obj_base_t base; + display_draw_callbacks_t draw_callbacks; +} display_t; + #endif // MODDISPLAY_H__