NORDIC nRF SDK sdk_config.h 配置于 app uart

硬件: nRF528xx

软件: NORDIC nRF5 SKD Ver15.0.0

目的: 使用SDK  components\libraries\uart 目录下 app uart 功能函数



步骤:

1. 文件中引入 app_uart.h 头文件

#include "app_uart.h"

2. 先编译一下测试,以确认编译环境中的路境是否包括;

注:曾在添加此路径调试时,遇到找不到 app_uart.h;  

3. 在 sdk_config.h 中添加相应定义

#ifndef APP_UART_ENABLED
#define APP_UART_ENABLED 1
#endif

#ifndef APP_FIFO_ENABLED
#define APP_FIFO_ENABLED 1
#endif

#ifndef APP_UART_DRIVER_INSTANCE
#define APP_UART_DRIVER_INSTANCE 0
#endif

//////////////////////////////////////////////////////////

#ifndef RETARGET_ENABLED         // 如使用 printf() 需用此项
#define RETARGET_ENABLED 1
#endif       

#ifndef BLE_NUS_C_ENABLED        // 如使用 NUS 串口功能
#define BLE_NUS_C_ENABLED 1
#endif

4. 建议使用 Keil Configuration Wizard 图形配置环境更高效

猜你喜欢

转载自blog.csdn.net/weixin_42396877/article/details/82025693