sub_get_product_id |
Top Previous Next |
Got to SUB-20 page |
Synopsis int sub_adc_single( sub_handle hndl, int* data, int mux ); int sub_adc_read( sub_handle hndl, int* data, int* mux, int reads );
Read single or multiple ADC conversion result(s) Parameters •data - buffer to store conversion result(s) •mux - ADC input channel multiplexer control code(s). See table below. •reads - number of results to read
ADC Result For single ended conversion:
For differential: ADC is a result of conversion. Note that the result of differential conversion is signed and can be negative. Return value On success function returns 0. Otherwise error code. Example int adc, adc_buf[3], adc_mux[3];
sub_adc_single( fd, &adc, ADC_S0 ); /* Read ADC on ADC0 input */
adc_mux[0] = ADC_S0; adc_mux[1] = ADC_S2; adc_mux[2] = ADC_S3; sub_adc_read( fd, adc_buf, adc_mux, 3 ); /* Read ADC on ADC0,2,3 inputs */
|