nRF51 SDK
|
The combined bicycle speed and cadence sensor implementation. More...
Macros | |
#define | CBSC_TX_ANT_CHANNEL 0 |
#define | UART_TX_BUF_SIZE 128u |
#define | UART_RX_BUF_SIZE 1u |
Functions | |
uint32_t | cbsc_tx_initialize (void) |
Function for initializing the module. More... | |
uint32_t | cbsc_tx_channel_event_handle (uint32_t event) |
Function for processing received ANT channel event message. More... | |
void | main_cbsc_tx_run (void) |
Function for configuring the device simulator, does not return. | |
void | softdevice_assert_callback (uint32_t pc, uint16_t line_num, const uint8_t *p_file_name) |
Function for handling SoftDevice asserts, 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... | |
static __INLINE void | softdevice_setup (void) |
Function for configuring and setting up the SoftDevice. | |
int | main (void) |
Function for application main entry, does not return. | |
sensor example
sensor example
The combined bicycle speed and cadence sensor implementation implements all the features, which are required for this type of sensor to be compliant with the ANT+ Bicycle Speed and Cadence profile, as defined by the ANT+ Bike Speed and Cadence Device Profile specification:
The general architecture of the combined bicycle speed and cadence sensor is illustrated in the picture below.
The following compile time configuration options are available to suite various combined bicycle speed and cadence sensor implementations:
The combined bicycle speed and cadence sensor will trace error handler specific information to UART depending on the selected compile time configuration options.
The following compile time configuration options are available, and enabled by default, to assist in the development phase of the combined bicycle speed and cadence sensor implementation:
#define CBSC_TX_ANT_CHANNEL 0 |
Default ANT Channel used.
#define UART_TX_BUF_SIZE 128u |
UART TX buffer size.
#define UART_RX_BUF_SIZE 1u |
UART RX buffer size.
uint32_t cbsc_tx_initialize | ( | void | ) |
Transmits the 1st broadcast message.
NRF_SUCCESS | Operation success. |
NRF_ERROR_INVALID_PARAM | Operation failure. Invalid Parameter. |
NRF_ANT_ERROR_MESSAGE_SIZE_EXCEEDS_LIMIT | Operation failure. Data message provided is too large. |
NRF_ANT_ERROR_INVALID_SCAN_TX_CHANNEL | Operation failure. Attempt to transmit on channel 0 while in scan mode. |
NRF_ANT_ERROR_CHANNEL_IN_WRONG_STATE | Operation failure. Attempt to perform an action in a wrong channel state. |
NRF_ANT_ERROR_TRANSFER_IN_PROGRESS | Operation failure. Attempt to communicate on a channel with a TX transfer in progress. |
NRF_ANT_ERROR_TRANSFER_IN_ERROR | Operation failure. Transfer error has occured on supplied burst message or burst data segment. |
uint32_t cbsc_tx_channel_event_handle | ( | uint32_t | event | ) |
[in] | event | ANT event received. |
NRF_SUCCESS | Operation success. |
NRF_ERROR_INVALID_PARAM | Operation failure. Invalid Parameter. |
NRF_ANT_ERROR_MESSAGE_SIZE_EXCEEDS_LIMIT | Operation failure. Data message provided is too large. |
NRF_ANT_ERROR_INVALID_SCAN_TX_CHANNEL | Operation failure. Attempt to transmit on channel 0 while in scan mode. |
NRF_ANT_ERROR_CHANNEL_IN_WRONG_STATE | Operation failure. Attempt to perform an action in a wrong channel state. |
NRF_ANT_ERROR_TRANSFER_IN_PROGRESS | Operation failure. Attempt to communicate on a channel with a TX transfer in progress. |
NRF_ANT_ERROR_TRANSFER_IN_ERROR | Operation failure. Transfer error has occured on supplied burst message or burst data segment. |
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.
[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.
[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. |