FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/ccd/csn1_s1.c @ 648:970d6199f2c5
gsm-fw/ccd/*.[ch]: initial import from the LoCosto source
| author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> | 
|---|---|
| date | Thu, 04 Sep 2014 05:48:57 +0000 | 
| parents | |
| children | 
   comparison
  equal
  deleted
  inserted
  replaced
| 647:a60b375014e3 | 648:970d6199f2c5 | 
|---|---|
| 1 /* | |
| 2 +----------------------------------------------------------------------------- | |
| 3 | Project : | |
| 4 | Modul : csn1_s1.c | |
| 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 : Definition of encoding and decoding functions for CSN1_S1 elements | |
| 18 +----------------------------------------------------------------------------- | |
| 19 */ | |
| 20 | |
| 21 | |
| 22 /* | |
| 23 * standard definitions like GLOBAL, UCHAR, ERROR etc. | |
| 24 */ | |
| 25 #include "typedefs.h" | |
| 26 #include "header.h" | |
| 27 | |
| 28 /* | |
| 29 * Prototypes of ccd (USE_DRIVER EQ undef) for prototypes only | |
| 30 * look at ccdapi.h | |
| 31 */ | |
| 32 #undef USE_DRIVER | |
| 33 #include "ccdapi.h" | |
| 34 | |
| 35 /* | |
| 36 * Types and functions for bit access and manipulation | |
| 37 */ | |
| 38 #include "ccd_globs.h" | |
| 39 #include "bitfun.h" | |
| 40 | |
| 41 /* | |
| 42 * Prototypes of ccd internal functions | |
| 43 */ | |
| 44 #include "ccd.h" | |
| 45 | |
| 46 /* | |
| 47 * Declaration of coder/decoder tables | |
| 48 */ | |
| 49 #include "ccdtable.h" | |
| 50 #include "ccddata.h" | |
| 51 | |
| 52 extern SHORT cdc_csn1_sx_decode (int flag, const ULONG e_ref, T_CCD_Globs *globs); | |
| 53 extern SHORT cdc_csn1_sx_encode (int flag, const ULONG e_ref, T_CCD_Globs *globs); | |
| 54 | |
| 55 #ifndef RUN_FLASH | |
| 56 /* | |
| 57 +--------------------------------------------------------------------+ | |
| 58 | PROJECT : CCD (6144) MODULE : CDC_GSM | | |
| 59 | STATE : code ROUTINE : cdc_csn1_s1_decode | | |
| 60 +--------------------------------------------------------------------+ | |
| 61 | |
| 62 PURPOSE : Decoding of the GSM Type CSN1 S1 element. This element | |
| 63 consists of a 1 bit valid flag and a value part. | |
| 64 Only if the valid bit is equal 1 the value part follows. | |
| 65 | |
| 66 */ | |
| 67 | |
| 68 SHORT cdc_csn1_s1_decode (const ULONG c_ref, const ULONG e_ref, T_CCD_Globs *globs) | |
| 69 { | |
| 70 #ifdef DEBUG_CCD | |
| 71 #ifndef CCD_SYMBOLS | |
| 72 TRACE_CCD (globs, "cdc_csn1_s1_decode()"); | |
| 73 #else | |
| 74 TRACE_CCD (globs, "cdc_csn1_s1_decode() %s", ccddata_get_alias((USHORT) e_ref, 1)); | |
| 75 #endif | |
| 76 #endif | |
| 77 | |
| 78 return cdc_csn1_sx_decode (1, e_ref, globs); | |
| 79 } | |
| 80 #endif /* !RUN_FLASH */ | |
| 81 | |
| 82 #ifndef RUN_FLASH | |
| 83 /* | |
| 84 +--------------------------------------------------------------------+ | |
| 85 | PROJECT : CCD (6144) MODULE : CDC_GSM | | |
| 86 | STATE : code ROUTINE : cdc_csn1_s1_encode | | |
| 87 +--------------------------------------------------------------------+ | |
| 88 | |
| 89 PURPOSE : Encoding of the GSM Type CSN1 S1 element. This element | |
| 90 consists of a 1 bit valid flag and a value part. If the | |
| 91 element is valid (the v_xxx components is TRUE in the | |
| 92 decoded message) a 1 bit will be coded followed by the | |
| 93 coding of the value part. Otherwise a 0 bit will be | |
| 94 coded. | |
| 95 | |
| 96 */ | |
| 97 | |
| 98 SHORT cdc_csn1_s1_encode (const ULONG c_ref, const ULONG e_ref, T_CCD_Globs *globs) | |
| 99 { | |
| 100 #ifdef DEBUG_CCD | |
| 101 #ifndef CCD_SYMBOLS | |
| 102 TRACE_CCD (globs, "cdc_csn1_s1_encode()"); | |
| 103 #else | |
| 104 TRACE_CCD (globs, "cdc_csn1_s1_encode() %s", ccddata_get_alias((USHORT) e_ref, 1)); | |
| 105 #endif | |
| 106 #endif | |
| 107 | |
| 108 return cdc_csn1_sx_encode (1, e_ref, globs); | |
| 109 } | |
| 110 #endif /* !RUN_FLASH */ | 
