update FTC to support PG2.1 and PG1.1
authorPeter Li <peter-li@ti.com>
Thu, 23 Feb 2017 00:04:43 +0000 (08:04 +0800)
committerPeter Li <peter-li@ti.com>
Thu, 23 Feb 2017 00:04:43 +0000 (08:04 +0800)
lib/libftc32.a
lib/libftc64.a
tas2557.c
tas2557.h
tas2557_ftc_lib.h
tas2557dm_ftc.c

index 61604fb0ca6a8f509bd4d523e75e743aace4a1ba..99eda4a3beb10afdf8f9d178342ab64f0da180b2 100755 (executable)
Binary files a/lib/libftc32.a and b/lib/libftc32.a differ
index 6be1fe91e46befcddef1f8990afaa51073b6809c..ea09a4c5110f7dd945d3794113b156d1d881a4af 100755 (executable)
Binary files a/lib/libftc64.a and b/lib/libftc64.a differ
index aafbc55c6eb2e5d04b70b2fce4dca9121c187aa3..1c5b788e5c2fabdaf1d88acd71f82aced740c7bc 100755 (executable)
--- a/tas2557.c
+++ b/tas2557.c
@@ -110,6 +110,23 @@ static void tas2557_check_node(void)
        printf("factorytest: %s handle = %d\n\r", TILOAD_NODE, gTILoad);
 }
 
+uint8_t tas2557_get_PGID(void)
+{
+       unsigned char pPageZero[] = {0x00, 0x00};
+       unsigned char pBook[] = {0x7F, 0x00};
+       unsigned char pPage[] = {0x00, 0x00};
+       unsigned char pData[] = {0x03, 0x00, 0x00, 0x00, 0x00};
+
+       tas2557_check_node();
+
+       write(gTILoad, pPageZero, 2);
+       write(gTILoad, pBook, 2);
+       write(gTILoad, pPage, 2);
+       read(gTILoad, pData, 1);
+
+       return pData[0];
+}
+
 uint32_t tas2557_coeff_read(uint8_t book, uint8_t page, uint8_t reg)
 {
        unsigned char pPageZero[] = {0x00, 0x00};
index cc4e776f4a903cbe08114fcd2d6ac20eafee6a03..31c120c4310d6d9b0ffef180b1bda2660c3809b2 100755 (executable)
--- a/tas2557.h
+++ b/tas2557.h
@@ -48,6 +48,7 @@
 \r
 void tas2557_load_configuration(int nConfiguration);\r
 void tas2557_load_calibration(int nCalibration);\r
+uint8_t tas2557_get_PGID(void);\r
 void tas2557_mixer_command(char *pCommand, int nData);\r
 uint32_t tas2557_switch_device(uint8_t i2cslave);\r
 uint32_t tas2557_coeff_read(uint8_t book, uint8_t page, uint8_t reg);\r
index d8ef72eebf0150a3fda0f9f34e18016bc5b5daf3..84fb51d7c2fcf64ae7f4209570eea45a30084795 100755 (executable)
 #include <stdbool.h>\r
 \r
 int get_lib_ver(void);\r
+void tas2557_set_PGID(unsigned char nPGID);\r
 void tas2557_ftc_start(void);\r
-void set_scth(double nSCTH);\r
-void set_nfs(double nNFS);\r
 void set_re(double re_ppc3, double re, double alpha);\r
 void set_temp_cal(uint32_t prm_pow, uint32_t prm_tlimit);\r
 double get_re(double re_ppc3);\r
-double get_f0(int32_t fs);\r
-double get_q(int32_t fs);\r
 uint32_t calc_prm_pow(double re, double delta_t_max, double nRTV, double nRTM, double nRTVA, double nSysGain);\r
 uint32_t calc_prm_tlimit(double delta_t_max, double alpha, double nDevNonlinPer, double nRTV, double nRTM, double nRTVA);\r
-double calc_safe_prm_tlimit(double prm_tlimit_safe, double alpha, double nDevNonlinPer, double nSpkReTolPer);\r
-double coeff_fixed_to_float(uint32_t coeff);\r
-\r
-\r
 #endif /* TAS2557_LIB_FTC_H_ */\r
index 56e8821d9983b920d88e73e652572c1b45eeb3ba..f3f6e72994bb348a14841b6d0280531875d1025b 100755 (executable)
@@ -53,7 +53,7 @@ uint32_t tas2557_ftc(double t_cal, TFTCConfiguration *pFTCC)
     double dev_b_re = pFTCC->nTSpkCharDevB.nPPC3_Re0;   // Default Re\r
     uint32_t dev_b_prm_pow = 0;           // Total RMS power coefficient\r
     uint32_t dev_b_prm_tlimit = 0;        // Delta temperature limit coefficient       \r
-       \r
+       uint8_t nPGID;\r
     uint32_t result = 0;\r
     pid_t nPlaybackProcess;\r
 \r
@@ -65,6 +65,10 @@ uint32_t tas2557_ftc(double t_cal, TFTCConfiguration *pFTCC)
     // STEP 2: Play calibration signal\r
        tas2557_mixer_command("PRI_MI2S_RX Audio Mixer MultiMedia1", 1); //platform dependent\r
     nPlaybackProcess = sys_play_wav("silense.wav", "loop");\r
+       /* get device PGID */\r
+       nPGID = tas2557_get_PGID();\r
+       /* set device PGID to FTC process */\r
+       tas2557_ftc_set_PGID(nPGID);\r
 \r
        // STEP 3: Play calibration signal\r
        tas2557_switch_device(gpFTCC->nTSpkCharDevA.nDevAddr);\r