AC63_BT_SDK/include_lib/btctrler/btcontroller_modules.h

324 lines
11 KiB
C
Raw Permalink Normal View History

2025-02-18 15:40:42 +08:00
/*********************************************************************************************
* Filename : btcontroller_modules.h
* Description : Lto Macro
* Author : Bingquan
* Email : bingquan_cai@zh-jieli.com
* Last modifiled : 2018-12-19 16:38
* Copyright:(c)JIELI 2011-2017 @ , All Rights Reserved.
*********************************************************************************************/
#ifndef _BTCONTROLLER_H_
#define _BTCONTROLLER_H_
#include "hci_transport.h"
#include "btcontroller_mode.h"
#include "ble/hci_ll.h"
#include "classic/hci_lmp.h"
/* app 层修改蓝牙版本可在BT_STATUS_INIT_OK case
set_bt_version
*/
#define BLUETOOTH_CORE_SPEC_42 0x08
#define BLUETOOTH_CORE_SPEC_50 0x09
#define BLUETOOTH_CORE_SPEC_51 0x0a
#define BLUETOOTH_CORE_SPEC_52 0x0b
extern void set_bt_version(u8 version);
/*
*-------------------Module SUPPORT
* brief : LTO
*/
#define BT_MODULE_CLASSIC BIT(0)
#define BT_MODULE_LE BIT(1)
extern const int config_btctler_modules;
#define BT_MODULES_IS_SUPPORT(x) (config_btctler_modules & (x))
/*-----------------------------------------------------------*/
extern const int config_stack_modules;
#define STACK_MODULES_IS_SUPPORT(x) (config_stack_modules & (x))
/*
*-------------------Mode SELECT
* brief : LTO
*/
extern const int config_btctler_mode;
#define BT_MODE_IS(x) (config_btctler_mode & (x))
/*-----------------------------------------------------------*/
extern const int config_btctler_hci_standard;
#define BT_HCI_STANDARD_IS_SUPPORT(x) (config_btctler_hci_standard)
extern const int config_bt_function ;
#define BT_ENCTRY_TASK BIT(0)
#define BT_MASTER_AFH BIT(1)
#define BT_MASTER_QOS BIT(2)
#define BT_FUNCTION_IS(x) (config_bt_function & (x))
extern const int CONFIG_TEST_DUT_CODE;
extern const int CONFIG_TEST_FCC_CODE;
extern const int CONFIG_TEST_DUT_ONLY_BOX_CODE;
extern const int CONFIG_BREDR_INQUIRY;
extern const int CONFIG_INQUIRY_PAGE_OFFSET_ADJUST ;
extern const int CONFIG_LMP_NAME_REQ_ENABLE ;
extern const int CONFIG_LMP_PASSKEY_ENABLE ;
extern const int CONFIG_LMP_MASTER_ESCO_ENABLE ;
extern const int config_btctler_bredr_master ;
extern const int config_bredr_afh_user ;
extern const int config_bredr_master_afh ;
extern const int CONFIG_ESCO_MUX_RX_BULK_ENABLE ;
extern const int config_bt_temperature_pll_trim ;
extern const int CONFIG_WIFI_DETECT_ENABLE;
extern const int ESCO_FORWARD_ENABLE;
/********************************************************************************/
/*
* API
*
*/
/* --------------------------------------------------------------------------*/
/**
* @brief rf_set_24g_hackable_coded
*
* \param [in] coded coded码,32bits0101.
* \return [out] :1->fail;0->succ;
*/
/* ----------------------------------------------------------------------------*/
u8 rf_set_24g_hackable_coded(u32 coded);
/* --------------------------------------------------------------------------*/
/**
* @brief rf_set_adv_24g_hackable_coded
*
* \param [in] coded coded码,32bits0101.
* \return [out] :1->fail;0->succ;
*/
/* ----------------------------------------------------------------------------*/
u8 rf_set_adv_24g_hackable_coded(u32 coded);
/* --------------------------------------------------------------------------*/
/**
* @brief rf_set_scan_24g_hackable_coded
*
* \param [in] coded coded码,32bits0101.
* \return [out] :1->fail;0->succ;
*/
/* ----------------------------------------------------------------------------*/
u8 rf_set_scan_24g_hackable_coded(u32 coded);
/* --------------------------------------------------------------------------*/
/**
* @brief bt_pll_para
*
* @param osc
* @param sys
* @param low_power
* @param xosc
*/
/* ----------------------------------------------------------------------------*/
void bt_pll_para(u32 osc, u32 sys, u8 low_power, u8 xosc);
/* --------------------------------------------------------------------------*/
/**
* @brief bt_production_test
*
* @param en
*/
/* ----------------------------------------------------------------------------*/
void bt_production_test(u8 en);
/* --------------------------------------------------------------------------*/
/**
* @brief bt_set_rxtx_status_enable
*
* @param en
*
*
TX RX
AI800x PA13 PA12
AC692x PA13 PA12
AC693x PA8 PA9
AC695x,AC635x PA9 PA10
AC696x,AC636x PC1 PC2
AC694x PB1 PB2
AC697x,AC637x PC2 PC3
AC698x,AC638x PC2 PC3
AC631x PA7 PA8
AC632x PA7 PA8
*/
/* ----------------------------------------------------------------------------*/
void bt_set_rxtx_status_enable(u8 en);
/* --------------------------------------------------------------------------*/
/**
* @brief bt_osc_offset_ext_save
*
* @param offset
*
*
*/
/* ----------------------------------------------------------------------------*/
void bt_osc_offset_ext_save(s32 offset);
/* --------------------------------------------------------------------------*/
/**
* @brief bt_osc_offset_ext_updata
*
* @param offset
*
*
*/
/* ----------------------------------------------------------------------------*/
void bt_osc_offset_ext_updata(s32 offset);
/* --------------------------------------------------------------------------*/
/**
* @brief
*
* @param pwr edr (range:0~9)
* @param pg_pwr edr page
* @param iq_pwr edr inquiry
* @param ble_pwr ble
*/
/* ----------------------------------------------------------------------------*/
/*
TX发射功率档位, (dbm) ,
BD29: rang(0~8) {-18.3, -14.6, -12.1, -8.5, -6.0, -4.1, -1.1, +1.1, +4.0, +6.1}
BD19: rang(0~10) {-17.6, -14.0, -11.5, -9.6, -6.6, -4.4, -0.79, +1.12, +3.8, +5.65, +8.04}
BR23: rang(0~9) {-15.7, -12.5, -10.0, -6.6, -4.4, -2.5, -0.1, +2.1, +4.6, +6.4}
BR25: rang(0~9) {-15.7, -12.5, -10.0, -6.6, -4.4, -2.5, -0.1, +2.1, +4.6, +6.4}
BR30: rang(0~8) {-17.48, -11.46, -7.96, -3.59, -0.79, +1.12, +3.8, +6.5, +8.44}
BR34: rang(0~10) {-17.6, -14.0, -11.5, -9.6, -6.6, -4.4, -1.8, 0, +2.1, +4, +6.3}
*/
void bt_max_pwr_set(u8 pwr, u8 pg_pwr, u8 iq_pwr, u8 ble_pwr);
/* --------------------------------------------------------------------------*/
/**
* @brief bt_set_ldos
*
* @param mode
*/
/* ----------------------------------------------------------------------------*/
void bt_set_ldos(u8 mode);
/* --------------------------------------------------------------------------*/
/**
* @brief ble_set_fix_pwr
*
* @param fix (0~max)
* BLE的发射功率
*/
/* ----------------------------------------------------------------------------*/
void ble_set_fix_pwr(u8 fix);
/* --------------------------------------------------------------------------*/
/**
* @brief bredr_set_fix_pwr
*
* @param fix (0~max)
* EDR的发射功率
*/
/* ----------------------------------------------------------------------------*/
void bredr_set_fix_pwr(u8 fix);
/* --------------------------------------------------------------------------*/
/**
* @brief ble_rf_vendor_fixed_channel
*
* @param channel_index: : range 0~39 fixed freq, or 0xff --close fixed,default 373839
* @param pktcnt: adv方式,1,range 1~3; scan,init的时候该参数noused
* ble advscaninit
*/
/* ----------------------------------------------------------------------------*/
bool ble_rf_vendor_fixed_channel(u8 channel_index, u8 pktcnt);
/* --------------------------------------------------------------------------*/
/**
* @brief ble_adv_rf_vendor_fixed_channel
*
* @param channel_index: adv指定信道定频: range 0~39 fixed freq, or 0xff --close fixed,default 373839
* @param pktcnt: 1,range 1~3
* ble adv状态定频
*/
/* ----------------------------------------------------------------------------*/
bool ble_adv_rf_vendor_fixed_channel(u8 channel_index, u8 pktcnt);
/* --------------------------------------------------------------------------*/
/**
* @brief ble_scan_rf_vendor_fixed_channel
*
* @param channel_index: scan指定信道定频: range 0~39 fixed freq, or 0xff --close fixed,default 373839
* @param pktcnt: scan,init的时候该参数noused
* ble scaninit
*/
/* ----------------------------------------------------------------------------*/
bool ble_scan_rf_vendor_fixed_channel(u8 channel_index, u8 pktcnt);
/* --------------------------------------------------------------------------*/
/**
* @brief bredr_get_rssi_for_address
* rssi
*
* @param address mac地址
* @return rssi range(-127 ~ +127)
*/
/* ----------------------------------------------------------------------------*/
s8 bredr_get_rssi_for_address(u8 *address);
/* --------------------------------------------------------------------------*/
/**
* @brief tx , (sdk默认支持)
*
* @param packet_type
* @param support_en 0 or 1
* @return true or false
*/
/* ----------------------------------------------------------------------------*/
typedef enum {
PKT_TYPE_2DH5_EU = 0,
} pkt_type_eu;
bool bredr_link_vendor_support_packet_enable(pkt_type_eu packet_type, u8 support_en);
/* --------------------------------------------------------------------------*/
/**
* @brief ble ACL, (sdk )
*
* @param role:0--master,1--slave
* @param enalbe 0 or 1
* @return null
*/
/* ----------------------------------------------------------------------------*/
void ble_vendor_set_hold_prio(u8 role, u8 enable);
void set_bt_afh_classs_enc(u8 afh_class);
void set_bt_enhanced_power_control(u8 en);
void set_bt_data_rate_acl_3mbs_mode(u8 en);
void set_bt_full_name_event(u8 en);
/* coexist between bt chips */
void bt_wl_coex_init(uint8_t state);
void bt_wl_coex_enable(bool enable);
#endif