EBST_CAM
|
Functions for interacting with the camera. More...
#include "Camera.h"
#include "../shared_src/enum_hardware.h"
#include "Board.h"
#include <inttypes.h>
Functions | |
es_status_codes | Cam_Init (uint32_t drvno) |
Initialize camera registers. | |
es_status_codes | Cam_DoSoftReset (uint32_t drvno) |
Do a soft reset of the camera. | |
es_status_codes | Cam_Initialize (uint32_t drvno) |
Trigger initialisation in the camera. | |
es_status_codes | Cam3001_Init (uint32_t drvno) |
Init routine for Camera System 3001. | |
es_status_codes | Cam3010_Init (uint32_t drvno, uint8_t adc_mode, uint16_t custom_pattern) |
Init routine for Camera System 3010. | |
es_status_codes | Cam3010_ADC_reset (uint32_t drvno) |
ADC reset routine for Camera System 3010. | |
es_status_codes | Cam3010_ADC_setOutputMode (uint32_t drvno, uint8_t adc_mode, uint16_t custom_pattern) |
es_status_codes | Cam3010_ADC_sendTestPattern (uint32_t drvno, uint16_t custom_pattern) |
es_status_codes | Cam3030_Init (uint32_t drvno) |
Init routine for Camera System 3030. | |
es_status_codes | Cam3030_ADC_reset (uint32_t drvno) |
ADC reset routine for Camera System 3030. | |
es_status_codes | Cam3030_ADC_twoWireModeEN (uint32_t drvno) |
ADC output interface config routine for Camera System 3030. | |
es_status_codes | Cam3030_ADC_SetGainAllChannels (uint32_t drvno, uint8_t gain) |
ADC gain config routine for Camera System 3030. | |
es_status_codes | Cam3030_ADC_SetGain (uint32_t drvno, uint8_t fkt, uint8_t g1, uint8_t g2, uint8_t g3, uint8_t g4, uint8_t g5, uint8_t g6, uint8_t g7, uint8_t g8) |
Set gain for ADS5294. | |
es_status_codes | Cam3030_ADC_RampOrPattern (uint32_t drvno, uint8_t adc_mode, uint16_t custom_pattern) |
ADC debug mode for Camera System 3030. | |
es_status_codes | Cam3030_ADC_Global_En_Filter (uint32_t drvno, bool enable) |
Enable or disable filters for all 8 channels. | |
es_status_codes | Cam3030_ADC_SetFilterSettings (uint32_t drvno, uint8_t channel, uint8_t coeff_set, uint8_t decimation_factor, uint8_t odd_tap, uint8_t use_filter, uint8_t hpf_corner, uint8_t en_hpf) |
Set all parameters for one filter determined by channel. | |
es_status_codes | Cam3030_ADC_SetFilterCustomCoefficient (uint32_t drvno, uint8_t channel, uint8_t coefficient_number, uint8_t enable, uint16_t coefficient) |
es_status_codes | Cam3030_ADC_SetDataRate (uint32_t drvno, uint8_t data_rate) |
Set the data rate of the ADC output. | |
es_status_codes | Cam3030_ADC_SetLFNS (uint32_t drvno, bool enable) |
Enables or disables low frequency noise suppression mode. | |
es_status_codes | Cam3030_ADC_SetSampleMode (uint32_t drvno, uint8_t sample_mode) |
Currently not in use. 11/22, P209_8. Set over how many samples of one pixel the ADC averages. | |
es_status_codes | Cam_SetSensorResetOrHsirEc (uint32_t drvno, uint16_t sensor_reset_or_hsir_ec) |
Sets the sensor reset length register in the camera, which controls the length of the ARG pulse. | |
es_status_codes | Cam_SetTemp (uint32_t drvno, uint8_t level) |
Set temperature level for cooled cameras. | |
es_status_codes | Cam_SendData (uint32_t drvno, uint8_t maddr, uint8_t adaddr, uint16_t data) |
Sends data via the fiber link to the camera. | |
es_status_codes | Cam_SetVfreqRegister (uint32_t drvno) |
Is basically the old vclk register (cam_adaddr_vclk). Sets: | |
es_status_codes | Cam_SetupFullBinning (uint32_t drvno) |
es_status_codes | Cam_SetupPartialBinning (uint32_t drvno) |
es_status_codes | Cam_SetLedOff (uint32_t drvno, uint8_t LED_OFF) |
Disables all camera leds to suppress stray light. | |
es_status_codes | Cam_SetPosition (uint32_t drvno) |
This functions sets the camera position register of the first camera to 0. | |
es_status_codes | CamIOCtrl_setImpactStartPixel (uint32_t drvno, uint16_t startPixel) |
Set the pixel where IOCtrl starts inserting its data. | |
es_status_codes | CamIOCtrl_setOutput (uint32_t drvno, uint32_t number, uint16_t width_in_5ns, uint16_t delay_in_5ns) |
Set paramters of one pulse output of IOCTRL. | |
es_status_codes | CamIOCtrl_setAllOutputs (uint32_t drvno, uint32_t *width_in_5ns, uint32_t *delay_in_5ns) |
Set parameters of all pulses output of IOCTRL. | |
es_status_codes | CamIOCtrl_setT0 (uint32_t drvno, uint32_t period_in_10ns) |
Set period of IOCtrl pulse outputs base frequency T0. | |
es_status_codes | Cam_DAC8568_sendData (uint32_t drvno, uint32_t data, uint8_t cameraPosition) |
es_status_codes | Cam_SetPixelRegister (uint32_t drvno) |
es_status_codes | Cam_SetTriggerInput (uint32_t drvno) |
es_status_codes | Cam_SetConfigRegister (uint32_t drvno) |
es_status_codes | Cam_SetupFFT (uint32_t drvno) |
Functions for interacting with the camera.
In this file are all the functions that are interacting with the camera. Interaction with the camera always includes Cam_SendData(), so all functions here call this function.
es_status_codes Cam3001_Init | ( | uint32_t | drvno | ) |
Init routine for Camera System 3001.
Sets register in camera.
drvno | selects PCIe board |
es_status_codes Cam3010_ADC_reset | ( | uint32_t | drvno | ) |
ADC reset routine for Camera System 3010.
ADC LTC2271 needs a reset via SPI first. Bit D7 of the reset register A0 with address 00h is set to 1. D6:D0 are don't care. So address is 00h and data is 80h = 10000000b for e.g. This has to be done after every startup. Then the ADC can be programmed further via SPI in the next frames. Called by Cam3010_Init
drvno | selects PCIe board |
es_status_codes Cam3010_ADC_sendTestPattern | ( | uint32_t | drvno, |
uint16_t | custom_pattern ) |
drvno | selects PCIe board |
custom_pattern |
es_status_codes Cam3010_ADC_setOutputMode | ( | uint32_t | drvno, |
uint8_t | adc_mode, | ||
uint16_t | custom_pattern ) |
drvno | selects PCIe board |
adc_mode | |
custom_pattern |
es_status_codes Cam3010_Init | ( | uint32_t | drvno, |
uint8_t | adc_mode, | ||
uint16_t | custom_pattern ) |
Init routine for Camera System 3010.
Sets registers in camera and ADC LTC2271. FL3010 is intended for sensor S12198 ! with frame rate 8kHz = min. 125�s exp time
drvno | selects PCIe board |
adc_mode | 0: normal mode, 2: custom pattern |
custom_pattern | fixed output for test mode, ignored when test mode FALSE |
es_status_codes Cam3030_ADC_Global_En_Filter | ( | uint32_t | drvno, |
bool | enable ) |
Enable or disable filters for all 8 channels.
Global enable must be set to true, if you want to use at least one filter. Filters can be enabled / disabled separately by Cam3030_ADC_SetFilter(). When the global filter enable is true, all channels are either passed through the filter or through a dummy delay so that the overall latency of all channels is 20 clock cycles.
drvno | selects PCIe board |
enable | true: |
es_status_codes Cam3030_ADC_RampOrPattern | ( | uint32_t | drvno, |
uint8_t | adc_mode, | ||
uint16_t | custom_pattern ) |
ADC debug mode for Camera System 3030.
Lets ADC send a ramp or a custom pattern (value) instead of ADC sample data. Called by Cam3030_Init when adc_mode > 0.
drvno | selects PCIe board |
adc_mode | 1: ramp, 2: custom pattern |
custom_pattern | (only used when adc_mode = 2) |
es_status_codes Cam3030_ADC_reset | ( | uint32_t | drvno | ) |
ADC reset routine for Camera System 3030.
Resets register of ADC ADS5294 to default state (output interface is 1 wire!). Called by Cam3030_Init
drvno | selects PCIe board |
es_status_codes Cam3030_ADC_SetDataRate | ( | uint32_t | drvno, |
uint8_t | data_rate ) |
Set the data rate of the ADC output.
Data rate specifies the ratio between ADC sampling rate and how many digital output values are generated.
drvno | selects PCIe board |
data_rate |
|
es_status_codes Cam3030_ADC_SetFilterCustomCoefficient | ( | uint32_t | drvno, |
uint8_t | channel, | ||
uint8_t | coefficient_number, | ||
uint8_t | enable, | ||
uint16_t | coefficient ) |
drvno | selects PCIe board |
channel | 1...8 |
coefficient_number | 0...11 |
enable | 0: disable, 1: enable |
coefficient | 12 bit signed value |
es_status_codes Cam3030_ADC_SetFilterSettings | ( | uint32_t | drvno, |
uint8_t | channel, | ||
uint8_t | coeff_set, | ||
uint8_t | decimation_factor, | ||
uint8_t | odd_tap, | ||
uint8_t | use_filter, | ||
uint8_t | hpf_corner, | ||
uint8_t | en_hpf ) |
Set all parameters for one filter determined by channel.
To use a filter, the global enable must be set to true by Cam3030_ADC_Global_En_Filter().
drvno | selects PCIe board |
channel | Channel to which the filter parameters should be applied. 1...8 |
coeff_set | Select stored coefficient set. |
decimation_factor | Set decimation factor aka FILTER_RATE.
|
odd_tap | 1: Use odd tap filter. 0: even tap |
use_filter | 1: enable filter, 0: disable filter |
hpf_corner | high pass filter corner in values k from 2 to 10 |
en_hpf | 1: high pass filter enabled, 0: disabled |
es_status_codes Cam3030_ADC_SetGain | ( | uint32_t | drvno, |
uint8_t | fkt, | ||
uint8_t | g1, | ||
uint8_t | g2, | ||
uint8_t | g3, | ||
uint8_t | g4, | ||
uint8_t | g5, | ||
uint8_t | g6, | ||
uint8_t | g7, | ||
uint8_t | g8 ) |
Set gain for ADS5294.
fkt | =0 reset to db=0, fkt=1 set to g1..g8 |
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
g1 | channel 1 |
g2 | channel 2 |
g3 | channel 3 |
g4 | channel 4 |
g5 | channel 5 |
g6 | channel 6 |
g7 | channel 7 |
g8 | channel 8 |
es_status_codes Cam3030_ADC_SetGainAllChannels | ( | uint32_t | drvno, |
uint8_t | gain ) |
ADC gain config routine for Camera System 3030.
Sets gain of ADC ADS5294 0...15 by calling Cam3030_ADC_SetGain() subroutine. Called by Cam3030_Init
drvno | selects PCIe board |
gain | of ADC |
es_status_codes Cam3030_ADC_SetLFNS | ( | uint32_t | drvno, |
bool | enable ) |
Enables or disables low frequency noise suppression mode.
drvno | selects PCIe board |
enable |
|
es_status_codes Cam3030_ADC_SetSampleMode | ( | uint32_t | drvno, |
uint8_t | sample_mode ) |
Currently not in use. 11/22, P209_8. Set over how many samples of one pixel the ADC averages.
drvno | selects PCIe board |
sample_mode |
|
es_status_codes Cam3030_ADC_twoWireModeEN | ( | uint32_t | drvno | ) |
ADC output interface config routine for Camera System 3030.
Enables two wire LVDS data transfer mode of ADC ADS5294. Only works with PAL versions P209_2 and above. Called by Cam3030_Init - comment for older versions and rebuild or use on e-lab test computer desktop LabView folder lv64hs (bool switch in 3030 init tab)
drvno | selects PCIe board |
es_status_codes Cam3030_Init | ( | uint32_t | drvno | ) |
Init routine for Camera System 3030.
Sets registers in ADC ADS5294.
drvno | selects PCIe board |
es_status_codes Cam_DAC8568_sendData | ( | uint32_t | drvno, |
uint32_t | data, | ||
uint8_t | cameraPosition ) |
es_status_codes Cam_DoSoftReset | ( | uint32_t | drvno | ) |
Do a soft reset of the camera.
Do this first in the camera initialisation routine.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes Cam_Init | ( | uint32_t | drvno | ) |
Initialize camera registers.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes Cam_Initialize | ( | uint32_t | drvno | ) |
Trigger initialisation in the camera.
Do this last in the camera initialisation routine.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes Cam_SendData | ( | uint32_t | drvno, |
uint8_t | maddr, | ||
uint8_t | adaddr, | ||
uint16_t | data ) |
Sends data via the fiber link to the camera.
The register S0Addr_DBR is used for sending data via the fiber link.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
maddr | master address for specifying which address space is used. See master_address_t for options. |
adaddr | register address. Which register is written to depends on the address space which is defined maddr. It is either camera_register_addresses_t, adc_ltc2271_register_adress_t, adc_ads5294_register_adress_t, ioctrl_register_address_t or dac_register_addresses_t. |
data | 16 bit data to send |
es_status_codes Cam_SetConfigRegister | ( | uint32_t | drvno | ) |
es_status_codes Cam_SetLedOff | ( | uint32_t | drvno, |
uint8_t | LED_OFF ) |
Disables all camera leds to suppress stray light.
Sets corresponding camera register: maddr = 0, adadr = 5;
drvno | selects PCIe board |
LED_OFF | 1 -> leds off, 0 -> led on |
es_status_codes Cam_SetPixelRegister | ( | uint32_t | drvno | ) |
es_status_codes Cam_SetPosition | ( | uint32_t | drvno | ) |
This functions sets the camera position register of the first camera to 0.
When there are more cameras in line, the cameras are handing their positions one to another.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
es_status_codes Cam_SetSensorResetOrHsirEc | ( | uint32_t | drvno, |
uint16_t | sensor_reset_or_hsir_ec ) |
Sets the sensor reset length register in the camera, which controls the length of the ARG pulse.
The behavior of this function is also controlled by camera_settings::ec_legacy_mode. When this is enabled, the function will the address of cam_adaddr_sensor_reset_length as IFC mode register. The IFC mode register was used to control the length of the ARG pulse in the camera.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
sensor_reset_or_hsir_ec | See camera_register_addresses_t::cam_adaddr_sensor_reset_length for more information. |
es_status_codes Cam_SetTemp | ( | uint32_t | drvno, |
uint8_t | level ) |
Set temperature level for cooled cameras.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
level | level 0..7 / 0=off, 7=min -> see cooling manual |
es_status_codes Cam_SetTriggerInput | ( | uint32_t | drvno | ) |
es_status_codes Cam_SetupFFT | ( | uint32_t | drvno | ) |
es_status_codes Cam_SetupFullBinning | ( | uint32_t | drvno | ) |
es_status_codes Cam_SetupPartialBinning | ( | uint32_t | drvno | ) |
es_status_codes Cam_SetVfreqRegister | ( | uint32_t | drvno | ) |
Is basically the old vclk register (cam_adaddr_vclk). Sets:
es_status_codes CamIOCtrl_setAllOutputs | ( | uint32_t | drvno, |
uint32_t * | width_in_5ns, | ||
uint32_t * | delay_in_5ns ) |
Set parameters of all pulses output of IOCTRL.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
width_in_5ns | Set width of pulse in 5ns steps. Array with 7 entries. |
delay_in_5ns | Set delay of pulse in 5ns steps. Array with 7 entries. |
es_status_codes CamIOCtrl_setImpactStartPixel | ( | uint32_t | drvno, |
uint16_t | startPixel ) |
Set the pixel where IOCtrl starts inserting its data.
drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
startPixel | Position of IOCtrl data in pixel |
es_status_codes CamIOCtrl_setOutput | ( | uint32_t | drvno, |
uint32_t | number, | ||
uint16_t | width_in_5ns, | ||
uint16_t | delay_in_5ns ) |
Set paramters of one pulse output of IOCTRL.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | number | Number of output: 1 ... 7 |
[in] | width_in_5ns | Set width of pulse in 5ns steps. |
[in] | delay_in_5ns | Set delay of pulse in 5ns steps. |
es_status_codes CamIOCtrl_setT0 | ( | uint32_t | drvno, |
uint32_t | period_in_10ns ) |
Set period of IOCtrl pulse outputs base frequency T0.
[in] | drvno | identifier of PCIe card, 0 ... MAXPCIECARDS, when there is only one PCIe board: always 0 |
[in] | period_in_10ns | Period of T0 in 10ns steps. |