Example of ANT HRM RX profile.
More...
|
void | PROTOCOL_EVENT_IRQHandler (void) |
| Function for stack Interrupt handling.
|
|
void | softdevice_assert_callback (uint32_t pc, uint16_t line_num, const uint8_t *p_file_name) |
| Function for handling softdevice asserts and does not return. More...
|
|
void | app_error_handler (uint32_t error_code, uint32_t line_num, const uint8_t *p_file_name) |
| Function for handling an error. More...
|
|
int | main (void) |
| Function for application main entry, does not return.
|
|
void | hrm_rx_open (void) |
| Function for setting ANT module ready for HRM RX.
|
|
void | hrm_rx_channel_event_handle (uint8_t const *p_event_message_buffer) |
| Function for processing channel event messages for the HRM. More...
|
|
This example connects to the nearest Heart Rate Monitor (HRM) in range and prints the UART data when it is received from the device.
- HRM specific configuration options
The following compile time configuration options are available to suit various HRM receiver implementations:
- HRMRX_NETWORK_KEY ANT PLUS network key.
- ANTPLUS_NETWORK_NUMBER Channel network key.
- HRMRX_ANT_CHANNEL Channel number.
- HRMRX_DEVICE_NUMBER Device number.
- HRMRX_DEVICE_TYPE Device type.
- HRMRX_TRANS_TYPE Transmission type.
- ANTPLUS_RF_FREQ Channel radio frequency - offset from 2400 MHz.
- HRMRX_MSG_PERIOD Channel period - in 32 kHz counts.
- Development phase configuration options
Depending on the selected compile time configuration, the HRM receiver will trace the profile specific state information to the UART.
The following options for the compile time configuration are available in the development phase of the HRM receiver implementation:
- TRACE_HRM_PAGE_NMBR - output page number of the current page to UART.
- TRACE_HRM_PAGE_1 - output page 1 data to UART.
- TRACE_HRM_PAGE_2 - output page 2 data to UART.
- TRACE_HRM_PAGE_3 - output page 3 data to UART.
- TRACE_HRM_PAGE_4 - output page 4 data to UART.
- TRACE_UART - UART output enabled.
- Note
- The ANT+ Network Key is available for ANT+ Adopters. Please refer to http://thisisant.com to become an ANT+ Adopter and access the key.
#define ANT_EVENT_MSG_BUFFER_MIN_SIZE 32u |
Minimum size of an ANT event message buffer.
#define UART_TX_BUF_SIZE 256u |
#define UART_RX_BUF_SIZE 1u |
void softdevice_assert_callback |
( |
uint32_t |
pc, |
|
|
uint16_t |
line_num, |
|
|
const uint8_t * |
p_file_name |
|
) |
| |
Traces out the user supplied parameters and busy loops.
- Parameters
-
[in] | pc | Value of the program counter. |
[in] | line_num | Line number where the assert occurred. |
[in] | p_file_name | Pointer to the file name. |
void app_error_handler |
( |
uint32_t |
error_code, |
|
|
uint32_t |
line_num, |
|
|
const uint8_t * |
p_file_name |
|
) |
| |
Function for error handling, which is called when an error has occurred.
- Parameters
-
[in] | error_code | Error code supplied to the handler. |
[in] | line_num | Line number where the error occurred. |
[in] | p_file_name | Pointer to the file name. |
void hrm_rx_channel_event_handle |
( |
uint8_t const * |
p_event_message_buffer | ) |
|
- Parameters
-
[in] | p_event_message_buffer | ANT event message buffer. |