WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
hcc_if.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2021-2023. All rights reserved.
3 * Description: the header file of hcc public interfacer.
4 */
5
6#ifndef HCC_INTERFACE_H
7#define HCC_INTERFACE_H
8#include "td_type.h"
9#include "hcc_types.h"
10#include "hcc.h"
11#include "hcc_bus.h"
12#include "hcc_test.h"
13#include "hcc_cfg_comm.h"
14
15#ifdef __cplusplus
16#if __cplusplus
17extern "C" {
18#endif
19#endif
20
21#define HCC_TASK_NAME_MAX_LEN 20
22#define HCC_CHANNEL_INVALID TD_U8_MAX
23
37
38/* HCC通道初始化/去初始化 */
41
42/* 获取逻辑通道句柄 */
44
45/*
46 * 使能/禁能调度接收线程,禁能后将使用直调方式
47 */
49
50/*
51 * 使能/禁能调度发送线程,禁能后将使用直调方式
52 */
54
55/*
56 * 消息机制: 该机制只支持通知 msg id, 不支持传数据,若需要传输数据请使用 hcc_tx_data 接口;
57 * 参数service_type: 业务类型,由于每个业务使用的bus可能不同,因此需要传入 service type, hcc才能用对应的bus传输.
58 */
61
62/*
63 * buf是hcc head + payloadl; hcc head由调用者分配空间,由hcc填充;
64 * len:hcc head + payload的总长度; len一定要大于hcc头的长度
65 * 返回值: 成功:EXT_ERR_SUCCESS, 失败:其他值
66 * 若返回失败需要接口调用者释放内存;
67 * 注:所有hcc收到的pkt长度都是包含了hcc头结构的长度。
68 */
71
72/*
73 * 可使用该接口获取 hcc 头结构的长度, hcc_tx_data 接口需要预留 hcc头结构的空间;
74 * Rx callback 中业务也可以使用该接口获取hcc头长度,以偏移到实际 payload 所在位置;
75 */
77
79
80/*************************************************bus layer interface*******************************************/
82
83/*
84 * 读寄存器
85 * chl: 指定通道的寄存器
86 * addr: 寄存器地址数组(sdio:建议高16bit配置为0x4001,低2bit配置为0,
87 * sdio只取addr中第2-15bit的值,其他bit的值忽略,
88 * 因此即使不按照建议配置addr,读取的也依然是0x4001XXXX寄存器。)
89 * value: 保存寄存器值数组
90 */
92
93/*
94 * 写寄存器
95 * chl: 指定通道的寄存器
96 * addr: 寄存器地址数组(sdio:建议高16bit配置为0x4001,低2bit配置为0,
97 * sdio只取addr中第2-15bit的值,其他bit的值忽略,
98 * 因此即使不按照建议配置addr,被写入的也依然是0x4001XXXX寄存器。)
99 * value: 保存寄存器值数组
100 */
102
103/*
104 * 获取通道传输的数据对齐长度
105 */
107
108/*
109 * 设置tx总线聚合层个数.
110 */
112
113/*
114 * 检查并关hcc流控.
115 */
117
118/*************************************************service layer interface*******************************************/
119
120/*
121 * hcc_service_type : 业务枚举类型
122 * chl : 通道ID
123 * hcc_adapt_ops : 业务回调接口
124 */
125/*
126 * 业务初始化,业务类型对应的adapt结构,包括业务的内存分配、流控处理、Rx calbback;
127 */
130/*
131 * 更新流控credit值
132 * 对流控方式为 HCC_FLOWCTRL_CREDIT 的队列才有效;
133 * RX端在内存管理中更新credit值
134 * TX端在发送时获取credit值,根据credit的水线决定是否发送;
135 * 注意: 如果要使用该流控方式,需要在 hcc_service_init 之后使用 hcc_service_update_credit 更新下初始值,否则为0
136 */
138
139/*************************************************flow ctrl interface*******************************************/
140/*
141 * 获取/设置 流控水线值
142 * chl: 逻辑通道
143 * direction: 队列方向
144 * q_id: 队列ID
145 * low_line: 低水线值
146 * high_line: 高水线值
147 */
149 td_u8 low_line, td_u8 high_line);
151 td_u8 *low_line, td_u8 *high_line);
153
154#ifdef CONFIG_HCC_SUPPORT_IPC
155td_u32 hcc_ipc_prequeue_remaining_packets(td_u8 queue_id);
156#endif
157#ifdef __cplusplus
158#if __cplusplus
159}
160#endif
161#endif
162#endif /* HCC_INTERFACE_H */
enum _hcc_serv_main_type hcc_service_type
td_u32 hcc_tx_msg_type
Definition hcc_cfg_comm.h:119
enum _hcc_bus_type_ hcc_bus_type
td_u32 hcc_rx_msg_type
Definition hcc_cfg_comm.h:120
td_u32 hcc_flowctrl_check_with_off(td_u8 *data)
hcc_handler * hcc_get_handler(td_u8 chl)
td_u8 hcc_init(hcc_channel_param *init)
td_void hcc_enable_tx_thread(td_u8 chl, td_bool enable)
td_void hcc_set_tx_sched_count(td_u8 chl, td_u8 count)
ext_errno hcc_read_reg(td_u8 chl, td_u32 addr, td_u32 *value)
ext_errno hcc_message_unregister(td_u8 chl, td_u8 rsv, hcc_rx_msg_type msg_id)
td_bool hcc_get_state(td_u8 chl)
ext_errno hcc_flow_ctrl_get_water_line(td_u8 chl, hcc_queue_dir direction, td_u8 q_id, td_u8 *low_line, td_u8 *high_line)
td_u16 hcc_get_head_len(td_void)
td_void hcc_enable_rx_thread(td_u8 chl, td_bool enable)
ext_errno hcc_bt_tx_data(td_u8 chl, td_u8 *data_buf, td_u16 len, hcc_transfer_param *param)
td_void hcc_ipc_complement_mem(td_void)
ext_errno hcc_flow_ctrl_set_water_line(td_u8 chl, hcc_queue_dir direction, td_u8 q_id, td_u8 low_line, td_u8 high_line)
ext_errno hcc_message_register(td_u8 chl, td_u8 rsv, hcc_rx_msg_type msg_id, hcc_msg_rx cb, td_u8 *cb_data)
ext_errno hcc_tx_data(td_u8 chl, td_u8 *buf, td_u16 len, hcc_transfer_param *param)
td_void hcc_deinit(td_u8 chl)
ext_errno hcc_write_reg(td_u8 chl, td_u32 addr, td_u32 value)
ext_errno hcc_service_init(td_u8 chl, hcc_service_type service_type, hcc_adapt_ops *adapt)
td_u32 hcc_get_channel_align_len(td_u8 chl)
ext_errno hcc_send_message(td_u8 chl, hcc_tx_msg_type msg_id, td_u8 rsv)
ext_errno hcc_service_deinit(td_u8 chl, hcc_service_type service_type)
td_void hcc_service_update_credit(td_u8 chl, hcc_service_type serv, td_u32 credit)
enum _hcc_queue_dir_ hcc_queue_dir
td_u32(* hcc_msg_rx)(td_u8 *cb_data)
Definition hcc_types.h:38
osal_u8 rsv[3]
Definition oal_net.h:2
ext_errno
Definition soc_errno.h:9
Definition hcc_types.h:71
Definition hcc.h:81
Definition hcc_types.h:30
Definition hcc_if.h:24
td_u16 rsv
Definition hcc_if.h:35
td_u8 service_max_cnt
Definition hcc_if.h:29
td_u16 unc_pool_size
Definition hcc_if.h:33
hcc_bus_type bus_type
Definition hcc_if.h:25
td_u8 task_pri
Definition hcc_if.h:28
td_u8 queue_len
Definition hcc_if.h:31
td_u16 tx_fail_num_limit
Definition hcc_if.h:30
td_u8 unc_pool_low_limit
Definition hcc_if.h:32
hcc_queue_cfg * queue_cfg
Definition hcc_if.h:26
td_u16 max_proc_packets_per_loop
Definition hcc_if.h:34
td_char * task_name
Definition hcc_if.h:27
Definition hcc_types.h:95
unsigned short td_u16
Definition td_type.h:37
unsigned char td_u8
Definition td_type.h:36
td_u8 td_bool
Definition td_type.h:50
void td_void
Definition td_type.h:49
unsigned int td_u32
Definition td_type.h:38
char td_char
Definition td_type.h:41
Definition hal_uart_v151_regs_def.h:38