comparison g23m-aci/uart/uart_drxf.c @ 0:75a11d740a02

initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:02:41 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:75a11d740a02
1 /*
2 +-----------------------------------------------------------------------------
3 | Project :
4 | Modul :
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : This modul is part of the entity UART and implements all
18 | procedures and functions as described in the
19 | SDL-documentation (DRX-statemachine)
20 +-----------------------------------------------------------------------------
21 */
22
23 #ifndef UART_DRXF_C
24 #define UART_DRXF_C
25 #endif /* !UART_DRXF_C */
26
27 #include "config.h"
28 #include "fixedconf.h"
29 #include "condat-features.h"
30
31 #define ENTITY_UART
32
33 /*==== INCLUDES =============================================================*/
34
35 #ifdef WIN32
36 #include "nucleus.h"
37 #endif /* WIN32 */
38 #include "typedefs.h" /* to get Condat data types */
39 #include "vsi.h" /* to get a lot of macros */
40 #include "macdef.h" /* to get a lot of macros */
41 #include "custom.h"
42 #include "gsm.h" /* to get a lot of macros */
43 #include "cnf_uart.h" /* to get cnf-definitions */
44 #include "mon_uart.h" /* to get mon-definitions */
45 #include "prim.h" /* to get the definitions of used SAP and directions */
46 #include "dti.h" /* to get dti lib */
47 #include "pei.h" /* to get PEI interface */
48 #ifdef FF_MULTI_PORT
49 #include "gsi.h" /* to get definitions of serial driver */
50 #else /* FF_MULTI_PORT */
51 #ifdef _TARGET_
52 #include "../../serial/serialswitch.h"
53 #include "../../serial/traceswitch.h"
54 #else /* _TARGET_ */
55 #include "serial_dat.h" /* to get definitions of serial driver */
56 #endif /* _TARGET_ */
57 #endif /* FF_MULTI_PORT */
58 #include "uart.h" /* to get the global entity definitions */
59
60 /*==== CONST ================================================================*/
61
62 /*==== LOCAL VARS ===========================================================*/
63
64 /*==== PRIVATE FUNCTIONS ====================================================*/
65
66 /*==== PUBLIC FUNCTIONS =====================================================*/
67
68
69
70 /*
71 +------------------------------------------------------------------------------
72 Function : drx_init
73 +------------------------------------------------------------------------------
74 Description : The function drx_init() initializes the service DRX
75
76 Parameters : none
77
78 +------------------------------------------------------------------------------
79 */
80 GLOBAL void drx_init ()
81 {
82 UBYTE i;
83
84 TRACE_FUNCTION( "drx_init" );
85
86 for( i = 0; i < UART_MAX_NUMBER_OF_CHANNELS; i++ )
87 {
88 /*
89 * select next instance of service DRX
90 */
91 uart_data->drx = &uart_data->drx_base[i];
92
93 /*
94 * initialize service instance specific variables
95 */
96 uart_data->drx->sending_state = UART_DRX_NOT_SENDING;
97 uart_data->drx->data_flow = UART_FLOW_ENABLED;
98
99 uart_data->drx->dlc_instance = i;
100
101 uart_data->drx->received_data = NULL;
102 uart_data->drx->read_pos = 0;
103
104 uart_data->drx->dti_drx_state = DTI_CLOSED;
105
106 INIT_STATE( UART_SERVICE_DRX , DRX_DEAD );
107 }
108 } /* drx_init() */
109
110
111
112 /*
113 +------------------------------------------------------------------------------
114 Function : drx_free_resources
115 +------------------------------------------------------------------------------
116 Description : The function drx_free_resources() frees all resources of the
117 service DRX
118
119 Parameters : none
120
121 +------------------------------------------------------------------------------
122 */
123 GLOBAL void drx_free_resources ()
124 {
125 TRACE_FUNCTION( "drx_free_resources" );
126
127 if(uart_data->drx->received_data)
128 {
129 MFREE_DESC2( uart_data->drx->received_data );
130 }
131 uart_data->drx->received_data = NULL;
132 uart_data->drx->read_pos = 0;
133 } /* drx_free_resources() */