MICCDlibrary
 All Data Structures Files Functions Variables Enumerations Pages
Data Structures | Enumerations | Functions
miccd.h File Reference

Prototypes for MI CCD library functions. More...

Data Structures

struct  camera_info_t
 Camera information structure. More...
 
struct  camera_info_h_t
 
struct  camera_t
 Camera support structure. More...
 

Enumerations

enum  model_t {
  G10300, G10400, G10800, G11200,
  G11400, G12000, G2, G3,
  G3_H
}
 Camera model.
 

Functions

int miccd_open (int32_t id, camera_t *camera)
 Open connection to camera with given product ID. More...
 
int miccd_close (camera_t *camera)
 Close connection to camera. More...
 
int miccd_info (camera_t *camera, camera_info_t *info)
 Retrieve camera information structure from camera. More...
 
int miccd_g1_mode (camera_t *camera, int bit16, int lownoise)
 Set G1 camera mode. More...
 
int miccd_mode (camera_t *camera, uint8_t mode)
 Set camera mode. More...
 
int miccd_clear (camera_t *camera)
 Clear camera CCD. More...
 
int miccd_hclear (camera_t *camera)
 Clear horizontal register. More...
 
int miccd_shift_to0 (camera_t *camera)
 Shifts rows till first imagine row. More...
 
int miccd_shift (camera_t *camera)
 Shift camera rows. More...
 
int miccd_vshift_clear (camera_t *camera, uint16_t v)
 Shift camera rows. More...
 
int miccd_hshift_clear (camera_t *camera, uint16_t h)
 Shift camera columns. More...
 
int miccd_read_frame (camera_t *camera, uint8_t hbinning, uint8_t vbinning, uint16_t x, uint16_t y, uint16_t w, uint16_t h, char *data)
 Readout camera chip. More...
 
int miccd_read_data (camera_t *camera, uint32_t data_size, char *data, uint16_t w, uint16_t h)
 
int miccd_open_shutter (camera_t *camera)
 Open camera shutter. More...
 
int miccd_close_shutter (camera_t *camera)
 Close camera shutter. More...
 
int32_t miccd_start_exposure (camera_t *camera, uint16_t x, uint16_t y, uint16_t w, uint16_t h, float exposure)
 Start exposure. More...
 
int miccd_abort_exposure (camera_t *camera)
 Abort exposure on G1 camera. More...
 
int miccd_filter (camera_t *camera, uint8_t filter)
 Change filter in camera filter wheel. More...
 
int miccd_set_cooltemp (camera_t *camera, float temp)
 Set camera cooling temperature. More...
 
int miccd_chip_temperature (camera_t *camera, float *temp)
 Retrieve chip temperature. More...
 
int miccd_environment_temperature (camera_t *camera, float *temp)
 Retrieve environmental (surrounding) temperature. More...
 
int miccd_power_voltage (camera_t *camera, uint16_t *voltage)
 Retrieve camera voltage. More...
 
int miccd_gain (camera_t *camera, uint16_t *gain)
 Retrieve camera gain. More...
 
int miccd_fan (camera_t *camera, int8_t fan)
 Switch on/off camera fan. More...
 
int miccd_read_eeprom (camera_t *camera, uint8_t offset, uint8_t size, void *buf)
 Read EEPROM data from the camera. More...
 

Detailed Description

Prototypes for MI CCD library functions.

Function Documentation

int miccd_abort_exposure ( camera_t camera)

Abort exposure on G1 camera.

Parameters
cameracamera structure filled in miccd_open() call
Returns
0 on success, negative error code on (-errno) on failure
int miccd_chip_temperature ( camera_t camera,
float *  temp 
)

Retrieve chip temperature.

Parameters
temppointer to float to store chip temperature (in degrees C).
cameracamera structure filled in miccd_open() call
Returns
0 on success, negative error code on (-errno) on failure
int miccd_clear ( camera_t camera)

Clear camera CCD.

Parameters
cameracamera structure filled in miccd_open() call
Returns
0 on success, negative error code on (-errno) on failure
int miccd_close ( camera_t camera)

Close connection to camera.

Parameters
cameracamera structure filled in miccd_open() call
Returns
0 on success, negative error code on (-errno) on failure.
int miccd_close_shutter ( camera_t camera)

Close camera shutter.

Parameters
cameracamera structure filled in miccd_open() call
Returns
0 on success, negative error code on (-errno) on failure
int miccd_environment_temperature ( camera_t camera,
float *  temp 
)

Retrieve environmental (surrounding) temperature.

Parameters
temppointer to float to store environmental temperature (in degrees C).
cameracamera structure filled in miccd_open() call
Returns
0 on success, negative error code on (-errno) on failure
int miccd_fan ( camera_t camera,
int8_t  fan 
)

Switch on/off camera fan.

Parameters
fanturn fan on/off (boolean)
cameracamera structure filled in miccd_open() call
Returns
0 on success, negative error code on (-errno) on failure
int miccd_filter ( camera_t camera,
uint8_t  filter 
)

Change filter in camera filter wheel.

Change filter in camera filter wheel. Filters are counted from 0.

Parameters
filterfilter number. Filters are counted from 0.
cameracamera structure filled in miccd_open() call
Returns
0 on success, negative error code on (-errno) on failure
int miccd_g1_mode ( camera_t camera,
int  bit16,
int  lownoise 
)

Set G1 camera mode.

Parameters
cameracamera structure filled in miccd_open() call
bit16if 16 bit readout should be enabled
lownoiselownoise mode enabled
int miccd_gain ( camera_t camera,
uint16_t *  gain 
)

Retrieve camera gain.

Parameters
gainpointer to integer to store gain level
cameracamera structure filled in miccd_open() call
Returns
0 on success, negative error code on (-errno) on failure
int miccd_hclear ( camera_t camera)

Clear horizontal register.

Parameters
cameracamera structure filled in miccd_open() call
Returns
0 on success, negative error code on (-errno) on failure
int miccd_hshift_clear ( camera_t camera,
uint16_t  h 
)

Shift camera columns.

This is equal to serial shift - ony serial register is shifted by given number of pixels.

Parameters
cameracamera structure filled in miccd_open() call
hnumber of pixels for serial shift
Returns
0 on success, negative error code on (-errno) on failure
int miccd_info ( camera_t camera,
camera_info_t info 
)

Retrieve camera information structure from camera.

Parameters
cameracamera structure filled in miccd_open() call
infocamera descriptor structure, filled on successfull return with camera data
Returns
0 on success, negative error code on (-errno) on failure
int miccd_mode ( camera_t camera,
uint8_t  mode 
)

Set camera mode.

Parameters
cameracamera structure filled in miccd_open() call
modecamera mode (0 - normal, 1 = low noise; 2 = ultra low noise; 2 is not available on G1)
Returns
0 on success, negative error code on (-errno) on failure
int miccd_open ( int32_t  id,
camera_t camera 
)

Open connection to camera with given product ID.

Parameters
idcamera product ID. If set to 0, the first found camera will be connected. You can use miccd_info(camera,info) call to retrieve its product ID
cameracamera support structure
Returns
opened file descriptor for camera, negative error code on error. Error code is negative errno value.
See also
miccd_info(camera,info)
int miccd_open_shutter ( camera_t camera)

Open camera shutter.

Parameters
cameracamera structure filled in miccd_open() call
Returns
0 on success, negative error code on (-errno) on failure
int miccd_power_voltage ( camera_t camera,
uint16_t *  voltage 
)

Retrieve camera voltage.

Parameters
voltagepointer to integer to store voltage level
cameracamera structure filled in miccd_open() call
Returns
0 on success, negative error code on (-errno) on failure
int miccd_read_eeprom ( camera_t camera,
uint8_t  offset,
uint8_t  size,
void *  buf 
)

Read EEPROM data from the camera.

Parameters
offsetread EEPROM from this offset
sizesize of buffer to read
cameracamera structure filled in miccd_open() call
Returns
0 on success, negative error code on (-errno) on failure
int miccd_read_frame ( camera_t camera,
uint8_t  hbinning,
uint8_t  vbinning,
uint16_t  x,
uint16_t  y,
uint16_t  w,
uint16_t  h,
char *  data 
)

Readout camera chip.

Read data from camera and stored them in provided buffer. You can call this function anytime, but most probably you will prefer to call miccd_open_shutter() and miccd_close_shutter() before to accumulate some light on the camera.

Parameters
cameracamera_t structure filled in miccd_open() call
hbinningframe horizontal binning
vbinningframe vertical binning
xROI x start
yROI y start
wROI width
hROI height
datapointer to buffer allocated to hold data. Must be large enough to hold all data from camera (e.g. at least w/hbinning * h/vbinning * 2 bytes).
Returns
0 on success, negative error code on (-errno) on failure
See also
miccd_open_shutter
miccd_close_shutter
int miccd_set_cooltemp ( camera_t camera,
float  temp 
)

Set camera cooling temperature.

Parameters
temptarget cooling temperature in degrees C. Please consult camera documentation for details of its cooling capabilities.
cameracamera structure filled in miccd_open() call
Returns
0 on success, negative error code on (-errno) on failure
int miccd_shift ( camera_t camera)

Shift camera rows.

Parameters
cameracamera structure filled in miccd_open() call
Returns
0 on success, negative error code on (-errno) on failure
int miccd_shift_to0 ( camera_t camera)

Shifts rows till first imagine row.

This jump over prescan region. After calling this function serial register holds first pixel of first non-prescan (image) row.

Parameters
cameracamera structure filled in miccd_open() call
Returns
0 on success, negative error code on (-errno) on failure
int32_t miccd_start_exposure ( camera_t camera,
uint16_t  x,
uint16_t  y,
uint16_t  w,
uint16_t  h,
float  exposure 
)

Start exposure.

Works only with G1 camera.

Parameters
cameracamera structure filled in miccd_open() call
exposureexposure length in seconds. If it is < 0, then the frame will be read out (no exposure will occurs). Start of the exposure should be triggered by call to miccd_clear.
Returns
0 on success, negative error code on (-errno) on failure
See also
miccd_clear
int miccd_vshift_clear ( camera_t camera,
uint16_t  v 
)

Shift camera rows.

This is equal to paraller shift - full rows of camera data are read out and discarded.

Parameters
cameracamera structure filled in miccd_open() call
vnumber of rows for paraller shift
Returns
0 on success, negative error code on (-errno) on failure