• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  * Description: the header file for main.
15  *
16  */
17 
18 #ifndef __CLOCK_INIT_H__
19 #define __CLOCK_INIT_H__
20 
21 #ifdef __cplusplus
22 #if __cplusplus
23 extern "C" {
24 #endif
25 #endif
26 
27 #define CMU_XO_SIG 0X40003404
28 #define XO_TRIM_ENABLE 1
29 #define SIZE_8_BITS 8
30 #define EFUSE_GROUP_MAX 3
31 #define EXT_EFUSE_LOCK_XO_TRIM_BIT_POS 7
32 #define EXT_EFUSE_XO_TRIM_1_ID  144
33 #define EXT_EFUSE_XO_TRIM_2_ID  162
34 #define EXT_EFUSE_XO_TRIM_3_ID  180
35 #define EXT_EFUSE_RSSI_BAND3_1_ID  160
36 #define EXT_EFUSE_RSSI_BAND3_2_ID  178
37 #define EXT_EFUSE_RSSI_BAND3_3_ID  196
38 
39 typedef union {
40     /* Define the struct bits */
41     struct {
42         uint32_t rg_cmu_xo_trim_fine : 8; /* [7..0] */
43         uint32_t rg_cmu_xo_trim_coarse : 4; /* [11..8] */
44         uint32_t rg_cmu_xo_trim_rev : 4; /* [15..12] */
45         uint32_t rg_cmu_xo_trim_fine_sel : 1; /* [16] */
46         uint32_t rg_cmu_xo_trim_coarse_sel : 1; /* [17] */
47         uint32_t rg_cmu_xo_trim_rev_sel : 1; /* [18] */
48         uint32_t reserved_0 : 13; /* [31..19] */
49     } bits;
50 
51     /* Define an unsigned member */
52     uint32_t u32;
53 } u_cmu_xo_sig;
54 
55 extern void LOS_SetSysClosk(uint32_t clock);
56 
57 void open_rf_power(void);
58 void switch_clock(void);
59 void set_uart_tcxo_clock_period(void);
60 
61 #ifdef __cplusplus
62 #if __cplusplus
63 }
64 #endif
65 #endif
66 
67 #endif // __MAIN_H__
68