nuttx/include
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
..
android
arpa
crypto crypto: support software key management based on MTD 2026-01-28 11:52:12 +08:00
cxx include/cxx/cmath: Use toolchain <cmath> with toolchain libm. 2026-02-26 12:48:55 +08:00
net forward: Add IFF_NOSRC_FORWARD and IFF_NODST_FORWARD flags. 2026-01-31 02:37:58 +08:00
netinet netinet/in.h: Rename imr_interface to imr_address in struct ip_mreqn. 2026-01-16 09:42:12 +08:00
netpacket net/packet: add PACKET_<ADD|DROP>_MEMBERSHIP support 2025-12-25 10:01:43 +08:00
nuttx drivers/lcd: Refactor ST7796 to use Kconfig and add Power Management 2026-03-08 15:46:52 -03:00
ssp
sys fs/timerfd: implement TFD_TIMER_CANCEL_ON_SET to detect clock changes 2026-01-30 17:20:24 +08:00
.gitignore tools: fix make host_info flag parsing and config string escaping 2026-02-05 14:23:19 +01:00
aio.h
alloca.h
assert.h
byteswap.h
ctype.h libcxx: fix compile error 2024-10-23 09:42:57 +08:00
debug.h drivers/rptun: add rptun debug config macros and Kconfig 2026-01-19 14:18:27 +08:00
dirent.h
dlfcn.h
dsp.h style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
dspb16.h style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
elf.h arch:use ARCH_64BIT to mark arch is support 64bit 2025-12-18 22:05:12 +08:00
elf32.h
elf64.h
endian.h
err.h
errno.h
execinfo.h
fcntl.h libc: add creat function implementation 2026-01-16 01:38:20 +08:00
fixedmath.h style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
fnmatch.h
ftw.h
gcov.h gcov: Refactoring the implementation framework of gcov 2025-07-03 00:17:58 +08:00
getopt.h
glob.h
grp.h
hex2bin.h
iconv.h
ifaddrs.h
imx_container.h arch/arm64/imx9: Add ROMAPI and AHAB support for i.MX9 2025-05-09 19:21:17 +08:00
inttypes.h inttype.h: add PRIuTM(time_t) to handle TIME64 & TIME32 print compatible 2025-12-01 10:07:49 +01:00
iso646.h
langinfo.h
libgen.h
libintl.h
limits.h limits: add _POSIX_PTHREAD_ constant for pthread management 2026-01-16 16:15:35 +08:00
locale.h style/FAR: remove FAR qualifier 2025-11-10 10:56:29 +01:00
lzf.h lzf: prevent lzf header struct optimization 2026-02-13 11:58:50 +01:00
malloc.h
mqueue.h [POSIX][Bug] mqueue.h: Include file does not conform the standard 2024-12-09 21:21:09 +08:00
netdb.h
nl_types.h
nxflat.h
obstack.h libs/libc/obstack: fix allocated chunk overrun due to invalid limit 2024-10-30 11:53:18 -03:00
poll.h
pthread.h libc/pthread: Avoid compiler optimizations for once_control->done 2026-01-22 19:47:45 +08:00
pty.h
pwd.h
regex.h
resolv.h
sched.h sched: remove csection and reduce the interrupt disabling time in sched_[un]lock 2025-01-23 19:58:49 +08:00
search.h LICENSE: update NuttX-PublicDomain SPDX identifier 2025-12-26 19:46:12 +08:00
semaphore.h sched/semaphore: add support to customize semaphore max allowed value 2025-09-04 09:48:34 +08:00
shadow.h
signal.h sched/timer: Fix MISRA Rule 10.4 2026-01-22 22:14:00 +08:00
spawn.h sched/spawn: Fix MISRA C 2012 Rule 10.4 violations 2026-02-02 20:39:36 +08:00
stdbool.h
stddef.h arm64_head.S: fix the asm code build error 2026-01-13 21:20:52 +08:00
stdint.h arm64_head.S: fix the asm code build error 2026-01-13 21:20:52 +08:00
stdio.h stdio.h: Update TMP_MAX definition to match Linux. 2026-01-14 17:28:30 -08:00
stdlib.h include/stdlib.h: define system()'s prototype for the flat build 2025-02-07 09:03:14 +08:00
stdnoreturn.h
string.h include/string.h: mark memset and memcpy as used_code 2026-02-12 13:19:06 -05:00
strings.h libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
syscall.h
syslog.h drivers/syslog: Add RFC 5424 protocol support 2025-06-13 20:26:57 +08:00
termios.h include: modify for support socat, so need add some macro same as linux 2025-12-10 23:44:14 +08:00
threads.h include/threads.h: Replace thrd_ defines by actual function definitions 2024-12-19 21:56:02 +08:00
time.h
ulimit.h ulimit: add ulimit implementation 2026-01-16 10:03:53 +08:00
unistd.h fpathconf: add _POSIX_PRIO_IO defintion 2026-01-15 16:10:51 -03:00
utime.h
uuid.h
wait.h wait: add wait.h header file 2024-12-20 11:46:14 -03:00
wchar.h fix misspelled names in locally scoped code 2025-05-15 10:12:12 +08:00
wctype.h