nRF51822库函数速查
- 格式:pdf
- 大小:85.57 KB
- 文档页数:7
OHTCOMTechnology Ltd.nRF51822模块规格说明书Datasheet of nRF51822 Modules2015.6.1目录1 简介 Introduction (3)2 nRF51822 M0 BLE模块介绍 specification for M0 Module . 4天线的连接 (7)程序的烧录 (8)表一 nRF51822 M0工作参数 (8)3 nRF51822 M1 BLE模块介绍 specification for M1 Module . 9程序的烧录 (11)表二 nRF51822 M1工作参数 (11)4 History (13)5 联系方式CONTACT US (14)NOTES:If you are customers from overseas, please contact sales@ for quotation and specifications of English version.1 简介IntroductionnRF51822 Mx BLE低功耗蓝牙模块目前包括nRF51822 M0、nRF51822 M1两款。
这两款BLE模块都是以nRF51822为主控芯片,封装不同的模块。
nRF51822 M0模块包含了LIS3DH3轴传感器,与百度手环使用相同的基础硬件,可以用来开发运动手环等穿戴设备。
nRF51822 M1模块单有一片nRF51822芯片,可以选择16kB RAM或者32kB RAM的不同版本,可以用来开发iBeacon、室内定位、穿戴设备,计算机控制等,应用更灵活,满足不同需求。
nRF51822 M0nRF51822 M12 nRF51822 M0 BLE模块介绍specification for M0 ModulenRF51822 M0采用BGA的nRF51822芯片封装并且集成了高低速晶振、LIS3DH三轴传感器,模块尺寸仅为10.5mm*8.5mm*1.5mm,为业界最小封装。
OHTCOMTechnology Ltd.nRF51822 Application KitnRF51822User Guide v0.9Copyright © 2013 Ohtcom Technology. All rights reserved.1 介绍nRF51822 Bluetooth® low energy/2.4 GHz Application Kit (AK) 提供了一整套的测试和应用nRF51822的解决方案。
nRF51822是nRF51 系列中的一员,它是一个超低功耗(ultra-low power),单片系统 (SoC) 的2.4 GHz 无线通信解决方案.1.1 最小系统要求• nRFgo Studio v1.14 或更高版本• Windows XP or Windows 71.2 外部资源• Keil MDK-ARM Lite v4.54或更高版本https:///demo/eval/arm.htm• J-Link Software v4.52b或更高版本/jlink-software.html1.3 Writing conventions这篇用户指南遵从了一些排版规则,这样能够使文章更加连贯,更加易于阅读。
以下是使用到的协作约定::• 命令使用Lucida Console.• 芯片管脚使用Consolas.• 文件名和用户接口使用bold.• 内部关联采用斜体并使用semi-bold.1.4 Application kit 发布说明Date Kit version Description2013年8月10日0.1Init.2013年8月19日0.2 加入蓝牙测试部分2013年8月25日0.3整合USB Dongle介绍.2013年8月26日0.31 确认使用USB Dongle下载可以解决Jlink不兼容的问题。
2013年8月28日0.4 完成度50%,增加200%的内容。
最近要用nRF51822进行项目的多任务调度,其中不可避免的要用到要用到nRF51822的相关中断首先,nRF51822是基于Cortex-M0架构的MCU,根据nRF51822的软件开发包中的core-m0.h文件夹,可以找到51822的相关中断编号定义(Interrupt Number Definition)[objc]view plain copy1.<span style="font-size:18px;">/* ------------------------- Interrupt Number Definition ------------------------ */2.3.typedef enum {4./* ------------------- Cortex-M0 Processor Exceptions Numbers ------------------- */5. Reset_IRQn = -15, /*!< 1 Reset Vector, invoked on Powerup and warm reset */6. NonMaskableInt_IRQn = -14, /*!< 2 Non maskable Interrupt, cannot be stopped or preempted */7. HardFault_IRQn = -13, /*!< 3 Hard Fault, all classes of Fault*/8. SVCall_IRQn = -5, /*!< 11 System Service Call via SVC instruction */9. DebugMonitor_IRQn = -4, /*!< 12 Debug Monitor*/10. PendSV_IRQn = -2, /*!< 14 Pendable request for system service */11. SysTick_IRQn = -1, /*!< 15 System Tick Timer*/12./* ---------------------- nRF51 Specific Interrupt Numbers ---------------------- */13. POWER_CLOCK_IRQn = 0, /*!< 0 POWER_CLOCK*/14. RADIO_IRQn = 1, /*!< 1 RADIO*/15. UART0_IRQn = 2, /*!< 2 UART0*/16. SPI0_TWI0_IRQn = 3, /*!< 3 SPI0_TWI0*/17. SPI1_TWI1_IRQn = 4, /*!< 4 SPI1_TWI1*/18. GPIOTE_IRQn = 6, /*!< 6 GPIOTE*/19. ADC_IRQn = 7, /*!< 7 ADC*/20. TIMER0_IRQn = 8, /*!< 8 TIMER0*/21. TIMER1_IRQn = 9, /*!< 9 TIMER1*/22. TIMER2_IRQn = 10, /*!< 10 TIMER2*/23. RTC0_IRQn = 11, /*!< 11 RTC0*/24. TEMP_IRQn = 12, /*!< 12 TEMP*/25. RNG_IRQn = 13, /*!< 13 RNG*/26. ECB_IRQn = 14, /*!< 14 ECB*/27. CCM_AAR_IRQn = 15, /*!< 15 CCM_AAR*/28. WDT_IRQn = 16, /*!< 16 WDT*/29. RTC1_IRQn = 17, /*!< 17 RTC1*/30. QDEC_IRQn = 18, /*!< 18 QDEC*/31. LPCOMP_COMP_IRQn = 19, /*!< 19 LPCOMP_COMP*/32. SWI0_IRQn = 20, /*!< 20 SWI0*/33. SWI1_IRQn = 21, /*!< 21 SWI1*/34. SWI2_IRQn = 22, /*!< 22 SWI2*/35. SWI3_IRQn = 23, /*!< 23 SWI3*/36. SWI4_IRQn = 24, /*!< 24 SWI4*/37. SWI5_IRQn = 25 /*!< 25 SWI5*/38.} IRQn_Type;39.</span>在进行中断处理时,一般都要按照这个步骤:1、对要用到的中断初始化;2、对用到的中断进行使能;3、对中断进行优先级设置1、中断初始化nRF51822的外部I/O(暂时理解的程度以及用过的中断只有I/O中断,其他中断没有实践过)中断是基于任务和事件模式的。
BLE-NRF51822教程3-sdk程序框架剖析【IT168 技术】本讲为框架介绍,不会牵涉到太多代码细节。
51822的官方SDK其实是没有框架依耐性的。
什么叫框架,比如TI的BLE SDK中就有一个操作系统抽象层(OSAL)他是一个轮训的调度。
你需要按照他的方式去创建任务等等。
而51822的SDK本质上只是提供了各种调用接口,比如开启初始化协议栈,初始化一些硬件功能模块,开始广播,发起链接等等。
这些接口怎么用完全取决于自己。
不过一般固件开发都是一些类似的流程各种资源的初始化,51822也不例外。
所以sdk中的作为从机的例子main函数都是类似如下的步骤:以官方的串口BLE 为例:int main(void){leds_init(); //非必须,只是该例子中用到了timers_init(); //非必须,只是该例子中用到了buttons_init(); //非必须,只是该例子中用到了uart_init(); //非必须,只是该例子中用到了串口ble_stack_init(); //必须gap_params_init(); //必须services_init(); //跟自己创建的服务相关,不同的服务细节不同但大体建立//过程基本一致,通常在直接使用官方的例子修改一些参数即可advertising_init(); //广播数据初始化,必须conn_params_init(); //是情况而定,如果连接后不需要连接参数的协商,该初始化也//可不要sec_params_init(); //安全参数初始化,如果没用到配对绑定相关这个也可以不初始化advertising_start(); //开启广播,必须// Enter main loopfor (;;){power_manage(); //进入睡眠}}可以看到其实核心必要的只有这5个函数而已。
你可以将其他代码全都去掉,只要留下这5个函数设备一样可以运行,手机也能搜到设备并与设备通信。
6月14日开发环境的搭建:/view/a9ce127908a1284ac85043dd.html前几天学习了nrf51822芯片详解/link?url=NoIPFYcVFVQiqtgcTIVDbTFKJsfSY0MnBKiQzptXa8Cirghc3ZCx2S TEduYpEMztfAdoMTN08Xf2pFZpAyJbYF_MV7NqPxyWwA1qFPkKOoW以前已将SDK,J-Link安装好。
今天开始学习nRF51822 在MDK中创建新工程/link?url=BGtmdmEEJg3lzoEFq7HB3LBTbZn2L9fD7rGiwBPYQkbR-gEQuw ScXm5L-DIMHjifN2FNsRgbQJv9uaT03cp2AnJZUbLm5htwoIbJLu8tdv7遇到如下问题:1、注:首先选择Nordic nRF51 Series Devices才能开始选择芯片类型(安装SDK才能有)。
我买的芯片上面显示nrf51822QFACA1,该选择AA还是AB?网上搜得AA与AB的区别为只是flash与运行代码大小的区别。
淘宝介绍说该芯片为256Kbflash,所以应该是QFAA。
6月15日关于JLINK用SWD模式与nrf51822的连接。
我连接的是GND(随便哪个地),VCC(pin1),TMS(pin7),TCK(pin9). 网上说可能还得接pin15的复位脚,但是我暂时没接。
接下来就是讲程序烧录看行不行。
1、有个问题,网上找的那个创建工程中并没有用户自己的文件(即像stm32中创建的时候会建立mai.c)不是很明白。
编译能通过,但是load的时候出现问题。
2、Load时出现如下错误:但是reset菜单没找到在哪里?又出现新问题:解决方法:第一次的时候没有遇到这个问题,所以可能是连线没接好,而且后来的jlink总感觉绿灯是闪亮的,很有可能是连线问题。
网上的答案:1.确保接线正确;2. 高版本jlink固件可识别出赝品jlink,而MDK5.x版本要求SEGGER固件高于V4.78,排查是否是盗版jlink导致该问题发生。
:首先入门必看资料是在讯联给的资料包里面的EK_TM入门上手资料的几个文档。
很
多人不看入门手册或者扫一下就去操作然后碰到问题又来问我,入门手册都有详细步骤。
每天重复回答这些有详细教程的问题我也没那么大精力。
Keil和jlink的一些问题看群文件2015-10月下的两个文件
keil常见问题.txt和烧写出错问题总结.txt
以下再总结一些程序运行不正常的问题。
这里的介绍都以sdk5.1为基础的。
因为协议栈和sdk的配套的。
而不同版本的协议栈大
小不同可能导致后面所说的一些地址问题不同。
这里讲的是sdk5.1sd6.0
一:程序如果下载不成功在驱动什么都装成功的情况下。
可能是以下的几个问题1:keil的烧写算法没设置
2:将板子用Nrfgo全部擦除一下。
3:供编程算法的ram太小,修改大一点。
二:程序烧写成功但是没正确运行。
1:先烧协议栈再烧程序。
2:协议栈要和sdk是配套的。
群文件中2015-8月下有一个对照文件
SDK、NRFGO stiuo、S110S120等和KEIL各个版本的匹配表
2:如果用的是5.1sdk和6.0的sd那么看一下设置是不是正确。
nRF51822库函数速查nrf_soc.h//初始化互斥锁uint32_t sd_mutex_new(nrf_mutex_t*p_mutex);//尝试获取互斥锁.uint32_t sd_mutex_acquire(nrf_mutex_t*p_mutex);//释放互斥锁.uint32_t sd_mutex_release(nrf_mutex_t*p_mutex);//使能外部中断.uint32_t sd_nvic_EnableIRQ(IRQn_Type IRQn);//禁止外部中断.uint32_t sd_nvic_DisableIRQ(IRQn_Type IRQn);//Get Pending Interrupt.uint32_t sd_nvic_GetPendingIRQ(IRQn_Type IRQn,uint32_t*p_pending_irq);//Set Pending Interrupt.uint32_t sd_nvic_SetPendingIRQ(IRQn_Type IRQn);//Clear Pending Interrupt.uint32_t sd_nvic_ClearPendingIRQ(IRQn_Type IRQn);//设置中断优先级.uint32_t sd_nvic_SetPriority(IRQn_Type IRQn,nrf_app_irq_priority_t priority);//取得中断优先级.uint32_t sd_nvic_GetPriority(IRQn_Type IRQn,nrf_app_irq_priority_t*p_priority); //系统复位.uint32_t sd_nvic_SystemReset(void);//进入临界区.uint32_t sd_nvic_critical_region_enter(uint8_t*p_is_nested_critical_region);//退出临界区.uint32_t sd_nvic_critical_region_exit(uint8_t is_nested_critical_region);//查询应用的随机数池容量.uint32_t sd_rand_application_pool_capacity_get(uint8_t*p_pool_capacity);//取得应用中有效地随机数字节数.uint32_t sd_rand_application_bytes_available_get(uint8_t*p_bytes_available);//从池中获取随机数字节.uint32_t sd_rand_application_vector_get(uint8_t*p_buff,uint8_t length);//取得复位原因寄存器的值.uint32_t sd_power_reset_reason_get(uint32_t*p_reset_reason);//清除复位原因寄存器的若干bit.uint32_t sd_power_reset_reason_clr(uint32_t reset_reason_clr_msk);//设置CPU睡眠时的电源模式.uint32_t sd_power_mode_set(nrf_power_mode_t power_mode);//关闭系统.uint32_t sd_power_system_off(void);//开关电源失效比较器uint32_t sd_power_pof_enable(uint8_t pof_enable);//设置电源故障阈值.uint32_t sd_power_pof_threshold_set(nrf_power_failure_threshold_t threshold);//设置NRF_POWER->RAMON寄存器.uint32_t sd_power_ramon_set(uint32_t ramon);//清除NRF_POWER->RAMON寄存器.uint32_t sd_power_ramon_clr(uint32_t ramon);//Get contents of NRF_POWER->RAMON register,indicates power status of ram blocks. uint32_t sd_power_ramon_get(uint32_t*p_ramon);//Set bits in the NRF_POWER->GPREGRET register.uint32_t sd_power_gpregret_set(uint32_t gpregret_msk);//Clear bits in the NRF_POWER->GPREGRET register.uint32_t sd_power_gpregret_clr(uint32_t gpregret_msk);//Get contents of the NRF_POWER->GPREGRET register.uint32_t sd_power_gpregret_get(uint32_t*p_gpregret);//设置DCDC模式.uint32_t sd_power_dcdc_mode_set(nrf_power_dcdc_mode_t dcdc_mode);//请求使用高频晶体振荡器.uint32_t sd_clock_hfclk_request(void);//释放高频晶体振荡器.uint32_t sd_clock_hfclk_release(void);//检查高频晶体振荡器是否在运行.SVCALL(SD_CLOCK_HFCLK_IS_RUNNING,uint32_t,sd_clock_hfclk_is_running(uint32_t*p_is_running));//等待程序事件.uint32_t sd_app_evt_wait(void);//Get PPI channel enable register contents.uint32_t sd_ppi_channel_enable_get(uint32_t*p_channel_enable);//Set PPI channel enable register.uint32_t sd_ppi_channel_enable_set(uint32_t channel_enable_set_msk);//Clear PPI channel enable register.uint32_t sd_ppi_channel_enable_clr(uint32_t channel_enable_clr_msk);//Assign endpoints to a PPI channel.uint32_t sd_ppi_channel_assign(uint8_t channel_num,const volatile void*evt_endpoint, const volatile void*task_endpoint);//Task to enable a channel group.uint32_t sd_ppi_group_task_enable(uint8_t group_num);//Task to disable a channel group.uint32_t sd_ppi_group_task_disable(uint8_t group_num);//Assign PPI channels to a channel group.uint32_t sd_ppi_group_assign(uint8_t group_num,uint32_t channel_msk);//Gets the PPI channels of a channel group.uint32_t sd_ppi_group_get(uint8_t group_num,uint32_t*p_channel_msk);//配置无线通知信号.uint32_t sd_radio_notification_cfg_set(nrf_radio_notification_type_t type,nrf_radio_notification_distance_t distance);//AES-ECB加密.uint32_t sd_ecb_block_encrypt(nrf_ecb_hal_data_t*p_ecb_data);//Gets any pending events generated by the SoC API.uint32_t,sd_evt_get(uint32_t*p_evt_id);//取得芯片温度uint32_t sd_temp_get(int32_t*p_temp);//写数据到Flashsd_flash_write(uint32_t*const p_dst,uint32_t const*const p_src,uint32_t size); //擦除Flash页uint32_t sd_flash_page_erase(uint32_t page_number);//Flash Protection setuint32_t sd_flash_protect(uint32_t protenset0,uint32_t protenset1);ble.h//从队列中取得等待处理的事件uint32_t,sd_ble_evt_get(uint8_t*p_dest,uint16_t*p_len);//取得BLE协议栈中有效地传输缓冲区总数uint32_t sd_ble_tx_buffer_count_get(uint8_t*p_count);//添加一个厂商特定UUID.uint32_t sd_ble_uuid_vs_add(ble_uuid128_t const*const p_vs_uuid,uint8_t*const p_uuid_type);//解码原始小端UUID字节(16bit或128bit)到24bit的ble_uuid_t结构uint32_t sd_ble_uuid_decode(uint8_t uuid_le_len,uint8_t const*const p_uuid_le, ble_uuid_t*const p_uuid);//编码24bit的ble_uuid_t结构到原始小端UUID字节(16bit或128bit)uint32_t sd_ble_uuid_encode(ble_uuid_t const*const p_uuid,uint8_t*constp_uuid_le_len,uint8_t*const p_uuid_le));//取得版本信息uint32_t sd_ble_version_get(ble_version_t*p_version);//提供用户内存块uint32_t sd_ble_user_mem_reply(uint16_t conn_handle,ble_user_mem_block_t*p_block); ble_gap.h//设置本地蓝牙MAC地址uint32_t sd_ble_gap_address_set(ble_gap_addr_t const*const p_addr);//取得本地蓝牙MAC地址uint32_t sd_ble_gap_address_get(ble_gap_addr_t*const p_addr);//设置,清除,更新广播扫描响应数据uint32_t sd_ble_gap_adv_data_set(uint8_t const*const p_data,uint8_t dlen,uint8_t const*const p_sr_data,uint8_t srdlen);//开始广播(Start advertising(GAP Discoverable,Connectable modes,Broadcast Procedure) uint32_t sd_ble_gap_adv_start(ble_gap_adv_params_t const*const p_adv_params);//停止广播(Start advertising(GAP Discoverable,Connectable modes,Broadcast Procedure) uint32_t sd_ble_gap_adv_stop(void);//更新连接参数uint32_t sd_ble_gap_conn_param_update(uint16_t conn_handle,ble_gap_conn_params_t const*const p_conn_params);//断开连接(GAP Link Termination).uint32_t,sd_ble_gap_disconnect(uint16_t conn_handle,uint8_t hci_status_code);//设置无线发射功率dBm(accepted values are-40,-30,-20,-16,-12,-8,-4,0,and4dBm). SVCALL(SD_BLE_GAP_TX_POWER_SET,uint32_t,sd_ble_gap_tx_power_set(int8_t tx_power)) ;//Set GAP Appearance value.uint32_t sd_ble_gap_appearance_set(uint16_t appearance);//Get GAP Appearance value.uint32_t,sd_ble_gap_appearance_get(uint16_t*const p_appearance);//设置GAP外设优先连接参数uint32_t sd_ble_gap_ppcp_set(ble_gap_conn_params_t const*const p_conn_params);//取得GAP外设优先连接参数uint32_t sd_ble_gap_ppcp_get(ble_gap_conn_params_t*const p_conn_params);//设置GAP设备名uint32_t sd_ble_gap_device_name_set(ble_gap_conn_sec_mode_t const*const p_write_perm, uint8_t const*const p_dev_name,uint16_t len);//取得GAP设备名uint32_t,sd_ble_gap_device_name_get(uint8_t*const p_dev_name,uint16_t*constp_len);//启动GAP认证流程uint32_t,sd_ble_gap_authenticate(uint16_t conn_handle,ble_gap_sec_params_t const* const p_sec_params);//Reply with GAP security parameters.uint32_t sd_ble_gap_sec_params_reply(uint16_t conn_handle,uint8_t sec_status,ble_gap_sec_params_t const*const p_sec_params);//Reply with an authentication keySVCALL(SD_BLE_GAP_AUTH_KEY_REPLY,uint32_t,sd_ble_gap_auth_key_reply(uint16_tconn_handle,uint8_t key_type,uint8_t const*const key);//Reply with GAP security information.uint32_t sd_ble_gap_sec_info_reply(uint16_t conn_handle,ble_gap_enc_info_t const* const p_enc_info,ble_gap_sign_info_t const*const p_sign_info);//Get the current connection security.uint32_t,sd_ble_gap_conn_sec_get(uint16_t conn_handle,ble_gap_conn_sec_t*const p_conn_sec);//开始接受RSSI值的变化通知uint32_t sd_ble_gap_rssi_start(uint16_t conn_handle);//停止接收RSSI值变化通知SVCALL(SD_BLE_GAP_RSSI_STOP,uint32_t,sd_ble_gap_rssi_stop(uint16_t conn_handle); ble_gattc.h//启动或继续GATT主要服务的发现过程uint32_t sd_ble_gattc_primary_services_discover(uint16_t conn_handle,uint16_tstart_handle,ble_uuid_t const*const p_srvc_uuid);//启动或继续GATT关系发现过程uint32_t sd_ble_gattc_relationships_discover(uint16_t conn_handle,ble_gattc_handle_range_t const*const p_handle_range);//启动或继续GATT特性发现过程uint32_t sd_ble_gattc_characteristics_discover(uint16_t conn_handle,ble_gattc_handle_range_t const*const p_handle_range);//启动或继续GATT特性描述发现过程uint32_t sd_ble_gattc_descriptors_discover(uint16_t conn_handle,ble_gattc_handle_range_t const*const p_handle_range);//启动或继续通过GATT特性的UUID的读操作uint32_t sd_ble_gattc_char_value_by_uuid_read(uint16_t conn_handle,ble_uuid_t const *const p_uuid,ble_gattc_handle_range_t const*const p_handle_range);//启动或继续GATT读取长特性或描述的过程uint32_t sd_ble_gattc_read(uint16_t conn_handle,uint16_t handle,uint16_t offset); //启动GATT读取多个特性值的过程uint32_t sd_ble_gattc_char_values_read(uint16_t conn_handle,uint16_t const*const p_handles,uint16_t handle_count);//执行一个无报告的写操作uint32_t sd_ble_gattc_write(uint16_t conn_handle,ble_gattc_write_params_t const* const p_write_params);//发送配置到GATT服务器uint32_t sd_ble_gattc_hv_confirm(uint16_t conn_handle,uint16_t handle);ble_gatts.h//添加一个服务声明到本地服务的ATT表uint32_t sd_ble_gatts_service_add(uint8_t type,ble_uuid_t const*const p_uuid,uint16_t*const p_handle);//添加一个包含声明到本地服务的ATT表uint32_t sd_ble_gatts_include_add(uint16_t service_handle,uint16_t inc_srvc_handle, uint16_t*const p_include_handle);//添加特性声明,特性值声明,可选的特性描述声明到ATT表uint32_t sd_ble_gatts_characteristic_add(uint16_t service_handle,ble_gatts_char_md_t const*const p_char_md,ble_gatts_attr_t const*const p_attr_char_value,ble_gatts_char_handles_t*const p_handles);//添加描述到ATT表uint32_t sd_ble_gatts_descriptor_add(uint16_t char_handle,ble_gatts_attr_t const* const p_attr,uint16_t*const p_handle);//设置值到特性uint32_t sd_ble_gatts_value_set(uint16_t handle,uint16_t offset,uint16_t*const p_len, uint8_t const*const p_value);//取得属性值uint32_t sd_ble_gatts_value_get(uint16_t handle,uint16_t offset,uint16_t*const p_len, uint8_t*const p_data);//Notify或Indicate特性值.uint32_t,sd_ble_gatts_hvx(uint16_t conn_handle,ble_gatts_hvx_params_t const*constp_hvx_params);//Indicate属性值改变uint32_t sd_ble_gatts_service_changed(uint16_t conn_handle,uint16_t start_handle, uint16_t end_handle);//报告读写授权请求uint32_t sd_ble_gatts_rw_authorize_reply(uint16_t conn_handle,ble_gatts_rw_authorize_reply_params_t const*const p_rw_authorize_reply_params);//Update persistent system attribute informationuint32_t sd_ble_gatts_sys_attr_set(uint16_t conn_handle,uint8_t const*constp_sys_attr_data,uint16_t len);//Retrieve persistent system attribute information from the stack.uint32_t sd_ble_gatts_sys_attr_get(uint16_t conn_handle,uint8_t*constp_sys_attr_data,uint16_t*const p_len);ble_l2cap.h//注册一个L2CAP的CIDuint32_t sd_ble_l2cap_cid_register(uint16_t cid);//注销CIDuint32_t sd_ble_l2cap_cid_unregister(uint16_t cid);//发送L2CAP包uint32_t sd_ble_l2cap_tx(uint16_t conn_handle,ble_l2cap_header_t const*const p_header,uint8_t const*const p_data);nrf_sdm.h//使能SoftDeviceuint32_t sd_softdevice_enable(nrf_clock_lfclksrc_t clock_source,softdevice_assertion_handler_t assertion_handler);//禁用SoftDeviceuint32_t sd_softdevice_disable(void);//检查SoftDevice是否已使能uint32_t sd_softdevice_is_enabled(uint8_t*p_softdevice_enabled);//开始转发中断到应用程序uint32_t sd_softdevice_forward_to_application(void);。