]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - tas2557sw-android/tas2557-ftc.git/blob - tas2557.h
update for reading Re/F0/Q/DeltaT during music playback
[tas2557sw-android/tas2557-ftc.git] / tas2557.h
1 /*\r
2 ** =============================================================================\r
3 ** Copyright (c) 2016  Texas Instruments Inc.\r
4 **\r
5 ** This program is free software; you can redistribute it and/or modify it under\r
6 ** the terms of the GNU General Public License as published by the Free Software \r
7 ** Foundation; version 2.\r
8 **\r
9 ** This program is distributed in the hope that it will be useful, but WITHOUT\r
10 ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
11 ** FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\r
12 **\r
13 ** You should have received a copy of the GNU General Public License along with\r
14 ** this program; if not, write to the Free Software Foundation, Inc., 51 Franklin\r
15 ** Street, Fifth Floor, Boston, MA 02110-1301, USA.\r
16 **\r
17 ** File:\r
18 **     tas2557.h\r
19 **\r
20 ** Description:\r
21 **     header file for tas2557.c\r
22 **\r
23 ** =============================================================================\r
24 */\r
25 \r
26 #ifndef TAS2557_H_\r
27 #define TAS2557_H_\r
28 \r
29 #include <stdint.h>\r
30 #include "tas2557_ftc.h"\r
31 \r
32 /* 0000 0000 0BBB BBBB BPPP PPPP PRRR RRRR */\r
33 \r
34 #define TAS2557_REG(book, page, reg)            ((((unsigned int)book * 256 * 128) + \\r
35                                                  ((unsigned int)page * 128)) + reg)\r
36 \r
37 #define TAS2557_BOOK_ID(reg)                    ((unsigned char)(reg / (256 * 128)))\r
38 #define TAS2557_PAGE_ID(reg)                    ((unsigned char)((reg % (256 * 128)) / 128))\r
39 #define TAS2557_BOOK_REG(reg)                   ((unsigned char)(reg % (256 * 128)))\r
40 #define TAS2557_PAGE_REG(reg)                   ((unsigned char)((reg % (256 * 128)) % 128))\r
41 \r
42 #define TILOAD_IOC_MAGIC   0xE0\r
43 \r
44 #define TILOAD_IOCTL_SET_CHL                    _IOW(TILOAD_IOC_MAGIC, 5, int)\r
45 #define TILOAD_IOCTL_SET_CONFIG                 _IOW(TILOAD_IOC_MAGIC, 6, int)\r
46 #define TILOAD_IOCTL_SET_CALIBRATION    _IOW(TILOAD_IOC_MAGIC, 7, int)\r
47 \r
48 #define RESULT_PASS                     0x00000000 \r
49 #define RE1_FAIL_HI                     0x00000001 \r
50 #define RE1_FAIL_LO                     0x00000010 \r
51 #define RE1_CHK_MSK                     0x00000011 \r
52 \r
53 uint8_t tas2557_get_PGID(void);\r
54 void tas2557_mixer_command(char *pCommand, int nData);\r
55 uint32_t tas2557_coeff_read(uint32_t reg);\r
56 void tas2557_coeff_write(uint32_t reg, uint32_t data);\r
57 void tas2557_save_cal(struct TFTCConfiguration *pFTCC,\r
58         double dev_a_re, uint32_t dev_a_rms_pow, uint32_t dev_a_t_limit,\r
59         double t_cal, uint32_t,char * pFileName);\r
60 uint32_t check_spk_bounds(struct TFTCConfiguration *pFTCC, double re1);\r
61 void tas2557_load_calibration(int nCalibration);\r
62 void tas2557_open_bin(char * pFileName);\r
63 void tas2557_close_bin(void);\r
64 void tas2557_ftc_release(void);\r
65 \r
66 #endif /* TAS2557_H_ */\r