Skip to content

Commit fa62cdc

Browse files
committed
draw: dma2d: add zephyr infrastructure to support
acceleration of the DMA2D peripheral Signed-off-by: Felipe Neves <[email protected]>
1 parent 1ed1ddd commit fa62cdc

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

src/draw/dma2d/lv_draw_dma2d.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,26 @@ void lv_draw_dma2d_init(void)
8282
#else
8383
#warning "LVGL can't enable the clock for DMA2D"
8484
#endif
85-
8685
/* disable dead time */
8786
DMA2D->AMTCR = 0;
8887

88+
#if defined(__ZEPHYR__)
89+
IRQ_CONNECT(DMA2D_IRQn, 0, lv_draw_dma2d_transfer_complete_interrupt_handler, NULL, 0);
90+
irq_enable(DMA2D_IRQn);
91+
#else
8992
/* enable the interrupt */
9093
NVIC_EnableIRQ(DMA2D_IRQn);
94+
#endif
9195
}
9296

9397
void lv_draw_dma2d_deinit(void)
9498
{
99+
#if defined(__ZEPHYR__)
100+
irq_disable(DMA2D_IRQn);
101+
#else
95102
/* disable the interrupt */
96103
NVIC_DisableIRQ(DMA2D_IRQn);
97-
104+
#endif
98105
/* disable the DMA2D clock */
99106
#if defined(STM32F4) || defined(STM32F7) || defined(STM32U5) || defined(STM32L4)
100107
RCC->AHB1ENR &= ~RCC_AHB1ENR_DMA2DEN;

src/draw/dma2d/lv_draw_dma2d_private.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ extern "C" {
1919

2020
#include "../lv_draw_private.h"
2121
#include "../sw/lv_draw_sw.h"
22-
#include LV_DRAW_DMA2D_HAL_INCLUDE
22+
#if defined(__ZEPHYR__)
23+
#include <zephyr/kernel.h>
24+
#include <zephyr/irq.h>
25+
#include <soc.h>
26+
#else
27+
#include LV_DRAW_DMA2D_HAL_INCLUDE
28+
#endif
29+
2330

2431
/*********************
2532
* DEFINES

0 commit comments

Comments
 (0)