MXC_A39_20240320/SW/components/drivers/bsp/display/driver_display.c

203 lines
4.2 KiB
C

/*
******************************************************************************
* @file driver_display.c
* @author FreqChip Firmware Team
* @version V1.0.0
* @date 2022
* @brief display abstract interfase.
******************************************************************************
* @attention
*
* Copyright (c) 2022 FreqChip.
* All rights reserved.
******************************************************************************
*/
#include <stdint.h>
#include "app_lvgl.h"
#include "app_config.h"
#include "driver_display.h"
#ifdef DISPLAY_TYPE_GC9C01
#include "driver_gc9c01.h"
#endif
#ifdef DISPLAY_TYPE_JD9854
#include "driver_jd9854.h"
#endif
#ifdef DISPLAY_TYPE_SH8601A
#include "driver_sh8601a.h"
#endif
#ifdef DISPLAY_TYPE_ICNA3310
#include "driver_icna3310.h"
#endif
#ifdef DISPLAY_TYPE_SH8601Z
#include "driver_sh8601z.h"
#endif
#ifdef DISPLAY_TYPE_NV3047_RGB
#include "driver_nv3047_rgb.h"
#endif
#ifdef DISPLAY_TYPE_ST7701_RGB
#include "driver_st7701_rgb.h"
#endif
#ifdef DISPLAY_TYPE_NV3041A
#include "driver_nv3041a.h"
#endif
void display_init(void)
{
#ifdef DISPLAY_TYPE_GC9C01
gc9c01_init();
#endif
#ifdef DISPLAY_TYPE_JD9854
jd9854_init();
#endif
#ifdef DISPLAY_TYPE_SH8601A
sh8601a_init();
#endif
#ifdef DISPLAY_TYPE_ICNA3310
icna3310_init();
#endif
#ifdef DISPLAY_TYPE_SH8601Z
sh8601z_init();
#endif
#ifdef DISPLAY_TYPE_NV3047_RGB
extern void* get_display_buffer1(void);
extern void rgb_display_controller_init(void);
rgb_display_controller_init();
rgb_display_init(get_display_buffer1());
#endif
#ifdef DISPLAY_TYPE_ST7701_RGB
extern void* get_display_buffer1(void);
st7701_init(get_display_buffer1());
#endif
#ifdef DISPLAY_TYPE_NV3041A
nv3041a_init();
#endif
}
void display_set_window(uint16_t x_s, uint16_t x_e, uint16_t y_s, uint16_t y_e)
{
#ifdef DISPLAY_TYPE_GC9C01
gc9c01_set_window(x_s, x_e, y_s, y_e);
#endif
#ifdef DISPLAY_TYPE_JD9854
jd9854_set_window(x_s, x_e, y_s, y_e);
#endif
#ifdef DISPLAY_TYPE_SH8601A
sh8601a_set_window(x_s, x_e, y_s, y_e);
#endif
#ifdef DISPLAY_TYPE_ICNA3310
icna3310_set_window(x_s, x_e, y_s, y_e);
#endif
#ifdef DISPLAY_TYPE_SH8601Z
sh8601z_set_window(x_s, x_e, y_s, y_e);
#endif
#ifdef DISPLAY_TYPE_NV3041A
nv3041a_set_window(x_s, x_e, y_s, y_e);
#endif
}
void display_update(uint32_t pixel_count, uint8_t pixel_width, void *data)
{
#ifdef DISPLAY_TYPE_GC9C01
gc9c01_display(pixel_count, pixel_width, data);
#endif
#ifdef DISPLAY_TYPE_JD9854
jd9854_display(pixel_count, pixel_width, data);
#endif
#ifdef DISPLAY_TYPE_SH8601A
sh8601a_display(pixel_count, pixel_width, data);
#endif
#ifdef DISPLAY_TYPE_ICNA3310
icna3310_display(pixel_count, pixel_width, data);
#endif
#ifdef DISPLAY_TYPE_SH8601Z
sh8601z_display(pixel_count, pixel_width, data);
#endif
#ifdef DISPLAY_TYPE_NV3041A
nv3041a_display(pixel_count, pixel_width, data);
#endif
}
void display_update_dma(uint32_t pixel_count, uint8_t pixel_width, void *data)
{
#ifdef DISPLAY_TYPE_GC9C01
gc9c01_display_dma(pixel_count, pixel_width, data);
#endif
#ifdef DISPLAY_TYPE_JD9854
jd9854_display_dma(pixel_count, pixel_width, data);
#endif
#ifdef DISPLAY_TYPE_SH8601A
sh8601a_display_dma(pixel_count, pixel_width, data);
#endif
#ifdef DISPLAY_TYPE_ICNA3310
icna3310_display_dma(pixel_count, pixel_width, data);
#endif
#ifdef DISPLAY_TYPE_SH8601Z
sh8601z_display_dma(pixel_count, pixel_width, data);
#endif
#ifdef DISPLAY_TYPE_NV3047_RGB
#endif
#ifdef DISPLAY_TYPE_ST7701_RGB
#endif
#ifdef DISPLAY_TYPE_NV3041A
nv3041a_display_dma(pixel_count, pixel_width, data);
#endif
}
void display_power_off(void)
{
#ifdef DISPLAY_TYPE_SH8601Z
sh8601z_power_off();
#endif
}
void display_power_on(void)
{
#ifdef DISPLAY_TYPE_SH8601Z
sh8601z_power_on();
#endif
}
void display_update_dma_isr(void)
{
#ifdef DISPLAY_TYPE_GC9C01
gc9c01_display_dma_isr();
#endif
#ifdef DISPLAY_TYPE_JD9854
jd9854_display_dma_isr();
#endif
#ifdef DISPLAY_TYPE_SH8601A
sh8601a_display_dma_isr();
#endif
#ifdef DISPLAY_TYPE_ICNA3310
icna3310_display_dma_isr();
#endif
#ifdef DISPLAY_TYPE_SH8601Z
sh8601z_display_dma_isr();
#endif
#ifdef DISPLAY_TYPE_ST7701_RGB
st7701_rgb_display_dma_irq();
#endif
#ifdef DISPLAY_TYPE_NV3041A
nv3041a_display_dma_isr();
#endif
}