4.5. 蓝牙低功耗

概述

使用demo_edr工程配置蓝牙低功耗。

4.5.1. 操作说明

    1. 在app_config.h文件中修改以下宏:

#define CONFIG_LOW_POWER_ENABLE              //软关机/睡眠开关
#define TCFG_LOWPOWER_LOWPOWER_SEL                  (RF_SLEEP_EN | SYS_SLEEP_EN | RF_FORCE_SYS_SLEEP_EN | SYS_SLEEP_BY_IDLE)
    1. 设置蓝牙功率接口( 详情查询[btcontroller_modules.h](include_libbtctrlerbtcontroller_modules.h) )

/* --------------------------------------------------------------------------*/
/**
* @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 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);