当前Media 驱动控制器主要为用户提供了以下功能接口
驱动组成由以下所示 :
.
├── fdc.c
├── fdc.h
├── fdc_static.c
├── fdc_hw.c
├── fdc_hw.h
├── fdc_g.c
├── fdc_common_hw.c
├── fdc_common_hw.h
├── fdp.c
├── fdp.h
├── fdp_static.c
├── fdp_phy.c
├── fdp_phy.h
├── fdp_hw.c
├── fdp_hw.h
├── fdp_g.c
├── fdp_aux.c
├── fdp_aux.h
├── fdp_edid.c
├── fdp_edia.h
├── fdp_audio.c
├── fdp_audio.h
├── fdcdp.c
├── fdcdp.h
├── fdcdp_intr.c
其中fdcdp.h 为用户开发者主要使用接口,提供了以下功能:
typedef struct
{
/* fdc instace object */
FDcCtrl dc_instance_p[FDCDP_INSTANCE_NUM];
/* fdp instace object */
FDpCtrl dp_instance_p[FDCDP_INSTANCE_NUM];
/* user config;*/
FDcDpUserConfig user_config[FDCDP_INSTANCE_NUM];
/*the intr config of dcdp*/
FMediaIntrConfig intr_event[FDCDP_INTR_MAX_NUM];
/*connect status ,1 :connected,0:disconnected*/
u32 connect_flg[FDCDP_INSTANCE_NUM];
/* Device is ininitialized and ready*/
u32 is_ready;
} FDcDp;
其中FdcPrivateParams结构体为dc模块相关变量,包含有时序,frambuffer,pannel,gamma,dither,cursor等等;FdpPrivateParams结构体为dp模块相关变量,包括有时序,传输参数,phy等等。
```c
dc 相关结构体定义
typedef struct
{
FDcDtdTable dtd_table; /*the table of dtd params*/
FDcSyncParameter sync_parameter[FDC_GOP_MAX_MODENUM];
FDcDisplayFramebuffer framebuffer;
FDcDisplayPanel panel;
FDcDisplayGamma gamma;
FDcDisplayDither dither;
FDcDisplayDpMode dp_mode;
FDcDisplayVideoMode video_mode; /*the params of video*/
FDcDisplayCursor cursor;
FDcDisplaySetting display_setting[FDC_DISPLAY_ID_MAX_NUM];
} FDcCurrentConfig;
typedef struct
{
u32 instance_id; /* dc id */
uintptr dcch_baseaddr; /* DC channel register address*/
uintptr dcctrl_baseaddr; /* DC control register address */
u32 irq_num; /* Device interrupt id */
} FDcConfig;
typedef struct
{
FDcCurrentConfig fdc_currentconfig;
FDcConfig config;
u32 multi_mode; /* The display mode of the device , including clone, horizontal and vertical display*/
} FDcCtrl;
dp 相关结构体
typedef struct
{
/* set the parameters of sync */
FDpSyncParameter sync_parameter[DP_GOP_MAX_MODENUM];
/*the trans config*/
FDpTransmissionConfig transmission_config;
/*audio config*/
FDpAudioConfig audio_config;
/* 当前状态 */
FDpStatus status;
u8 down_spread_enable;
#define DTD_MAX 4
/* edid 缓冲数据 */
FDpDtdTable dtd_table[DTD_MAX]; /* the max dtd num is 4 */
} FDpCurrentConfig;
typedef struct
{
u32 instance_id;
uintptr dp_channe_base_addr;
uintptr dp_phy_base_addr;
u32 irq_num;
} FDpConfig;
typedef struct
{
FDpCurrentConfig fdp_current_config;
FDpConfig config;
} FDpCtrl;
中断 相关结构体
typedef enum
{
FDCDP_HPD_IRQ_CONNECTED = 0, /* hpd 中断 */
FDCDP_HPD_IRQ_DISCONNECTED,
FDCDP_AUX_REPLY_TIMEOUT,
FDCDP_AUX_REPLY_ERROR,
FDCDP_INTR_MAX_NUM
} FDcDpIntrEventType;
typedef void (*FDcDpIntrHandler )(void *param, u32 index);
typedef struct
{
FDcDpIntrEventType; /* data */
FDcDpIntrHandler handler;
void *param;
} FMediaIntrConfig;
FMEDIA_DEFAULT_PARAM_ERR /*获取默认参数失败 */ FMEDIA_ERR_PIXEL /* 时钟设置错误 */ FMEDIA_ERR_EDID /* EDID参数获取错误*/ FMEDIA_AUX_CONNECT_FAILED /* AUX连接失败 */ FMEDIA_TRAIN_TIME_ERR /* dp train次数超过5次还未能连接 */ FMEDIA_REACH_MAX_VOLTAGE /*已经达到最大电压设置 */ FMEDIA_ERR_HPD_DISCONNECTED /* HPD 连接错误 */
当您在使用显示驱动时,有必要将显示系统中的关键参数为您介绍:
显示器能够呈现的最基本的单元是像素,显示器的显示区域正是被像素点所填充,显示器的分辨率就代表了显示器所能呈现的最大像素点,通常使用较多的是1024768,19201080几种,在本驱动中,已将板卡支持分辨率统一至dpSyncTable,dcSyncTable中
色彩深度是用「n位元颜色」(n-bit colour)来作为单位的。若色彩深度是n位元,即有2的n次方种颜色选择,而储存每像素所用的位数目就是n,通常您见到最多的一般是16bit或32bit
显示器每秒刷新画面的次数;单位是Hz;例如60Hz,120Hz
像素时钟 = 实际的水平像素垂直像素刷新率(像素数包括消隐数据)
比如 {800 , 525 , 1 , 1 , 96 , 2 , 640 , 480 , 144 , 35 , 0 , 0 } 640*480@60Hz
像素时钟 = 80052560 = 25.2 Mhz Vesa标准采用25.175
其中第一个例程只是点亮屏幕;第二个例程可与lvgl库进行连接,测试
FDcConfig *FDcLookupConfig(u32 instance_id)
FDpConfig *FDpLookupConfig(u32 instance_id)
获取当前FDC驱动默认配置
获取当前FDP驱动默认配置
FDcConfig * :dc静态默认配置 FDpConfig * :dp静态默认配置
FError FDcDpInitial(FDcDp *instance_p,u32 channel);
void FDcDpRegisterHandler(FDcDp *instance_p, FDcDpIntrEventType type,FMediaIntrHandler handler,void *param)
void FDcDpInterruptHandler(s32 vector, void *args);
-中断handle处理函数
s32 vector 中断返回值
void *irq_args 回调结构体指针
void FDcDpIrqEnable(FDcDp *instance_p,u32 index, FDcDpIntrEventType intr_event_p);
-中断使能函数
FDcDp *instance_p dcdp驱动实例
u32 index 通道序号
FMediaIntrConfig intr_event_p 中断类型
FError FDcConfigInit(FDcCtrl *instance_p);
FDcCtrl *instance_p dc驱动实例
FError FDpInit(FDcCtrl *dc_config, FDpCtrl *dp_config, FDcDisplaySetting *gop_mode, u32 mode_id);
FDcCtrl *dc_config dc驱动实例
FDpCtrl *dp_config dp驱动实例
FDcDisplaySetting *gop_mode 显示时序参数
u32 mode_id 显示参数模式号
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。