epc670_ll
The following API has been generated from the header file epc670_ll.h. It contains the low level API for the epc670 sensor.
-
enum epc670_ll_fct_mux_flag
Flag to indicate that setting is taken from frame configuration table as opposed to register bank used in epc670_ll_fct_multiplex_conf()
Values:
-
enumerator EPC670_LL_MUX_FCT_CDS_GAIN
-
enumerator EPC670_LL_MUX_FCT_DUAL_MGX
-
enumerator EPC670_LL_MUX_FCT_ROI
-
enumerator EPC670_LL_MUX_FCT_BIN
-
enumerator EPC670_LL_MUX_FCT_RES_RED
-
enumerator EPC670_LL_MUX_FCT_DELAY_LINE
-
enumerator EPC670_LL_MUX_FCT_INT_LEN
-
enumerator EPC670_LL_MUX_FCT_INT_LEN_DUAL
-
enumerator EPC670_LL_MUX_FCT_DISTANCE_OFFSET
-
enumerator EPC670_LL_MUX_FCT_CLK_DIV_MOD
-
enumerator EPC670_LL_MUX_FCT_CDS_GAIN
-
enum epc670_ll_modulation_gate
Configurable modulation gates.
Values:
-
enumerator EPC670_LL_MOD_GATE_0
Default modulation gate in use
-
enumerator EPC670_LL_MOD_GATE_1
Alternative modulation gate for dual modulation and integration
-
enumerator EPC670_LL_MOD_GATE_0
-
enum epc670_ll_modulation_phase
Supported demodulation phases relative to the modulation.
Values:
-
enumerator EPC670_LL_MOD_PHASE_000
Phase used for DCS0
-
enumerator EPC670_LL_MOD_PHASE_090
Phase used for DCS1
-
enumerator EPC670_LL_MOD_PHASE_180
Phase used for DCS2
-
enumerator EPC670_LL_MOD_PHASE_270
Phase used for DCS3
-
enumerator EPC670_LL_MOD_PHASE_000
-
enum epc670_ll_cds_gain
FCT supported cds gains in %. Register bank setting supports finer steps.
Values:
-
enumerator EPC670_LL_CDS_GAIN_050
-
enumerator EPC670_LL_CDS_GAIN_100
-
enumerator EPC670_LL_CDS_GAIN_200
-
enumerator EPC670_LL_CDS_GAIN_400
-
enumerator EPC670_LL_CDS_GAIN_050
-
enum epc670_ll_modulation_override
Available modulation overrides.
LED On override takes precedence on Off. Modulation Off overrides take precedence oover On.
Values:
-
enumerator EPC670_LL_OVERRIDE_LED_MOD_INACTIVE
-
enumerator EPC670_LL_OVERRIDE_LED_MOD_ACTIVE
-
enumerator EPC670_LL_OVERRIDE_MGB_MOD_ACTIVE
-
enumerator EPC670_LL_OVERRIDE_MGA_MOD_ACTIVE
-
enumerator EPC670_LL_OVERRIDE_MGB_MOD_INACTIVE
-
enumerator EPC670_LL_OVERRIDE_MGA_MOD_INACTIVE
-
enumerator EPC670_LL_OVERRIDE_LED_MOD_INACTIVE
-
enum epc670_ll_readout_mode
Pixel readout mode.
Values:
-
enumerator EPC670_LL_READOUT_DIFFERENTIAL_WO_ABS
-
enumerator EPC670_LL_READOUT_SINGLE_ENDED_SGA
-
enumerator EPC670_LL_READOUT_SINGLE_ENDED_SGB
-
enumerator EPC670_LL_READOUT_DIFFERENTIAL_W_ABS
-
enumerator EPC670_LL_READOUT_DIFFERENTIAL_WO_ABS
-
enum epc670_ll_direction
Generic direction relative to the chip orientation.
Values:
-
enumerator EPC670_LL_DIRECTION_NONE
-
enumerator EPC670_LL_DIRECTION_HORIZONTAL
-
enumerator EPC670_LL_DIRECTION_VERTICAL
-
enumerator EPC670_LL_DIRECTION_BOTH
-
enumerator EPC670_LL_DIRECTION_NONE
-
enum epc670_ll_fst_dump_types
Different types of functional safety test dumps.
Values:
-
enumerator EPC670_LL_FST_REGISTER_DUMP
Transmits register bank content over the video interface.
-
enumerator EPC670_LL_FST_RO_SEQUENCER_DUMP
Transmits readout sequencer program over the video interface.
-
enumerator EPC670_LL_FST_REGISTER_DUMP
-
enum epc670_ll_fst_frame_types
Different types of functional safety test frames.
Values:
-
enumerator EPC670_LL_FST_FULL_SCALE
-
enumerator EPC670_LL_FST_RAMP
Triggers a ramp test pattern frame acquisition. Increasing values per pixel as flattened array. Start value dependent on MIPI frame number
-
enumerator EPC670_LL_FST_PN9
Triggers a pseudo random test pattern frame acquisition. Values resulting from PN9 polynomial (x^9+x^7+1) values per pixel as flattened array. Start value dependent on MIPI frame number
-
enumerator EPC670_LL_FST_FULL_SCALE
-
enum epc670_ll_mod_clk_src
Modulation clock source.
Values:
-
enumerator EPC670_LL_MOD_CLK_EXTERNAL
External clock from pad CLK_MOD
-
enumerator EPC670_LL_MOD_CLK_INTERNAL
Internal clock from main PLL pre-divided by 2.
-
enumerator EPC670_LL_MOD_CLK_EXTERNAL
-
enum epc670_ll_modulation_mode
Modulation modes used in epc670_ll_modulation_mode_set()
Values:
-
enumerator EPC670_LL_MODULATION_MODE_CWTOF
-
enumerator EPC670_LL_MODULATION_MODE_GRAYSCALE
-
enumerator EPC670_LL_MODULATION_MODE_CWTOF
-
enum epc670_ll_led_driver
Available LED drivers.
Values:
-
enumerator EPC670_LL_LED_0
-
enumerator EPC670_LL_LED_1
-
enumerator EPC670_LL_LED_0
-
enum epc670_ll_mipi_ctrl_set_flags
Configuration flags used in epc670_ll_mipi_ctrl_set.
Values:
-
enumerator EPC670_LL_MIPI_FRAME_NUMBER_RESET
Resets internal MIPI frame count
-
enumerator EPC670_LL_MIPI_DATA_SATURATION_FLAG_ENABLE
Saturation flag overrides pixel value (default)
-
enumerator EPC670_LL_MIPI_DATA_SATURATION_FLAG_DISABLE
No Saturation flag - raw pixel value
-
enumerator EPC670_LL_MIPI_LINE_SYNC_PKG_ENABLE
Short line synchronisation packages are sent every line (default)
-
enumerator EPC670_LL_MIPI_LINE_SYNC_PKG_DISABLE
No short line synchronisation packages are sent
-
enumerator EPC670_LL_MIPI_EMBEDDED_DATA_PKG_ENABLE
MIPI frame transmission contains embedded data (default)
-
enumerator EPC670_LL_MIPI_EMBEDDED_DATA_PKG_DISABLE
MIPI frame only contains frame data
-
enumerator EPC670_LL_MIPI_DATA_SIGNEDNESS_UNSIGNED
Digital output ranges 0..4095 (default)
-
enumerator EPC670_LL_MIPI_DATA_SIGNEDNESS_SIGNED
Digital output ranges -2048..2047
-
enumerator EPC670_LL_MIPI_CLOCK_MODE_CONTINUOUS_SET
Clock is continuously active.
-
enumerator EPC670_LL_MIPI_CLOCK_MODE_FRAME_SET
Clock transitions between active and inactive state between every frame transmission
-
enumerator EPC670_LL_MIPI_CLOCK_MODE_ROW_BURST_SET
Clock transitions between active and inactive state between every row burst transmission (default)
-
enumerator EPC670_LL_MIPI_CLOCK_MODE_PACKET_SET
Clock transitions between active and inactive state between every package transmission
-
enumerator EPC670_LL_MIPI_FRAME_NUMBER_RESET
-
enum epc670_ll_mipi_clk_modes
Possible MIPI clock modes return values of epc670_ll_mipi_clk_mode_get.
Values:
-
enumerator EPC670_LL_MIPI_CLOCK_MODE_PACKET
Clock transitions between active and inactive state between every package transmission
-
enumerator EPC670_LL_MIPI_CLOCK_MODE_ROW_BURST
Clock transitions between active and inactive state between every row burst transmission (default)
-
enumerator EPC670_LL_MIPI_CLOCK_MODE_FRAME
Clock transitions between active and inactive state between every frame transmission
-
enumerator EPC670_LL_MIPI_CLOCK_MODE_CONTINUOUS
Clock transitions between active and inactive state between every frame transmission
-
enumerator EPC670_LL_MIPI_CLOCK_MODE_PACKET
-
enum epc670_ll_led_ctrl_set_flags
Configuration flags used in epc670_ll_led_ctrl_set()
Values:
-
enumerator EPC670_LL_LED_ENABLE
Enable the led control output.
-
enumerator EPC670_LL_LED_FORCE_ON
Force the led control output, permanently active LED_X output.
-
enumerator EPC670_LL_LED_INVERTED
Sets LED_X output to active low.
-
enumerator EPC670_LL_LED_ENABLE
-
enum epc670_ll_fct_addr
All availabe FCT addresses one hot encoded.
Values:
-
enumerator EPC670_LL_FCT_ADDR_0
-
enumerator EPC670_LL_FCT_ADDR_1
-
enumerator EPC670_LL_FCT_ADDR_2
-
enumerator EPC670_LL_FCT_ADDR_3
-
enumerator EPC670_LL_FCT_ADDR_4
-
enumerator EPC670_LL_FCT_ADDR_5
-
enumerator EPC670_LL_FCT_ADDR_6
-
enumerator EPC670_LL_FCT_ADDR_7
-
enumerator EPC670_LL_FCT_ADDR_8
-
enumerator EPC670_LL_FCT_ADDR_9
-
enumerator EPC670_LL_FCT_ADDR_10
-
enumerator EPC670_LL_FCT_ADDR_11
-
enumerator EPC670_LL_FCT_ADDR_12
-
enumerator EPC670_LL_FCT_ADDR_13
-
enumerator EPC670_LL_FCT_ADDR_14
-
enumerator EPC670_LL_FCT_ADDR_15
-
enumerator EPC670_LL_FCT_ADDR_0
-
enum epc670_ll_fct_comb_addr
Some frequently used FCT address combinations which corresponds to groups used in 4DCS imaging.
Values:
-
enumerator EPC670_LL_FCT_ADDR_G0
-
enumerator EPC670_LL_FCT_ADDR_G1
-
enumerator EPC670_LL_FCT_ADDR_G2
-
enumerator EPC670_LL_FCT_ADDR_G3
-
enumerator EPC670_LL_FCT_ADDR_G0
-
int epc670_ll_video_start(const struct epc670_ll *epc670, bool continuous)
Sends a shutter signal to the sensor over I2C.
SW shutter only allows to trigger a maximum of 15 frames where HW shutter allows for 16
- Parameters:
epc670 – [in] epc670 instance
continuous – [in] if set to true, the sensor will start continuous video mode, otherwise single shutter mode
- Returns:
current frames per shutter conf is too high for continous operation
Otherwise
-
int epc670_ll_video_stop(const struct epc670_ll *epc670)
Stops continuous shutter signal to the sensor over I2C.
- Parameters:
epc670 – [in] epc670 instance
- Returns:
-
int epc670_ll_video_num_frames_set(const struct epc670_ll *epc670, uint8_t n_frames)
Set the number of frames to be triggered by a shutter.
- Parameters:
epc670 – [in] epc670 instance
n_frames – [in] number of consecutive frames triggered with a single shutter
- Returns:
n_frames is not in [1, 16]
-EPC_ERR_RESULTS_IN_ILLEGAL_STATE
n_frames is 16 and continuous SW shutter is set (continuous video mode)
Otherwise
-
int epc670_ll_ic_informations_get(const struct epc670_ll *epc670, struct epc670_ll_ic_information *info)
Get the information stored on sensor chip.
- Parameters:
epc670 – [in] epc670 instance
info – [out] buffer for IC information
- Returns:
info is NULL
Otherwise
-
int epc670_ll_fct_multiplex_conf(const struct epc670_ll *epc670, uint16_t fct_mux)
Configures which features are controlled by the frame configuration settings or by the register settings.
The FCT configuration selection bits are spread over multiple registers.
- Parameters:
epc670 – epc670 instance
fct_mux – combination of epc670_ll_fct_mux_flag enum flags
- Returns:
fct_mux contains flag not listed in epc670_ll_fct_mux_flag
Otherwise
-
int epc670_ll_fct_modulation_phase_set(const struct epc670_ll *epc670, uint16_t conf_addr, enum epc670_ll_modulation_gate mgx, enum epc670_ll_modulation_phase phase)
Set the modulation phase setting of frame configuration entries.
- Parameters:
epc670 – [in] epc670 instance
conf_addr – [in] combination of one hot representation of fct_addresses. Can be selected from epc670_ll_fct_comb_addr, or be manually combined from epc670_ll_fct_addr *
mgx – [in] demodulation gate to be configured
phase – [in] demodulation phase shift to modulation
- Returns:
-
int epc670_ll_fct_cds_gain_set(const struct epc670_ll *epc670, uint16_t conf_addr, enum epc670_ll_cds_gain gain_pct)
Set the cds gain setting of frame configuration entries.
- Parameters:
epc670 – [in] epc670 instance
conf_addr – [in] combination of one hot representation of fct_addresses. Can be selected from epc670_ll_fct_comb_addr, or be manually combined from epc670_ll_fct_addr
gain_pct – [in] cds gain setting. See epc670_ll_cds_gain enum
- Returns:
-
int epc670_ll_fct_dual_mgx_en_set(const struct epc670_ll *epc670, uint16_t conf_addr, bool dual_mgx_en)
Set the dual mgx mode enable setting of frame configuration entries.
- Parameters:
epc670 – [in] epc670 instance
conf_addr – [in] combination of one hot representation of fct_addresses. Can be selected from epc670_ll_fct_comb_addr, or be manually combined from epc670_ll_fct_addr
dual_mgx_en – [in] dual mgx mode enable
- Returns:
-
int epc670_ll_fct_overrides_set(const struct epc670_ll *epc670, uint16_t conf_addr, uint8_t overrides)
Set the override flags of frame configuration entries.
- Parameters:
epc670 – [in] epc670 instance
conf_addr – [in] combination of one hot representation of fct_addresses. Can be selected from epc670_ll_fct_comb_addr, or be manually combined from epc670_ll_fct_addr
overrides – [in] combination of epc670_ll_modulation_override enum. Overrides are disabled if flags is not passed
- Returns:
overrides contains flag not listed in epc670_ll_modulation_override
Otherwise
-
int epc670_ll_fct_distance_offset_set(const struct epc670_ll *epc670, uint16_t conf_addr, uint8_t distance_offset)
Set the distance offset setting of frame configuration entries.
- Parameters:
epc670 – [in] epc670 instance
conf_addr – [in] combination of one hot representation of fct_addresses. Can be selected from epc670_ll_fct_comb_addr, or be manually combined from epc670_ll_fct_addr
distance_offset – [in] Distance offset with unit step of \(T_{clk\_main\_mod}\)
- Returns:
distance_offset is not in [0, 0x7F]
Otherwise
-
int epc670_ll_fct_modulation_clk_div_set(const struct epc670_ll *epc670, uint16_t conf_addr, uint8_t clk_div)
Set the modulation clock division setting of frame configuration entries.
- Parameters:
epc670 – [in] epc670 instance
conf_addr – [in] combination of one hot representation of fct_addresses. Can be selected from epc670_ll_fct_comb_addr, or be manually combined from epc670_ll_fct_addr
clk_div – [in] Clock divider
- Returns:
clk_div is not in [1, 32]
Otherwise
-
int epc670_ll_fct_roi_set(const struct epc670_ll *epc670, uint16_t conf_addr, uint16_t x0, uint8_t y0, uint16_t x1, uint8_t y1)
Set the roi setting of frame configuration entries.
- Parameters:
epc670 – [in] epc670 instance
conf_addr – [in] combination of one hot representation of fct_addresses. Can be selected from epc670_ll_fct_comb_addr, or be manually combined from epc670_ll_fct_addr
x0 – [in] lowest column idx in roi. See epc670_ll_roi_set()
y0 – [in] lowest pixel idx in roi. See epc670_ll_roi_set()
x1 – [in] highest column idx in roi. See epc670_ll_roi_set()
y1 – [in] highest pixel idx in roi. See epc670_ll_roi_set()
- Returns:
-EPC_ERR_OUT_OF_BOUNDS See epc670_ll_roi_set() details
Otherwise
-
int epc670_ll_fct_readout_mode_set(const struct epc670_ll *epc670, uint16_t conf_addr, enum epc670_ll_readout_mode ro_mode)
Set the readout mode setting of frame configuration entries.
- Parameters:
epc670 – [in] epc670 instance
conf_addr – [in] combination of one hot representation of fct_addresses. Can be selected from epc670_ll_fct_comb_addr, or be manually combined from epc670_ll_fct_addr
ro_mode – [in] readout mode setting. See epc670_ll_readout_mode enum
- Returns:
-
int epc670_ll_fct_binning_analog_set(const struct epc670_ll *epc670, uint16_t conf_addr, enum epc670_ll_direction binning_dir)
Set the pixel binning mode setting of frame configuration entries.
- Parameters:
epc670 – [in] epc670 instance
conf_addr – [in] combination of one hot representation of fct_addresses. Can be selected from epc670_ll_fct_comb_addr, or be manually combined from epc670_ll_fct_addr
binning_dir – [in] direction in which pixel get binned. See epc670_ll_direction enum
- Returns:
-
int epc670_ll_fct_resolution_reduction_set(const struct epc670_ll *epc670, uint16_t conf_addr, enum epc670_ll_direction res_reduction_dir)
Set the resolution reduction setting of frame configuration entries.
- Parameters:
epc670 – [in] epc670 instance
conf_addr – [in] combination of one hot representation of fct_addresses. Can be selected from epc670_ll_fct_comb_addr, or be manually combined from epc670_ll_fct_addr
res_reduction_dir – [in] direction in which resolution gets reduced. See epc670_ll_direction enum
- Returns:
-
int epc670_ll_fct_led_coarse_delay_set(const struct epc670_ll *epc670, uint16_t conf_addr, uint8_t led_delay)
Set the led delay line setting of frame configuration entries.
- Parameters:
epc670 – [in] epc670 instance
conf_addr – [in] combination of one hot representation of fct_addresses. Can be selected from epc670_ll_fct_comb_addr, or be manually combined from epc670_ll_fct_addr
led_delay – [in] led control signal coarse delay steps
- Returns:
See epc670_ll_led_coarse_delay_set() details
Otherwise
-
int epc670_ll_fct_int_len_set(const struct epc670_ll *epc670, uint16_t conf_addr, uint32_t int_us, uint32_t mod_freq_hz)
Set the integration length setting of frame configuration entries.
- Parameters:
epc670 – [in] epc670 instance
conf_addr – [in] combination of one hot representation of fct_addresses. Can be selected from epc670_ll_fct_comb_addr, or be manually combined from epc670_ll_fct_addr
int_us – [in] integration length in us
mod_freq_hz – [in] modulation frequency used for calulcation in Hz
- Returns:
Any epc error
Return code of private epc670_ll_calc_int_time_reg()
Otherwise
-
int epc670_ll_fct_int_len_get(const struct epc670_ll *epc670, enum epc670_ll_fct_addr fct_addr, uint32_t mod_freq_hz, uint32_t *int_us)
Get the integration length setting of frame configuration entries.
- Parameters:
epc670 – [in] epc670 instance
fct_addr – [in] one hot representation of fct_addresses
mod_freq_hz – [in] modulation frequency used for calulcation in Hz
int_us – [out] pointer to the integration length in us.
- Returns:
Any epc error
Return code of private epc670_ll_calc_reg_int_time()
Otherwise
-
int epc670_ll_fct_int_len_dual_set(const struct epc670_ll *epc670, uint16_t conf_addr, uint32_t int_us_dual, uint32_t mod_freq_hz)
Set the integration length setting of frame configuration entries.
- Parameters:
epc670 – [in] epc670 instance
conf_addr – [in] combination of one hot representation of fct_addresses. Can be selected from epc670_ll_fct_comb_addr, or be manually combined from epc670_ll_fct_addr *
int_us_dual – [in] integration length in us
mod_freq_hz – [in] modulation frequency used for calulcation in Hz
- Returns:
Any epc error
Return code of private epc670_ll_calc_int_time_reg()
Otherwise
-
int epc670_ll_roi_set(const struct epc670_ll *epc670, uint16_t x0, uint8_t y0, uint16_t x1, uint8_t y1)
Set the roi in the register bank.
The ROI allows to reduce the amount of pixel which are read out and transmitted, increasing frame rate or focusing if needed. The possible combinations are restricted by the architecture. The chip will automatically try to resolve when given a impossible ROI:
Vertical ROI can only be read in fixed groups of 8 with the start value being a multiple of 8. The height requires to be divisible by 8
Horizontal ROI always requires 4 pixel to be transmissted, meaning that in case of horizontal reduction or binning the width needs to be divisible by 8 otherwise divisble by 4. The horizontal start value may be any within the range as long as the width-constraint is respected.
E.g valid only without binning or reduction: x0 - 33, y0 - 16, x1 = 73, y1 = 167
E.g valid with binning or reduction: x0 - 33, y0 - 16, x1 = 77, y1 = 167
E.g invalid: x0 - 33, y0 - 15, x1 = 77, y1 = 167
For more information refer to datasheet.
- Parameters:
epc670 – [in] epc670 instance
x0 – [in] lowest column idx in roi. See details
y0 – [in] lowest pixel idx in roi. See details
x1 – [in] highest column idx in roi. See details
y1 – [in] highest pixel idx in roi. See details
- Returns:
x0 not in [ 4, 320] or
y0 not in [ 8, 240] or
x1 not in [ 7, 323] or
y1 not in [15, 247]
Otherwise
-
int epc670_ll_int_len_set(const struct epc670_ll *epc670, uint32_t int_us, uint32_t mod_freq_hz)
Set base integration length.
The possible integration length is dependent of the modulation frequency: \(t_{max} =\frac{2^{NIntBits}}{f_{clk\_mod\_main}} = \frac{2^{24}}{f_{clk\_mod\_main}}\)
- Parameters:
epc670 – [in] epc670 instance
int_us – [in] integration length in us
mod_freq_hz – [in] modulation frequency used for calulcation in Hz
- Returns:
See details
Otherwise
-
int epc670_ll_int_len_get(const struct epc670_ll *epc670, uint32_t mod_freq_hz, uint32_t *int_us)
Get base integration length.
- Parameters:
epc670 – [in] epc670 instance
mod_freq_hz – [in] modulation frequency used for calulcation in Hz
int_us – [out] integration length in us
- Returns:
See details
Otherwise
-
int epc670_ll_cds_gain_pct_set(const struct epc670_ll *epc670, uint16_t cds_gain_pct)
Sets the register bank cds gain setting.
The epc670 provides an amplification before ADC conversion. This can be used to have a higher sensitivity that comes at the cost of dynamic range. Sensitivities below 150% also show non-linear behavior, therefore it is heavily recommended to stay above.
- Parameters:
epc670 – [in] epc670 instance
cds_gain_pct – [in] gain to be set in %. Ranges from 25% to 400% in discreet steps of 25%.
- Returns:
cds_gain_pct is not in [25%,400%]
Otherwise
-
int epc670_ll_cds_gain_pct_get(const struct epc670_ll *epc670, uint16_t *cds_gain_pct)
Gets the register bank cds gain setting.
See epc670_ll_cds_gain_pct_set (…) details.
- Parameters:
epc670 – [in] epc670 instance
cds_gain_pct – [out] cds gain readback value
- Returns:
cds_gain_pct is NULL
Otherwise
-
int epc670_ll_fst_frame_trigger(const struct epc670_ll *epc670, enum epc670_ll_fst_frame_types type)
Triggers a functional safety test frame.
- Parameters:
epc670 – [in] epc670 instance
type – [in] Functional safety test type. See epc670_ll_fst_frame_types enum
- Returns:
-
int epc670_ll_fst_dump_trigger(const struct epc670_ll *epc670, enum epc670_ll_fst_dump_types type)
Triggers a functional safety test dump.
- Parameters:
epc670 – [in] epc670 instance
type – [in] Functional safety test type. See epc670_ll_fst_dump_types enum
- Returns:
-
int epc670_ll_seq_input_error_flag_get(const struct epc670_ll *epc670, bool *state)
Returns the state of readout sequencer input error flag.
- Parameters:
epc670 – [in] epc670 instance
state – [out] False - No Error | True - Error
- Returns:
-EPC_ERR_ARG_NULL state
Otherwise
-
int epc670_ll_seq_input_error_flag_clear(const struct epc670_ll *epc670)
Clears a raised readout sequencer input error flag.
- Parameters:
epc670 – [in] epc670 instance
- Returns:
-
int epc670_ll_modulation_mode_set(const struct epc670_ll *epc670, enum epc670_ll_modulation_mode mode)
Set the modulation mode.
- Parameters:
epc670 – [in] epc670 instance
mode – [in] Modulation mode. See epc670_ll_modulation_mode enum
- Returns:
-
int epc670_ll_update_sequencer(const struct epc670_ll *epc670, const struct epc670_ll_sequencer_entry *entries, size_t num_entries)
update readout sequencer with the given entries
The sequencer ram interface contains an address by address checksum check. This prevents errounous data to be written to the readout control sequencer, thus risking the integrity of the sensor. The Error flag is raised in the ERROR_STATUS(0x3F) register and needs to be cleared once it is resolved.
- Parameters:
epc670 – epc670 instance
entries – pointer to array of sequencer entries epc670_ll_sequencer_entry struct
num_entries – number of entries to be written
- Returns:
sequencer is NULL
num_entries is not in [0, 256]
RO-sequencer input error
Otherwise
-
int epc670_ll_mipi_ctrl_set(const struct epc670_ll *epc670, uint32_t mipi_ctrl_flags)
Set various configuration of the MIPI interface.
Combination of ENABLE and UNSIGNED with any DISABLE and SIGNED counterpart will result in an error. Combination of clock modes is also prohibited.
- Parameters:
epc670 – [in] epc670 instance
mipi_ctrl_flags – [in] MIPI control flags. See epc670_ll_mipi_ctrl_set_flags enum
- Returns:
-EPC_ERR_ILLEGAL_FLAG_COMBINATION
mipi_ctrl_flags non-clock flag combination is not allowed
-EPC_ERR_ILLEGAL_CLOCK_COMBINATION
mipi_ctrl_flags clock mode combination is not allowed
Otherwise
-
int epc670_ll_mipi_data_sat_get(const struct epc670_ll *epc670, bool *sat)
Get saturation flag enable state.
returns the inverted value of register bit for user friendliness
- Parameters:
epc670 – [in] epc670 instance
sat – [out] Saturation flag: 0 - Disabled, 1 - Enabled
- Returns:
sat is NULL
Otherwise
-
int epc670_ll_mipi_line_sync_pkg_get(const struct epc670_ll *epc670, bool *line_sync)
Get the MIPI line synchronisation pakage state.
returns the inverted value of register bit for user friendliness
- Parameters:
epc670 – [in] epc670 instance
line_sync – [out] line synchronisation package: 0 - Disabled, 1 - Enabled
- Returns:
line_sync is NULL
Otherwise
-
int epc670_ll_mipi_embedded_data_pkg_get(const struct epc670_ll *epc670, bool *embedded_data)
Get the MIPI embedded_data pakage state.
returns the inverted value of register bit for user friendliness
- Parameters:
epc670 – [in] epc670 instance
embedded_data – [out] Embedded_data package state: 0 - Disabled, 1 - Enabled
- Returns:
embedded_data is NULL
Otherwise
-
int epc670_ll_mipi_data_sign_get(const struct epc670_ll *epc670, bool *sign)
Get the data signedness.
- Parameters:
epc670 – [in] epc670 instance
sign – [out] Signedness of data: 0 - Unsigned, 1 - Signed
- Returns:
sign is NULL
Otherwise
-
int epc670_ll_mipi_clk_mode_get(const struct epc670_ll *epc670, enum epc670_ll_mipi_clk_modes *clk_mode)
Get the MIPI clock mode.
- Parameters:
epc670 – [in] epc670 instance
clk_mode – [out] MIPI clock mode. See epc670_ll_mipi_ctrl_set_flags enum
- Returns:
clk_mode is NULL
Otherwise
-
int epc670_ll_temp_sensor_calib_get(const struct epc670_ll *epc670, uint8_t sensor_idx, struct epc670_ll_temp_sensor_calib *calib)
Get the epc670 temperature sensor calibration data from specified sensor.
Additional info at epc670_ll_temp_sensor_calib struct and epc670_ll_temp_sensor_get (…)
- Parameters:
epc670 – [in] epc670 instance
sensor_idx – [in] Index of the sensor from which to grab the calibration data
calib – [out] pointer to calibration data of temperature sensor
- Returns:
calib is NULL
sensor[sensor_idx] does not exist
offset of sensor[sensor_idx] is not calibrated
gain of sensor[sensor_idx] is not calibrated
Otherwise
-
int epc670_ll_temp_sensor_get(const struct epc670_ll *epc670, uint8_t sensor_idx, const struct epc670_ll_temp_sensor_calib *calib, int16_t *temp_sensor_cC)
Get the epc670 temperature from specified sensor.
The result and calibration data is stored as scaled integer values to be able to prevent floating point arithmetic as it should be avoided in linux kernel drivers. Calculation implemented according to epc670_datasheet v1.0.
- Parameters:
epc670 – [in] epc670 instance
sensor_idx – [in] Index of the sensor from which to grab the data
calib – [in] pointer to calibration data of temperature sensor aquired by epc670_ll_temp_sensor_calib_get
temp_sensor_cC – [out] Latest temperature measurement of temperature sensor in cC°
- Returns:
temp_sensor_cC is NULL
sensor[sensor_idx] does not exist
Otherwise
-
int epc670_ll_modulation_clk_src_set(const struct epc670_ll *epc670, enum epc670_ll_mod_clk_src clk_src)
Set the modulation clock source.
- Parameters:
epc670 – [in] epc670 instance
clk_src – [in] Clock source. See epc670_ll_mod_clk_src enum.
- Returns:
-
int epc670_ll_modulation_clk_div_set(const struct epc670_ll *epc670, uint8_t clk_div)
Set the modulation clock divider.
- Parameters:
epc670 – [in] epc670 instance
clk_div – [in] Clock divider. Only values in range 0 to 32 allowed.
- Returns:
clk_div is not in [0, 32]
Otherwise
-
int epc670_ll_modulation_clk_src_get(const struct epc670_ll *epc670, enum epc670_ll_mod_clk_src *clk_src)
Get the modulation clock source.
- Parameters:
epc670 – [in] epc670 instance
clk_src – [out] Clock source. See epc670_ll_mod_clk_src enum.
- Returns:
-
int epc670_ll_modulation_clk_div_get(const struct epc670_ll *epc670, uint8_t *clk_div)
Get the modulation clock divider.
- Parameters:
epc670 – [in] epc670 instance
clk_div – [out] Current clock divider.
- Returns:
-
int epc670_ll_led_delay_mux_set(const struct epc670_ll *epc670, enum epc670_ll_led_driver led_sel)
Set which LED is muxed to be delayed.
- Parameters:
epc670 – [in] epc670 instance
led_sel – [in] LED driver to be delayed. See epc670_ll_led_driver enum
- Returns:
-
int epc670_ll_led_ctrl_set(const struct epc670_ll *epc670, enum epc670_ll_led_driver led_sel, uint8_t led_conf)
Set the LED configuration.
- Parameters:
epc670 – [in] epc670 instance
led_sel – [in] LED driver to be configured. See epc670_ll_led_driver enum
led_conf – [in] Configuration to apply. See epc670_ll_led_ctrl_set_flags enum
- Returns:
temp_sensor_cC is NULL
led_conf contains a flag not listed in epc670_ll_led_ctrl_set_flags
led_drivers[led_sel] does not exist. See epc670_ll_led_driver
Otherwise
-
int epc670_ll_led_coarse_delay_set(const struct epc670_ll *epc670, uint8_t coarse_delay)
Set the led coarse delay.
- Parameters:
epc670 – [in] epc670 instance
coarse_delay – [in] Coarse delay steps to be applied on selected LED output signal
- Returns:
coarse_delay is not in [0, 49]
Otherwise
return of epc670_ll::i2c_write(), epc670_ll::i2c_read()
-
int epc670_ll_led_coarse_delay_get(const struct epc670_ll *epc670, uint8_t *coarse_delay)
Get the led coarse delay.
- Parameters:
epc670 – [in] epc670 instance
coarse_delay – [out] Coarse delay steps applied on selected LED output signal
- Returns:
-
static int epc670_ll_calc_int_time_reg(uint32_t int_us, uint32_t mod_freq_hz, uint8_t *reg_values)
helper function to convert an integration time to register values
Since the epc670 chip does not feature an internal measurement of the modulation clock frequency it only stores an amount of steps to do. The resulting integration times are dependent on the modulation clock frequency.
\[t_{int} = (N_{Hi}*2^16+N_{Mi}*2^8+N_{Lo})*\frac{1}{f_{mod}}\]In the special case the modulation clock mode is 0 the resulting integration time also results to be 0.- Parameters:
int_us – [in] integration time in us
mod_freq_hz – [in] modulation frequency used for calulcation
reg_values – [out] buffer for register values. Order 0-1-2 is Hi-Mi-Lo
- Returns:
reg_values is NULL
Mismatch between int_us and mod_freq_hz. See details
Otherwise
0
-
static int epc670_ll_calc_reg_int_time(const uint8_t *reg_values, uint32_t mod_freq_hz, uint32_t *int_us)
helper function to convert the register values to integration time
Computes the integration time in us from the register values. The reverse computation of epc670_ll_calc_int_time_reg (…)
- Parameters:
reg_values – [in] Exact register values read. Order 0-1-2 is Hi-Mi-Lo
mod_freq_hz – [in] modulation frequency used for calulcation
int_us – [out] integration time in us
- Returns:
int_us is NULL
Mismatch between int_us and mod_freq_hz. See details
Otherwise
0
-
EPC670_LL_ROI_MAX_WIDTH 320
-
EPC670_LL_ROI_MAX_HEIGHT 240
-
struct epc670_ll
Structure containing device and functions that need to be provided by user.
Public Members
-
const struct i2cdevice *i2c_device
I2C device passed to I2c functions
-
i2c_read_reg_t i2c_read
I2C read command. See i2c_read_reg_t
-
i2c_write_reg_t i2c_write
I2C write command. See i2c_write_reg_t
-
const struct i2cdevice *i2c_device
-
struct epc670_ll_ic_information
Container for information about sensor chip acquired with epc670_ll_ic_informations_get()
-
struct epc670_ll_temp_sensor_calib
Temperature sensor calibration data.
The offset and gain are scaled to be able to prevent floating point arithmetic as it should be avoided in linux kernel drivers.
-
struct epc670_ll_sequencer_entry
-
struct epc670_ll_sequencer
Public Members
-
uint8_t version
-
const struct epc670_ll_sequencer_entry *entries
-
const size_t num_entries
-
uint8_t version