/*------------------------------------------------------------------------------------ ** h2.h - H2RG Array functions **------------------------------------------------------------------------------------ */ #ifndef H2_H #define H2_H struct h2rg_settings_t { int subarray_count; struct ir_array_t darray[3]; int slow_counts; int termination_type; int reset_enable; int omg_refvoltagemode; }; struct h2rg_settings_t h2rg_settings; /*---------------- General H2RG Defines -------------------*/ #define H2_NAXIS1 2048 #define H2_NAXIS2 2048 #define D_MAINRSTB 1 #define D_FASTPADEN 2 #define D_SAMPLECLK 3 #define D_BUFDISABLE 4 #define D_DATACLK 5 #define D_DATAIN 6 #define D_VRESETB 7 #define D_FSYNCB 8 #define D_HRESETB 9 #define D_LSYNCB 10 #define D_HTESTEN 11 #define D_READEN 12 #define D_CSB 13 #define D_LA0 14 #define D_LA1 15 #define PPG4 0 /*16*/ #define PPG4_VCLK 2 + PPG4 #define PPG4_VREADEDGE 4 + PPG4 #define PPG4_VTESTEN 8 + PPG4 #define PG4 0 /*19*/ #define PG4_HCLK 0 + PG4 #define PG4_HREADEDGE 1 + PG4 #define PG4_ADC 2 + PG4 #define PG3 0 /* 22 */ #define PG3_RESETEN 1 + PG3 #define TERMINATION_NONE 0 #define TERMINATION_VCLK 1 #define TERMINATION_FIRST 2 #define TERMINATION_LAST 3 #define TERMINATION_REFERENCE_ENABLE 4 #define H2RG_MAX_BGRCLOCK 10000; /** * Standard functions coming from command line */ int h2rg_init_ir(void); int h2rg_check_subarray ( int num_darray, struct ir_array_t *da); int h2rg_bgrclock(int usecs); int h2rg_bgren(int onoff); int h2rg_bgrrest(int usecs); int h2rg_bgrwait(int usecs); int h2rg_itime(double itime); int h2rg_rdr(int onoff); int h2rg_rom(int mode); int h2rg_rren(int onoff); int h2rg_setrstm(int mode); int h2rg_setttf(int type); int h2rg_setttl(char *type); int h2rg_setvrd(int updown); int h2rg_setwd(int welldepth); int h2rg_slowcnt(int slowcnt); int h2rg_surwt(int usecs); /** * Engineering functions coming from command line */ int h2rge_suram(int mode); int h2rge_setreg(char *regname, char *op, char *bits[]); int h2rge_setemd(char *mode); int h2rge_setspr(int *mode); int h2rge_selsp(int x, int y); int h2rge_selsl(int y); int h2rge_vbg(float vbiasgate); int h2rge_vds(float vdsub); int h2rge_vrst(float vreset); int h2rge_psswd(char *passwd); /** * Functions called from other code */ int h2rg_t1_ir(ce_t *Ce); int h2rg_test_ir( struct ir_ce_buf_t *ce_sample_buf, FILE *fp ); int h2rg_generate_ce_array_setup_ir(struct ir_ce_buf_t *ce_sample_buf, struct h2rg_settings_t *h2rg_settings, FILE *fp ); int h2rg_generate_ce_readout_s_ir ( struct ir_ce_buf_t *ce_sample_buf, struct h2rg_settings_t *h2rg_settings, FILE *fp ); int h2rg_generate_ce_readout_m_ir ( struct ir_ce_buf_t *ce_sample_buf, struct h2rg_settings_t *h2rg_settings, FILE *fp ); int h2rg_generate_ce_reset_s_ir ( struct ir_ce_buf_t *ce_sample_buf, struct h2rg_settings_t *h2rg_settings, FILE *fp ); int h2rg_generate_ce_reset_m_ir ( struct ir_ce_buf_t *ce_sample_buf, struct h2rg_settings_t *h2rg_settings, FILE *fp ); int h2rg_generate_ce_integration_ir( struct ir_ce_buf_t *ce_sample_buf, struct h2rg_settings_t *h2rg_settings, FILE *fp ); #endif /* H2_H */