資源簡介
基于Nordic藍牙芯片的智能手環端源碼。功能包含計步、統計心率等。

代碼片段和文件信息
/*?Copyright?(c)?2012?Nordic?Semiconductor.?All?Rights?Reserved.
?*
?*?The?information?contained?herein?is?property?of?Nordic?Semiconductor?ASA.
?*?Terms?and?conditions?of?usage?are?described?in?detail?in?NORDIC
?*?SEMICONDUCTOR?STANDARD?SOFTWARE?LICENSE?AGREEMENT.
?*
?*?Licensees?are?granted?free?non-transferable?use?of?the?information.?NO
?*?WARRANTY?of?ANY?KIND?is?provided.?This?heading?must?NOT?be?removed?from
?*?the?file.
?*
?*/
#include?“app_button.h“
#include?
#include?“nordic_common.h“
#include?“app_util.h“
#include?“app_gpiote.h“
#include?“app_timer.h“
#include?“app_error.h“
static?app_button_cfg_t?*?????????????mp_buttons?=?NULL;???????????/**static?uint8_t????????????????????????m_button_count;??????????????/**static?uint32_t???????????????????????m_active_low_states_mask;????/**static?uint32_t???????????????????????m_active_high_states_mask;???/**static?uint32_t???????????????????????m_detection_delay;???????????/**static?app_button_evt_schedule_func_t?m_evt_schedule_func;?????????/**static?app_gpiote_user_id_t???????????m_gpiote_user_id;????????????/**static?app_timer_id_t?????????????????m_detection_delay_timer_id;??/**
/**@brief?Function?for?executing?the?application?button?handler?for?specified?button.
?*
?*?@param[in]??p_btn???Button?that?has?been?pushed.
?*/
static?void?button_handler_execute(app_button_cfg_t?*?p_btn)
{
????if?(m_evt_schedule_func?!=?NULL)
????{
????????uint32_t?err_code?=?m_evt_schedule_func(p_btn->button_handler?p_btn->pin_no);
????????APP_ERROR_CHECK(err_code);
????}
????else
????{
????????p_btn->button_handler(p_btn->pin_no);
????}
}
/**@brief?Function?for?handling?the?timeout?that?delays?reporting?buttons?as?pushed.
?*
?*?@details????The?detection_delay_timeout_handler(...)?is?a?call-back?issued?from?the?app_timer
?*?????????????module.?It?is?called?with?the?p_context?parameter.?The?p_context?parameter?is
?*?????????????provided?to?the?app_timer?module?when?a?timer?is?started?using?the?call
?*?????????????@ref?app_timer_start.?On?@ref?app_timer_start?the?p_context?will?be?holding?the
?*?????????????currently?pressed?buttons.
?*
?*?@param[in]??p_context???Pointer?used?for?passing?information?app_start_timer()?was?called.
?*?????????????????????????In?the?app_button?module?the?p_context?holds?information?on?pressed
?*?????????????????????????buttons.
?*/
static?void?detection_delay_timeout_handler(void?*?p_context)
{
????uint32_t?err_code;
????uint32_t?event_pins_mask;
????uint32_t?current_state_pins;
????uint32_t?active_pins?????????=?0;
????//?Get?state?of?pins?when?timer?was?started.
????event_pins_mask?=?(uint32_t)p_context;
????
????//?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-07-29?10:17??wrist-rom-master?code\
?????目錄???????????0??2014-07-29?10:17??wrist-rom-master?code\wrist-rom-master\
?????文件?????????109??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\.gitignore
?????文件???????11325??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\LICENSE
?????目錄???????????0??2014-07-29?10:17??wrist-rom-master?code\wrist-rom-master\nrf51822\
?????目錄???????????0??2014-07-29?10:17??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\
?????目錄???????????0??2014-07-29?10:17??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\app_common\
?????文件????????8188??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\app_common\app_button.h
?????文件????????2931??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\app_common\app_error.h
?????文件????????3277??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\app_common\app_fifo.h
?????文件????????7989??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\app_common\app_gpiote.h
?????文件????????6158??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\app_common\app_scheduler.h
?????文件???????15908??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\app_common\app_timer.h
?????文件???????20082??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\app_common\app_uart.h
?????文件???????17069??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\app_common\app_util.h
?????文件????????1366??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\app_common\crc16.h
?????文件????????5008??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\app_common\hci_mem_pool.h
?????文件?????????832??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\app_common\hci_mem_pool_internal.h
?????文件????????5993??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\app_common\hci_slip.h
?????文件????????9518??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\app_common\hci_transport.h
?????目錄???????????0??2014-07-29?10:17??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\ble\
?????文件????????5234??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\ble\ble_advdata.h
?????文件???????16859??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\ble\ble_bondmngr.h
?????文件????????5730??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\ble\ble_conn_params.h
?????文件????????2185??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\ble\ble_date_time.h
?????文件????????2448??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\ble\ble_debug_assert_handler.h
?????文件????????7053??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\ble\ble_dtm.h
?????文件????????4175??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\ble\ble_error_log.h
?????文件????????1595??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\ble\ble_eval_board_pins.h
?????文件????????7032??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\ble\ble_flash.h
?????文件????????5668??2014-02-13?08:02??wrist-rom-master?code\wrist-rom-master\nrf51822\Include\ble\ble_racp.h
............此處省略300個文件信息
評論
共有 條評論