![]() |
nRF5 SDK
v12.3.0
|
| Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API |
This module implements the Stride Based Speed and Distance Monitor profile. More...
Modules | |
| Stride Based Speed and Distance Monitor Profile configuration | |
| Stride Based Speed and Distance Monitor profile pages | |
| This module implements functions for the SDM data pages. | |
| Stride Based Speed and Distance Monitor profile utilities | |
| This module implements utilities for the Stride Based Speed and Distance Monitor profile. | |
Data Structures | |
| struct | ant_sdm_sens_config_t |
| SDM Sensor configuration structure. More... | |
| struct | ant_sdm_disp_config_t |
| SDM Display configuration structure. More... | |
| struct | ant_sdm_profile_s |
| SDM profile structure. More... | |
| struct | ant_sdm_disp_cb_t |
| SDM Display control block. More... | |
| struct | ant_sdm_sens_cb_t |
| SDM Sensor control block. More... | |
Macros | |
| #define | SDM_DEVICE_TYPE 0x7Cu |
| Device type reserved for ANT+ SDM. | |
| #define | SDM_ANTPLUS_RF_FREQ 0x39u |
| Frequency, decimal 57 (2457 MHz). | |
| #define | SDM_MSG_PERIOD_4Hz 0x1FC6u |
| Message period, decimal 8134 (4.03 Hz). | |
| #define | SDM_MSG_PERIOD_2Hz 0x3F8Cu |
| Message period, decimal 16268 (2.01 Hz). | |
| #define | SDM_EXT_ASSIGN 0x00 |
| ANT ext assign (see Ext. Assign Channel Parameters in ant_parameters.h: ANT Stack Parameters). | |
| #define | SDM_DISP_CHANNEL_TYPE CHANNEL_TYPE_SLAVE |
| RX SDM channel type. | |
| #define | SDM_SENS_CHANNEL_TYPE CHANNEL_TYPE_MASTER |
| TX SDM channel type. | |
| #define | SDM_DISP_CHANNEL_CONFIG_DEF(NAME,CHANNEL_NUMBER,TRANSMISSION_TYPE,DEVICE_NUMBER,NETWORK_NUMBER,SDM_MSG_PERIOD) |
| Initialize an ANT channel configuration structure for the SDM profile (Display). More... | |
| #define | SDM_DISP_CHANNEL_CONFIG(NAME) &NAME##_channel_sdm_disp_config |
| #define | SDM_SENS_CHANNEL_CONFIG_DEF(NAME,CHANNEL_NUMBER,TRANSMISSION_TYPE,DEVICE_NUMBER,NETWORK_NUMBER) |
| Initialize an ANT channel configuration structure for the SDM profile (Sensor). More... | |
| #define | SDM_SENS_CHANNEL_CONFIG(NAME) &NAME##_channel_sdm_sens_config |
| #define | SDM_DISP_PROFILE_CONFIG_DEF(NAME,EVT_HANDLER) |
| Initialize an ANT profile configuration structure for the SDM profile (Display). More... | |
| #define | SDM_DISP_PROFILE_CONFIG(NAME) &NAME##_profile_sdm_disp_config |
| #define | SDM_SENS_PROFILE_CONFIG_DEF(NAME,SUPPLEMENTARY_PAGE_NUMBER,EVT_HANDLER) |
| Initialize an ANT profile configuration structure for the SDM profile (Sensor). More... | |
| #define | SDM_SENS_PROFILE_CONFIG(NAME) &NAME##_profile_sdm_sens_config |
Typedefs | |
| typedef struct ant_sdm_profile_s | ant_sdm_profile_t |
| typedef void(* | ant_sdm_evt_handler_t )(ant_sdm_profile_t *, ant_sdm_evt_t) |
| SDM event handler type. | |
Enumerations | |
| enum | ant_sdm_page_t { ANT_SDM_PAGE_1 = 1, ANT_SDM_PAGE_2 = 2, ANT_SDM_PAGE_3 = 3, ANT_SDM_PAGE_16 = 16, ANT_SDM_PAGE_22 = 22, ANT_SDM_PAGE_70 = ANT_COMMON_PAGE_70, ANT_SDM_PAGE_80 = ANT_COMMON_PAGE_80, ANT_SDM_PAGE_81 = ANT_COMMON_PAGE_81 } |
| SDM page number type. More... | |
| enum | ant_sdm_evt_t { ANT_SDM_PAGE_1_UPDATED = ANT_SDM_PAGE_1, ANT_SDM_PAGE_2_UPDATED = ANT_SDM_PAGE_2, ANT_SDM_PAGE_3_UPDATED = ANT_SDM_PAGE_3, ANT_SDM_PAGE_16_UPDATED = ANT_SDM_PAGE_16, ANT_SDM_PAGE_22_UPDATED = ANT_SDM_PAGE_22, ANT_SDM_PAGE_80_UPDATED = ANT_SDM_PAGE_80, ANT_SDM_PAGE_81_UPDATED = ANT_SDM_PAGE_81, ANT_SDM_PAGE_REQUEST_SUCCESS, ANT_SDM_PAGE_REQUEST_FAILED } |
| SDM profile event type. More... | |
Functions | |
| ret_code_t | ant_sdm_disp_init (ant_sdm_profile_t *p_profile, ant_channel_config_t const *p_channel_config, ant_sdm_disp_config_t const *p_disp_config) |
| Function for initializing the ANT SDM RX profile instance. More... | |
| ret_code_t | ant_sdm_sens_init (ant_sdm_profile_t *p_profile, ant_channel_config_t const *p_channel_config, ant_sdm_sens_config_t const *p_sens_config) |
| Function for initializing the ANT SDM TX profile instance. More... | |
| ret_code_t | ant_sdm_disp_open (ant_sdm_profile_t *p_profile) |
| Function for opening the profile instance channel for ANT SDM Display. More... | |
| ret_code_t | ant_sdm_sens_open (ant_sdm_profile_t *p_profile) |
| Function for opening the profile instance channel for ANT SDM Sensor. More... | |
| ret_code_t | ant_sdm_page_request (ant_sdm_profile_t *p_profile, ant_common_page70_data_t *p_page_70) |
| Function for sending a data page request. More... | |
| void | ant_sdm_sens_evt_handler (ant_sdm_profile_t *p_profile, ant_evt_t *p_ant_event) |
| Function for handling the Sensor ANT events. More... | |
| void | ant_sdm_disp_evt_handler (ant_sdm_profile_t *p_profile, ant_evt_t *p_ant_event) |
| Function for handling the Display ANT events. More... | |
This module implements the Stride Based Speed and Distance Monitor profile.
| #define SDM_DISP_CHANNEL_CONFIG_DEF | ( | NAME, | |
| CHANNEL_NUMBER, | |||
| TRANSMISSION_TYPE, | |||
| DEVICE_NUMBER, | |||
| NETWORK_NUMBER, | |||
| SDM_MSG_PERIOD | |||
| ) |
Initialize an ANT channel configuration structure for the SDM profile (Display).
| [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] | SDM_MSG_PERIOD | Channel period in 32 kHz counts. The SDM profile supports only the following periods: SDM_MSG_PERIOD_4Hz, SDM_MSG_PERIOD_2Hz. |
| #define SDM_DISP_PROFILE_CONFIG_DEF | ( | NAME, | |
| EVT_HANDLER | |||
| ) |
Initialize an ANT profile configuration structure for the SDM profile (Display).
| [in] | NAME | Name of related instance. |
| [in] | EVT_HANDLER | Event handler to be called for handling events in the SDM profile. |
| #define SDM_SENS_CHANNEL_CONFIG_DEF | ( | NAME, | |
| CHANNEL_NUMBER, | |||
| TRANSMISSION_TYPE, | |||
| DEVICE_NUMBER, | |||
| NETWORK_NUMBER | |||
| ) |
Initialize an ANT channel configuration structure for the SDM profile (Sensor).
| [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 SDM_SENS_PROFILE_CONFIG_DEF | ( | NAME, | |
| SUPPLEMENTARY_PAGE_NUMBER, | |||
| EVT_HANDLER | |||
| ) |
Initialize an ANT profile configuration structure for the SDM profile (Sensor).
| [in] | NAME | Name of related instance. |
| [in] | SUPPLEMENTARY_PAGE_NUMBER | Supplementary data page (ANT_SDM_PAGE_2 or ANT_SDM_PAGE_3). Use ANT_SDM_PAGE_1 to disable. |
| [in] | EVT_HANDLER | Event handler to be called for handling events in the SDM profile. |
| enum ant_sdm_evt_t |
SDM profile event type.
| enum ant_sdm_page_t |
| void ant_sdm_disp_evt_handler | ( | ant_sdm_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 SDM Display profile.
| [in] | p_profile | Pointer to the profile instance. |
| [in] | p_ant_event | Event received from the ANT stack. |
| ret_code_t ant_sdm_disp_init | ( | ant_sdm_profile_t * | p_profile, |
| ant_channel_config_t const * | p_channel_config, | ||
| ant_sdm_disp_config_t const * | p_disp_config | ||
| ) |
Function for initializing the ANT SDM RX profile instance.
| [in] | p_profile | Pointer to the profile instance. |
| [in] | p_channel_config | Pointer to the ANT channel configuration structure. |
| [in] | p_disp_config | Pointer to the SDM Display configuration structure. |
| NRF_SUCCESS | If initialization was successful. Otherwise, an error code is returned. |
| ret_code_t ant_sdm_disp_open | ( | ant_sdm_profile_t * | p_profile | ) |
Function for opening the profile instance channel for ANT SDM Display.
Before calling this function, pages should be configured.
| [in] | p_profile | Pointer to the profile instance. |
| NRF_SUCCESS | If the channel was successfully opened. Otherwise, an error code is returned. |
| ret_code_t ant_sdm_page_request | ( | ant_sdm_profile_t * | p_profile, |
| ant_common_page70_data_t * | p_page_70 | ||
| ) |
Function for sending a data page request.
This function can be called only on the display side.
| [in] | p_profile | Pointer to the profile instance. |
| [in] | p_page_70 | Pointer to the prepared page 70. |
| NRF_SUCCESS | If the request has been sent. Otherwise, an error code is returned. |
| void ant_sdm_sens_evt_handler | ( | ant_sdm_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 SDM Sensor profile.
| [in] | p_profile | Pointer to the profile instance. |
| [in] | p_ant_event | Event received from the ANT stack. |
| ret_code_t ant_sdm_sens_init | ( | ant_sdm_profile_t * | p_profile, |
| ant_channel_config_t const * | p_channel_config, | ||
| ant_sdm_sens_config_t const * | p_sens_config | ||
| ) |
Function for initializing the ANT SDM TX profile instance.
| [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 SDM Sensor configuration structure. |
| NRF_SUCCESS | If initialization was successful. Otherwise, an error code is returned. |
| ret_code_t ant_sdm_sens_open | ( | ant_sdm_profile_t * | p_profile | ) |
Function for opening the profile instance channel for ANT SDM Sensor.
Before calling this function, pages should be configured.
| [in] | p_profile | Pointer to the profile instance. |
| NRF_SUCCESS | If the channel was successfully opened. Otherwise, an error code is returned. |