sc_push_range( current_cal, range );
postgain_bip = setup->caldacs[ layout->adc_postgain_offset( channel ) ].current;
/* unipolar postgain */
- current_cal = sc_alloc_calibration_setting( setup );
- generic_do_adc_postgain_offset( setup, layout, current_cal, channel, 1 );
+ if( layout->do_adc_unipolar_postgain )
+ {
+ current_cal = sc_alloc_calibration_setting( setup );
+ generic_do_adc_postgain_offset( setup, layout, current_cal, channel, 1 );
+ }
for( range = 0; range < num_ai_ranges; range++ )
if( is_unipolar( setup->dev, setup->ad_subdev, channel, range ) )
sc_push_range( current_cal, range );
if( is_bipolar( setup->dev, setup->ad_subdev, 0, range ) )
sc_push_range( current_cal, range );
postgain_bip = setup->caldacs[ layout->adc_postgain_offset( 0 ) ].current;
-
/* unipolar postgain */
- current_cal = sc_alloc_calibration_setting( setup );
- generic_do_adc_postgain_offset( setup, layout, current_cal, 0, 1 );
- sc_push_channel( current_cal, SC_ALL_CHANNELS );
+ if( layout->do_adc_unipolar_postgain )
+ {
+ current_cal = sc_alloc_calibration_setting( setup );
+ generic_do_adc_postgain_offset( setup, layout, current_cal, 0, 1 );
+ sc_push_channel( current_cal, SC_ALL_CHANNELS );
+ }
for( range = 0; range < num_ai_ranges; range++ )
if( is_unipolar( setup->dev, setup->ad_subdev, 0, range ) )
sc_push_range( current_cal, range );
layout->adc_ground_observable = dummy_observable;
layout->dac_high_observable = dummy_observable;
layout->dac_ground_observable = dummy_observable;
+ layout->do_adc_unipolar_postgain = 1;
}
unsigned int channel, unsigned int range );
int (*dac_ground_observable)( const calibration_setup_t *setup,
unsigned int channel, unsigned int range );
+ unsigned do_adc_unipolar_postgain : 1;
} generic_layout_t;
void init_generic_layout( generic_layout_t *layout );
int generic_cal_by_channel_and_range( calibration_setup_t *setup,
layout.adc_ground_observable = ai_ground_observable_1xxx;
layout.dac_high_observable = ao_high_observable_1xxx;
layout.dac_ground_observable = ao_ground_observable_1xxx;
+ /* On unipolar ranges, both the gain and offset adjustments couple
+ * to the ground observables. I don't know if there is a way
+ * to get around it, so we'll just use the bipolar postgain setting. */
+ layout.do_adc_unipolar_postgain = 0;
return generic_cal_by_range( setup, &layout );
}