47. Developer’s Guide¶
47.1. API Reference¶
The statistical information can be obtained after the last pixel of the image passes,
and the user can use CVI_ISP_GetVDTimeOut
to get statistics synchronously.
Refer to the process of 33.1.8. Because the user space task scheduling of Linux system can not guarantee the consistent real-time performance, the driver configuration needs to be completed in kernel space.
ISP provides the registration of synchronous callback interface to synchronize with VD.
In this chapter, there are corresponding interface descriptions.
Users can put tasks with high real-time requirements in synchronous callbacks. The bottom layer provides HwIRQ and Workqueue to implement them. You can choose the corresponding implementation method to determine the real-time level.
HwIRQ means that tasks are implemented in interrupt service, which has the highest real-time performance. The real-time performance of Workqueue depends on Linux system call.
isp_sync_task_register : Register synchronization callback interface with ISP.
isp_sync_task_unregister : Unregister the synchronization callback interface with ISP.
47.1.1. isp_sync_task_register¶
【Description】
Register synchronization callback interface with ISP.
【Syntax】
int isp_sync_task_register(int vi_pipe, struct isp_sync_task_node *new_node);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
vi_pipe |
VI_PIPE number |
Input |
new_node |
Newly inserted synchronization callback node |
Input |
【Retrun Value】
Return Value |
Description |
---|---|
0 |
Success |
non 0 |
Failure. |
【Requirement】
Header files: cvi_vip_isp_ext.h
【Note】
Make sure ISP driver is loaded before use.
Because the internal implementation of ISP synchronization callback does not save the user’s incoming new_Node refers to the entity, so isp_sync_task_node is required to be used to define the entity, which cannot be a local variable.
【Example】
None.
【Related Topic】
47.1.2. isp_sync_task_unregister¶
【Description】
Unregister the synchronization callback interface with ISP.
【Syntax】
int isp_sync_task_unregister(int vi_pipe, struct isp_sync_task_node *del_node);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
vi_pipe |
VI_PIPE number |
Input |
del_node |
Synchronization callback node to be deleted |
Input |
【Retrun Value】
Return Value |
Description |
---|---|
0 |
Success |
non 0 |
Failure. |
【Requirement】
Header files: cvi_vip_isp_ext.h
【Note】
Make sure ISP driver is loaded before use.
【Example】
None.
【Related Topic】
47.2. Data Types¶
isp_sync_tsk_method :Define synchronous callback method to determine real-time performance.
isp_sync_task_node :Define the synchronization callback node information.
47.2.1. isp_sync_tsk_method¶
【Description】
Define synchronous callback method to determine real-time performance.
【Syntax】
enum isp_sync_tsk_method {
ISP_SYNC_TSK_METHOD_HW_IRQ = 0,
ISP_SYNC_TSK_METHOD_WORKQUE,
ISP_SYNC_TSK_METHOD_BUTT
};
【Member】
Member |
Description |
---|---|
ISP_SYNC_TSK_METHOD_HW_IRQ |
Use hardware interrupt to call back. |
ISP_SYNC_TSK_METHOD_HW_WORKQUE |
Use work queue callback. |
【Note】
None.
【Related Data Type and Interface】
None.
47.2.2. isp_sync_task_node¶
【Description】
Define the synchronization callback node information.
【Syntax】
struct isp_sync_task_node {
enum isp_sync_tsk_method method;
__s32 (*isp_sync_tsk_call_back)(__u64 data);
__u64 data;
const char *sz_id;
struct list_head list;
};
【Member】
Member |
Description |
---|---|
method |
Callback mode. |
isp_sync_tsk_call_back |
Callback function, which is passed in when the user registers. |
data |
Callback function parameter, which is passed in when the user registers. |
sz_id |
Node ID |
list |
List node, used to manage multiple callback nodes, no need to pay attention. |
【Example】
isp_sync_task_node sync_node = {
.method = ISP_SYNC_TSK_METHOD_HW_IRQ,
.isp_sync_tsk_call_back = sync_af_calc,
.data = 0,
.sz_id = "hw_0"
};
【Note】
None.
【Related Data Type and Interface】