nuttx/drivers
vrmay23 45651ea6e5 drivers/lcd: Refactor ST7796 to use Kconfig and add Power Management
Previously, the ST7796 driver required the board to pass a struct
st7796_config_s at initialization time, carrying display resolution,
color depth, orientation (MADCTL), BGR flag, SPI frequency, and
initial rotation.

All of these are chip-level properties, not board wiring details.
This created an awkward split: board code computed MADCTL values,
selected BPP, and derived effective resolution depending on orientation
(knowledge that belongs exclusively in the generic driver).

This commit removes that split entirely, following the same pattern used
by the ST7789 driver in drivers/lcd/Kconfig. It also implements the
getpower/setpower interface for standard framebuffer power management.

What was changed (per file):

drivers/lcd/Kconfig:
- Added a full 'if LCD_ST7796' ... 'endif # LCD_ST7796' block containing
  all chip-level configuration.
- Includes LCD_ST7796_XRES/YRES, LCD_ST7796_BPP, LCD_ST7796_FREQUENCY,
  LCD_ST7796_SPIMODE, LCD_ST7796_BGR, LCD_ST7796_INVCOLOR,
  and orientation/rotation choices.

drivers/lcd/st7796.c:
- Removed struct st7796_config_s from struct st7796_dev_s.
- Moved struct st7796_cmd_s from public header to Private Types.
- Added compile-time macros derived from Kconfig:
  ST7796_XRES/YRES (swapped for landscape),
  ST7796_MADCTL_BASE,
  ST7796_SPIMODE,
  ST7796_BYTESPP,
  ST7796_COLORFMT.

- Implemented st7796_getpower() and st7796_setpower() using the
  st7796_board_power() board callback.
- Registered power functions in st7796_fbinitialize() vtable.
- Updated st7796_init_display() to make INVON/INVOFF conditional on
  CONFIG_LCD_ST7796_INVCOLOR.
- Simplified st7796_fbinitialize() signature to only take
  'struct spi_dev_s *spi'.

include/nuttx/lcd/st7796.h:
- Removed legacy macros (ST7796_XRES_RAW, etc.) and configuration
  structures.
- Updated st7796_fbinitialize() prototype.
- Added st7796_board_power() callback prototype.
- Removed private implementation details from the public header.

boards/arm/stm32h7/nucleo-h753zi/Kconfig:
- Removed chip-level menus (settings, orientation) now handled by the
  generic driver.
- Retained only board-specific wiring concerns (pins and SPI bus).

boards/.../stm32_st7796.c:
- Removed g_st7796_config and associated board-side macros.
- Updated st7796_fbinitialize() call to the new signature.
- stm32_st7796_flush_fb() now queries effective resolution
  via g_fb_vtable->getvideoinfo().

Verified on nucleo-h753zi:
Orientation: Landscape (480x320),
Rotation: 180 deg,
BGR: enabled,
INVCOLOR: disabled,
BPP: RGB565,
Frequency: 40 MHz.
Making INVCOLOR a Kconfig option (default n) fixes cases where panels
previously showed inverted colors due to hardcoded INVON.

Signed-off-by: vrmay23 <vmay.sweden@gmail.com>
2026-03-08 15:46:52 -03:00
..
1wire drivers/1wire/1wire_ds2xxx.h: add the driver for DS2XXX eeproms. 2025-10-10 08:55:45 +02:00
aie drivers: unify Private Types banners 2025-05-28 10:17:15 +08:00
analog drivers/analog: fix adc ads1115 driver 2026-02-03 08:27:59 -05:00
audio timers/oneshot: Remove all callback and args. 2025-11-18 13:02:29 +01:00
bch drivers/fs: Control the behavior of FTL by passing oflags during the open process. 2025-07-16 14:11:41 +08:00
can netdev_driver: add carrier_on to xxx_ifup where carrier_on is absent 2026-02-02 13:23:05 +08:00
clk style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
contactless sched/sleep: replace all Signal-based sleep implement to Scheduled sleep 2025-10-17 14:05:02 +08:00
coresight arch | boards | drivers: fix whitespace issues for switch case statements 2025-05-23 10:48:41 +08:00
crypto sched/sleep: replace all Signal-based sleep implement to Scheduled sleep 2025-10-17 14:05:02 +08:00
devicetree style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
dma drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
dummy drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
eeprom mtd/at25ee: Use eeprom/spi_xx25xx internally 2025-12-17 19:03:54 +01:00
efuse drivers: unify Private Types banners 2025-05-28 10:17:15 +08:00
i2c drivers/i2c: add ioexpander-based lower-half implementation for I2C bit-bang 2026-01-01 17:08:47 +08:00
i2s drivers/i2s/i2schar: Implement blocking read/write operations 2025-08-27 11:07:05 +08:00
i3c Revert: "drivers/i3c: remove extra i3c_dev_register, do_daa has created them" 2025-12-09 08:23:46 -03:00
input drivers/input: remove nxsig_notification when signal support is disabled 2026-02-26 20:03:05 +08:00
ioexpander drivers/ioexpander: add DEV_GPIO_NSIGNALS dependency on signals 2026-02-26 20:03:05 +08:00
ipcc style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
lcd drivers/lcd: Refactor ST7796 to use Kconfig and add Power Management 2026-03-08 15:46:52 -03:00
leds drivers/leds: remove bo_closing as lu_lock can prevent race condition occurs 2026-01-08 11:17:17 +08:00
loop drivers/iovec: revert vector io implement from loop/null/zero driver 2025-01-22 11:29:39 +08:00
math drivers/math: use small lock to replace enter_critical_section 2026-01-08 11:17:17 +08:00
misc drivers/misc/optee: add missing addrenv header include 2026-01-16 09:04:12 -03:00
mmcsd drivers/mmcsd: fix typo, it should be "Byte" by spec 2026-01-16 01:38:29 +08:00
modem drivers/alt1250: remove altmdm_timer for no signals 2026-02-26 20:03:05 +08:00
motor drivers/motor: use small lock to replace enter_critical_section 2026-01-08 11:17:17 +08:00
mtd mtdconfig/nvs: clean up block without valid data during GC 2026-01-29 14:56:19 +08:00
net drivers/net: remove nxsig_notification when signal support is disabled 2026-02-26 20:03:05 +08:00
note drivers/note: noteram ioctl FIONBIO should return -ENOTTY 2026-02-10 08:01:59 -03:00
pci drivers/pci:fix pci_disable_irq/pci_enable_irq parameter 2026-01-30 12:50:42 +08:00
pinctrl drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
pipes drivers/pipe: fix POLLHUP handling in poll() 2026-01-22 22:09:01 +08:00
power drivers/power/pm: Fix typos in comments 2026-02-02 15:53:09 +01:00
rc style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
regmap style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
reset style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
rf drivers/rf: migrate license to ASF 2024-11-06 19:46:13 +08:00
rmt drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
rpmsg drivers/rpmsg_virtio: Add VIRTIO_RPMSG_F_BUFADDR to support specify the address 2026-03-05 12:39:13 +08:00
rptun rpmsg_virtio/rptun: support fallback cpuname when VIRTIO_RPMSG_F_CPUNAME not set 2026-02-04 20:01:13 -03:00
segger drivers/segger: Add a kconfig to override Segger SystemView target sources version 2025-07-22 23:21:31 +08:00
sensors drivers/sensors: Legacy sensor warning 2026-03-01 16:37:20 -03:00
serial serial/uart_rpmsg: Remove redundant CONFIG_RPMSG_UART_CONSOLE macro check 2026-03-03 11:55:34 -05:00
spi sched/sleep: replace all Signal-based sleep implement to Scheduled sleep 2025-10-17 14:05:02 +08:00
syslog drivers/syslog: add millisecond option for syslog timestamp formatting 2026-02-27 08:09:31 -03:00
thermal style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
timers drivers/timers: remove nxsig_notification when signal support is disabled 2026-02-26 20:03:05 +08:00
usbdev rndis.c: move ifup in setconfig to the work queue 2026-02-27 15:39:38 +08:00
usbhost netdev_driver: add carrier_on to xxx_ifup where carrier_on is absent 2026-02-02 13:23:05 +08:00
usbmisc sched/sleep: replace all Signal-based sleep implement to Scheduled sleep 2025-10-17 14:05:02 +08:00
usbmonitor sched/sleep: replace all Signal-based sleep implement to Scheduled sleep 2025-10-17 14:05:02 +08:00
usrsock usrsock_rpmsg_server.c: replace net_lock with conn_lock 2026-01-07 09:17:49 -03:00
vhost drivers/vhost: add missing SCHED_WORKQUEUE dependency 2026-02-04 02:32:02 +08:00
video v4l2_cap: fix reqbuf return error when set count = 0. 2026-02-10 16:20:21 -05:00
virtio drivers/virtio and vhost: auto-select parent config from sub-drivers 2026-02-04 02:32:02 +08:00
wireless wireless/cc1101: Add standard RF IOCTL support. 2026-03-04 10:51:16 -03:00
.gitignore
CMakeLists.txt drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
drivers_initialize.c serial/uart_rpmsg: add _raw version of driver 2026-02-23 09:19:57 -03:00
Kconfig AI engine driver 2024-10-16 13:57:23 +08:00
Makefile Makefile: Remove make depend files by make distclean 2026-02-16 16:27:57 +01:00