proslic.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. /*
  2. * See http://www.asterisk.org for more information about
  3. * the Asterisk project. Please do not directly contact
  4. * any of the maintainers of this project for assistance;
  5. * the project provides a web site, mailing lists and IRC
  6. * channels for your use.
  7. *
  8. * This program is free software, distributed under the terms of
  9. * the GNU General Public License Version 2 as published by the
  10. * Free Software Foundation. See the LICENSE file included with
  11. * this program for more details.
  12. */
  13. // ProSlic Header File
  14. typedef struct {
  15. unsigned char address;
  16. unsigned char altaddr;
  17. char *name;
  18. unsigned short initial;
  19. } alpha;
  20. typedef struct {
  21. unsigned char chip_number;
  22. unsigned char DTMF_digit;
  23. unsigned char interrupt_line;
  24. unsigned char hook_status;
  25. unsigned long half_pulses[20]; // Contains the time stamps of incomming half pulses.
  26. unsigned char half_pulses_detected; // Contains the number of half pulses detected.
  27. unsigned char Pulse_digit;
  28. unsigned long On_Hook_time;
  29. unsigned long Off_Hook_time;
  30. } chipStruct;
  31. // Defines
  32. #define LPT 0X378
  33. /* Proslic Linefeed options for register 64 - Linefeed Control */
  34. #define SLIC_LF_OPEN 0x0
  35. #define SLIC_LF_ACTIVE_FWD 0x1
  36. #define SLIC_LF_OHTRAN_FWD 0x2 /* Forward On Hook Transfer */
  37. #define SLIC_LF_TIP_OPEN 0x3
  38. #define SLIC_LF_RINGING 0x4
  39. #define SLIC_LF_ACTIVE_REV 0x5
  40. #define SLIC_LF_OHTRAN_REV 0x6 /* Reverse On Hook Transfer */
  41. #define SLIC_LF_RING_OPEN 0x7
  42. #define SLIC_LF_SETMASK 0x7
  43. #define SLIC_LF_OPPENDING 0x10
  44. /* Mask used to reverse the linefeed mode between forward and
  45. * reverse polarity. */
  46. #define SLIC_LF_REVMASK 0x4
  47. #define IDA_LO 28
  48. #define IDA_HI 29
  49. #define IAA 30
  50. #define ID_ACCES_STATUS 31
  51. #define IAS_BIT 1
  52. #define I_STATUS 31
  53. #define SPI_MODE 0
  54. #define PCM_MODE 1
  55. #define PCM_XMIT_START_COUNT_LSB 2
  56. #define PCM_XMIT_START_COUNT_MSB 3
  57. #define PCM_RCV_START_COUNT_LSB 4
  58. #define PCM_RCV_START_COUNT_MSB 5
  59. #define DIO 6
  60. #define AUDIO_LOOPBACK 8
  61. #define AUDIO_GAIN 9
  62. #define LINE_IMPEDANCE 10
  63. #define HYBRID 11
  64. #define RESERVED12 12
  65. #define RESERVED13 13
  66. #define PWR_DOWN1 14
  67. #define PWR_DOWN2 15
  68. #define RESERVED16 16
  69. #define RESERVED17 17
  70. #define INTRPT_STATUS1 18
  71. #define INTRPT_STATUS2 19
  72. #define INTRPT_STATUS3 20
  73. #define INTRPT_MASK1 21
  74. #define INTRPT_MASK2 22
  75. #define INTRPT_MASK3 23
  76. #define DTMF_DIGIT 24
  77. #define RESERVED25 25
  78. #define RESERVED26 26
  79. #define RESERVED27 27
  80. #define I_DATA_LOW 28
  81. #define I_DATA_HIGH 29
  82. #define I_ADDRESS 30
  83. #define I_STATUS 31
  84. #define OSC1 32
  85. #define OSC2 33
  86. #define RING_OSC_CTL 34
  87. #define PULSE_OSC 35
  88. #define OSC1_ON__LO 36
  89. #define OSC1_ON_HI 37
  90. #define OSC1_OFF_LO 38
  91. #define OSC1_OFF_HI 39
  92. #define OSC2_ON__LO 40
  93. #define OSC2_ON_HI 41
  94. #define OSC2_OFF_LO 42
  95. #define OSC2_OFF_HI 43
  96. #define PULSE_ON__LO 44
  97. #define PULSE_ON_HI 45
  98. #define PULSE_OFF_LO 46
  99. #define PULSE_OFF_HI 47
  100. #define RING_ON__LO 48
  101. #define RING_ON_HI 49
  102. #define RING_OFF_LO 50
  103. #define RING_OFF_HI 51
  104. #define RESERVED52 52
  105. #define RESERVED53 53
  106. #define RESERVED54 54
  107. #define RESERVED55 55
  108. #define RESERVED56 56
  109. #define RESERVED57 57
  110. #define RESERVED58 58
  111. #define RESERVED59 59
  112. #define RESERVED60 60
  113. #define RESERVED61 61
  114. #define RESERVED62 62
  115. #define RESERVED63 63
  116. #define LINE_STATE 64
  117. #define ACTIVATE_LINE 0x11
  118. #define RING_LINE 0x44
  119. #define BIAS_SQUELCH 65
  120. #define BAT_FEED 66
  121. #define AUTO_STATE 67
  122. #define LOOP_STAT 68
  123. #define LOOP_DEBOUCE 69
  124. #define RT_DEBOUCE 70
  125. #define LOOP_I_LIMIT 71
  126. #define OFF_HOOK_V 72
  127. #define COMMON_V 73
  128. #define BAT_V_HI 74
  129. #define BAT_V_LO 75
  130. #define PWR_STAT_DEV 76
  131. #define PWR_STAT 77
  132. #define LOOP_V_SENSE 78
  133. #define LOOP_I_SENSE 79
  134. #define TIP_V_SENSE 80
  135. #define RING_V_SENSE 81
  136. #define BAT_V_HI_SENSE 82
  137. #define BAT_V_LO_SENSE 83
  138. #define IQ1 84
  139. #define IQ2 85
  140. #define IQ3 86
  141. #define IQ4 87
  142. #define IQ5 88
  143. #define IQ6 89
  144. #define RESERVED90 90
  145. #define RESERVED91 91
  146. #define DCDC_PWM_OFF 92
  147. #define DCDC 93
  148. #define DCDC_PW_OFF 94
  149. #define RESERVED95 95
  150. #define CALIBR1 96
  151. #define CALIBRATE_LINE 0x78
  152. #define NORMAL_CALIBRATION_COMPLETE 0x20
  153. #define CALIBR2 97
  154. #define RING_GAIN_CAL 98
  155. #define TIP_GAIN_CAL 99
  156. #define DIFF_I_CAL 100
  157. #define COMMON_I_CAL 101
  158. #define I_LIMIT_GAIN_CAL 102
  159. #define ADC_OFFSET_CAL 103
  160. #define DAC_ADC_OFFSET 104
  161. #define DAC_OFFSET_CAL 105
  162. #define COMMON_BAL_CAL 106
  163. #define DC_PEAK_CAL 107
  164. // Indirect Register (decimal)
  165. #define DTMF_ROW_0_PEAK 0
  166. #define DTMF_ROW_1_PEAK 1
  167. #define DTMF_ROW2_PEAK 2
  168. #define DTMF_ROW3_PEAK 3
  169. #define DTMF_COL1_PEAK 4
  170. #define DTMF_FWD_TWIST 5
  171. #define DTMF_RVS_TWIST 6
  172. #define DTMF_ROW_RATIO_THRESH 7
  173. #define DTMF_COL_RATIO_THRESH 8
  174. #define DTMF_ROW_2ND_HARM 9
  175. #define DTMF_COL_2ND_HARM 10
  176. #define DTMF_PWR_MIN_THRESH 11
  177. #define DTMF_HOT_LIM_THRESH 12
  178. #define OSC1_COEF 13
  179. #define OSC1X 14
  180. #define OSC1Y 15
  181. #define OSC2_COEF 16
  182. #define OSC2X 17
  183. #define OSC2Y 18
  184. #define RING_V_OFF 19
  185. #define RING_OSC_COEF 20
  186. #define RING_X 21
  187. #define RING_Y 22
  188. #define PULSE_ENVEL 23
  189. #define PULSE_X 24
  190. #define PULSE_Y 25
  191. #define RECV_DIGITAL_GAIN 26
  192. #define XMIT_DIGITAL_GAIN 27
  193. #define LOOP_CLOSE_THRESH 28
  194. #define RING_TRIP_THRESH 29
  195. #define COMMON_MIN_THRESH 30
  196. #define COMMON_MAX_THRESH 31
  197. #define PWR_ALARM_Q1Q2 32
  198. #define PWR_ALARM_Q3Q4 33
  199. #define PWR_ALARM_Q5Q6 34
  200. #define LOOP_CLOSURE_FILTER 35
  201. #define RING_TRIP_FILTER 36
  202. #define THERM_LP_POLE_Q1Q2 37
  203. #define THERM_LP_POLE_Q3Q4 38
  204. #define THERM_LP_POLE_Q5Q6 39
  205. #define CM_BIAS_RINGING 40
  206. #define DCDC_MIN_V 41
  207. #define DCDC_XTRA 42