1#ifndef DVSYNC_PRO_INTERFACE_HPP
2#define DVSYNC_PRO_INTERFACE_HPP
4#include "DvsenseHal/EventStream/V4l2DataTransfer.hpp"
5#include "DvsenseHal/interface/Interface.hpp"
14#ifdef DVSENSE_HAL_EXPORTS
15#define DVSENSE_API __declspec(dllexport)
17#define DVSENSE_API __declspec(dllimport)
67 PwmConfig xvs{
"/sys/class/pwm/pwmchip0", 67000000, 200000,
"inversed"};
72 static std::shared_ptr<DVSyncProInterface>
create();
77 std::vector<uint32_t>
readRegister(uint32_t address,
int nval)
override;
102 uint32_t readI2c(
const I2cTarget &target, uint32_t address, uint8_t *data, uint16_t length);
103 uint32_t writeI2c(
const I2cTarget &target, uint32_t address,
const uint8_t *data, uint16_t length);
104 bool getV4l2Control(uint32_t
id, int32_t &value)
const;
105 bool setV4l2Control(uint32_t
id, int32_t value)
const;
106 bool configurePwm(
const std::string &chip, uint64_t period, uint64_t duty_cycle,
107 const std::string &polarity);
108 bool setPwmEnabled(
const std::string &chip,
bool enabled);
111 mutable std::mutex aps_control_mutex_;
112 std::mutex i2c_mutex_;
bool prepareAll()
取流前配置处于禁用状态的 PWM 输出,成功返回 true。
uint32_t writeRegisterWithControlTransfer(uint32_t address, uint8_t *data, uint16_t length) override
uint64_t duty_cycle
定义 DVSyncProInterface.hpp:63
uint32_t readRegister(uint32_t address) override
std::string device
定义 DVSyncProInterface.hpp:40
uint32_t writeRegisterWithControlTransfer(uint32_t address, uint32_t value) override
std::string chip
定义 DVSyncProInterface.hpp:61
bool enableAll()
启用配置的同步 PWM 输出,成功返回 true。
std::string aps_subdevice
定义 DVSyncProInterface.hpp:59
I2cTarget aps_i2c
定义 DVSyncProInterface.hpp:58
const V4l2StreamConfig & dvsStreamConfig() const
定义 DVSyncProInterface.hpp:85
V4l2StreamConfig dvs_stream
定义 DVSyncProInterface.hpp:55
const V4l2StreamConfig & apsStreamConfig() const
定义 DVSyncProInterface.hpp:86
V4l2StreamConfig aps_stream
定义 DVSyncProInterface.hpp:56
uint32_t readRegisterWithControlTransfer(uint32_t address, uint8_t *data, uint16_t length) override
uint32_t readRegisterWithControlTransfer(uint32_t address, uint32_t &value) override
const bool isConnected() override
uint16_t slave_address
定义 DVSyncProInterface.hpp:41
bool force_slave
定义 DVSyncProInterface.hpp:46
static std::shared_ptr< DVSyncProInterface > create()
std::string polarity
定义 DVSyncProInterface.hpp:64
uint8_t value_bytes
定义 DVSyncProInterface.hpp:43
DVSyncProInterface(Config config)
I2cTarget dvs_i2c
定义 DVSyncProInterface.hpp:57
PwmConfig xvs
定义 DVSyncProInterface.hpp:67
std::vector< uint32_t > readRegister(uint32_t address, int nval) override
uint64_t period
定义 DVSyncProInterface.hpp:62
bool disableAll()
禁用同步 PWM 输出,成功返回 true。
uint8_t register_address_bytes
定义 DVSyncProInterface.hpp:42
PwmConfig xhs
定义 DVSyncProInterface.hpp:68
void writeRegister(uint32_t address, uint32_t value) override
static std::shared_ptr< DVSyncProInterface > create(Config config)
参考板数据流、I2C 与 PWM 配置;PWM 时间单位为纳秒。
定义 DVSyncProInterface.hpp:54
定义 DVSyncProInterface.hpp:60
定义 DVSyncProInterface.hpp:39
V4L2 采集节点、缓冲区尺寸、格式与传输大小配置。
定义 V4l2DataTransfer.hpp:32