mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys/auto_init/screen: rename st7735 to more generic st77xx
This commit is contained in:
parent
f64890a43b
commit
b5b4ad4a69
@ -26,34 +26,34 @@
|
||||
#include "lcd.h"
|
||||
#include "lcd_disp_dev.h"
|
||||
|
||||
#include "st7735.h"
|
||||
#include "st7735_params.h"
|
||||
#include "st77xx.h"
|
||||
#include "st77xx_params.h"
|
||||
|
||||
#ifndef ST7735_NUMOF
|
||||
#define ST7735_NUMOF 0
|
||||
#ifndef ST77XX_NUMOF
|
||||
#define ST77XX_NUMOF 0
|
||||
#endif
|
||||
#ifndef ST7735_SCREEN_NUMOF
|
||||
#define ST7735_SCREEN_NUMOF 0
|
||||
#ifndef ST77XX_SCREEN_NUMOF
|
||||
#define ST77XX_SCREEN_NUMOF 0
|
||||
#endif
|
||||
|
||||
static st7735_t st7735_devs[ST7735_NUMOF];
|
||||
static st77xx_t st77xx_devs[ST77XX_NUMOF];
|
||||
|
||||
static disp_dev_reg_t disp_dev_entries[ST7735_NUMOF];
|
||||
static disp_dev_reg_t disp_dev_entries[ST77XX_NUMOF];
|
||||
|
||||
void auto_init_st7735(void)
|
||||
void auto_init_st77xx(void)
|
||||
{
|
||||
assert(ST7735_NUMOF == ST7735_SCREEN_NUMOF);
|
||||
assert(ST77XX_NUMOF == ST77XX_SCREEN_NUMOF);
|
||||
|
||||
for (size_t i = 0; i < ST7735_NUMOF; i++) {
|
||||
st7735_devs[i].dev.driver = &lcd_st7735_driver;
|
||||
for (size_t i = 0; i < ST77XX_NUMOF; i++) {
|
||||
st77xx_devs[i].dev.driver = &lcd_st77xx_driver;
|
||||
LOG_DEBUG("[auto_init_screen] initializing st7735 #%u\n", i);
|
||||
if (lcd_init(&st7735_devs[i].dev, &st7735_params[i]) < 0) {
|
||||
if (lcd_init(&st77xx_devs[i].dev, &st77xx_params[i]) < 0) {
|
||||
LOG_ERROR("[auto_init_screen] error initializing st7735 #%u\n", i);
|
||||
continue;
|
||||
}
|
||||
|
||||
disp_dev_entries[i].dev = (disp_dev_t *) &st7735_devs[i].dev;
|
||||
disp_dev_entries[i].screen_id = st7735_screen_ids[i];
|
||||
disp_dev_entries[i].dev = (disp_dev_t *) &st77xx_devs[i].dev;
|
||||
disp_dev_entries[i].screen_id = st77xx_screen_ids[i];
|
||||
disp_dev_entries[i].dev->driver = &lcd_disp_dev_driver;
|
||||
|
||||
/* add to disp_dev registry */
|
@ -33,9 +33,9 @@ void auto_init_screen(void)
|
||||
extern void auto_init_periph_ltdc(void);
|
||||
auto_init_periph_ltdc();
|
||||
}
|
||||
if (IS_USED(MODULE_ST7735)) {
|
||||
extern void auto_init_st7735(void);
|
||||
auto_init_st7735();
|
||||
if (IS_USED(MODULE_ST77XX)) {
|
||||
extern void auto_init_st77xx(void);
|
||||
auto_init_st77xx();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user