This module implements the Heart Rate Monitor profile. More...
Modules |
|
| Heart Rate Monitor Profile configuration | |
| Heart Rate Monitor profile pages | |
|
This module implements functions for the HRM data pages.
|
|
| Heart Rate Monitor profile utilities | |
|
This module implements utilities for the Heart Rate Monitor profile.
|
|
Data Structures |
|
| struct | ant_hrm_sens_config_t |
|
HRM sensor configuration structure.
More...
|
|
| struct | ant_hrm_profile_s |
|
HRM profile structure.
More...
|
|
| struct | ant_hrm_sens_cb_t |
|
HRM Sensor control block.
More...
|
|
Macros |
|
| #define | HRM_DEVICE_TYPE 0x78u |
|
Device type reserved for ANT+ heart rate monitor.
|
|
| #define | HRM_ANTPLUS_RF_FREQ 0x39u |
|
Frequency, decimal 57 (2457 MHz).
|
|
| #define | HRM_MSG_PERIOD_4Hz 0x1F86u |
|
Message period, decimal 8070 (4.06 Hz).
|
|
| #define | HRM_MSG_PERIOD_2Hz 0x3F0Cu |
|
Message period, decimal 16140 (2.03 Hz).
|
|
| #define | HRM_MSG_PERIOD_1Hz 0x7E18u |
|
Message period, decimal 32280 (1.02 Hz).
|
|
| #define | HRM_EXT_ASSIGN 0x00 |
|
ANT ext assign.
|
|
| #define | HRM_DISP_CHANNEL_TYPE CHANNEL_TYPE_SLAVE_RX_ONLY |
|
Display HRM channel type.
|
|
| #define | HRM_SENS_CHANNEL_TYPE CHANNEL_TYPE_MASTER |
|
Sensor HRM channel type.
|
|
| #define | HRM_DISP_CHANNEL_CONFIG_DEF (NAME,CHANNEL_NUMBER,TRANSMISSION_TYPE,DEVICE_NUMBER,NETWORK_NUMBER,HRM_MSG_PERIOD) |
|
Initialize an ANT channel configuration structure for the HRM profile (Display).
More...
|
|
| #define | HRM_DISP_CHANNEL_CONFIG (NAME) &NAME##_channel_hrm_disp_config |
| #define | HRM_SENS_CHANNEL_CONFIG_DEF (NAME,CHANNEL_NUMBER,TRANSMISSION_TYPE,DEVICE_NUMBER,NETWORK_NUMBER) |
|
Initialize an ANT channel configuration structure for the HRM profile (Sensor).
More...
|
|
| #define | HRM_SENS_CHANNEL_CONFIG (NAME) &NAME##_channel_hrm_sens_config |
| #define | HRM_SENS_PROFILE_CONFIG_DEF (NAME,PAGE_1_PRESENT,MAIN_PAGE_NUMBER,EVT_HANDLER) |
|
Initialize an ANT profile configuration structure for the HRM profile (Sensor).
More...
|
|
| #define | HRM_SENS_PROFILE_CONFIG (NAME) &NAME##_profile_hrm_sens_config |
Typedefs |
|
| typedef struct ant_hrm_profile_s | ant_hrm_profile_t |
| typedef void(* | ant_hrm_evt_handler_t )( ant_hrm_profile_t *, ant_hrm_evt_t ) |
|
HRM event handler type.
|
|
Enumerations |
|
| enum |
ant_hrm_page_t
{
ANT_HRM_PAGE_0 , ANT_HRM_PAGE_1 , ANT_HRM_PAGE_2 , ANT_HRM_PAGE_3 , ANT_HRM_PAGE_4 } |
|
HRM page number type.
More...
|
|
| enum |
ant_hrm_evt_t
{
ANT_HRM_PAGE_0_UPDATED = ANT_HRM_PAGE_0, ANT_HRM_PAGE_1_UPDATED = ANT_HRM_PAGE_1, ANT_HRM_PAGE_2_UPDATED = ANT_HRM_PAGE_2, ANT_HRM_PAGE_3_UPDATED = ANT_HRM_PAGE_3, ANT_HRM_PAGE_4_UPDATED = ANT_HRM_PAGE_4 } |
|
HRM profile event type.
More...
|
|
Functions |
|
| ret_code_t | ant_hrm_disp_init ( ant_hrm_profile_t *p_profile, ant_channel_config_t const *p_channel_config, ant_hrm_evt_handler_t evt_handler) |
|
Function for initializing the ANT HRM Display profile instance.
More...
|
|
| ret_code_t | ant_hrm_sens_init ( ant_hrm_profile_t *p_profile, ant_channel_config_t const *p_channel_config, ant_hrm_sens_config_t const *p_sens_config) |
|
Function for initializing the ANT HRM Sensor profile instance.
More...
|
|
| ret_code_t | ant_hrm_disp_open ( ant_hrm_profile_t *p_profile) |
|
Function for opening the profile instance channel for ANT HRM Display.
More...
|
|
| ret_code_t | ant_hrm_sens_open ( ant_hrm_profile_t *p_profile) |
|
Function for opening the profile instance channel for ANT HRM Sensor.
More...
|
|
| void | ant_hrm_sens_evt_handler ( ant_hrm_profile_t *p_profile, ant_evt_t *p_ant_event) |
|
Function for handling the sensor ANT events.
More...
|
|
| void | ant_hrm_disp_evt_handler ( ant_hrm_profile_t *p_profile, ant_evt_t *p_ant_event) |
|
Function for handling the display ANT events.
More...
|
|
Detailed Description
This module implements the Heart Rate Monitor profile.
Macro Definition Documentation
| #define HRM_DISP_CHANNEL_CONFIG_DEF | ( | NAME, | |
| CHANNEL_NUMBER, | |||
| TRANSMISSION_TYPE, | |||
| DEVICE_NUMBER, | |||
| NETWORK_NUMBER, | |||
| HRM_MSG_PERIOD | |||
| ) |
Initialize an ANT channel configuration structure for the HRM profile (Display).
- Parameters
-
[in] NAME Name of related instance. [in] CHANNEL_NUMBER Number of the channel assigned to the profile instance. [in] TRANSMISSION_TYPE Type of transmission assigned to the profile instance. [in] DEVICE_NUMBER Number of the device assigned to the profile instance. [in] NETWORK_NUMBER Number of the network assigned to the profile instance. [in] HRM_MSG_PERIOD Channel period in 32 kHz counts. The HRM profile supports only the following periods: HRM_MSG_PERIOD_4Hz , HRM_MSG_PERIOD_2Hz , HRM_MSG_PERIOD_1Hz .
| #define HRM_SENS_CHANNEL_CONFIG_DEF | ( | NAME, | |
| CHANNEL_NUMBER, | |||
| TRANSMISSION_TYPE, | |||
| DEVICE_NUMBER, | |||
| NETWORK_NUMBER | |||
| ) |
Initialize an ANT channel configuration structure for the HRM profile (Sensor).
- Parameters
-
[in] NAME Name of related instance. [in] CHANNEL_NUMBER Number of the channel assigned to the profile instance. [in] TRANSMISSION_TYPE Type of transmission assigned to the profile instance. [in] DEVICE_NUMBER Number of the device assigned to the profile instance. [in] NETWORK_NUMBER Number of the network assigned to the profile instance.
| #define HRM_SENS_PROFILE_CONFIG_DEF | ( | NAME, | |
| PAGE_1_PRESENT, | |||
| MAIN_PAGE_NUMBER, | |||
| EVT_HANDLER | |||
| ) |
Initialize an ANT profile configuration structure for the HRM profile (Sensor).
- Parameters
-
[in] NAME Name of related instance. [in] PAGE_1_PRESENT Determines whether page 1 is included. [in] MAIN_PAGE_NUMBER Determines the main data page ( ANT_HRM_PAGE_0 or ANT_HRM_PAGE_4 ). [in] EVT_HANDLER Event handler to be called for handling events in the HRM profile.
Enumeration Type Documentation
| enum ant_hrm_evt_t |
HRM profile event type.
| enum ant_hrm_page_t |
Function Documentation
| void ant_hrm_disp_evt_handler | ( | ant_hrm_profile_t * | p_profile , |
| ant_evt_t * | p_ant_event | ||
| ) |
Function for handling the display ANT events.
This function handles all events from the ANT stack that are of interest to the Heart Rate Monitor Display profile.
- Parameters
-
[in] p_profile Pointer to the profile instance. [in] p_ant_event Event received from the ANT stack.
| ret_code_t ant_hrm_disp_init | ( | ant_hrm_profile_t * | p_profile , |
| ant_channel_config_t const * | p_channel_config , | ||
| ant_hrm_evt_handler_t | evt_handler | ||
| ) |
Function for initializing the ANT HRM Display profile instance.
- Parameters
-
[in] p_profile Pointer to the profile instance. [in] p_channel_config Pointer to the ANT channel configuration structure. [in] evt_handler Event handler to be called for handling events in the HRM profile.
- Return values
-
NRF_SUCCESS If initialization was successful. Otherwise, an error code is returned.
| ret_code_t ant_hrm_disp_open | ( | ant_hrm_profile_t * | p_profile | ) |
Function for opening the profile instance channel for ANT HRM Display.
Before calling this function, pages should be configured.
- Parameters
-
[in] p_profile Pointer to the profile instance.
- Return values
-
NRF_SUCCESS If the channel was successfully opened. Otherwise, an error code is returned.
| void ant_hrm_sens_evt_handler | ( | ant_hrm_profile_t * | p_profile , |
| ant_evt_t * | p_ant_event | ||
| ) |
Function for handling the sensor ANT events.
This function handles all events from the ANT stack that are of interest to the Heart Rate Monitor Sensor profile.
- Parameters
-
[in] p_profile Pointer to the profile instance. [in] p_ant_event Event received from the ANT stack.
| ret_code_t ant_hrm_sens_init | ( | ant_hrm_profile_t * | p_profile , |
| ant_channel_config_t const * | p_channel_config , | ||
| ant_hrm_sens_config_t const * | p_sens_config | ||
| ) |
Function for initializing the ANT HRM Sensor profile instance.
- Parameters
-
[in] p_profile Pointer to the profile instance. [in] p_channel_config Pointer to the ANT channel configuration structure. [in] p_sens_config Pointer to the HRM sensor configuration structure.
- Return values
-
NRF_SUCCESS If initialization was successful. Otherwise, an error code is returned.
| ret_code_t ant_hrm_sens_open | ( | ant_hrm_profile_t * | p_profile | ) |
Function for opening the profile instance channel for ANT HRM Sensor.
Before calling this function, pages should be configured.
- Parameters
-
[in] p_profile Pointer to the profile instance.
- Return values
-
NRF_SUCCESS If the channel was successfully opened. Otherwise, an error code is returned.