diff options
author | Peter Li | 2017-04-11 19:37:05 -0500 |
---|---|---|
committer | Peter Li | 2017-04-11 19:37:05 -0500 |
commit | 44e7bfc1cd8a3891e05db4f00e6d86858d35336c (patch) | |
tree | 57cf62d842f932cd2e5b8567a0cef7cbd3ad3762 | |
parent | 56907db7ffc648ece8a5a8352a4115fe87e869ef (diff) | |
download | tas2557dm-ftc-44e7bfc1cd8a3891e05db4f00e6d86858d35336c.tar.gz tas2557dm-ftc-44e7bfc1cd8a3891e05db4f00e6d86858d35336c.tar.xz tas2557dm-ftc-44e7bfc1cd8a3891e05db4f00e6d86858d35336c.zip |
support Re/DeltaT/F0/Q readout during normal music playback (FTCLib: 1.0.0.5)
-rwxr-xr-x | Android.mk | 3 | ||||
-rwxr-xr-x | factorytest.c | 35 | ||||
-rw-r--r-- | lib/libftc32.a | bin | 7104 -> 12330 bytes | |||
-rw-r--r-- | lib/libftc64.a | bin | 8520 -> 12678 bytes | |||
-rwxr-xr-x | readme.txt | 3 | ||||
-rwxr-xr-x | speaker_l.ftcfg | 30 | ||||
-rwxr-xr-x | speaker_r.ftcfg | 30 | ||||
-rwxr-xr-x | tas2557_ftc.h | 6 | ||||
-rwxr-xr-x | tas2557_ftc_lib.h | 5 | ||||
-rwxr-xr-x | tas2557dm_chk.c | 91 | ||||
-rwxr-xr-x | tas2557evm_aacspk_a.ftcfg | 45 | ||||
-rwxr-xr-x | tas2557evm_aacspk_b.ftcfg | 45 |
12 files changed, 227 insertions, 66 deletions
@@ -5,7 +5,8 @@ LOCAL_SRC_FILES += \ | |||
5 | factorytest.c \ | 5 | factorytest.c \ |
6 | system.c \ | 6 | system.c \ |
7 | tas2557.c \ | 7 | tas2557.c \ |
8 | tas2557dm_ftc.c | 8 | tas2557dm_ftc.c \ |
9 | tas2557dm_chk.c | ||
9 | 10 | ||
10 | LOCAL_C_INCLUDES += ${LOCAL_PATH}/ | 11 | LOCAL_C_INCLUDES += ${LOCAL_PATH}/ |
11 | 12 | ||
diff --git a/factorytest.c b/factorytest.c index cd82ac8..c5470db 100755 --- a/factorytest.c +++ b/factorytest.c | |||
@@ -41,6 +41,9 @@ | |||
41 | 41 | ||
42 | // Obtained from PurePath Console 3 (PPC3) | 42 | // Obtained from PurePath Console 3 (PPC3) |
43 | #define PPC3_RE0 7.41 // Re0 (ohm) | 43 | #define PPC3_RE0 7.41 // Re0 (ohm) |
44 | #define PPC3_FWARP 891 | ||
45 | #define PPC3_BL 0.814 | ||
46 | #define PPC3_MMS 0.0666 | ||
44 | #define PPC3_RTV 46.5 // Rtv (K/W) | 47 | #define PPC3_RTV 46.5 // Rtv (K/W) |
45 | #define PPC3_RTM 78.2 // Rtm (K/W) | 48 | #define PPC3_RTM 78.2 // Rtm (K/W) |
46 | #define PPC3_RTVA 2460 // Rtva (K/W) | 49 | #define PPC3_RTVA 2460 // Rtva (K/W) |
@@ -61,7 +64,8 @@ void ExitWithHint(char *pHint) | |||
61 | 64 | ||
62 | void InitFTCC(struct TFTCConfiguration *pFTCC) | 65 | void InitFTCC(struct TFTCConfiguration *pFTCC) |
63 | { | 66 | { |
64 | pFTCC->nCalibrationTime = 4000; | 67 | pFTCC->nCalibrationTime = 2000; |
68 | pFTCC->nPPC3_FS = 48000; | ||
65 | 69 | ||
66 | pFTCC->bVerbose = false; | 70 | pFTCC->bVerbose = false; |
67 | pFTCC->bLoadCalibration = false; | 71 | pFTCC->bLoadCalibration = false; |
@@ -72,6 +76,9 @@ void InitFTCC(struct TFTCConfiguration *pFTCC) | |||
72 | pFTCC->nTSpkCharDevA.nReHi = PPC3_RE0*1.15; | 76 | pFTCC->nTSpkCharDevA.nReHi = PPC3_RE0*1.15; |
73 | pFTCC->nTSpkCharDevA.nReLo = PPC3_RE0*0.85; | 77 | pFTCC->nTSpkCharDevA.nReLo = PPC3_RE0*0.85; |
74 | pFTCC->nTSpkCharDevA.nPPC3_Re0 = PPC3_RE0; | 78 | pFTCC->nTSpkCharDevA.nPPC3_Re0 = PPC3_RE0; |
79 | pFTCC->nTSpkCharDevA.nPPC3_FWarp = PPC3_FWARP; | ||
80 | pFTCC->nTSpkCharDevA.nPPC3_Bl = PPC3_BL; | ||
81 | pFTCC->nTSpkCharDevA.nPPC3_Mms = PPC3_MMS; | ||
75 | pFTCC->nTSpkCharDevA.nPPC3_RTV = PPC3_RTV; | 82 | pFTCC->nTSpkCharDevA.nPPC3_RTV = PPC3_RTV; |
76 | pFTCC->nTSpkCharDevA.nPPC3_RTM = PPC3_RTM; | 83 | pFTCC->nTSpkCharDevA.nPPC3_RTM = PPC3_RTM; |
77 | pFTCC->nTSpkCharDevA.nPPC3_RTVA = PPC3_RTVA; | 84 | pFTCC->nTSpkCharDevA.nPPC3_RTVA = PPC3_RTVA; |
@@ -86,6 +93,9 @@ void InitFTCC(struct TFTCConfiguration *pFTCC) | |||
86 | pFTCC->nTSpkCharDevB.nReHi = PPC3_RE0*1.15; | 93 | pFTCC->nTSpkCharDevB.nReHi = PPC3_RE0*1.15; |
87 | pFTCC->nTSpkCharDevB.nReLo = PPC3_RE0*0.85; | 94 | pFTCC->nTSpkCharDevB.nReLo = PPC3_RE0*0.85; |
88 | pFTCC->nTSpkCharDevB.nPPC3_Re0 = PPC3_RE0; | 95 | pFTCC->nTSpkCharDevB.nPPC3_Re0 = PPC3_RE0; |
96 | pFTCC->nTSpkCharDevB.nPPC3_FWarp = PPC3_FWARP; | ||
97 | pFTCC->nTSpkCharDevB.nPPC3_Bl = PPC3_BL; | ||
98 | pFTCC->nTSpkCharDevB.nPPC3_Mms = PPC3_MMS; | ||
89 | pFTCC->nTSpkCharDevB.nPPC3_RTV = PPC3_RTV; | 99 | pFTCC->nTSpkCharDevB.nPPC3_RTV = PPC3_RTV; |
90 | pFTCC->nTSpkCharDevB.nPPC3_RTM = PPC3_RTM; | 100 | pFTCC->nTSpkCharDevB.nPPC3_RTM = PPC3_RTM; |
91 | pFTCC->nTSpkCharDevB.nPPC3_RTVA = PPC3_RTVA; | 101 | pFTCC->nTSpkCharDevB.nPPC3_RTVA = PPC3_RTVA; |
@@ -124,10 +134,14 @@ unsigned int RemoveComments(char *pData, char cCharacter, unsigned int nSize) | |||
124 | void ReadValue(struct TFTCConfiguration *pFTCC, struct TSPKCharData *pSpk, char *pLine, char *pValue) | 134 | void ReadValue(struct TFTCConfiguration *pFTCC, struct TSPKCharData *pSpk, char *pLine, char *pValue) |
125 | { | 135 | { |
126 | if (!strcmp(pLine, "CALIBRATION_TIME")) {pFTCC->nCalibrationTime = atoi(pValue); return;}; | 136 | if (!strcmp(pLine, "CALIBRATION_TIME")) {pFTCC->nCalibrationTime = atoi(pValue); return;}; |
137 | if (!strcmp(pLine, "FS_RATE")) {pFTCC->nPPC3_FS = atof(pValue); return;}; | ||
127 | if (!strcmp(pLine, "SPK_T_MAX")) {pSpk->nSpkTMax = atof(pValue); return;}; | 138 | if (!strcmp(pLine, "SPK_T_MAX")) {pSpk->nSpkTMax = atof(pValue); return;}; |
128 | if (!strcmp(pLine, "SPK_RE_TOL_PER")) {pSpk->nSpkReTolPer = atof(pValue); return;}; | 139 | if (!strcmp(pLine, "SPK_RE_TOL_PER")) {pSpk->nSpkReTolPer = atof(pValue); return;}; |
129 | if (!strcmp(pLine, "SPK_RE_ALPHA")) {pSpk->nSpkReAlpha = atof(pValue); return;}; | 140 | if (!strcmp(pLine, "PPC3_RE_ALPHA")) {pSpk->nSpkReAlpha = atof(pValue); return;}; |
130 | if (!strcmp(pLine, "PPC3_RE0")) {pSpk->nPPC3_Re0 = atof(pValue); return;}; | 141 | if (!strcmp(pLine, "PPC3_RE0")) {pSpk->nPPC3_Re0 = atof(pValue); return;}; |
142 | if (!strcmp(pLine, "PPC3_FWARP")) {pSpk->nPPC3_FWarp = atof(pValue); return;}; | ||
143 | if (!strcmp(pLine, "PPC3_BL")) {pSpk->nPPC3_Bl = atof(pValue); return;}; | ||
144 | if (!strcmp(pLine, "PPC3_MMS")) {pSpk->nPPC3_Mms = atof(pValue); return;}; | ||
131 | if (!strcmp(pLine, "PPC3_RTV")) {pSpk->nPPC3_RTV = atof(pValue); return;}; | 145 | if (!strcmp(pLine, "PPC3_RTV")) {pSpk->nPPC3_RTV = atof(pValue); return;}; |
132 | if (!strcmp(pLine, "PPC3_RTM")) {pSpk->nPPC3_RTM = atof(pValue); return;}; | 146 | if (!strcmp(pLine, "PPC3_RTM")) {pSpk->nPPC3_RTM = atof(pValue); return;}; |
133 | if (!strcmp(pLine, "PPC3_RTVA")) {pSpk->nPPC3_RTVA = atof(pValue); return;}; | 147 | if (!strcmp(pLine, "PPC3_RTVA")) {pSpk->nPPC3_RTVA = atof(pValue); return;}; |
@@ -155,6 +169,9 @@ void ftcc_print(struct TFTCConfiguration *pFTCC) | |||
155 | printf(" SPKA SPK_RE_ALPHA = %2.4f\n\r\n\r", pFTCC->nTSpkCharDevA.nSpkReAlpha); | 169 | printf(" SPKA SPK_RE_ALPHA = %2.4f\n\r\n\r", pFTCC->nTSpkCharDevA.nSpkReAlpha); |
156 | 170 | ||
157 | printf(" SPKA PPC3_RE0 = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_Re0); | 171 | printf(" SPKA PPC3_RE0 = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_Re0); |
172 | printf(" SPKA PPC3_FWARP = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_FWarp); | ||
173 | printf(" SPKA PPC3_BL = %2.6f\n\r", pFTCC->nTSpkCharDevA.nPPC3_Bl); | ||
174 | printf(" SPKA PPC3_MMS = %2.6f\n\r", pFTCC->nTSpkCharDevA.nPPC3_Mms); | ||
158 | printf(" SPKA PPC3_RTV = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_RTV); | 175 | printf(" SPKA PPC3_RTV = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_RTV); |
159 | printf(" SPKA PPC3_RTM = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_RTM); | 176 | printf(" SPKA PPC3_RTM = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_RTM); |
160 | printf(" SPKA PPC3_RTVA = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_RTVA); | 177 | printf(" SPKA PPC3_RTVA = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_RTVA); |
@@ -170,6 +187,9 @@ void ftcc_print(struct TFTCConfiguration *pFTCC) | |||
170 | printf(" SPKB SPK_RE_ALPHA = %2.4f\n\r\n\r", pFTCC->nTSpkCharDevB.nSpkReAlpha); | 187 | printf(" SPKB SPK_RE_ALPHA = %2.4f\n\r\n\r", pFTCC->nTSpkCharDevB.nSpkReAlpha); |
171 | 188 | ||
172 | printf(" SPKB PPC3_RE0 = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_Re0); | 189 | printf(" SPKB PPC3_RE0 = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_Re0); |
190 | printf(" SPKB PPC3_FWARP = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_FWarp); | ||
191 | printf(" SPKB PPC3_BL = %2.6f\n\r", pFTCC->nTSpkCharDevB.nPPC3_Bl); | ||
192 | printf(" SPKB PPC3_MMS = %2.6f\n\r", pFTCC->nTSpkCharDevB.nPPC3_Mms); | ||
173 | printf(" SPKB PPC3_RTV = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_RTV); | 193 | printf(" SPKB PPC3_RTV = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_RTV); |
174 | printf(" SPKB PPC3_RTM = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_RTM); | 194 | printf(" SPKB PPC3_RTM = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_RTM); |
175 | printf(" SPKB PPC3_RTVA = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_RTVA); | 195 | printf(" SPKB PPC3_RTVA = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_RTVA); |
@@ -243,6 +263,7 @@ int main(int argc, char *argv[]) | |||
243 | double nTemp = 20.0; | 263 | double nTemp = 20.0; |
244 | int nArg = 1; | 264 | int nArg = 1; |
245 | bool bValidArg; | 265 | bool bValidArg; |
266 | bool bSpkChk = false; | ||
246 | char pHint[256]; | 267 | char pHint[256]; |
247 | struct TFTCConfiguration sFTCC; | 268 | struct TFTCConfiguration sFTCC; |
248 | 269 | ||
@@ -290,6 +311,11 @@ int main(int argc, char *argv[]) | |||
290 | bValidArg = true; | 311 | bValidArg = true; |
291 | } | 312 | } |
292 | 313 | ||
314 | if (!strcmp(argv[nArg], "-m")) { | ||
315 | bSpkChk = true; | ||
316 | bValidArg = true; | ||
317 | } | ||
318 | |||
293 | if (!bValidArg) { | 319 | if (!bValidArg) { |
294 | sprintf(pHint, "don't know argument %s", argv[nArg]); | 320 | sprintf(pHint, "don't know argument %s", argv[nArg]); |
295 | ExitWithHint(pHint); | 321 | ExitWithHint(pHint); |
@@ -302,6 +328,9 @@ int main(int argc, char *argv[]) | |||
302 | ftcc_print(&sFTCC); | 328 | ftcc_print(&sFTCC); |
303 | } | 329 | } |
304 | 330 | ||
305 | tas2557_ftc(nTemp, &sFTCC); | 331 | if (bSpkChk) |
332 | tas2557_chk(nTemp, &sFTCC); | ||
333 | else | ||
334 | tas2557_ftc(nTemp, &sFTCC); | ||
306 | return 0; | 335 | return 0; |
307 | } | 336 | } |
diff --git a/lib/libftc32.a b/lib/libftc32.a index 0d85d4a..861aaae 100644 --- a/lib/libftc32.a +++ b/lib/libftc32.a | |||
Binary files differ | |||
diff --git a/lib/libftc64.a b/lib/libftc64.a index 3f2e2d9..e29a6f7 100644 --- a/lib/libftc64.a +++ b/lib/libftc64.a | |||
Binary files differ | |||
@@ -1 +1,2 @@ | |||
1 | ./factorytest -t 25 -l speaker_l.ftcfg -r speaker_r.ftcfg -v \ No newline at end of file | 1 | To do speaker calibration $./factorytest -t 25 -l tas2557evm_aacspk_a.ftcfg -r tas2557evm_aacspk_b.ftcfg -v |
2 | To do F0/Q/Re/Delta_tv readout : $./factorytest -t 25 -l tas2557evm_aacspk_a.ftcfg -r tas2557evm_aacspk_b.ftcfg -v -m \ No newline at end of file | ||
diff --git a/speaker_l.ftcfg b/speaker_l.ftcfg deleted file mode 100755 index ef8eccd..0000000 --- a/speaker_l.ftcfg +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | |||
2 | ; TAS2557 Factory Test and Calibration Configuration File | ||
3 | ; ----------------------------------------------------------------------------- | ||
4 | ; PPC3 File: example.ppc3 | ||
5 | ; DDC Name: N48M1V2 | ||
6 | ; Comments: [Write Comments Here] | ||
7 | |||
8 | ; FTC Settings | ||
9 | CALIBRATION_TIME = 2000 ; Duration (in ms) of calibration phase | ||
10 | CONVERGENCE_TIME = 8000 ; Duration of F0 tracker stable | ||
11 | DEV_ADDR = 98 ; I2C slave write addr for device A | ||
12 | |||
13 | ; Obtained from Speaker Manufacturer | ||
14 | SPK_T_MAX = 80 ; Speaker Maximum Temperature (C) | ||
15 | SPK_RE_TOL_PER = 10 ; Re +/- tolerance (%) | ||
16 | SPK_RE_ALPHA = 0.0039 ; Temperature coefficient alpha (1/K) | ||
17 | |||
18 | ; Pass/Fail Limits | ||
19 | RE_HI = 8.0 | ||
20 | RE_LO = 6.0 | ||
21 | |||
22 | ; Obtained from PurePath Console 3 (PPC3) | ||
23 | PPC3_RE0 = 7.0 ; Re0 (ohm) | ||
24 | PPC3_RTV = 44.9 ; Rtv (K/W) | ||
25 | PPC3_RTM = 80.7 ; Rtm (K/W) | ||
26 | PPC3_RTVA = 1723 ; Rtva (K/W) | ||
27 | PPC3_SYSGAIN = 9.35 ; System Gain (V/FS) | ||
28 | PPC3_DEV_NONLIN_PER = 1.5 ; Device Non-linearity (%) | ||
29 | PPC3_PIG = 1 ; Refer to documentation | ||
30 | FS_RATE = 48000 ; TAS2557-B Sample Rate | ||
diff --git a/speaker_r.ftcfg b/speaker_r.ftcfg deleted file mode 100755 index a6b7329..0000000 --- a/speaker_r.ftcfg +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | |||
2 | ; TAS2557 Factory Test and Calibration Configuration File | ||
3 | ; ----------------------------------------------------------------------------- | ||
4 | ; PPC3 File: example.ppc3 | ||
5 | ; DDC Name: N48M1V2 | ||
6 | ; Comments: [Write Comments Here] | ||
7 | |||
8 | ; FTC Settings | ||
9 | CALIBRATION_TIME = 2000 ; Duration (in ms) of calibration phase | ||
10 | CONVERGENCE_TIME = 8000 ; Duration of F0 tracker stable | ||
11 | DEV_ADDR = 9a ; I2C slave write addr for device B | ||
12 | |||
13 | ; Obtained from Speaker Manufacturer | ||
14 | SPK_T_MAX = 80 ; Speaker Maximum Temperature (C) | ||
15 | SPK_RE_TOL_PER = 10 ; Re +/- tolerance (%) | ||
16 | SPK_RE_ALPHA = 0.0039 ; Temperature coefficient alpha (1/K) | ||
17 | |||
18 | ; Pass/Fail Limits | ||
19 | RE_HI = 8.0 | ||
20 | RE_LO = 6.0 | ||
21 | |||
22 | ; Obtained from PurePath Console 3 (PPC3) | ||
23 | PPC3_RE0 = 7.0 ; Re0 (ohm) | ||
24 | PPC3_RTV = 44.9 ; Rtv (K/W) | ||
25 | PPC3_RTM = 80.7 ; Rtm (K/W) | ||
26 | PPC3_RTVA = 1723 ; Rtva (K/W) | ||
27 | PPC3_SYSGAIN = 9.35 ; System Gain (V/FS) | ||
28 | PPC3_DEV_NONLIN_PER = 1.5 ; Device Non-linearity (%) | ||
29 | PPC3_PIG = 1 ; Refer to documentation | ||
30 | FS_RATE = 48000 ; TAS2557-B Sample Rate | ||
diff --git a/tas2557_ftc.h b/tas2557_ftc.h index 475d521..732c31f 100755 --- a/tas2557_ftc.h +++ b/tas2557_ftc.h | |||
@@ -35,6 +35,9 @@ struct TSPKCharData { | |||
35 | double nSpkReAlpha; | 35 | double nSpkReAlpha; |
36 | 36 | ||
37 | double nPPC3_Re0; | 37 | double nPPC3_Re0; |
38 | double nPPC3_FWarp; | ||
39 | double nPPC3_Bl; | ||
40 | double nPPC3_Mms; | ||
38 | double nPPC3_RTV; | 41 | double nPPC3_RTV; |
39 | double nPPC3_RTM; | 42 | double nPPC3_RTM; |
40 | double nPPC3_RTVA; | 43 | double nPPC3_RTVA; |
@@ -52,11 +55,12 @@ struct TFTCConfiguration { | |||
52 | bool bVerbose; | 55 | bool bVerbose; |
53 | bool bLoadCalibration; | 56 | bool bLoadCalibration; |
54 | unsigned int nCalibrationTime; | 57 | unsigned int nCalibrationTime; |
58 | double nPPC3_FS; | ||
55 | 59 | ||
56 | struct TSPKCharData nTSpkCharDevA; | 60 | struct TSPKCharData nTSpkCharDevA; |
57 | struct TSPKCharData nTSpkCharDevB; | 61 | struct TSPKCharData nTSpkCharDevB; |
58 | }; | 62 | }; |
59 | 63 | ||
60 | uint32_t tas2557_ftc(double t_cal, struct TFTCConfiguration *pFTCC); | 64 | uint32_t tas2557_ftc(double t_cal, struct TFTCConfiguration *pFTCC); |
61 | 65 | int tas2557_chk(double t_cal, struct TFTCConfiguration *pFTCC); | |
62 | #endif /* TAS2557_FTC_H_ */ | 66 | #endif /* TAS2557_FTC_H_ */ |
diff --git a/tas2557_ftc_lib.h b/tas2557_ftc_lib.h index ea53446..d761028 100755 --- a/tas2557_ftc_lib.h +++ b/tas2557_ftc_lib.h | |||
@@ -41,4 +41,9 @@ double CalcRe(double re_ppc3, uint32_t prm_r0); | |||
41 | uint32_t calc_prm_pow(double re, double delta_t_max, double nRTV, double nRTM, double nRTVA, double nSysGain); | 41 | uint32_t calc_prm_pow(double re, double delta_t_max, double nRTV, double nRTM, double nRTVA, double nSysGain); |
42 | uint32_t calc_prm_tlimit(double delta_t_max, double alpha, double nDevNonlinPer, double nRTV, double nRTM, double nRTVA, double nPIG); | 42 | uint32_t calc_prm_tlimit(double delta_t_max, double alpha, double nDevNonlinPer, double nRTV, double nRTM, double nRTVA, double nPIG); |
43 | void tas2557_ftc_stop(void); | 43 | void tas2557_ftc_stop(void); |
44 | |||
45 | /* below functions are used in SPK measurement only */ | ||
46 | int get_Re_deltaT(double nPPC3_Re, double nPPC3_alpha, double *pnRe, double *pnDeltaT); | ||
47 | int get_f0_Q(double nPPC3_FWarp, double nPPC3_nFS, double nPPC3_Bl, double nPPC3_Mms, double nPPC3_Re0, double *pnF0, double *pnQ); | ||
48 | |||
44 | #endif /* TAS2557_LIB_FTC_H_ */ | 49 | #endif /* TAS2557_LIB_FTC_H_ */ |
diff --git a/tas2557dm_chk.c b/tas2557dm_chk.c new file mode 100755 index 0000000..31a4db7 --- /dev/null +++ b/tas2557dm_chk.c | |||
@@ -0,0 +1,91 @@ | |||
1 | /* | ||
2 | ** ============================================================================= | ||
3 | ** Copyright (c) 2016 Texas Instruments Inc. | ||
4 | ** | ||
5 | ** This program is free software; you can redistribute it and/or modify it under | ||
6 | ** the terms of the GNU General Public License as published by the Free Software | ||
7 | ** Foundation; version 2. | ||
8 | ** | ||
9 | ** This program is distributed in the hope that it will be useful, but WITHOUT | ||
10 | ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
11 | ** FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
12 | ** | ||
13 | ** You should have received a copy of the GNU General Public License along with | ||
14 | ** this program; if not, write to the Free Software Foundation, Inc., 51 Franklin | ||
15 | ** Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
16 | ** | ||
17 | ** File: | ||
18 | ** tas2557_ftc.c | ||
19 | ** | ||
20 | ** Description: | ||
21 | ** factory test program for TAS2557 Android devices | ||
22 | ** | ||
23 | ** ============================================================================= | ||
24 | */ | ||
25 | |||
26 | #include <stdio.h> | ||
27 | #include <stdint.h> | ||
28 | #include <math.h> | ||
29 | #include <sys/types.h> | ||
30 | |||
31 | #include "system.h" | ||
32 | #include "tas2557.h" // TAS2557 Driver | ||
33 | #include "tas2557_ftc_lib.h" | ||
34 | #include "tas2557_ftc.h" // TAS2557 Factory Test and Calibration Tool | ||
35 | |||
36 | #define PI 3.14159 | ||
37 | |||
38 | // ----------------------------------------------------------------------------- | ||
39 | // tas2557_ftc | ||
40 | // ----------------------------------------------------------------------------- | ||
41 | // Description: | ||
42 | // Obtains Re, f0, Q and T_cal from the speaker. This only needs to be | ||
43 | // executed once during production line test. | ||
44 | // ----------------------------------------------------------------------------- | ||
45 | int tas2557_chk(double t_cal, struct TFTCConfiguration *pFTCC) | ||
46 | { | ||
47 | int nResult = 0; | ||
48 | double nDevARe, nDevADeltaT, nDevAF0, nDevAQ; | ||
49 | double nDevBRe, nDevBDeltaT, nDevBF0, nDevBQ; | ||
50 | uint8_t nPGID; | ||
51 | uint32_t libVersion; | ||
52 | |||
53 | libVersion = get_lib_ver(); | ||
54 | printf("libVersion=0x%x\r\n", libVersion); | ||
55 | |||
56 | /* get device PGID */ | ||
57 | tas2557_switch_device(pFTCC->nTSpkCharDevA.nDevAddr); | ||
58 | nPGID = tas2557_get_PGID(); | ||
59 | printf("PGID=0x%x\r\n", nPGID); | ||
60 | /* set device PGID to FTC process */ | ||
61 | tas2557_ftc_set_PGID(nPGID); | ||
62 | |||
63 | /* Get actual Re from TAS2557 */ | ||
64 | tas2557_switch_device(pFTCC->nTSpkCharDevA.nDevAddr); | ||
65 | nResult = get_Re_deltaT(pFTCC->nTSpkCharDevA.nPPC3_Re0, | ||
66 | pFTCC->nTSpkCharDevA.nSpkReAlpha, | ||
67 | &nDevARe, &nDevADeltaT); | ||
68 | nResult = get_f0_Q(pFTCC->nTSpkCharDevA.nPPC3_FWarp, | ||
69 | pFTCC->nPPC3_FS, | ||
70 | pFTCC->nTSpkCharDevA.nPPC3_Bl, | ||
71 | pFTCC->nTSpkCharDevA.nPPC3_Mms, | ||
72 | pFTCC->nTSpkCharDevA.nPPC3_Re0, | ||
73 | &nDevAF0, &nDevAQ); | ||
74 | printf("SPK_A Re = %f, DeltaT=%f, F0 = %f, Q = %f\n", nDevARe, nDevADeltaT, nDevAF0, nDevAQ); | ||
75 | |||
76 | tas2557_switch_device(pFTCC->nTSpkCharDevB.nDevAddr); | ||
77 | nResult = get_Re_deltaT(pFTCC->nTSpkCharDevB.nPPC3_Re0, | ||
78 | pFTCC->nTSpkCharDevB.nSpkReAlpha, | ||
79 | &nDevBRe, &nDevBDeltaT); | ||
80 | nResult = get_f0_Q(pFTCC->nTSpkCharDevB.nPPC3_FWarp, | ||
81 | pFTCC->nPPC3_FS, | ||
82 | pFTCC->nTSpkCharDevB.nPPC3_Bl, | ||
83 | pFTCC->nTSpkCharDevB.nPPC3_Mms, | ||
84 | pFTCC->nTSpkCharDevB.nPPC3_Re0, | ||
85 | &nDevBF0, &nDevBQ); | ||
86 | printf("SPK_B Re = %f, DeltaT=%f, F0 = %f, Q = %f\n", nDevBRe, nDevBDeltaT, nDevBF0, nDevBQ); | ||
87 | |||
88 | tas2557_ftc_release(); | ||
89 | |||
90 | return nResult; | ||
91 | } | ||
diff --git a/tas2557evm_aacspk_a.ftcfg b/tas2557evm_aacspk_a.ftcfg new file mode 100755 index 0000000..f160647 --- /dev/null +++ b/tas2557evm_aacspk_a.ftcfg | |||
@@ -0,0 +1,45 @@ | |||
1 | |||
2 | ; TAS2557 Factory Test and Calibration Configuration File | ||
3 | ; ----------------------------------------------------------------------------- | ||
4 | ; PPC3 File: AAC_v2_vC3_48000_HP_TAS2557_pg2p1_dm.ppc3 | ||
5 | ; DDC Name: TAS2557MSS_20170411 | ||
6 | ; Comments: [Write Comments Here] | ||
7 | |||
8 | ; FTC Settings | ||
9 | FTC_BYPASS = 0 ; Refer to documentation | ||
10 | TEST_DELTA_T = 80 ; Delta Temperature Limit during verification phase | ||
11 | CALIBRATION_TIME = 2000 ; Duration (in ms) of calibration phase | ||
12 | VERIFICATION_TIME = 4000 ; Duration (in ms) of the verification phase | ||
13 | CONFIGURATION = 0 ; Refer to documentation | ||
14 | CONFIGURATION_CALIBRATION = 1 ; Refer to documentation | ||
15 | DEV_ADDR = 98 ; I2C slave write addr (in hex) for device A | ||
16 | |||
17 | ; Pass/Fail Limits | ||
18 | RE_HI = 7.975 | ||
19 | RE_LO = 6.525 | ||
20 | F0_HI = 924 | ||
21 | F0_LO = 616 | ||
22 | Q_HI = 1.704 | ||
23 | Q_LO = 1.136 | ||
24 | T_HI = 40 | ||
25 | T_LO = 0 | ||
26 | |||
27 | ; Obtained from Speaker Manufacturer | ||
28 | SPK_T_MAX = 100 ; Speaker Maximum Temperature (C) | ||
29 | SPK_RE_TOL_PER = 10 ; Re +/- tolerance (%) | ||
30 | |||
31 | ; Obtained from PurePath Console 3 (PPC3) | ||
32 | PPC3_RE0 = 6.7 ; Re0 (ohm) | ||
33 | PPC3_FWARP = 891 ; CMWF (Hz) | ||
34 | PPC3_BL = 0.814 ; Bl (Tm) | ||
35 | PPC3_MMS = 0.0666 ; Mms (g) | ||
36 | PPC3_RTV = 63.4 ; Rtv (K/W) | ||
37 | PPC3_RTM = 566.7 ; Rtm (K/W) | ||
38 | PPC3_RTVA = 136 ; Rtva (K/W) | ||
39 | PPC3_SYSGAIN = 9.35 ; System Gain (V/FS) | ||
40 | PPC3_DEV_NONLIN_PER = 1.5 ; Device Non-linearity (%) | ||
41 | PPC3_DELTA_T_LIMIT = 80 ; Delta Thermal Limit (C) | ||
42 | PPC3_PIG = 1 ; Refer to documentation | ||
43 | PPC3_RE_ALPHA = 0.0033 ; Temperature coefficient alpha (1/K) | ||
44 | FS_RATE = 48000 ; TAS2557 Sample Rate | ||
45 | |||
diff --git a/tas2557evm_aacspk_b.ftcfg b/tas2557evm_aacspk_b.ftcfg new file mode 100755 index 0000000..0787bf2 --- /dev/null +++ b/tas2557evm_aacspk_b.ftcfg | |||
@@ -0,0 +1,45 @@ | |||
1 | |||
2 | ; TAS2557-B Factory Test and Calibration Configuration File | ||
3 | ; ----------------------------------------------------------------------------- | ||
4 | ; PPC3 File: AAC_v2_vC3_48000_HP_TAS2557_pg2p1_dm.ppc3 | ||
5 | ; DDC Name: TAS2557MSS_20170411 | ||
6 | ; Comments: [Write Comments Here] | ||
7 | |||
8 | ; FTC Settings | ||
9 | FTC_BYPASS = 0 ; Refer to documentation | ||
10 | TEST_DELTA_T = 80 ; Delta Temperature Limit during verification phase | ||
11 | CALIBRATION_TIME = 2000 ; Duration (in ms) of calibration phase | ||
12 | VERIFICATION_TIME = 4000 ; Duration (in ms) of the verification phase | ||
13 | CONFIGURATION = 0 ; Refer to documentation | ||
14 | CONFIGURATION_CALIBRATION = 1 ; Refer to documentation | ||
15 | DEV_ADDR = 9a ; I2C slave write addr (in hex) for device B | ||
16 | |||
17 | ; Pass/Fail Limits | ||
18 | RE_HI = 7.975 | ||
19 | RE_LO = 6.525 | ||
20 | F0_HI = 924 | ||
21 | F0_LO = 616 | ||
22 | Q_HI = 1.704 | ||
23 | Q_LO = 1.136 | ||
24 | T_HI = 40 | ||
25 | T_LO = 0 | ||
26 | |||
27 | ; Obtained from Speaker Manufacturer | ||
28 | SPK_T_MAX = 100 ; Speaker Maximum Temperature (C) | ||
29 | SPK_RE_TOL_PER = 10 ; Re +/- tolerance (%) | ||
30 | |||
31 | ; Obtained from PurePath Console 3 (PPC3) | ||
32 | PPC3_RE0 = 6.7 ; Re0 (ohm) | ||
33 | PPC3_FWARP = 891 ; CMWF (Hz) | ||
34 | PPC3_BL = 0.814 ; Bl (Tm) | ||
35 | PPC3_MMS = 0.0666 ; Mms (g) | ||
36 | PPC3_RTV = 63.4 ; Rtv (K/W) | ||
37 | PPC3_RTM = 566.7 ; Rtm (K/W) | ||
38 | PPC3_RTVA = 136 ; Rtva (K/W) | ||
39 | PPC3_SYSGAIN = 9.35 ; System Gain (V/FS) | ||
40 | PPC3_DEV_NONLIN_PER = 1.5 ; Device Non-linearity (%) | ||
41 | PPC3_DELTA_T_LIMIT = 80 ; Delta Thermal Limit (C) | ||
42 | PPC3_PIG = 1 ; Refer to documentation | ||
43 | PPC3_RE_ALPHA = 0.0033 ; Temperature coefficient alpha (1/K) | ||
44 | FS_RATE = 48000 ; TAS2557-B Sample Rate | ||
45 | |||