/*------------------------------------------------------------------------------------ ** al.h - Aladdin Array functions **------------------------------------------------------------------------------------ */ #ifndef AL_H #define AL_H /*--------------------------------------------------------------------------- ** al_ck_t is the aladdin clocking data structure **--------------------------------------------------------------------------- */ struct al_ck_in_t /* input variables for created CE clocking commands */ { int num_darray; /* number of data array */ struct ir_array_t darray[3]; /* sub array definition */ int slowcnt; /* slowcnt */ int numsample; /* from ir_ce_adc_t.numsamples */ int numchannels; /* " */ int multisample_gap; /* " */ int glr_period_usec; /* global reset period in usec; 1 to 250000 */ }; /*---------------- General Aladdin Defines -------------------*/ #define AL_NAXIS1 512 #define AL_NAXIS2 512 #define AL_NUM_OUTPUTS 8 /* 8 outputs on the 512x512 device */ /*---------------- Clocking BITS on DigOut -------------------*/ /* SLOW or row clocks are on DIGOUT */ #define AL_PSS 0x0001 /* B00 - sync */ #define AL_PS1 0x0002 /* B01 - shift 1 */ #define AL_PS2 0x0004 /* B02 - shift 2 */ #define AL_PSOE 0x0008 /* B03 - old or even row */ /* Bit used in resetting rows ON DIGOUT */ #define AL_VRSTR 0x0010 /* B04 - */ #define AL_VROWON 0x0020 /* B05 - */ /* Global reset bits ON DIGIOUT */ #define AL_VGGCL 0x0040 /* B06 - */ #define AL_VRSTG 0x0080 /* B07 - */ #define AL_VDDCL 0x0100 /* B08 - */ /* Non device for controller bits */ #define AL_FRAME 0x0200 /* B09 - */ #define AL_UNUSED10 0x0400 /* B10 - */ #define AL_UNUSED11 0x0800 /* B11 - */ #define AL_UNUSED12 0x1000 /* B12 - */ #define AL_UNUSED13 0x2000 /* B13 - */ #define AL_UNUSED14 0x4000 /* B14 - */ #define AL_UNUSED15 0x8000 /* B15 - */ /*------------ Clocking BITS on VidSeq or PG3/PG4 ---------------*/ /* video pattern generator 3 */ /* PG3 B0, B1 are unused */ #define AL_PFS IR_CE_VPG3_BIT2 /* PG3 B02 - fast sync */ #define AL_PF1 IR_CE_VPG4_BIT0 /* PG4 B00 - fast shift 1 */ #define AL_PF2 IR_CE_VPG4_BIT1 /* PG4 B01 - fast shift 2 */ /* PG4 B02 - is VCLAMP_IN - do not use */ #define AL_ADC IR_CE_VPG4_ADCTRIG /* PG4 B03 - ADCTRIG */ /*-------------------------------------------------------------------------------- ** AL's Scan Table defines & structure - The scan table help keep track where ** convert pulses occur while clocking out an array. Due to sub-array support, ** convert pulses can occur at various columns during the row. We convert in ** group of 16 pixel (2 ADCTRIG per VIDSEQ). */ #define ALST_NUM_ROW AL_NAXIS2 #define ALST_NUM_COL (AL_NAXIS1/16) /* = 32 columns, hmmm file in a unsigned int */ struct alst_row_t { int converts; /* number of converts per row */ int min_col; /* min & max columns of converts in this row */ int max_col; unsigned long col; /* bits representing which columns are skip/scan. */ }; struct alst_table_t /* array table structure*/ { /* alst_setSubArray() fills in the following data:*/ int converts; /* total number of ON bits for the array */ int min_row; /* min & max row of sampled in this array */ int max_row; struct alst_row_t row[ALST_NUM_ROW]; /* converts mask for each row */ }; /*-------------------- ** function prototype */ /*------------------------------------ al_ck_-------------------------------------*/ /* generate ce data for clocking */ int al_ck_generate_ce_sample( struct ir_ce_buf_t *ce_s, struct alst_table_t *st, struct al_ck_in_t *in, FILE *fp ); int al_ck_sample_column( struct ir_ce_buf_t *ce_s, struct alst_table_t *st, struct al_ck_in_t *in, unsigned short *digout, int y, int ts_adc, FILE * fp ); int al_ck_generate_ce_reset( struct ir_ce_buf_t *ce_r, struct al_ck_in_t *in, FILE * fp ); int al_check_subarray( int num_darray,struct ir_array_t *da); /*---------------------------------- alst_ -------------------------------------*/ int alst_clear( struct alst_table_t * st ); int alst_setColRow( struct alst_table_t * st, int col, int row ); int alst_getColRow( struct alst_table_t * st, int col, int row ); int alst_setTable( struct alst_table_t * st, int num_darray, struct ir_array_t *da); int alst_showTable( struct alst_table_t * st, FILE * fp ); #endif /* AL_H */