nuttx/include/nuttx
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 1wire DS2XXX: add 1wire and DS2XXX documentation 2025-10-11 07:39:01 -03:00
aie
analog drivers/adc: Use mutexlock to replace critical section protection 2026-01-05 22:03:12 +08:00
audio nuttx/audio: clear apb buffer when playback dequeue 2026-02-05 08:22:18 -03:00
binfmt binfmt: Add a configuration flag to store the module filename 2025-11-01 22:59:47 +08:00
can sja1000: replace enter_critical_section with spinlock 2026-01-08 09:15:04 -03:00
clk
contactless
coresight style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
crypto crypto/blake2s.h: fix tasking compile warning 2026-01-19 14:16:25 +08:00
dma
drivers serial/uart_rpmsg: add _raw version of driver 2026-02-23 09:19:57 -03:00
eeprom mtd/at25ee: Use eeprom/spi_xx25xx internally 2025-12-17 19:03:54 +01:00
efuse
fs fs/procfs: Add mallinfo and memdump callback to procfs_meminfo_entry_s 2026-01-27 21:27:53 +08:00
himem
hwspinlock
i2c drivers/i2c: add ioexpander-based lower-half implementation for I2C bit-bang 2026-01-01 17:08:47 +08:00
i3c style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
input input: add keyboard matrix driver 2026-02-10 08:15:01 -03:00
ioexpander drivers/ioexpander: add enable & disable macro for gpio SETDEBOUNCE and SETMASK 2026-01-13 09:27:52 -03:00
lcd drivers/lcd: Refactor ST7796 to use Kconfig and add Power Management 2026-03-08 15:46:52 -03:00
leds drivers/leds: Add support for KTD2052 2025-07-07 09:49:51 -03:00
lib libc: add support for C23 stdbit.h with bit manipulation macros 2026-03-02 09:09:40 -03:00
math drivers/math: use small lock to replace enter_critical_section 2026-01-08 11:17:17 +08:00
mbox
mm protect: move us_heap to userspace_data_s 2026-02-02 11:06:53 +08:00
modem style/FAR: remove FAR qualifier 2025-11-10 10:56:29 +01:00
motor style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
mtd drivers/mtd: add MTDIOC_ISBAD ioctl 2025-12-23 09:26:34 -03:00
net netdev: delete macro CONFIG_NETDEV_CHECKSUM with nuttx 2026-01-19 23:22:46 +08:00
note note/ram: support multiple noterams to dump data when panic occurs 2026-01-24 19:33:17 +08:00
nx style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
pci drivers/pci:write legacy num to config space when enable legacy irq 2026-01-30 12:50:42 +08:00
pinctrl
power power/battery: support get battery cycle count 2025-12-22 09:15:56 -03:00
rc style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
regmap
reset style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
rf
rmt
rpmsg rpmsg_virtio/rptun: support fallback cpuname when VIRTIO_RPMSG_F_CPUNAME not set 2026-02-04 20:01:13 -03:00
rptun rptun: add configuring the stack of rptun as static 2026-01-19 14:18:27 +08:00
segger
sensors drivers/sensors: add sensor monitor log. 2026-01-29 18:30:38 +08:00
serial serial/xlnx_ps: add common Xilinx UART Peripheral System (XUARTPS) support 2026-02-27 08:14:03 -03:00
spi drivers/rpmsg_port_spi_slave: add getrecvbuf callback for zero-copy receive 2026-01-26 21:17:27 +08:00
syslog driver/ramlog: Implement the rate limiting function for ramlog driver. 2026-01-27 03:17:05 +08:00
timers timer: add timer wdog 2026-01-29 09:25:07 -03:00
usb arch/sim: Optimize sim usbhost isoc endpoint transmission 2026-01-05 09:59:06 +08:00
usrsock
vhost drivers/vhost: add vhost_get_vq_buffers() to collect scatter-gather buffers 2026-02-04 02:32:02 +08:00
video video/imgdata: fix IMGDATA_SET_BUF macro int-conversion warning 2026-02-26 14:47:52 +01:00
virtio include/nuttx/virtio: allow common virtio helpers to be used by vhost 2026-02-04 02:32:02 +08:00
wireless net/wireless: fix compile warning 2025-12-25 18:05:33 +08:00
.gitignore
addrenv.h addrenv: support addrenv when mpu is used 2026-01-26 16:27:19 +08:00
allsyms.h
arch.h sched/hrtimer: fix hrtimer regression introduced by recent update 2026-01-27 19:35:31 +08:00
ascii.h
atexit.h
atomic.h include/nuttx/atomic.h: fix C++ definition conflicts 2025-12-22 15:27:39 +08:00
bits.h
board.h boards/boardctl: Add BOARDIOC_MACADDR command 2026-01-22 22:13:31 +08:00
cache.h nuttx/cache.h: fix the compile warning in sim when enable OpenAMP 2025-12-31 02:36:29 +08:00
can.h drivers/can: move CAN utils to CAN common files 2025-05-14 10:30:25 -03:00
cancelpt.h sched/cancelpt: Fix MISRA C 2012 Rule 10.4 violations 2026-02-02 21:09:40 +08:00
circbuf.h
clock.h sched: fix code style violations in clock conversion macros (MISRA C-2012) 2026-02-01 01:14:01 +08:00
clock_notifier.h fs/timerfd: implement TFD_TIMER_CANCEL_ON_SET to detect clock changes 2026-01-30 17:20:24 +08:00
compiler.h compiler: Add PRAGMA and unroll_loop. 2026-01-06 19:46:30 +08:00
coredump.h
crc8.h libs/crc: implement AUTOSAR-compatible CRC algorithm 2026-01-30 17:32:15 +08:00
crc16.h libs/crc: implement AUTOSAR-compatible CRC algorithm 2026-01-30 17:32:15 +08:00
crc32.h libs/crc: implement AUTOSAR-compatible CRC algorithm 2026-01-30 17:32:15 +08:00
crc64.h libs/crc: implement AUTOSAR-compatible CRC algorithm 2026-01-30 17:32:15 +08:00
elf.h
environ.h
envpath.h
ethtool.h
event.h [!] sched/event: Remove wait object dependency from event implementation 2025-10-31 19:56:32 -03:00
fdcheck.h
fdt.h
gdbstub.h
hashtable.h
hrtimer.h sched/hrtimer: Update the comments. 2026-02-02 13:26:22 +08:00
idr.h
init.h sched: add trace points during system startup and board initialization 2026-01-27 03:18:11 +08:00
instrument.h style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
ipcc.h style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
irq.h sched/irq: Consolidate IRQ bounds checking into IRQ_TO_NDX macro 2026-01-28 13:35:30 +08:00
kmalloc.h
kthread.h
lin.h LIN:adjust the LIN flag 2026-01-08 23:15:31 +08:00
lirc.h
list.h list: Fix the list conflicts. 2026-01-19 14:12:09 +08:00
list_type.h list: Fix the list conflicts. 2026-01-19 14:12:09 +08:00
macro.h macro: use portable variadic macros 2026-01-22 22:14:00 +08:00
memoryregion.h
mmcsd.h
module.h libc/elf: rename modlib to libelf 2025-04-11 09:43:22 +08:00
mqueue.h style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
mutex.h sched/pthread: move pthread mutex from syscall to user-space 2026-01-22 12:40:49 -03:00
notifier.h include/notifier: fix undefined reference to spin_lock_irqsave_nopreempt 2026-01-28 23:37:32 +08:00
nuttx.h
page.h
panic_notifier.h
pgalloc.h mm/gran: add gran_alloc_align API 2025-05-12 15:01:37 +08:00
progmem.h
pthread.h pthread: move pthread_cond to userspace 2026-01-26 16:26:39 +08:00
queue.h
random.h
reboot_notifier.h
rwsem.h sched/sem_rw.c: Add downgrade_write API for sem_rw 2026-01-07 22:47:09 +08:00
sched.h sched/sched: add nxsched_abstick_sleep() 2026-02-26 17:04:47 +08:00
sched_note.h note: add NOTE_DUMP_BINARY support for binary log dumping 2026-01-27 21:56:03 +08:00
scsi.h style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
sdio.h style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
sdio_slave.h style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
semaphore.h semaphore.h: fix ubsan error 2026-01-28 12:45:11 -03:00
seqlock.h seqlock: Fix struct name and constants. 2025-12-22 10:22:06 -03:00
signal.h sched/signal: Remove shadow definitions to reduce unnecessary API 2025-10-14 17:40:18 +08:00
spawn.h
spinlock.h sched/spinlock: Add time statistics in func enter_critical_section(). 2026-01-27 21:59:14 +08:00
spinlock_type.h seqlock: Fix struct name and constants. 2025-12-22 10:22:06 -03:00
streams.h libc/stream: Add support for lib_scanf 2025-06-20 09:48:39 +08:00
symtab.h
tee.h drivers/misc/optee: Expanded RPC support. 2025-08-06 02:29:33 +08:00
thermal.h
tls.h pthread: remove tl_lock 2026-01-26 20:56:12 +08:00
trace.h trace: fix macro line continuation formatting 2026-01-25 10:45:26 -03:00
uorb.h drivers/sensors: Add new features. 2026-01-27 19:34:33 +08:00
userspace.h protect: move us_heap to userspace_data_s 2026-02-02 11:06:53 +08:00
vt100.h
wdog.h sched/wdog : remove critical section. 2026-01-27 17:59:07 +08:00
wqueue.h list: Fix the list conflicts. 2026-01-19 14:12:09 +08:00
zoneinfo.h