/hal_espressif-3.6.0/zephyr/esp32/src/esp_adc_cal/ |
D | esp_adc_cal.c | 232 static uint32_t calculate_voltage_linear(uint32_t adc_reading, uint32_t coeff_a, uint32_t coeff_b) in calculate_voltage_linear() argument 235 return (((coeff_a * adc_reading) + LIN_COEFF_A_ROUND) / LIN_COEFF_A_SCALE) + coeff_b; in calculate_voltage_linear() 331 uint32_t esp_adc_cal_raw_to_voltage(uint32_t adc_reading, const esp_adc_cal_characteristics_t *char… in esp_adc_cal_raw_to_voltage() argument 336 adc_reading = (adc_reading << (ADC_WIDTH_BIT_12 - chars->bit_width)); in esp_adc_cal_raw_to_voltage() 337 if (adc_reading > ADC_12_BIT_RES - 1) { in esp_adc_cal_raw_to_voltage() 338 adc_reading = ADC_12_BIT_RES - 1; //Set to 12bit res max in esp_adc_cal_raw_to_voltage() 341 …if (LUT_ENABLED && (chars->atten == ADC_ATTEN_DB_11) && (adc_reading >= LUT_LOW_THRESH)) { //Chec… in esp_adc_cal_raw_to_voltage() 343 …uint32_t lut_voltage = calculate_voltage_lut(adc_reading, chars->vref, chars->low_curve, chars->hi… in esp_adc_cal_raw_to_voltage() 344 …if (adc_reading <= LUT_HIGH_THRESH) { //If ADC is transitioning from linear region to non-linear… in esp_adc_cal_raw_to_voltage() 346 … uint32_t linear_voltage = calculate_voltage_linear(adc_reading, chars->coeff_a, chars->coeff_b); in esp_adc_cal_raw_to_voltage() [all …]
|
/hal_espressif-3.6.0/components/esp_adc_cal/esp32/ |
D | esp_adc_cal.c | 233 static uint32_t calculate_voltage_linear(uint32_t adc_reading, uint32_t coeff_a, uint32_t coeff_b) in calculate_voltage_linear() argument 236 return (((coeff_a * adc_reading) + LIN_COEFF_A_ROUND) / LIN_COEFF_A_SCALE) + coeff_b; in calculate_voltage_linear() 332 uint32_t esp_adc_cal_raw_to_voltage(uint32_t adc_reading, const esp_adc_cal_characteristics_t *char… in esp_adc_cal_raw_to_voltage() argument 337 adc_reading = (adc_reading << (ADC_WIDTH_BIT_12 - chars->bit_width)); in esp_adc_cal_raw_to_voltage() 338 if (adc_reading > ADC_12_BIT_RES - 1) { in esp_adc_cal_raw_to_voltage() 339 adc_reading = ADC_12_BIT_RES - 1; //Set to 12bit res max in esp_adc_cal_raw_to_voltage() 342 …if (LUT_ENABLED && (chars->atten == ADC_ATTEN_DB_11) && (adc_reading >= LUT_LOW_THRESH)) { //Chec… in esp_adc_cal_raw_to_voltage() 344 …uint32_t lut_voltage = calculate_voltage_lut(adc_reading, chars->vref, chars->low_curve, chars->hi… in esp_adc_cal_raw_to_voltage() 345 …if (adc_reading <= LUT_HIGH_THRESH) { //If ADC is transitioning from linear region to non-linear… in esp_adc_cal_raw_to_voltage() 347 … uint32_t linear_voltage = calculate_voltage_linear(adc_reading, chars->coeff_a, chars->coeff_b); in esp_adc_cal_raw_to_voltage() [all …]
|
/hal_espressif-3.6.0/examples/peripherals/adc/single_read/adc/main/ |
D | adc1_example_main.c | 91 uint32_t adc_reading = 0; in app_main() local 95 adc_reading += adc1_get_raw((adc1_channel_t)channel); in app_main() 99 adc_reading += raw; in app_main() 102 adc_reading /= NO_OF_SAMPLES; in app_main() 104 uint32_t voltage = esp_adc_cal_raw_to_voltage(adc_reading, adc_chars); in app_main() 105 printf("Raw: %d\tVoltage: %dmV\n", adc_reading, voltage); in app_main()
|
/hal_espressif-3.6.0/zephyr/esp_shared/components/esp_adc_cal/ |
D | esp_adc_cal_common.c | 26 int adc_reading; in esp_adc_cal_get_voltage() local 31 adc_reading = adc1_get_raw(channel); in esp_adc_cal_get_voltage() 36 ret = adc2_get_raw(channel, chars->bit_width, &adc_reading); in esp_adc_cal_get_voltage() 38 *voltage = esp_adc_cal_raw_to_voltage((uint32_t)adc_reading, chars); in esp_adc_cal_get_voltage()
|
/hal_espressif-3.6.0/components/esp_adc_cal/ |
D | esp_adc_cal_common.c | 29 int adc_reading; in esp_adc_cal_get_voltage() local 32 adc_reading = adc1_get_raw(channel); in esp_adc_cal_get_voltage() 35 ret = adc2_get_raw(channel, chars->bit_width, &adc_reading); in esp_adc_cal_get_voltage() 37 *voltage = esp_adc_cal_raw_to_voltage((uint32_t)adc_reading, chars); in esp_adc_cal_get_voltage()
|
/hal_espressif-3.6.0/components/esp_adc_cal/esp32s3/ |
D | esp_adc_cal.c | 157 uint32_t esp_adc_cal_raw_to_voltage(uint32_t adc_reading, const esp_adc_cal_characteristics_t *char… in esp_adc_cal_raw_to_voltage() argument 162 assert(adc_reading < 4096); in esp_adc_cal_raw_to_voltage() 169 v_cali_1 = adc_reading * chars->coeff_a; in esp_adc_cal_raw_to_voltage()
|
/hal_espressif-3.6.0/zephyr/esp32s3/src/esp_adc_cal/ |
D | esp_adc_cal.c | 171 uint32_t esp_adc_cal_raw_to_voltage(uint32_t adc_reading, const esp_adc_cal_characteristics_t *char… in esp_adc_cal_raw_to_voltage() argument 176 assert(adc_reading < 4096); in esp_adc_cal_raw_to_voltage() 183 v_cali_1 = adc_reading * chars->coeff_a; in esp_adc_cal_raw_to_voltage()
|
/hal_espressif-3.6.0/zephyr/esp32c3/src/esp_adc_cal/ |
D | esp_adc_cal.c | 170 uint32_t esp_adc_cal_raw_to_voltage(uint32_t adc_reading, const esp_adc_cal_characteristics_t *char… in esp_adc_cal_raw_to_voltage() argument 175 uint64_t v_cali_1 = adc_reading * chars->coeff_a / coeff_a_scaling; in esp_adc_cal_raw_to_voltage()
|
/hal_espressif-3.6.0/components/esp_adc_cal/esp32c3/ |
D | esp_adc_cal.c | 157 uint32_t esp_adc_cal_raw_to_voltage(uint32_t adc_reading, const esp_adc_cal_characteristics_t *char… in esp_adc_cal_raw_to_voltage() argument 162 uint64_t v_cali_1 = adc_reading * chars->coeff_a / coeff_a_scaling; in esp_adc_cal_raw_to_voltage()
|
/hal_espressif-3.6.0/components/esp_adc_cal/esp32s2/ |
D | esp_adc_cal.c | 196 uint32_t esp_adc_cal_raw_to_voltage(uint32_t adc_reading, const esp_adc_cal_characteristics_t *char… in esp_adc_cal_raw_to_voltage() argument 199 return adc_reading * chars->coeff_a / coeff_a_scaling + chars->coeff_b / coeff_b_scaling; in esp_adc_cal_raw_to_voltage()
|
/hal_espressif-3.6.0/zephyr/esp32s2/src/esp_adc_cal/ |
D | esp_adc_cal.c | 195 uint32_t esp_adc_cal_raw_to_voltage(uint32_t adc_reading, const esp_adc_cal_characteristics_t *char… in esp_adc_cal_raw_to_voltage() argument 198 return adc_reading * chars->coeff_a / coeff_a_scaling + chars->coeff_b / coeff_b_scaling; in esp_adc_cal_raw_to_voltage()
|
/hal_espressif-3.6.0/components/esp_adc_cal/include/ |
D | esp_adc_cal.h | 108 uint32_t esp_adc_cal_raw_to_voltage(uint32_t adc_reading, const esp_adc_cal_characteristics_t *char…
|
/hal_espressif-3.6.0/zephyr/esp_shared/components/include/ |
D | esp_adc_cal.h | 108 uint32_t esp_adc_cal_raw_to_voltage(uint32_t adc_reading, const esp_adc_cal_characteristics_t *char…
|