Skip to content

Commit

Permalink
tests: drivers: display: Add support for Smartbond Pro DevKit.
Browse files Browse the repository at this point in the history
Add Kconfig option to enable allocating test buffer(s) to external
SRAM. Note that the linker section name is retrieved from the
sram-ext alias which should be compatible to zephyr,memory-region.

Signed-off-by: Ioannis Karachalios <[email protected]>
  • Loading branch information
ioannis-karachalios committed Mar 6, 2024
1 parent 89afeb9 commit 6a8ebc2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
10 changes: 10 additions & 0 deletions tests/drivers/display/display_read_write/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2023 Renesas Electronics Corporation
# SPDX-License-Identifier: Apache-2.0

mainmenu "Display Read/Write Test"

source "Kconfig.zephyr"

config DISPLAY_READ_WRITE_BUF_SRAM_EXT
bool "Buffer allocation is done from sram-ext alias"
default n
10 changes: 9 additions & 1 deletion tests/drivers/display/display_read_write/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@
#include <zephyr/ztest.h>
#include <zephyr/device.h>
#include <zephyr/logging/log.h>
#include <zephyr/linker/devicetree_regions.h>

LOG_MODULE_DECLARE(display_api, CONFIG_DISPLAY_LOG_LEVEL);

#if CONFIG_DISPLAY_READ_WRITE_BUF_SRAM_EXT
#define DISP_BUFFER_LINKER_SECTION \
Z_GENERIC_SECTION(LINKER_DT_NODE_REGION_NAME(DT_ALIAS(sram_ext)))
#else
#define DISP_BUFFER_LINKER_SECTION
#endif

static const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_display));
static const uint32_t display_width = DT_PROP(DT_CHOSEN(zephyr_display), width);
static const uint32_t display_height = DT_PROP(DT_CHOSEN(zephyr_display), height);
static uint8_t disp_buffer[DT_PROP(DT_CHOSEN(zephyr_display), width) *
DT_PROP(DT_CHOSEN(zephyr_display), height) * 4];
DT_PROP(DT_CHOSEN(zephyr_display), height) * 4] DISP_BUFFER_LINKER_SECTION;
static struct display_capabilities cfg;
static uint8_t bpp;
static bool is_tiled;
Expand Down

0 comments on commit 6a8ebc2

Please sign in to comment.