comparison chipsetsw/layer1/gtt_include/ctm/ctm_receiver.h @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
1 /*
2 *******************************************************************************
3 *
4 * COPYRIGHT (C) 2000 BY ERICSSON EUROLAB DEUTSCHLAND GmbH
5 * 90411 NUERNBERG, GERMANY, Tel Int + 49 911 5217 100
6 *
7 * The program(s) may be used and/or copied only with the
8 * written permission from Ericsson or in accordance
9 * with the terms and conditions stipulated in the agreement or
10 * contract under which the program(s) have been supplied.
11 *
12 *******************************************************************************
13 *
14 * File : ctm_receiver.h
15 * Author : EEDN/RV Matthias Doerbecker
16 * Tested Platforms : Sun Solaris, Windows NT 4.0
17 * Description : header file for ctm_receiver.c
18 *
19 * Changes since October 13, 2000:
20 * - added reset function reset_ctm_receiver()
21 *
22 * $Log: $
23 *
24 *******************************************************************************
25 */
26 #ifndef ctm_receiver_h
27 #define ctm_receiver_h "$Id: $"
28
29 /*
30 *******************************************************************************
31 * INCLUDE FILES
32 *******************************************************************************
33 */
34
35 #include "init_interleaver.h"
36 //#include "tonedemod.h"
37 #include "wait_for_sync.h"
38 #include "conv_poly.h"
39 #include "viterbi.h"
40 #include "ctm_typedefs.h"
41 #include "fifo.h"
42
43 #include <stdlib.h>
44 #include <stdio.h>
45
46
47 /* ******************************************************************/
48 /* Type definitions for variables that contain all states of the */
49 /* Cellular Text Telephone Modem (CTM) Transmitter and Receiver, */
50 /* respectively. */
51 /* ******************************************************************/
52
53 typedef struct {
54 /* simple variables */
55 WORD16 samplingCorrection;
56 WORD16 numBitsWithLowReliability;
57 WORD16 cntIdleSymbols;
58 WORD16 numDeintlBits;
59 WORD16 cntRXBits;
60 WORD16 syncCorrect;
61 WORD16 cntUnreliableGrossBits;
62 WORD16 intl_delay;
63
64 /* structs (state types) */
65 fifo_state_t rx_bits_fifo_state;
66 fifo_state_t octet_fifo_state;
67 fifo_state_t net_bits_fifo_state;
68 //demod_state_t tonedemod_state;
69 // interleaver_state_t intl_state;
70 interleaver_state_t deintl_state;
71 wait_for_sync_state_t wait_state;
72 viterbi_t viterbi_state;
73
74 /* vectors (not to be allocated) */
75 #if (NUM_MUTE_ROWS>0)
76 WORD16 mutePositions[intlvB*NUM_MUTE_ROWS];
77 #else
78 WORD16 mutePositions[1];
79 #endif
80
81 /* vectors (to be allocated in init_ctm_receiver()) */
82 WORD16 *waitSyncOut;
83 WORD16 *deintlOut;
84
85 } rx_state_t;
86
87
88
89
90 /***********************************************************************/
91 /* init_ctm_receiver() */
92 /* ******************* */
93 /* Initialization of the CTM Receiver. */
94 /* */
95 /* output vaiables: */
96 /* rx_state : pointer to a variable of rx_state_t containing the */
97 /* initialized states of the receiver */
98 /***********************************************************************/
99
100 void init_ctm_receiver(rx_state_t* rx_state);
101
102 /*
103 ***********************************************************************
104 * Shutdown_ctm_receiver() *
105 * *********************** *
106 * Shutdown of the CTM Receiver. *
107 * *
108 * Input variables: *
109 * rx_state : pointer to a variable of rx_state_t containing the *
110 * initialized states of the receiver *
111 ***********************************************************************
112 */
113 void Shutdown_ctm_receiver(rx_state_t* rx_state);
114
115 /*
116 ***********************************************************************
117 * reset_ctm_receiver() *
118 * ******************** *
119 * Reset of the Cellular Text Telephone Modem receiver, state *
120 * machines and buffer pointers. *
121 * *
122 * Input variables: *
123 * rx_state : pointer to a variable of rx_state_t containing the *
124 * initialized states of the receiver *
125 ***********************************************************************
126 */
127 void reset_ctm_receiver(rx_state_t* rx_state);
128
129
130 /***************************************************************************/
131 /* ctm_receiver() */
132 /* ************** */
133 /* Runs the Cellular Text Telephone Modem Receiver for a block of */
134 /* (nominally) 160 samples. Due to the internal synchronization, the */
135 /* number of processed samples might vary between 156 and 164 samples. */
136 /* The input of the samples and the output of the decoded characters */
137 /* is handled via fifo buffers, which have to be initialized */
138 /* externally before using this function (see fifo.h for details). */
139 /* */
140 /* input/output variables: */
141 /* *ptr_signal_fifo_state fifo state for the input samples */
142 /* *ptr_output_char_fifo_state fifo state for the output characters */
143 /* *ptr_early_muting_required returns whether the original audio signal */
144 /* must not be forwarded. This is to guarantee */
145 /* that the preamble or resync sequence is */
146 /* detected only by the first CTM device, if */
147 /* several CTM devices are cascaded */
148 /* subsequently. */
149 /* *rx_state pointer to the variable containing the */
150 /* receiver states */
151 /***************************************************************************/
152
153 void ctm_receiver(fifo_state_t* ptr_signal_fifo_state,
154 fifo_state_t* ptr_output_char_fifo_state,
155 BOOL* ptr_early_muting_required,
156 rx_state_t* rx_state);
157
158 #endif