Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1
190
Ver.1.0.0
11. Drivers in BLE SDK
11.1 External Capacitor for 24 MHz Crystal
By default, SDK uses internal capacitor of TLSR8232 MCU (i.e. cap corresponding to
ana_81<4:0>) as matching capacitor of 24MHz crystal oscillator, which is measurable
and adjustable in Telink jig system to reach optimal frequency point value of final
application product.
If an external soldered capacitor needs to be use as the matching capacitor of 24MHz
crystal oscillator instead, the API below should be called at the beginning of main
function and before “cpu_wakeup_init” function.
static
inline
void
blc_app_setExternalCrystalCapEnable
(
u8
en)
{
blt_miscParam.
ext_cap_en
= en;
}
As long as this API is call
ed before “cpu_wakeup_init”, SDK will automatically implement
all operations (e.g. disable internal matching capacitor and stop reading frequency offset
calibration value).
11.2 Select 32kHz Clock Sources
By default SDK uses internal 32kHz crystal, i.e. 32kHz RC. The error of this crystal is
large, so its accuracy will be influenced for applications with long suspend time. Currently
32kHz RC supports up to 3s suspend by default. Once the suspend time exceeds 3s,
inaccurate packet Rx time will be caused by BLE timing error; this case usually needs
packet Rx/Tx retry, thus to increase power consumption and result in disconnection.
To ensure time accuracy for long suspend applications, external 32kHz crystal (i.e.
32kHz pad) should be used instead. Currently SDK supports this mode.
Call either of the two APIs below at the beginning of main function (must before
“cpu_wakeup_init” function) to select 32kHz RC or 32kHz pad.
void
blc_pm_select_internal_32k_crystal
(
void
);
void
blc_pm_select_external_32k_crystal
(
void
);
SDK chooses 32k RC
by default by calling “blc_pm_select_internal_32k_crystal”. For 32k
pad, call “blc_pm_select_external_32k_crystal”.
11.3 EMI
11.3.1 EMI Test
5316 SDK
provides project “EMI Test”. Users can see “app_emi.c” in the project folder of
“5316_driver_test” , see “emi.c and emi.h” in driver/5316 files for related documents. To
use EMI,
users need to set the marco “DRIVER_TEST_MODE” in “app_config.h to
“TEST_RF_EMI”.