blob: 24aefcc4522820ca41252822ea9c5772dd83bc76 [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001/*****************************************************************************
2* Copyright Statement:
3* --------------------
4* This software is protected by Copyright and the information contained
5* herein is confidential. The software may not be copied and the information
6* contained herein may not be used or disclosed except with the written
7* permission of MediaTek Inc. (C) 2016
8*
9* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
10* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS (""MEDIATEK SOFTWARE"")
11* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
12* AN ""AS-IS"" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
13* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
15* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
16* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
17* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
18* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
19* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
20* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
21*
22* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
23* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
24* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
25* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
26* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
27*
28* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
29* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
30* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
31* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
32* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
33*
34*****************************************************************************/
35/**************************************************************************************************
36* %version: 2 % %instance: HZPT_2 % %date_created: Fri Mar 23 16:20:45 2007 % %created_by: jingzhang % %derived_by: jingzhang %
37**************************************************************************************************/
38
39#ifndef VALUTITLS_H
40#define VALUTITLS_H
41#include "sysdefs.h"
42#ifdef __cplusplus
43extern "C" {
44#endif
45
46#ifdef MTK_CBP
47typedef enum
48{
49 VAL_VSER_STATUS_TRACE = 30000000,
50 VAL_SAVE_UNSLCT_RESULT_EXP_TRACE_1 = 70000000,
51 VAL_SAVE_UNSLCT_RESULT_EXP_TRACE_2,
52 VAL_SAVE_UNSLCT_RESULT_EXP_TRACE_3,
53 VAL_SEND_UNSLCT_RESULT_EXP_TRACE_1 = 70000005,
54 VAL_ENH_AT_SEND_UNSLCT_RESULT_EXP_TRACE_1 = 70000010,
55 VAL_ENH_AT_SEND_UNSLCT_RESULT_EXP_TRACE_2,
56 VAL_SUSPEND_TRACE_1 = 70000015,
57 VAL_SUSPEND_TRACE_2,
58 VAL_GET_SYS_TIME_TRACE_1 = 70000020,
59 VAL_GET_SYS_TIME_TRACE_2
60} ValGenericDec1TraceIDE;
61#endif
62
63/*****************************************************************************
64
65 FUNCTION NAME: PhbChar2BCD - Revised by zhengyi 2004-9-9
66 DESCRIPTION:
67 Convert digital char string to BCD code.: example:convert '135' to 0x31 0xF5
68 PARAMETERS:
69 pBcd :where BCD code storaged.
70 pCharArray: char string with '\0' end.
71 RETURNED VALUES:
72
73*****************************************************************************/
74
75void PhbChar2BCD( kal_uint8* pBcd,
76 kal_uint8* pCharArray );
77
78/*****************************************************************************
79 FUNCTION NAME: PhbBCD2Char
80 DESCRIPTION:
81 Convert BCD code to digital char string. example:convert 0x31 0xF5 to '135'
82 the max char string length is signed 10.
83 PARAMETERS:
84 pBcd : pointer to BCD code array, with 0xf*,or 0xff end.
85 pCharArray: char string
86 RETURNED VALUES:
87
88*****************************************************************************/
89#ifdef MTK_CBP
90void PhbBCD2Char( kal_uint8* pCharArray,kal_uint8 MaxCharLen, kal_uint8* pBcd, kal_uint8 MaxBcdLen );
91#else
92void PhbBCD2Char( kal_uint8* pCharArray,
93 kal_uint8* pBcd );
94#endif
95kal_uint8 getuint8(kal_uint8* data, kal_uint16 startBit, kal_uint8 numBits);
96kal_uint16 getuint16(kal_uint8* data, kal_uint16 startBit, kal_uint8 numBits);
97void putuint8(kal_uint8* data, kal_uint16 startBit, kal_uint8 numBits, kal_uint8 value);
98void putuint16(kal_uint8* data, kal_uint16 startBit, kal_uint8 numBits, kal_uint16 value);
99kal_uint16 crc16bit(kal_uint8* msg, kal_uint16 len);
100#ifdef __cplusplus
101}
102#endif
103#endif
104
105/**Log information: \main\vtui2_5x\2 2008-09-29 07:41:09 GMT dwang
106** HREF#2278**/
107/**Log information: \main\vtui2_5x\3 2008-11-06 03:03:10 GMT pzhang
108** HREF#2895**/
109