请问nordic nrf51822中文手册低功耗蓝牙量产脱机烧录器哪个厂家好?有介绍的吗?

&&&&&&当前位置:&gt
邮费:22.00
邮费:12.00
邮费:10.00
邮费:22.00
邮费:12.00
邮费:12.00
邮费:12.00
邮费:12.00
邮费:12.00
邮费:10.00
邮费:12.00
邮费:1512.00
邮费:1512.00
邮费:10.00
邮费:12.00
邮费:10.00
邮费:15.00
邮费:15.00
邮费:12.00
邮费:12.00
邮费:15.00
邮费:10.00
邮费:15.00
邮费:10.00
邮费:10.00
邮费:12.00
邮费:15.00
邮费:10.00
邮费:22.00
邮费:22.00
邮费:12.00
一淘网为您找到nordic 51822产品的详细资讯,实时报价,价格行情,nordic 51822商品分类,论坛问答/求购等信息。您还可以找nordic winds连体长裤,nrf51822 ab,nrf51822等相关产品信息。
增值电信业务经营许可证:浙B2-低功耗蓝牙4.0BLE编程-nrf51822开发(2) - xgbing
- 博客频道 - CSDN.NET
2090人阅读
& & 首先看的示例是心率计一个示例程序:&KEIL path& \ARM\Device\Nordic\nrf51822\Board\pca1\ble_app_hrs\arm。
& & 打开工程前需要下载蓝牙协议栈S110 nRF51822 SoftDevice(s110_nrf.0_softdevice.hex)到板子中,这个手册上有说明。
& & 首先看的是main.c中的main函数:
/*****************************************************************************
* Main Function
*****************************************************************************/
/**@brief Function for the application main entry.
int main(void)
uint32_t err_
timers_init();
gpiote_init();
buttons_init();
ble_stack_init();
bond_manager_init();
// Initialize Bluetooth Stack parameters
gap_params_init();
advertising_init();
services_init();
conn_params_init();
sec_params_init();
// Start advertising
advertising_start();
// Enter main loop
// Switch to a low power state until an event is available for the application
err_code = sd_app_evt_wait();
APP_ERROR_CHECK(err_code);
它很简洁:初始化-&start-&loop。
(1)Timer初始化
/**@brief Function for the Timer initialization.
* @details Initializes the timer module. This creates and starts application timers.
static void timers_init(void)
uint32_t err_
// Initialize timer module
APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, false);
// Create timers
err_code = app_timer_create(&m_battery_timer_id,
APP_TIMER_MODE_REPEATED,
battery_level_meas_timeout_handler);
APP_ERROR_CHECK(err_code);
err_code = app_timer_create(&m_heart_rate_timer_id,
APP_TIMER_MODE_REPEATED,
heart_rate_meas_timeout_handler);
APP_ERROR_CHECK(err_code);
使用app_timer_create创建了两个时钟,处理函数分别是battery_level_meas_timeout_handler和heart_rate_meas_timeout_handler。
/**@brief Function for handling the Battery measurement timer timeout.
* @details This function will be called each time the battery level measurement timer expires.
This function will start the ADC.
* @param[in]
Pointer used for passing some arbitrary information (context) from the
app_start_timer() call to the timeout handler.
static void battery_level_meas_timeout_handler(void * p_context)
UNUSED_PARAMETER(p_context);
battery_start();
/**@brief Function for handling the Heart rate measurement timer timeout.
* @details This function will be called each time the heart rate measurement timer expires.
It will exclude RR Interval data from every third measurement.
* @param[in]
Pointer used for passing some arbitrary information (context) from the
app_start_timer() call to the timeout handler.
static void heart_rate_meas_timeout_handler(void * p_context)
uint32_t err_
UNUSED_PARAMETER(p_context);
err_code = ble_hrs_heart_rate_measurement_send(&m_hrs, m_cur_heart_rate);
(err_code != NRF_SUCCESS)
(err_code != NRF_ERROR_INVALID_STATE)
(err_code != BLE_ERROR_NO_TX_BUFFERS)
(err_code != BLE_ERROR_GATTS_SYS_ATTR_MISSING)
APP_ERROR_HANDLER(err_code);
时钟创建后并不会自动运行,当调用application_timers_start后时钟开始运行:
/**@brief Function for starting the application timers.
static void application_timers_start(void)
uint32_t err_
// Start application timers
err_code = app_timer_start(m_battery_timer_id, BATTERY_LEVEL_MEAS_INTERVAL, NULL);
APP_ERROR_CHECK(err_code);
err_code = app_timer_start(m_heart_rate_timer_id, HEART_RATE_MEAS_INTERVAL, NULL);
APP_ERROR_CHECK(err_code);
services_init()初始化程序中的三个服务:ble_dis.c, ble_bas.c, ble_hrs.c。
/**@brief Function for initializing the services that will be used by the application.
* @details Initialize the Heart Rate, Battery and Device Information services.
static void services_init(void)
ble_hrs_init_t hrs_
ble_bas_init_t bas_
ble_dis_init_t dis_
body_sensor_
// Initialize Heart Rate Service
body_sensor_location = BLE_HRS_BODY_SENSOR_LOCATION_FINGER;
memset(&hrs_init, 0, sizeof(hrs_init));
hrs_init.is_sensor_contact_supported =
hrs_init.p_body_sensor_location
= &body_sensor_
// Here the sec level for the Heart Rate Service can be changed/increased.
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&hrs_init.hrs_hrm_attr_md.cccd_write_perm);
BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(&hrs_init.hrs_hrm_attr_md.read_perm);
BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(&hrs_init.hrs_hrm_attr_md.write_perm);
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&hrs_init.hrs_bsl_attr_md.read_perm);
BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(&hrs_init.hrs_bsl_attr_md.write_perm);
err_code = ble_hrs_init(&m_hrs, &hrs_init);
APP_ERROR_CHECK(err_code);
// Initialize Battery Service
memset(&bas_init, 0, sizeof(bas_init));
// Here the sec level for the Battery Service can be changed/increased.
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&bas_init.battery_level_char_attr_md.cccd_write_perm);
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&bas_init.battery_level_char_attr_md.read_perm);
BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(&bas_init.battery_level_char_attr_md.write_perm);
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&bas_init.battery_level_report_read_perm);
bas_init.evt_handler
bas_init.support_notification =
bas_init.p_report_ref
bas_init.initial_batt_level
err_code = ble_bas_init(&bas, &bas_init);
APP_ERROR_CHECK(err_code);
// Initialize Device Information Service
memset(&dis_init, 0, sizeof(dis_init));
ble_srv_ascii_to_utf8(&dis_init.manufact_name_str, MANUFACTURER_NAME);
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&dis_init.dis_attr_md.read_perm);
BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(&dis_init.dis_attr_md.write_perm);
err_code = ble_dis_init(&dis_init);
APP_ERROR_CHECK(err_code);
static ble_hrs_t的结构定义:
/**@brief Heart Rate Service structure. This contains various status information for the service. */
typedef struct ble_hrs_s
ble_hrs_evt_handler_t
/**& Event handler to be called for handling events in the Heart Rate Service. */
is_expended_energy_
/**& TRUE if Expended Energy measurement is supported. */
is_sensor_contact_
/**& TRUE if sensor contact detection is supported. */
/**& Handle of Heart Rate Service (as provided by the BLE stack). */
ble_gatts_char_handles_t
/**& Handles related to the Heart Rate Measurement characteristic. */
ble_gatts_char_handles_t
/**& Handles related to the Body Sensor Location characteristic. */
ble_gatts_char_handles_t
/**& Handles related to the Heart Rate Control Point characteristic. */
/**& Handle of the current connection (as provided by the BLE stack, is BLE_CONN_HANDLE_INVALID if not in a connection). */
is_sensor_contact_
/**& TRUE if sensor contact has been detected. */
rr_interval[BLE_HRS_MAX_BUFFERED_RR_INTERVALS];
/**& Set of RR Interval measurements since the last Heart Rate Measurement transmission. */
rr_interval_
/**& Number of RR Interval measurements since the last Heart Rate Measurement transmission. */
} ble_hrs_t;
ble_hrs.h/ble_hrs.c是心率计程序服务的代码。
buttons_init(void)初始化两个按钮:HR_INC_BUTTON_PIN_NO和HR_DEC_BUTTON_PIN_NO,分别模拟心率计的加减。
/**@brief Function for initializing the button module.
static void buttons_init(void)
// Configure HR_INC_BUTTON_PIN_NO and HR_DEC_BUTTON_PIN_NO as wake up buttons and also configure
// for 'pull up' because the eval board does not have external pull up resistors connected to
// the buttons.
static app_button_cfg_t buttons[] =
{HR_INC_BUTTON_PIN_NO, false, BUTTON_PULL, button_event_handler},
{HR_DEC_BUTTON_PIN_NO, false, BUTTON_PULL, button_event_handler}
// Note: This pin is also BONDMNGR_DELETE_BUTTON_PIN_NO
APP_BUTTON_INIT(buttons, sizeof(buttons) / sizeof(buttons[0]), BUTTON_DETECTION_DELAY, false);
当按下按钮时,处理程序是button_event_handler(),它处理心率计的加减模拟:
/**@brief Function for handling button events.
* @param[in]
The pin number of the button pressed.
static void button_event_handler(uint8_t pin_no, uint8_t button_action)
if (button_action == APP_BUTTON_PUSH)
switch (pin_no)
case HR_INC_BUTTON_PIN_NO:
// Increase Heart Rate measurement
m_cur_heart_rate += HEART_RATE_CHANGE;
if (m_cur_heart_rate & MAX_HEART_RATE)
m_cur_heart_rate = MIN_HEART_RATE; // Loop back
case HR_DEC_BUTTON_PIN_NO:
// Decrease Heart Rate measurement
m_cur_heart_rate -= HEART_RATE_CHANGE;
if (m_cur_heart_rate & MIN_HEART_RATE)
m_cur_heart_rate = MAX_HEART_RATE; // Loop back
APP_ERROR_HANDLER(pin_no);
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:532369次
积分:7401
积分:7401
排名:第1086名
原创:167篇
转载:98篇
评论:175条
(5)(3)(1)(4)(4)(4)(3)(2)(4)(2)(7)(4)(23)(11)(5)(2)(8)(1)(3)(1)(4)(3)(1)(13)(35)(20)(5)(2)(1)(2)(1)(1)(4)(1)(3)(4)(10)(17)(1)(1)(3)(3)(1)(7)(2)(6)(1)(1)(10)(7)(2)(1)(2)(3)(2)(1)(2)(6)(3)(3)(1)(1)(2)(5)(1)(2)Nordic:nRF51822蓝牙低功耗和2.4GHz专利SoC产品规格
  产品特点
  单芯片, 高灵活性, 2.4GHz 多协议设备
  32 位 ARM Cortex M0 CPU 内核
  256KB flash 16KB RAM
  支持 S110 蓝牙低功耗协议堆栈
  S110 需要 80 kB 内存空间
  线程安全和运行时保护
  事件驱动 API
  与 nRF24L 系列无线兼容
  3 种数据率 (2Mbps/1Mbps/250kbps)
  +4dBm 输出功率
  -92.5dBm 敏感度、蓝牙低功耗
  用于最大化能源效率应用和代码简化的 PPI 系统
  具备对每个周边产品进行自动能源管理的灵活能源管理系统
  用于模拟和数字 I/O 的可配置 I/O 映射
  移动电话配件
  PC 周边产品
  消费电子 (CE) 遥控器
  邻近/警报传感器
  运动、健身和医疗保健传感器
  智能 RF 标记
  玩具和电子游戏
  智能家用设备
  工业和商用传感器
Nordic:nRF51822蓝牙低功耗和2.4GHz专利SoC产品规格下载
下载资料需要,并消耗一定积分。
下载此资料的人还喜欢:
技术交流、我要发言! 发表评论可获取积分! 请遵守相关规定。
本周热点资料
电子资料热门词
上传者其它资料
通信网络下载排行

我要回帖

更多关于 nordic nrf51822 的文章

 

随机推荐