config LV_USE_NEMA_GFX
	bool "NemaGFX renderer"
	default n
	help
		Accelerate drawing with the Think Silicon (TSi) NemaGFX GPU library.

if LV_USE_NEMA_GFX

config LV_NEMA_USE_CACHE
	bool "Cache maintenance"
	default n
	help
		Clean and invalidate the CPU cache around draw buffers so the GPU sees
		coherent data. Needed on cores with a data cache.

config LV_NEMA_CACHE_HAL_INCLUDE
	string "Cache HAL header"
	default "stm32u5xx_hal.h"
	depends on LV_NEMA_USE_CACHE

choice LV_USE_NEMA_LIB
	prompt "NemaGFX static library"
	default LV_NEMA_LIB_NONE
	help
		Bundled NemaGFX library and headers to use, per target CPU core.
		None warns at build time and falls back to Cortex-M33 (Rev C).

	config LV_NEMA_LIB_NONE
		bool "None"
	config LV_NEMA_LIB_M33_REVC
		bool "Cortex-M33 (Rev C)"
	config LV_NEMA_LIB_M33_NEMAPVG
		bool "Cortex-M33 (NemaPVG)"
	config LV_NEMA_LIB_M55
		bool "Cortex-M55"
	config LV_NEMA_LIB_M7
		bool "Cortex-M7"
endchoice

config LV_USE_NEMA_LIB
	int
	default 0 if LV_NEMA_LIB_NONE
	default 1 if LV_NEMA_LIB_M33_REVC
	default 2 if LV_NEMA_LIB_M33_NEMAPVG
	default 3 if LV_NEMA_LIB_M55
	default 4 if LV_NEMA_LIB_M7

choice LV_USE_NEMA_HAL
	prompt "NemaGFX HAL"
	default LV_NEMA_HAL_CUSTOM
	help
		STM32 uses the HAL bundled with LVGL. Custom means the application
		provides the NemaGFX HAL (nema_hal.c) itself.

	config LV_NEMA_HAL_CUSTOM
		bool "Custom"
	config LV_NEMA_HAL_STM32
		bool "STM32"
endchoice

config LV_USE_NEMA_HAL
	int
	default 0 if LV_NEMA_HAL_CUSTOM
	default 1 if LV_NEMA_HAL_STM32

config LV_NEMA_STM32_HAL_INCLUDE
	string "STM32 HAL header"
	default "stm32u5xx_hal.h"
	depends on LV_NEMA_HAL_STM32

config LV_NEMA_USE_CUSTOM_INCLUDE
	bool "Custom attribute header"
	default n
	depends on LV_NEMA_HAL_STM32
	help
	  Include the header given by LV_NEMA_CUSTOM_INCLUDE to override
	  NemaGFX/STM32 HAL-specific macros such as
	  LV_NEMA_STM32_HAL_ATTRIBUTE_POOL_MEM.

config LV_NEMA_CUSTOM_INCLUDE
	string "Path to custom NemaGFX attribute header"
	default ""
	depends on LV_NEMA_USE_CUSTOM_INCLUDE
	help
	  Optional header to override NemaGFX/STM32 HAL-specific macros.

	  LV_NEMA_STM32_HAL_ATTRIBUTE_POOL_MEM
	    Attribute applied to the NemaGFX memory pool on STM32 targets.
	    Used to place the pool in a specific RAM region accessible by
	    the NemaGFX DMA.
	    e.g. __attribute__((section(".nema_pool")))

config LV_USE_NEMA_VG
	bool "NemaVG vector graphics"
	select LV_DRAW_HAS_VECTOR_SUPPORT
	default n
	help
		Draw vector graphics (lv_vector_dsc) with NemaVG on top of NemaGFX.

config LV_NEMA_GFX_MAX_RESX
	int "NemaVG max horizontal resolution (px)"
	default 800
	help
		Canvas width NemaVG is initialized for. With the vertical resolution it also
		sizes the NemaGFX memory pool on STM32 (RESX * RESY + 10KB).

config LV_NEMA_GFX_MAX_RESY
	int "NemaVG max vertical resolution (px)"
	default 600
	help
		Canvas height NemaVG is initialized for.

endif
