1 /* 2 * Copyright 2024 NXP 3 * All rights reserved. 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 */ 7 8 #ifndef _FSL_DC_FB_DBI_H_ 9 #define _FSL_DC_FB_DBI_H_ 10 11 #include "fsl_dc_fb.h" 12 #include "fsl_dbi.h" 13 14 /*! 15 * @addtogroup dc_fb_dbi 16 * @{ 17 */ 18 19 /* 20 * Change log: 21 * 22 * - 1.0.0 23 * - Initial version 24 */ 25 26 /******************************************************************************* 27 * Definitions 28 ******************************************************************************/ 29 30 /*! @brief Data for DBI display controller driver handle. */ 31 typedef struct _dc_fb_dbi_handle 32 { 33 /* These items are initialized in driver */ 34 uint8_t initTimes; /*!< How many times the displa controller is initialized. */ 35 dc_fb_info_t fbInfo; /*!< Frame buffer info. */ 36 dc_fb_callback_t callback; /*!< Callback for frame data sent done. */ 37 void *cbParam; /*!< Callback parameter. */ 38 uint8_t *frameBuffer; /*!< The frame buffer currently used. */ 39 volatile bool fbWaitTE; /*!< There is frame buffer wait to send at next TE. */ 40 41 /* These items are initialized by application. */ 42 dbi_iface_t *dbiIface; /*!< DBI interface. */ 43 uint16_t width; /*!< Panel width. */ 44 uint16_t height; /*!< Panel height. */ 45 video_pixel_format_t pixelFormat; /*!< Panel pixel format. */ 46 bool useTEPin; /*!< Whether to use the panel TE pin to handle tearing effect. */ 47 } dc_fb_dbi_handle_t; 48 49 extern const dc_fb_ops_t g_dcFbOpsDbi; 50 51 /******************************************************************************* 52 * API 53 ******************************************************************************/ 54 55 #if defined(__cplusplus) 56 extern "C" { 57 #endif 58 59 status_t DC_FB_DBI_Init(const dc_fb_t *dc); 60 status_t DC_FB_DBI_Deinit(const dc_fb_t *dc); 61 status_t DC_FB_DBI_EnableLayer(const dc_fb_t *dc, uint8_t layer); 62 status_t DC_FB_DBI_DisableLayer(const dc_fb_t *dc, uint8_t layer); 63 status_t DC_FB_DBI_SetLayerConfig(const dc_fb_t *dc, uint8_t layer, dc_fb_info_t *fbInfo); 64 status_t DC_FB_DBI_GetLayerDefaultConfig(const dc_fb_t *dc, uint8_t layer, dc_fb_info_t *fbInfo); 65 status_t DC_FB_DBI_SetFrameBuffer(const dc_fb_t *dc, uint8_t layer, void *frameBuffer); 66 uint32_t DC_FB_DBI_GetProperty(const dc_fb_t *dc); 67 void DC_FB_DBI_SetCallback(const dc_fb_t *dc, uint8_t layer, dc_fb_callback_t callback, void *param); 68 69 /* 70 * If useTEPin is true, the driver will use TE pin to handle tearing effect. 71 * Then call this function should be called in panel TE pin ISR. 72 */ 73 void DC_FB_DBI_TE_IRQHandler(const dc_fb_t *dc); 74 75 #if defined(__cplusplus) 76 } 77 #endif 78 79 /*! @} */ 80 81 #endif /* _FSL_DC_FB_DBI_H_ */ 82