WL818_SDK/src/include/hal_edp_rx.h

106 lines
2.6 KiB
C
Raw Normal View History

/*******************************************************************************
* File: hal_edp_rx.h
* Description: edp rx模块接口
* Version: V1.0
* Date: 2026-2-27
* Author: lyp
*******************************************************************************/
#ifndef __HAL_EDP_RX_H__
#define __HAL_EDP_RX_H__
#include <stdarg.h>
#include "la_config.h"
/**
* @brief SDP数据
* @note
*/
typedef struct _SDP_Info
{
uint8_t SDP_HB[4];
uint8_t SDP_DB[32];
uint8_t SDP_ERR_FLAG[4];
}SDP_Info;
/**
* @brief DPCD地址及对应数据
* @note dpcd_address是DPCD地址
* dpcd_value是DPCD地址里对应的数值
*/
typedef struct _DPCD_Packet
{
uint32_t dpcd_address;
uint8_t dpcd_value;
}DPCD_Packet;
/* SDP更新回调用于获取second data packet */
typedef void (*hal_edp_rx_sdp_cb)(SDP_Info sdp_info);
/* 休眠回调当基板通过AUX往DPCD寄存器600H写02时触发 */
typedef void (*hal_edp_rx_sleep_cb)(void);
/* 唤醒回调当基板reset脚拉高触发 */
typedef void (*hal_edp_rx_wake_cb)(void);
/**
* @brief SDP更新回调注册
* @note sleep_cb是唤醒回调地址
* execute_mode是执行方式true-,false-
*/
typedef struct _SDP_Handle
{
hal_edp_rx_sdp_cb sdp_cb;
bool execute_mode;
}SDP_Handle;
/**
* @brief
* @note sleep_cb是唤醒回调地址
* execute_mode是执行方式true-,false-
*/
typedef struct _Sleep_Handle
{
hal_edp_rx_sleep_cb sleep_cb;
bool execute_mode;
}Sleep_Handle;
/**
* @brief
* @note wake_cb是唤醒回调地址
* execute_mode是执行方式true-,false-
* reset脚接在芯片具体管脚
*/
typedef struct _WAKE_Handle
{
hal_edp_rx_wake_cb wake_cb;
bool execute_mode;
}WAKE_Handle;
/**
* @brief rx相关功能回调
* @note
*/
typedef struct _RX_CB_Handle
{
SDP_Handle sdp_handle;
Sleep_Handle sleep_handle;
WAKE_Handle wake_handle;
}RX_CB_Handle;
/**
* @brief rx相关回调
* @param RX_CB_Handle: rx回调参数结构体
* @retval true-false-
*/
bool hal_edp_rx_cb_init(RX_CB_Handle *rx_cb_handle);
/**
* @brief DPCD寄存器
* @param table_address: DPCD数据表地址
* @param table_size: DPCD数据表大小
* @retval true-false-
*/
bool hal_edp_rx_dpcd_init(const DPCD_Packet *table_address, uint32_t table_size);
#endif