diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/isdn/hardware/eicon/capidtmf.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'drivers/isdn/hardware/eicon/capidtmf.h')
-rw-r--r-- | drivers/isdn/hardware/eicon/capidtmf.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/drivers/isdn/hardware/eicon/capidtmf.h b/drivers/isdn/hardware/eicon/capidtmf.h new file mode 100644 index 000000000000..242048fb2dd7 --- /dev/null +++ b/drivers/isdn/hardware/eicon/capidtmf.h | |||
@@ -0,0 +1,79 @@ | |||
1 | |||
2 | /* | ||
3 | * | ||
4 | Copyright (c) Eicon Networks, 2002. | ||
5 | * | ||
6 | This source file is supplied for the use with | ||
7 | Eicon Networks range of DIVA Server Adapters. | ||
8 | * | ||
9 | Eicon File Revision : 2.1 | ||
10 | * | ||
11 | This program is free software; you can redistribute it and/or modify | ||
12 | it under the terms of the GNU General Public License as published by | ||
13 | the Free Software Foundation; either version 2, or (at your option) | ||
14 | any later version. | ||
15 | * | ||
16 | This program is distributed in the hope that it will be useful, | ||
17 | but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY | ||
18 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
19 | See the GNU General Public License for more details. | ||
20 | * | ||
21 | You should have received a copy of the GNU General Public License | ||
22 | along with this program; if not, write to the Free Software | ||
23 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | * | ||
25 | */ | ||
26 | #ifndef CAPIDTMF_H_ | ||
27 | #define CAPIDTMF_H_ | ||
28 | /*---------------------------------------------------------------------------*/ | ||
29 | /*---------------------------------------------------------------------------*/ | ||
30 | #define CAPIDTMF_TONE_GROUP_COUNT 2 | ||
31 | #define CAPIDTMF_LOW_GROUP_FREQUENCIES 4 | ||
32 | #define CAPIDTMF_HIGH_GROUP_FREQUENCIES 4 | ||
33 | #define DSPDTMF_RX_SENSITIVITY_LOW_DEFAULT 50 /* -52 dBm */ | ||
34 | #define DSPDTMF_RX_SENSITIVITY_HIGH_DEFAULT 50 /* -52 dBm */ | ||
35 | #define DSPDTMF_RX_HIGH_EXCEEDING_LOW_DEFAULT 10 /* dB */ | ||
36 | #define DSPDTMF_RX_LOW_EXCEEDING_HIGH_DEFAULT 10 /* dB */ | ||
37 | #define DSPDTMF_RX_HARMONICS_SEL_DEFAULT 12 /* dB */ | ||
38 | #define CAPIDTMF_RECV_BASE_FREQUENCY_COUNT (CAPIDTMF_LOW_GROUP_FREQUENCIES + CAPIDTMF_HIGH_GROUP_FREQUENCIES) | ||
39 | #define CAPIDTMF_RECV_GUARD_FREQUENCY_COUNT 8 | ||
40 | #define CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT (CAPIDTMF_RECV_BASE_FREQUENCY_COUNT + CAPIDTMF_RECV_GUARD_FREQUENCY_COUNT) | ||
41 | #define CAPIDTMF_RECV_POSITIVE_COEFF_COUNT 16 | ||
42 | #define CAPIDTMF_RECV_NEGATIVE_COEFF_COUNT (CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT - CAPIDTMF_RECV_POSITIVE_COEFF_COUNT) | ||
43 | #define CAPIDTMF_RECV_ACCUMULATE_CYCLES 205 | ||
44 | #define CAPIDTMF_RECV_FUNDAMENTAL_OFFSET (0xff35L * 2) | ||
45 | #define CAPIDTMF_RECV_FUNDAMENTAL_DECREMENT (0x0028L * 2) | ||
46 | #define CAPIDTMF_RECV_DIGIT_BUFFER_SIZE 32 | ||
47 | #define CAPIDTMF_RECV_STATE_IDLE 0x00 | ||
48 | #define CAPIDTMF_RECV_STATE_DTMF_ACTIVE 0x01 | ||
49 | typedef struct tag_capidtmf_recv_state | ||
50 | { | ||
51 | byte digit_buffer[CAPIDTMF_RECV_DIGIT_BUFFER_SIZE]; | ||
52 | word digit_write_pos; | ||
53 | word digit_read_pos; | ||
54 | word indication_state; | ||
55 | word indication_state_ack; | ||
56 | long goertzel_buffer[2][CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT]; | ||
57 | word min_gap_duration; | ||
58 | word min_digit_duration; | ||
59 | word cycle_counter; | ||
60 | word current_digit_on_time; | ||
61 | word current_digit_off_time; | ||
62 | byte current_digit_value; | ||
63 | byte state; | ||
64 | } t_capidtmf_recv_state; | ||
65 | typedef struct tag_capidtmf_state | ||
66 | { | ||
67 | byte ulaw; | ||
68 | t_capidtmf_recv_state recv; | ||
69 | } t_capidtmf_state; | ||
70 | word capidtmf_recv_indication (t_capidtmf_state *p_state, byte *buffer); | ||
71 | void capidtmf_recv_block (t_capidtmf_state *p_state, byte *buffer, word length); | ||
72 | void capidtmf_init (t_capidtmf_state *p_state, byte ulaw); | ||
73 | void capidtmf_recv_enable (t_capidtmf_state *p_state, word min_digit_duration, word min_gap_duration); | ||
74 | void capidtmf_recv_disable (t_capidtmf_state *p_state); | ||
75 | #define capidtmf_indication(p_state,buffer) (((p_state)->recv.indication_state != (p_state)->recv.indication_state_ack) ? capidtmf_recv_indication (p_state, buffer) : 0) | ||
76 | #define capidtmf_recv_process_block(p_state,buffer,length) { if ((p_state)->recv.state != CAPIDTMF_RECV_STATE_IDLE) capidtmf_recv_block (p_state, buffer, length); } | ||
77 | /*---------------------------------------------------------------------------*/ | ||
78 | /*---------------------------------------------------------------------------*/ | ||
79 | #endif | ||