1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/auto_init: add periph_ltdc auto_init

This commit is contained in:
Alexandre Abadie 2021-12-22 16:06:39 +01:00
parent 4e582b360f
commit 2703c63397
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405
2 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,44 @@
/*
* Copyright (C) 2021 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 sys_auto_init
* @{
* @file
* @brief initializes LTDC peripheral display device
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
* @}
*/
#include <assert.h>
#include <stddef.h>
#include "log.h"
#include "disp_dev.h"
#include "periph_cpu.h"
static disp_dev_reg_t _disp_dev_reg;
static disp_dev_t _disp_dev;
extern const disp_dev_driver_t stm32_ltdc_disp_dev_driver;
void auto_init_periph_ltdc(void)
{
LOG_DEBUG("[auto_init_screen] initializing LTDC periph\n");
ltdc_init();
_disp_dev_reg.dev = &_disp_dev;
_disp_dev_reg.screen_id = 0;
_disp_dev_reg.dev->driver = &stm32_ltdc_disp_dev_driver;
/* add to disp_dev registry */
disp_dev_reg_add(&_disp_dev_reg);
}

View File

@ -29,6 +29,10 @@ void auto_init_screen(void)
extern void auto_init_ili9341(void);
auto_init_ili9341();
}
if (IS_USED(MODULE_PERIPH_LTDC)) {
extern void auto_init_periph_ltdc(void);
auto_init_periph_ltdc();
}
}
if (IS_USED(MODULE_TOUCH_DEV)) {