Program Listing for File dvs132s.h

Return to documentation for file (include/libcaer/devices/dvs132s.h)

#ifndef LIBCAER_DEVICES_DVS132S_H_
#define LIBCAER_DEVICES_DVS132S_H_

#include "../events/polarity.h"
#include "../events/special.h"

#include "imu_support.h"
#include "usb.h"

#ifdef __cplusplus
extern "C" {
#endif

#define CAER_DEVICE_DVS132S 7

#define DVS132S_CHIP_ID 15

#define DVS132S_CONFIG_MUX 0
#define DVS132S_CONFIG_DVS 1
#define DVS132S_CONFIG_IMU 3
#define DVS132S_CONFIG_EXTINPUT 4
#define DVS132S_CONFIG_BIAS 5
#define DVS132S_CONFIG_SYSINFO 6
#define DVS132S_CONFIG_USB 9

#define DVS132S_CONFIG_MUX_RUN 0
#define DVS132S_CONFIG_MUX_TIMESTAMP_RUN 1
#define DVS132S_CONFIG_MUX_TIMESTAMP_RESET 2
#define DVS132S_CONFIG_MUX_RUN_CHIP 3
#define DVS132S_CONFIG_MUX_DROP_EXTINPUT_ON_TRANSFER_STALL 4
#define DVS132S_CONFIG_MUX_DROP_DVS_ON_TRANSFER_STALL 5
#define DVS132S_CONFIG_MUX_HAS_STATISTICS 80
#define DVS132S_CONFIG_MUX_STATISTICS_EXTINPUT_DROPPED 81
#define DVS132S_CONFIG_MUX_STATISTICS_DVS_DROPPED 83

#define DVS132S_CONFIG_DVS_SIZE_COLUMNS 0
#define DVS132S_CONFIG_DVS_SIZE_ROWS 1
#define DVS132S_CONFIG_DVS_ORIENTATION_INFO 2
#define DVS132S_CONFIG_DVS_RUN 3
#define DVS132S_CONFIG_DVS_WAIT_ON_TRANSFER_STALL 4
#define DVS132S_CONFIG_DVS_FILTER_AT_LEAST_2_UNSIGNED 5
#define DVS132S_CONFIG_DVS_FILTER_NOT_ALL_4_UNSIGNED 6
#define DVS132S_CONFIG_DVS_FILTER_AT_LEAST_2_SIGNED 7
#define DVS132S_CONFIG_DVS_FILTER_NOT_ALL_4_SIGNED 8
#define DVS132S_CONFIG_DVS_RESTART_TIME 9
#define DVS132S_CONFIG_DVS_CAPTURE_INTERVAL 10
#define DVS132S_CONFIG_DVS_ROW_ENABLE_31_TO_0 20
#define DVS132S_CONFIG_DVS_ROW_ENABLE_63_TO_32 21
#define DVS132S_CONFIG_DVS_ROW_ENABLE_65_TO_64 22
#define DVS132S_CONFIG_DVS_COLUMN_ENABLE_31_TO_0 50
#define DVS132S_CONFIG_DVS_COLUMN_ENABLE_51_TO_32 51
#define DVS132S_CONFIG_DVS_HAS_STATISTICS 80
#define DVS132S_CONFIG_DVS_STATISTICS_TRANSACTIONS_SUCCESS 81
#define DVS132S_CONFIG_DVS_STATISTICS_TRANSACTIONS_SKIPPED 83
#define DVS132S_CONFIG_DVS_STATISTICS_TRANSACTIONS_ERRORED 91

#define DVS132S_CONFIG_IMU_TYPE 0
#define DVS132S_CONFIG_IMU_ORIENTATION_INFO 1
#define DVS132S_CONFIG_IMU_RUN_ACCELEROMETER 2
#define DVS132S_CONFIG_IMU_RUN_GYROSCOPE 3
#define DVS132S_CONFIG_IMU_RUN_TEMPERATURE 4
#define DVS132S_CONFIG_IMU_ACCEL_DATA_RATE 5
#define DVS132S_CONFIG_IMU_ACCEL_FILTER 6
#define DVS132S_CONFIG_IMU_ACCEL_RANGE 7
#define DVS132S_CONFIG_IMU_GYRO_DATA_RATE 8
#define DVS132S_CONFIG_IMU_GYRO_FILTER 9
#define DVS132S_CONFIG_IMU_GYRO_RANGE 10

#define DVS132S_CONFIG_EXTINPUT_RUN_DETECTOR 0
#define DVS132S_CONFIG_EXTINPUT_DETECT_RISING_EDGES 1
#define DVS132S_CONFIG_EXTINPUT_DETECT_FALLING_EDGES 2
#define DVS132S_CONFIG_EXTINPUT_DETECT_PULSES 3
#define DVS132S_CONFIG_EXTINPUT_DETECT_PULSE_POLARITY 4
#define DVS132S_CONFIG_EXTINPUT_DETECT_PULSE_LENGTH 5
#define DVS132S_CONFIG_EXTINPUT_HAS_GENERATOR 10
#define DVS132S_CONFIG_EXTINPUT_RUN_GENERATOR 11
#define DVS132S_CONFIG_EXTINPUT_GENERATE_PULSE_POLARITY 12
#define DVS132S_CONFIG_EXTINPUT_GENERATE_PULSE_INTERVAL 13
#define DVS132S_CONFIG_EXTINPUT_GENERATE_PULSE_LENGTH 14
#define DVS132S_CONFIG_EXTINPUT_GENERATE_INJECT_ON_RISING_EDGE 15
#define DVS132S_CONFIG_EXTINPUT_GENERATE_INJECT_ON_FALLING_EDGE 16

#define DVS132S_CONFIG_SYSINFO_LOGIC_VERSION 0
#define DVS132S_CONFIG_SYSINFO_CHIP_IDENTIFIER 1
#define DVS132S_CONFIG_SYSINFO_DEVICE_IS_MASTER 2
#define DVS132S_CONFIG_SYSINFO_LOGIC_CLOCK 3
#define DVS132S_CONFIG_SYSINFO_USB_CLOCK 5
#define DVS132S_CONFIG_SYSINFO_CLOCK_DEVIATION 6
#define DVS132S_CONFIG_SYSINFO_LOGIC_PATCH 7

#define DVS132S_CONFIG_USB_RUN 0
#define DVS132S_CONFIG_USB_EARLY_PACKET_DELAY 1


#define DVS132S_CONFIG_BIAS_PRBP      0
#define DVS132S_CONFIG_BIAS_PRSFBP    1
#define DVS132S_CONFIG_BIAS_BLPUBP    2
#define DVS132S_CONFIG_BIAS_BIASBUFBP 3
#define DVS132S_CONFIG_BIAS_OFFBN     4
#define DVS132S_CONFIG_BIAS_DIFFBN    5
#define DVS132S_CONFIG_BIAS_ONBN      6
#define DVS132S_CONFIG_BIAS_CASBN     7
#define DVS132S_CONFIG_BIAS_DPBN      8
#define DVS132S_CONFIG_BIAS_BIASBUFBN 9
#define DVS132S_CONFIG_BIAS_ABUFBN    10

struct caer_dvs132s_info {
    int16_t deviceID;
    char deviceSerialNumber[8 + 1];
    uint8_t deviceUSBBusNumber;
    uint8_t deviceUSBDeviceAddress;
    char *deviceString;
    int16_t firmwareVersion;
    int16_t logicVersion;
    int16_t chipID;
    bool deviceIsMaster;
    bool muxHasStatistics;
    int16_t dvsSizeX;
    int16_t dvsSizeY;
    bool dvsHasStatistics;
    enum caer_imu_types imuType;
    bool extInputHasGenerator;
};

LIBRARY_PUBLIC_VISIBILITY struct caer_dvs132s_info caerDVS132SInfoGet(caerDeviceHandle handle);

struct caer_bias_coarsefine1024 {
    uint16_t coarseValue;
    uint16_t fineValue;
};

LIBRARY_PUBLIC_VISIBILITY uint32_t caerBiasCoarseFine1024Generate(struct caer_bias_coarsefine1024 coarseFine1024Bias);

LIBRARY_PUBLIC_VISIBILITY struct caer_bias_coarsefine1024 caerBiasCoarseFine1024Parse(uint32_t coarseFine1024Bias);

LIBRARY_PUBLIC_VISIBILITY struct caer_bias_coarsefine1024 caerBiasCoarseFine1024FromCurrent(uint32_t picoAmps);

LIBRARY_PUBLIC_VISIBILITY uint32_t caerBiasCoarseFine1024ToCurrent(struct caer_bias_coarsefine1024 coarseFine1024Bias);

#ifdef __cplusplus
}
#endif

#endif /* LIBCAER_DEVICES_DVS132S_H_ */