EasyManua.ls Logo

TELINK SEMICONDUCTOR TLSR8232 - Main.C

Default Icon
211 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Telink TLSR8232 BLE SDK Developer Handbook
AN-19112700-E1 15 Ver.1.0.0
vendor: This folder contains user APP-layer code, e.g. 5316_ble_remote demo
application. The following four basic files are needed for each new user folder.
1.1.1 main.c
The “main.c” file includes the entry function main of the program, system
initialization functions and endless loop “while(1)”. It’s not recommended to make any
modification to this file.
int main(void){
blc_pm_select_internal_32k_crystal(); // select internal 32k rc as 32k counter
clock source
cpu_wakeup_init(); // basic MCU hardware initialization, negligible to users
clock_init(SYS_CLK_16M_Crystal); // clock initialization, users only needs to fill
related parameters accordingly.
gpio_init(); // GPIO initialization, users only need to configure related parameters
in app_config.h
rf_drv_init(RF_MODE_BLE_1M); // RF initialization, negligible to users, only support
BLE 1M
user_init (); // BLE initialization, initialization of the whole system, configured by
users
irq_enable(); // enable global interrupt
while (1) {
#if (MODULE_WATCHDOG_ENABLE)
wd_clear(); //clear watch dog
#endif
main_loop ();// include BLE Rx/Tx processing, power management and user
tasks
}
}

Table of Contents