vrmay23 commented on code in PR #18301:
URL: https://github.com/apache/nuttx/pull/18301#discussion_r2755875716


##########
drivers/lcd/Kconfig:
##########
@@ -827,6 +827,14 @@ config LCD_ST7789_DATA_ENDIAN_LITTLE
 
 endif # LCD_ST7789
 
+config LCD_ST7796
+       bool "ST7796 LCD Display"
+       default n
+       depends on SPI
+       select LCD_FRAMEBUFFER

Review Comment:
   This driver requires framebuffer infrastructure to work. Maybe I have 
understood wrongly. But what I have understood is that Nuttx works as an 'xor' 
approach for LCD and FB drivers. The signature functions are incompatibles, 
right? 
   
   This is correct because the driver allocates framebuffer: kmm_zalloc(xres * 
yres * bpp); Also we are using
   fb_vtable_s interface and implementing "updatearea()" not putrun(). Finally, 
the driver returns at struct fb_vtable_s* rather  struct lcd_dev_s*. not
   
   /****************************************************************************
    * Name: st7796_fbinitialize
    *
    * Description:
    *   Initialize the ST7796 LCD controller and framebuffer driver. This
    *   function allocates the framebuffer memory, initializes the driver
    *   structure, sends the display initialization sequence, and returns
    *   a pointer to the framebuffer virtual table for use with the NuttX
    *   framebuffer interface.
    *
    * Input Parameters:
    *   spi    - Reference to the SPI driver structure to use for communication
    *   config - Board-specific configuration (frequency, resolution, etc.)
    *
    * Returned Value:
    *   On success, a pointer to the framebuffer virtual table is returned.
    *   On failure, NULL is returned.
    *
    
****************************************************************************/
   
   FAR struct fb_vtable_s *st7796_fbinitialize(FAR struct spi_dev_s *spi,
                                               FAR const struct st7796_config_s
                                               *config)
   {
   
   This driver also uses the fb.h interfaces, examples:
   #include <nuttx/video/fb.h>
   
   struct fb_videoinfo_s
   struct fb_planeinfo_s  
   struct fb_area_s
   
   And such thing just can be used once the symbol "CONFIG_VIDEO_FB" is enabled 
via menuconfig.
   Finally, the ddriver implements the framebuffer driver (not the lcd one):
   
   priv->vtable.getvideoinfo = st7796_getvideoinfo;  // fb interface
   priv->vtable.getplaneinfo = st7796_getplaneinfo;  // fb interface
   priv->vtable.updatearea   = st7796_updatearea;    // fb interface
   priv->vtable.ioctl        = st7796_ioctl;         // fb interface
   
   So, in the end the ST7789 CAN work without a FB but ST7796 CAN NOT. This is 
an architecture decision. Hence, we must enable this symbol to use it. Did you 
understand my points?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to