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 __AON_SRAM_H__ 16 #define __AON_SRAM_H__ 17 /*chipsea_ohos proguard begin*/ 18 #include "cs_proguard.h" 19 /*chipsea_ohos proguard end*/ 20 21 #ifdef CFG_AON 22 #include "al_rtos.h" 23 #include "target_config.h" 24 #include <stdint.h> 25 #include <string.h> 26 #ifndef CFG_BLE_ONLY 27 #include "cs_adp_api.h" 28 #include "app_a2dp.h" 29 #include "app_hfp.h" 30 #include "app_bt.h" 31 #include "bt_task_msg.h" 32 33 #if APP_SUPPORT_A2DP_SBC == 1 || APP_SUPPORT_A2DP_AAC == 1 || APP_SUPPORT_A2DP_SOURCE == 1 34 extern app_a2dp_state_t t_a2dp_state; 35 #endif 36 #if APP_SUPPORT_HFP == 1 37 extern app_hfp_state_t s_hfp_state; 38 extern uint16_t s_hfp_scocodec; 39 #endif 40 extern APP_BT_HANDLER handler_register_list[HANDLER_REG_MAX]; 41 extern app_connect_manager app_bt_connect_struct[LINK_MAX]; 42 extern app_connect_manager *app_con_ptr[LINK_MAX]; 43 extern app_bt_state_t s_bt_state; 44 extern AppBtScanMode bt_scan_mode; 45 46 #if APP_SUPPORT_AES == 1 47 extern U32 secret_key[8]; 48 #endif 49 extern U32 cs_host_log ; 50 51 typedef struct{ 52 #if APP_SUPPORT_A2DP_SBC == 1 || APP_SUPPORT_A2DP_AAC == 1 || APP_SUPPORT_A2DP_SOURCE == 1 53 app_a2dp_state_t t_a2dp_state; 54 #endif 55 #if APP_SUPPORT_HFP == 1 56 app_hfp_state_t s_hfp_state; 57 uint16_t s_hfp_scocodec; 58 #endif 59 app_bt_state_t s_bt_state; 60 AppBtScanMode bt_scan_mode; 61 APP_BT_HANDLER handler_register_list[HANDLER_REG_MAX]; 62 app_connect_manager app_bt_connect_struct[LINK_MAX]; 63 app_connect_manager *app_con_ptr[LINK_MAX]; 64 U32 cs_host_log; 65 #if APP_SUPPORT_AES == 1 66 U32 secret_key[8]; 67 #endif 68 }AppBtStatic; 69 #endif 70 71 #if PLF_BLE_STACK == 1 72 #include "app_present.h" 73 #include "hal_profile.h" 74 #include "ble_ke_mem.h" 75 #if BLE_APP_HID 76 #include "hal_profile_utils.h" 77 #include "bass.h" 78 #include "hid_over_gatt_device.h" 79 #endif 80 #if BLE_APP_SMARTCONFIG 81 #include "smartconfig.h" 82 #endif 83 84 extern uint8_t ble_enabled; 85 86 typedef struct 87 { 88 struct prf_env_tag prf_env; 89 #if BLE_APP_HID 90 struct bass_env_tag bass_env; 91 struct hogpd_env_tag hogpd_env; 92 #endif 93 #if BLE_APP_SMARTCONFIG 94 struct smartconfig_env_tag smartconfig_env; 95 #endif 96 }AppBlePrfEnv; 97 98 extern struct app_env_tag app_env; 99 extern struct ble_app_user_info aon_ble_app_user_info; 100 typedef struct{ 101 uint8_t aon_ble_enabled; 102 AonBleAppEnv aon_ble_app_env; 103 AonBleAppUserInfo aon_ble_app_user_info; 104 }AppBleStatic; 105 #endif 106 107 extern uint8_t bt_lp_level; 108 109 typedef struct{ 110 #ifndef CFG_BLE_ONLY 111 AppBtStatic btstatic; 112 #endif 113 #if PLF_BLE_STACK == 1 114 AppBleStatic blestatic; 115 AppBlePrfEnv ble_prf_env; 116 #endif 117 uint8_t bt_lp_level; 118 }AppStatic; 119 120 typedef struct 121 { 122 uint32_t len; 123 uint8_t app_static[AON_APP_STATIC_LEN]; 124 }AonAppStatic; 125 126 127 #endif 128 #endif 129