comparison src/g23m-aci/uart/uart_drxf.c @ 1:d393cd9bb723

src/g23m-*: initial import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 04:40:46 +0000
parents
children
comparison
equal deleted inserted replaced
0:b6a5e36de839 1:d393cd9bb723
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 #define ENTITY_UART
28
29 /*==== INCLUDES =============================================================*/
30
31 #ifdef WIN32
32 #include "nucleus.h"
33 #endif /* WIN32 */
34 #include "typedefs.h" /* to get Condat data types */
35 #include "vsi.h" /* to get a lot of macros */
36 #include "macdef.h" /* to get a lot of macros */
37 #include "custom.h"
38 #include "gsm.h" /* to get a lot of macros */
39 #include "cnf_uart.h" /* to get cnf-definitions */
40 #include "mon_uart.h" /* to get mon-definitions */
41 #include "prim.h" /* to get the definitions of used SAP and directions */
42 #include "dti.h" /* to get dti lib */
43 #include "pei.h" /* to get PEI interface */
44 #ifdef FF_MULTI_PORT
45 #include "gsi.h" /* to get definitions of serial driver */
46 #else /* FF_MULTI_PORT */
47 #ifdef _TARGET_
48 #include "uart/serialswitch.h"
49 #include "uart/traceswitch.h"
50 #else /* _TARGET_ */
51 #include "serial_dat.h" /* to get definitions of serial driver */
52 #endif /* _TARGET_ */
53 #endif /* FF_MULTI_PORT */
54 #include "uart.h" /* to get the global entity definitions */
55
56 /*==== CONST ================================================================*/
57
58 /*==== LOCAL VARS ===========================================================*/
59
60 /*==== PRIVATE FUNCTIONS ====================================================*/
61
62 /*==== PUBLIC FUNCTIONS =====================================================*/
63
64
65
66 /*
67 +------------------------------------------------------------------------------
68 Function : drx_init
69 +------------------------------------------------------------------------------
70 Description : The function drx_init() initializes the service DRX
71
72 Parameters : none
73
74 +------------------------------------------------------------------------------
75 */
76 GLOBAL void drx_init ()
77 {
78 UBYTE i;
79
80 TRACE_FUNCTION( "drx_init" );
81
82 for( i = 0; i < UART_MAX_NUMBER_OF_CHANNELS; i++ )
83 {
84 /*
85 * select next instance of service DRX
86 */
87 uart_data->drx = &uart_data->drx_base[i];
88
89 /*
90 * initialize service instance specific variables
91 */
92 uart_data->drx->sending_state = UART_DRX_NOT_SENDING;
93 uart_data->drx->data_flow = UART_FLOW_ENABLED;
94
95 uart_data->drx->dlc_instance = i;
96
97 uart_data->drx->received_data = NULL;
98 uart_data->drx->read_pos = 0;
99
100 uart_data->drx->dti_drx_state = DTI_CLOSED;
101
102 INIT_STATE( UART_SERVICE_DRX , DRX_DEAD );
103 }
104 } /* drx_init() */
105
106
107
108 /*
109 +------------------------------------------------------------------------------
110 Function : drx_free_resources
111 +------------------------------------------------------------------------------
112 Description : The function drx_free_resources() frees all resources of the
113 service DRX
114
115 Parameters : none
116
117 +------------------------------------------------------------------------------
118 */
119 GLOBAL void drx_free_resources ()
120 {
121 TRACE_FUNCTION( "drx_free_resources" );
122
123 if(uart_data->drx->received_data)
124 {
125 MFREE_DESC2( uart_data->drx->received_data );
126 }
127 uart_data->drx->received_data = NULL;
128 uart_data->drx->read_pos = 0;
129 } /* drx_free_resources() */