annotate src/cs/drivers/drv_app/fchg/fchg_convert_mA.c @ 286:ee16d57b32b2

Condat audio_Init(): rm setting of sidetone level The default sidetone level in the absence of audio mode loading is just that, a basic default without any promises of good tuning. In the original TCS211 code this default sidetone level was set in two places: first in L1 init of ABB-via-DSP registers (set to -17 dB), and then initialized again in Condat audio_Init(), this time set to -5 dB. The present change removes the redundant second initialization. The default sidetone level is now -17 dB instead of -5 dB with this change, but again it is just the default; all serious users are now expected to use audio mode config files.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 09 Nov 2021 02:16:59 +0000
parents 09ea37852fd6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
225
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This module implements the fchg_convert_ichg_to_mA() function,
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * converting charging current (Ichg) measurements from ADC units
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * to human-friendly mA numbers. In the phone hardware this current
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * measurement is made with the aid of a current measurement resistor
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 * placed in the charging current path (the Iota chip's MADC actually
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 * measures the voltage across this resistor, between VCCS and VBATS
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 * terminals), and it just so happens that different phone designers
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 * have chosen different values for this current measurement resistor:
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 * Pirelli DP-L10 uses 0.20R, following TI's canon, whereas Mot C1xx
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 * phones use 0.15R. Because of these different resistor values,
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 * the formula for converting ADC units to mA becomes target-dependent.
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 */
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 #include "fchg/fchg_api.h"
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 #include "fc-target.h"
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 UINT16 fchg_convert_ichg_to_mA(UINT16 ichg)
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 {
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 #ifdef CONFIG_TARGET_COMPAL
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 /* formula for 0.15R */
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 return (ichg * 875 / 768);
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 #else
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 /* formula for 0.20R */
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 return (ichg * 875 / 1024);
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 #endif
09ea37852fd6 add function to convert Ichg ADC readings to mA
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 }