mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
Add support for ST7796 TFT LCD controller (320x480). The driver implements the NuttX framebuffer interface for SPI-connected displays. Features: - SPI interface with CONFIG_SPI_CMDDATA for D/C pin control; - RGB565 (16-bit) and RGB666 (18-bit) color formats; - Runtime rotation support (0, 90, 180, 270 degrees) via MADCTL; - Board-provided configuration via st7796_config_s structure; - Partial screen update via updatearea for efficient rendering; - Persistent swap buffer to avoid per-frame allocations; - Proper ST7796S initialization sequence with documented timing; The driver uses a board-provided configuration structure allowing flexible setup of resolution, SPI frequency, color depth, and initial MADCTL value without requiring Kconfig options in the generic driver. Architecture changes in this revision as per request: - Moved internal register commands to .c file (private) - Moved MADCTL bit definitions to .c file (private) - Moved struct st7796_cmd_s to .c file (private) - Converted MADCTL orientation macros to absolute values - Moved CONFIG_SPI_CMDDATA error check to beginning of file - Removed duplicated CONFIG_SPI_CMDDATA guards - Public header contains only board configuration API - Changed the Kconfig auto-select FB from 'select' to 'depends on' Tested with LVGL graphics library on STM32H753ZI board (my own port). Signed-off-by: Vinicius May <vmay.sweden@gmail.com>
197 lines
3.9 KiB
Text
197 lines
3.9 KiB
Text
############################################################################
|
|
# drivers/lcd/Make.defs
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
# this work for additional information regarding copyright ownership. The
|
|
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
# "License"); you may not use this file except in compliance with the
|
|
# License. You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
#
|
|
############################################################################
|
|
|
|
ifeq ($(CONFIG_LCD),y)
|
|
|
|
# Support for the generic LCD framebuffer front-end
|
|
|
|
ifeq ($(CONFIG_LCD_FRAMEBUFFER),y)
|
|
CSRCS += lcd_framebuffer.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_DEV),y)
|
|
CSRCS += lcd_dev.c
|
|
endif
|
|
|
|
# Include support for Graphics LCD drivers
|
|
|
|
ifeq ($(CONFIG_LCD_FT80X),y)
|
|
CSRCS += ft80x.c
|
|
ifeq ($(CONFIG_LCD_FT80X_SPI),y)
|
|
CSRCS += ft80x_spi.c
|
|
else ifeq ($(CONFIG_LCD_FT80X_I2C),y)
|
|
CSRCS += ft80x_i2c.c
|
|
endif
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_LPM013M091A),y)
|
|
CSRCS += lpm013m091a.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_APA102),y)
|
|
CSRCS += apa102.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_P14201),y)
|
|
CSRCS += p14201.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_UG2864AMBAG01),y)
|
|
CSRCS += ug-2864ambag01.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_UG9664HSWAG01),y)
|
|
CSRCS += ug-9664hswag01.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_SSD1306),y)
|
|
CSRCS += ssd1306_base.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_SSD1306_SPI),y)
|
|
CSRCS += ssd1306_spi.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_SSD1306_I2C),y)
|
|
CSRCS += ssd1306_i2c.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_SSD1289),y)
|
|
CSRCS += ssd1289.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_SSD1680),y)
|
|
CSRCS += ssd1680.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_SSD1351),y)
|
|
CSRCS += ssd1351.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_MIO283QT2),y)
|
|
CSRCS += mio283qt2.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_MAX7219),y)
|
|
CSRCS += max7219.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_MIO283QT9A),y)
|
|
CSRCS += mio283qt9a.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_PCD8544),y)
|
|
CSRCS += pcd8544.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ST7565),y)
|
|
CSRCS += st7565.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ST7567),y)
|
|
CSRCS += st7567.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_SHARP_MEMLCD),y)
|
|
CSRCS += memlcd.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ILI9225),y)
|
|
CSRCS += ili9225.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ILI9340),y)
|
|
CSRCS += ili9340.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ILI9341),y)
|
|
CSRCS += ili9341.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_LCDDRV_SPIIF),y)
|
|
CSRCS += lcddrv_spiif.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_RA8875),y)
|
|
CSRCS += ra8875.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ST7735),y)
|
|
CSRCS += st7735.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ST7789),y)
|
|
CSRCS += st7789.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ST7796),y)
|
|
CSRCS += st7796.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_GC9A01),y)
|
|
CSRCS += gc9a01.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_JD9851),y)
|
|
CSRCS += jd9851.c
|
|
endif
|
|
|
|
endif # CONFIG_LCD
|
|
|
|
ifeq ($(CONFIG_SLCD),y)
|
|
|
|
# Include support for Alphanumeric/Segment LCD drivers
|
|
|
|
ifeq ($(CONFIG_LCD_BACKPACK),y)
|
|
CSRCS += pcf8574_lcd_backpack.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_ST7032),y)
|
|
CSRCS += st7032.c
|
|
endif
|
|
|
|
ifeq ($(CONFIG_LCD_HT16K33),y)
|
|
CSRCS += ht16k33_14seg.c
|
|
endif
|
|
endif # CONFIG_SLCD
|
|
|
|
# Other LCD-related devices
|
|
|
|
ifeq ($(CONFIG_LCD_TDA19988),y)
|
|
CSRCS += tda19988.c
|
|
endif
|
|
|
|
# Include LCD driver build support (the nested if-then-else implements an OR)
|
|
|
|
ifeq ($(CONFIG_LCD),y)
|
|
DEPPATH += --dep-path lcd
|
|
VPATH += :lcd
|
|
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)drivers$(DELIM)lcd
|
|
else ifeq ($(CONFIG_SLCD),y)
|
|
DEPPATH += --dep-path lcd
|
|
VPATH += :lcd
|
|
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)drivers$(DELIM)lcd
|
|
else ifeq ($(CONFIG_LCD_OTHER),y)
|
|
DEPPATH += --dep-path lcd
|
|
VPATH += :lcd
|
|
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)drivers$(DELIM)lcd
|
|
endif
|