This module implements the Heart Rate Monitor profile.
More...
|
#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 |
| 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) &CONCAT_2(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) &CONCAT_2(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) &CONCAT_2(NAME,_profile_hrm_sens_config) |
|
|
#define | HRM_PROFILE_beat_count page_0.beat_count |
|
#define | HRM_PROFILE_computed_heart_rate page_0.computed_heart_rate |
|
#define | HRM_PROFILE_beat_time page_0.beat_time |
|
#define | HRM_PROFILE_operating_time page_1.operating_time |
|
#define | HRM_PROFILE_manuf_id page_2.manuf_id |
|
#define | HRM_PROFILE_serial_num page_2.serial_num |
|
#define | HRM_PROFILE_hw_version page_3.hw_version |
|
#define | HRM_PROFILE_sw_version page_3.sw_version |
|
#define | HRM_PROFILE_model_num page_3.model_num |
|
#define | HRM_PROFILE_manuf_spec page_4.manuf_spec |
|
#define | HRM_PROFILE_prev_beat page_4.prev_beat |
|
This module implements the Heart Rate Monitor profile.
#define HRM_DISP_CHANNEL_CONFIG_DEF |
( |
|
NAME, |
|
|
|
CHANNEL_NUMBER, |
|
|
|
TRANSMISSION_TYPE, |
|
|
|
DEVICE_NUMBER, |
|
|
|
NETWORK_NUMBER, |
|
|
|
HRM_MSG_PERIOD |
|
) |
| |
Value:
{ \
.channel_number = (CHANNEL_NUMBER), \
.transmission_type = (TRANSMISSION_TYPE), \
.device_number = (DEVICE_NUMBER), \
.channel_period = (HRM_MSG_PERIOD), \
.network_number = (NETWORK_NUMBER), \
}
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 |
|
) |
| |
Value:
{ \
.channel_number = (CHANNEL_NUMBER), \
.transmission_type = (TRANSMISSION_TYPE), \
.device_number = (DEVICE_NUMBER), \
.network_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 |
|
) |
| |
Value:
{ \
.page_1_present = (PAGE_1_PRESENT), \
.main_page_number = (MAIN_PAGE_NUMBER), \
.evt_handler = (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. |
HRM profile event type.
Enumerator |
---|
ANT_HRM_PAGE_0_UPDATED |
Data page 0 has been updated (Display) or sent (Sensor).
|
ANT_HRM_PAGE_1_UPDATED |
Data page 0 and page 1 have been updated (Display) or sent (Sensor).
|
ANT_HRM_PAGE_2_UPDATED |
Data page 0 and page 2 have been updated (Display) or sent (Sensor).
|
ANT_HRM_PAGE_3_UPDATED |
Data page 0 and page 3 have been updated (Display) or sent (Sensor).
|
ANT_HRM_PAGE_4_UPDATED |
Data page 0 and page 4 have been updated (Display) or sent (Sensor).
|
HRM page number type.
Enumerator |
---|
ANT_HRM_PAGE_0 |
Main data page number 0.
|
ANT_HRM_PAGE_1 |
Background data page number 1. This page is optional.
|
ANT_HRM_PAGE_2 |
Background data page number 2.
|
ANT_HRM_PAGE_3 |
Background data page number 3.
|
ANT_HRM_PAGE_4 |
Main data page number 4.
|
void ant_hrm_disp_evt_handler |
( |
ant_evt_t * |
p_ant_evt, |
|
|
void * |
p_context |
|
) |
| |
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_ant_evt | Event received from the ANT stack. |
[in] | p_context | Pointer to the profile instance. |
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. |
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_evt_t * |
p_ant_evt, |
|
|
void * |
p_context |
|
) |
| |
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_ant_evt | Event received from the ANT stack. |
[in] | p_context | Pointer to the profile instance. |
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. |
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. |