Camsys 时间戳信息简介

不同平台时间戳介绍

1.征程 3 平台

其中 u64 timestamps: 硬件时间戳,是跟 CPU 一起用的 64 bit system counter,1s 是 24M 个 clock。 FS 的时候从硬件寄存器读取。读取的值除以 24000 是毫秒,除以 24000000 是秒。

struct timeval tv; 系统时间, SIF FS 的时候获取 do_gettimeofday。

C 复制代码
J3 时间戳和frameid相关的结构体定义如下:
驱动接口:
struct frame_id {
    u32 frame_id;
    u64 timestamps;
    struct timeval tv;
};
HAL结构体:
typedef struct image_info_s {
    uint16_t sensor_id;
    uint32_t pipeline_id;
    uint32_t frame_id;
    uint64_t time_stamp;    //HW time stamp 硬件时间
    struct timeval tv;     //system time of hal get buf,系统时间
    int buf_index;
    int img_format;
    int fd[HB_VIO_BUFFER_MAX_PLANES];//ion buf fd
    uint32_t size[HB_VIO_BUFFER_MAX_PLANES];
    uint32_t planeCount;
    uint32_t dynamic_flag;
    uint32_t water_mark_line;
    VIO_DATA_TYPE_E data_type;
    buffer_state_e state;
} image_info_t;

2.征程 5 平台

其中的 tv 时间戳来源三种可选,通过设备树可以设置默认来源,通过 sys 节点可以动态临时修改来源

C 复制代码
typedef struct _frame_info_s{
        uint32_t frame_id;
        uint64_t timestamps;//hw_timestamp (硬件时间戳)
        struct timeval tv;// 系统时间(软件时间戳)
        uint32_t format;
        uint32_t height;
        uint32_t width;
        uint64_t addr[7];
        uint32_t pre_int;
        uint32_t num_planes;
        int32_t bufferindex;
        uint32_t pixel_length;
        uint32_t dynamic_flag;
} frame_info_t;

3.征程 6 平台

相较与 征程 5, 增加了 lpwm 信号的 trig 时间,同时 tv 时间中的 phc 由硬件自动缓存。

C 复制代码
typedef struct image_info_s {
        uint16_t sensor_id; /**< sensor id */
        uint32_t pipeline_id; /**< pipeline id */
        uint32_t frame_id; /**< frame id */
        uint64_t time_stamp; /**< HW time stamp */
        struct timeval tv; /**< system time of hal get buf */
        int32_t buf_index; /**< buffer index */
        int32_t img_format; /**< image format */
        int32_t fd[HB_VIO_BUFFER_MAX_PLANES]; /**< ion buf fd */
        uint32_t size[HB_VIO_BUFFER_MAX_PLANES]; /**< buffer size per plane */
        uint32_t planeCount; /**< image plane count */
        uint32_t dynamic_flag; /**< dynamic flag */
        uint32_t water_mark_line; /**< water mark line value */
        VIO_DATA_TYPE_E data_type; /**< buffer data type */
        buffer_state_e state; /**< buffer state */
        uint64_t desc; /**< temp description for isp raw feedback */
        struct timeval trig_tv;/**< system time of lpwm trigger */
} image_info_t;
相关推荐
乌萨奇也要立志学C++23 分钟前
【洛谷】BFS 求解最短路:从马的遍历到迷宫问题的实战解析
算法·宽度优先
老鼠只爱大米32 分钟前
LeetCode经典算法面试题 #46:全排列(回溯、交换、剪枝等五种实现方案详细解析)
算法·leetcode·剪枝·回溯·全排列·stj算法
Dovis(誓平步青云)1 小时前
《滑动窗口算法:从 “暴力遍历” 到 “线性高效” 的思维跃迁》
运维·服务器·数据库·算法
_OP_CHEN1 小时前
【算法基础篇】(五十七)线性代数之矩阵乘法从入门到实战:手撕模板 + 真题详解
线性代数·算法·矩阵·蓝桥杯·c/c++·矩阵乘法·acm/icpc
天天爱吃肉82181 小时前
【跨界封神|周杰伦×王传福(陶晶莹主持):音乐创作与新能源NVH测试,底层逻辑竟完全同源!(新人必看入行指南)】
python·嵌入式硬件·算法·汽车
im_AMBER1 小时前
Leetcode 114 链表中的下一个更大节点 | 删除排序链表中的重复元素 II
算法·leetcode
xhbaitxl1 小时前
算法学习day38-动态规划
学习·算法·动态规划
多恩Stone2 小时前
【3D AICG 系列-6】OmniPart 训练流程梳理
人工智能·pytorch·算法·3d·aigc
历程里程碑2 小时前
普通数组----轮转数组
java·数据结构·c++·算法·spring·leetcode·eclipse
pp起床2 小时前
贪心算法 | part02
算法·leetcode·贪心算法