Apache NuttX is a mature, real-time embedded operating system (RTOS) https://nuttx.apache.org/
Find a file
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
.github CI: fix labeler for common boards files 2026-03-08 17:29:17 +01:00
arch boards/arm64/bcm2711/raspberrypi-4b: Fix GPIO 2026-03-08 14:30:40 -04:00
audio Makefile: Remove make depend files by make distclean 2026-02-16 16:27:57 +01:00
binfmt Makefile: Remove make depend files by make distclean 2026-02-16 16:27:57 +01:00
boards boards/nucleo-h723zg: Add support for the OA-TC6 10BASE-T1S SPI Ethernet 2026-03-08 09:09:00 -03:00
cmake libc: add support for C23 stdbit.h with bit manipulation macros 2026-03-02 09:09:40 -03:00
crypto Makefile: Remove make depend files by make distclean 2026-02-16 16:27:57 +01:00
Documentation Documentation/platforms/nucleo-h723zg: Add oa_tc6 defconfig info 2026-03-08 09:09:00 -03:00
drivers drivers/lcd: Refactor ST7796 to use Kconfig and add Power Management 2026-03-08 15:46:52 -03:00
dummy build: add initial cmake build system 2023-07-08 13:50:48 +08:00
fs fs: disable fs automounter when no signals 2026-02-26 20:03:05 +08:00
graphics Makefile: Remove make depend files by make distclean 2026-02-16 16:27:57 +01:00
include drivers/lcd: Refactor ST7796 to use Kconfig and add Power Management 2026-03-08 15:46:52 -03:00
libs libs/libc: add configurable skip count for mutex backtrace addresses 2026-02-27 19:54:37 +08:00
mm mm/mempool: fix the entry condition for semaphore during mempool allocation 2026-02-28 00:24:54 +08:00
net netdev/netdev_ioctl: log in hex mode for ioctl cmd 2026-03-03 15:58:03 -03:00
openamp openamp: add patch for VIRTIO_RPMSG_F_BUFADDR buffer address support 2026-03-05 12:39:13 +08:00
pass1 Makefile: Remove make depend files by make distclean 2026-02-16 16:27:57 +01:00
sched sched/critmon: Fix CPU load stats incorrect when using SCHED_CPULOAD_CRITMONITOR 2026-03-03 11:54:20 -05:00
syscall Makefile: Remove make depend files by make distclean 2026-02-16 16:27:57 +01:00
tools CI: allow ntfc tests for cmake builds 2026-03-03 20:54:12 +08:00
video Makefile: Remove make depend files by make distclean 2026-02-16 16:27:57 +01:00
wireless drivers/net: remove nxsig_notification when signal support is disabled 2026-02-26 20:03:05 +08:00
.asf.yaml github: master branch protection tune. 2025-05-07 18:37:13 -05:00
.codespell-ignore-lines net/icmpv6: replace net_lock with conn_lock and conn_lock_dev 2025-12-29 09:42:18 +08:00
.codespellrc codespellrc: add ist to ignorelist 2025-10-14 17:42:01 +08:00
.editorconfig .editorconfig: fix character encoding property specification 2025-11-28 19:12:13 +08:00
.gitignore gitignore: add more vim swap files 2025-06-18 15:44:51 -04:00
.gitmessage docs/contributing: Add a commit message template 2025-06-03 17:33:24 +08:00
.pre-commit-config.yaml pre-commit: enable codespell checks 2025-05-05 12:34:39 +08:00
.yamllint
AUTHORS AUTHORS: add Donny Jiuzhu 2026-02-25 10:17:40 +01:00
CMakeLists.txt cmake: Enhance .config handling and comparison logic 2026-02-26 09:46:02 -03:00
CONTRIBUTING.md doc: Contributing Guide updates. 2026-02-19 12:11:14 -05:00
INVIOLABLES.md
Kconfig libc: add support for C23 stdbit.h with bit manipulation macros 2026-03-02 09:09:40 -03:00
LICENSE style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
Makefile tools: migrate to SPDX identifier 2024-09-10 23:11:11 +08:00
NOTICE
README.md Gathering community recommendations 2023-10-28 13:55:56 +08:00
ReleaseNotes Documentation: move ReleaseNotes 2023-09-26 20:41:00 +08:00

POSIX Badge License Issues Tracking Badge Contributors GitHub Build Badge Documentation Badge

Apache NuttX is a real-time operating system (RTOS) with an emphasis on standards compliance and small footprint. Scalable from 8-bit to 64-bit microcontroller environments, the primary governing standards in NuttX are POSIX and ANSI standards. Additional standard APIs from Unix and other common RTOSs (such as VxWorks) are adopted for functionality not available under these standards, or for functionality that is not appropriate for deeply-embedded environments (such as fork()).

For brevity, many parts of the documentation will refer to Apache NuttX as simply NuttX.

Getting Started

First time on NuttX? Read the Getting Started guide! If you don't have a board available, NuttX has its own simulator that you can run on terminal.

Documentation

You can find the current NuttX documentation on the Documentation Page.

Alternatively, you can build the documentation yourself by following the Documentation Build Instructions.

The old NuttX documentation is still available in the Apache wiki.

Supported Boards

NuttX supports a wide variety of platforms. See the full list on the Supported Platforms page.

Contributing

If you wish to contribute to the NuttX project, read the Contributing guidelines for information on Git usage, coding standard, workflow and the NuttX principles.

License

The code in this repository is under either the Apache 2 license, or a license compatible with the Apache 2 license. See the License Page for more information.