WL818_SDK/src/include/hal_edp_rx.h

106 lines
2.6 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*******************************************************************************
* 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