| Moteur de recherche de fiches techniques de composants électroniques |
|
PM0237 Fiches technique(PDF) 42 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
PM0237 Fiches technique(HTML) 42 Page - STMicroelectronics |
|
42 / 88 page ![]() Design an application using BlueNRG, BlueNRG-MS ACI APIs PM0237 42/88 DocID027104 Rev 2 3.1 Initialization phase and main application loop The following main steps are required for properly configure the selected external microcontroller and the SPI communication with a BlueNRG or BlueNRG-MS device. 1. Configure selected BlueNRG platform 2. Configure clock, GPIOs and setup low power mode 3. Initialize the serial communication channel used for I/O communication (debug and utility information) 4. Initialize list heads of ready and free hci data packet queues 5. Init SPI interface for allowing external microcontroller to get access to the BlueNRG features properly 6. Reset the BlueNRG, BlueNRG-MS network coprocessor 7. Configure BlueNRG, BlueNRG-MS public address (if public address is used) 8. Init BLE NRG GATT layer 9. Init BLE NRG GAP layer depending on the selected device role 10. Set the proper security I/O capability and authentication requirement (if BLE NRG security is used) 11. Define the required Services & Characteristics if the device is a GATT server 12. Add a while(1) loop calling the HCI_Process() API and a specific user application function where user actions/events are processed (advertising, connections, services and characteristics discovery, notification and related events ). The following pseudocode example illustrates the required initialization steps: int main(void) { int ret; /* Setup the STM32L1xx NVIC vector table base address */ NVIC_SetVectorTable(NVIC_VectTab_FLASH, VECTOR_TABLE_BASE_ADDRESS); /* Configure selected BlueNRG platform */ SdkEvalIdentification(); /* Configure clock */ RCC_Configuration(); /* Init I/O ports */ Init_GPIOs (); PWR_PVDCmd(DISABLE); /* Disable FLASH during Sleep */ FLASH_SLEEPPowerDownCmd(ENABLE); /* Enable Ultra low power mode */ PWR_UltraLowPowerCmd(ENABLE); PWR_FastWakeUpCmd(DISABLE); NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1); /* Init timer used for SPI timeouts */ Clock_Init(); /* Configure I/O communication channel: It requires the void IO_Receive_Data(uint8_t * rx_data, uint16_t data_size)function where user received data should be processed */ |
|
Lien URL |
| ALLDATASHEET vous a-t-il été utile ? [ DONATE ] |
À propos de Alldatasheet | Publicité | Contactez-nous | Politique de confidentialité | Lien vers la fiche technique | Echange de liens | Fabricants All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |