So I am doing a project with a 160x80 TFT display, using the ST7735 driver. I have slightly modified the ST7735 functions to work with my display, and everything is running perfectly (great job with the driver). Now I am trying to build an interface and would like to update text on the display without it flickering. In my previous projects, I used an internal frame buffer/canvas to hold the text and background, while using some write_bitmap function to write the buffer to the display.
I would like to do this with the nRF52 SDK and found the function nrf_gfx_display() in the documentation.
/** * @brief Function for displaying data from an internal frame buffer. * * @param[in] p_instance Pointer to the LCD instance. */ void nrf_gfx_display(nrf_lcd_t const * p_instance);
However, as I understand, this has never been implemented and is up to the individual developer to do so - is this correct? In that case I do have some questions as of how what is the best practise for implementing this. Personally I don't think it makes sense to implement it in the modified ST7735 driver as I would not have access to any of the helper functions in nrf_gxf such as write_line() etc. Also I am having a hard time thinking how I should implement this with only the function nrf_gfx_display() without any arguments or anything.
No matter what I think of I end up with the need to modify the nrf_lcd_t struct in order to get more functions. F.x. I am thinking of creating a new "driver" file called canvas in the same manner as the ST7735, however in order to retrieve the buffered canvas I would have to add another function pointer in the nrf_lcd_t struct - something like get_buffer. Is this a good practice?
I come from a C++ programming background and are used to classes, however I am having a hard time adjusting to the none-class nature of C. Any good advice is much appreciated!
Thanks :-)