mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tests/sys_disp_dev: add disp_dev test application
This commit is contained in:
parent
acfac5d32d
commit
ede7836b16
9
tests/disp_dev/Makefile
Normal file
9
tests/disp_dev/Makefile
Normal file
@ -0,0 +1,9 @@
|
||||
BOARD ?= stm32f429i-disc1
|
||||
include ../Makefile.tests_common
|
||||
|
||||
DISABLE_MODULE += test_utils_interactive_sync
|
||||
|
||||
USEMODULE += ili9341
|
||||
USEMODULE += disp_dev
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
14
tests/disp_dev/Makefile.ci
Normal file
14
tests/disp_dev/Makefile.ci
Normal file
@ -0,0 +1,14 @@
|
||||
BOARD_INSUFFICIENT_MEMORY := \
|
||||
arduino-duemilanove \
|
||||
arduino-leonardo \
|
||||
arduino-mega2560 \
|
||||
arduino-nano \
|
||||
arduino-uno \
|
||||
atmega1284p \
|
||||
atmega328p \
|
||||
derfmega128 \
|
||||
mega-xplained \
|
||||
microduino-corerf \
|
||||
stm32f030f4-demo \
|
||||
waspmote-pro \
|
||||
#
|
68
tests/disp_dev/main.c
Normal file
68
tests/disp_dev/main.c
Normal file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Inria
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup tests
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Generic display device test application
|
||||
*
|
||||
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "disp_dev.h"
|
||||
|
||||
#include "ili9341.h"
|
||||
#include "ili9341_params.h"
|
||||
#include "ili9341_disp_dev.h"
|
||||
|
||||
#include "riot_logo.h"
|
||||
|
||||
#include "test_utils/expect.h"
|
||||
|
||||
static ili9341_t ili9341;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
#ifdef BOARD_PINETIME
|
||||
/* on PineTime, enable the backlight */
|
||||
gpio_clear(LCD_BACKLIGHT_LOW);
|
||||
#endif
|
||||
|
||||
ili9341_init(&ili9341, &ili9341_params[0]);
|
||||
|
||||
disp_dev_t *dev = (disp_dev_t *)&ili9341;
|
||||
dev->driver = &ili9341_disp_dev_driver;
|
||||
|
||||
disp_dev_set_invert(dev, true);
|
||||
|
||||
uint16_t max_width = disp_dev_width(dev);
|
||||
uint16_t max_height = disp_dev_height(dev);
|
||||
|
||||
expect(max_width == ili9341.params->lines);
|
||||
expect(max_height == 240);
|
||||
|
||||
uint16_t color = 0;
|
||||
for (uint16_t y = 0; y < max_height; ++y) {
|
||||
for (uint16_t x = 0; x < max_width; ++x) {
|
||||
disp_dev_map(dev, x, x, y, y, &color);
|
||||
}
|
||||
}
|
||||
|
||||
disp_dev_map(dev, 95, 222, 85, 153, (const uint16_t *)picture);
|
||||
|
||||
puts("SUCCESS");
|
||||
|
||||
return 0;
|
||||
}
|
1058
tests/disp_dev/riot_logo.h
Normal file
1058
tests/disp_dev/riot_logo.h
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user