• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Chipsea Technologies (Shenzhen) Corp., Ltd. All rights reserved.
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  */
15 #ifndef __BT_DRV_INTERFACE_H__
16 #define  __BT_DRV_INTERFACE_H__
17 /*chipsea_ohos proguard begin*/
18 #include "cs_proguard.h"
19 /*chipsea_ohos proguard end*/
20 
21 #include "stdint.h"
22 #include "stdbool.h"
23 #include "bt_cs8800_driver.h"
24 #include "cs_target_config.h"
25 
26 extern const BtDrvRfModeEnum bt_rf_mode;
27 extern const bt_drv_rf_calib_req_cmd rf_calib_req;
28 extern const uint16_t page_timeout_default_value;
29 extern const uint8_t  local_feature[8];
30 extern const bt_drv_wr_aon_param *wr_aon_param_ptr;
31 extern uint32_t aon_debug_level;
32 extern uint8_t bt_lp_level;
33 extern uint8_t pwr_ctrl_slave;
34 extern uint8_t bt_sleep_debug_level;
35 
36 void cs_bt_start(void);
37 /********************************************
38 * ecc encript api
39 ********************************************/
40 //start
41 void bt_drv_start_generate_key(void);
42 void bt_drv_generate_secret_key(void);
43 void bt_drv_pool_key_complete(void);
44 int bt_drv_set_BasePoint_y_256_vaule(uint8_t* ptr ,uint16_t len);
45 int bt_drv_set_BasePoint_x_256_vaule(uint8_t* ptr ,uint16_t len);
46 //end
47 TWS_BT_CLK_INFO_Type rwip_clk_offset_read(void);
48 rwip_time_t rwip_time_read(void);
49 bool bt_drv_fw_mem_table_isneeded_get(void);
50 bool bt_drv_fw_mem_table_entry_get(uint32_t *addr, uint32_t *val);
51 uint32_t bt_drv_get_reg_addr_in_aon(uint32_t reg_addr);
52 bool bt_drv_rf_mdm_regs_table_isneeded_get(void);
53 bool bt_drv_rf_mdm_regs_table_entry_get(uint32_t *addr, uint32_t *val);
54 
55 void bt_drv_fw_patch_table_init(void);
56 void bt_drv_fw_patch_init_b4_fw_init(void);
57 void bt_drv_fw_extra_patch_init_b4_fw_init(void);
58 void bt_drv_fw_patch_init_after_fw_init(void);
59 void bt_drv_minisys_patch_init_b4_minisys_init(void);
60 void bt_drv_minisys_extra_patch_init_b4_minisys_init(void);
61 void bt_drv_minisys_patch_init_after_minisys_init(void);
62 
63 /**
64 *   wait for firmware init complete
65 *   bit 6 : 0:not ready  1:ready
66 */
67 bool bt_get_fw_init_complete(void);
68 void bt_drv_enable_dut(void);
69 void bt_drv_scan_en(uint32_t scan_en);
70 void bt_sleep_entry_init(void);
71 void bt_prevent_sleep_set(uint32_t prv_slp_bit);
72 void bt_prevent_sleep_clear(uint32_t prv_slp_bit);
73 uint32_t bt_prevent_sleep_get(void);
74 #endif
75 
76