nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
ANT combined bicycle speed and cadence

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. More...
 
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...
 
int main (void)
 Function for application main entry, does not return.
 

Detailed Description

The combined bicycle speed and cadence sensor implementation.

sensor example

Macro Definition Documentation

#define CBSC_TX_ANT_CHANNEL   0

Default ANT Channel used.

#define UART_RX_BUF_SIZE   1u

UART RX buffer size.

#define UART_TX_BUF_SIZE   128u

UART TX buffer size.

Function Documentation

void app_error_handler ( uint32_t  error_code,
uint32_t  line_num,
const uint8_t *  p_file_name 
)

Function for handling an error.

Function for error handling, which is called when an error has occurred.

Parameters
[in]error_codeError code supplied to the handler.
[in]line_numLine number where the error occurred.
[in]p_file_namePointer to the file name.
uint32_t cbsc_tx_channel_event_handle ( uint32_t  event)

Function for processing received ANT channel event message.

Parameters
[in]eventANT event received.
Return values
NRF_SUCCESSOperation success.
NRF_ERROR_INVALID_PARAMOperation failure. Invalid Parameter.
NRF_ANT_ERROR_MESSAGE_SIZE_EXCEEDS_LIMITOperation failure. Data message provided is too large.
NRF_ANT_ERROR_INVALID_SCAN_TX_CHANNELOperation failure. Attempt to transmit on channel 0 while in scan mode.
NRF_ANT_ERROR_CHANNEL_IN_WRONG_STATEOperation failure. Attempt to perform an action in a wrong channel state.
NRF_ANT_ERROR_TRANSFER_IN_PROGRESSOperation failure. Attempt to communicate on a channel with a TX transfer in progress.
NRF_ANT_ERROR_TRANSFER_IN_ERROROperation failure. Transfer error has occured on supplied burst message or burst data segment.
uint32_t cbsc_tx_initialize ( void  )

Function for initializing the module.

Transmits the 1st broadcast message.

Return values
NRF_SUCCESSOperation success.
NRF_ERROR_INVALID_PARAMOperation failure. Invalid Parameter.
NRF_ANT_ERROR_MESSAGE_SIZE_EXCEEDS_LIMITOperation failure. Data message provided is too large.
NRF_ANT_ERROR_INVALID_SCAN_TX_CHANNELOperation failure. Attempt to transmit on channel 0 while in scan mode.
NRF_ANT_ERROR_CHANNEL_IN_WRONG_STATEOperation failure. Attempt to perform an action in a wrong channel state.
NRF_ANT_ERROR_TRANSFER_IN_PROGRESSOperation failure. Attempt to communicate on a channel with a TX transfer in progress.
NRF_ANT_ERROR_TRANSFER_IN_ERROROperation failure. Transfer error has occured on supplied burst message or burst data segment.

< Desired RTC COUNTER frequency is 1024Hz (1/1024s period).

< Computed value of the RTC prescaler register.

< Desired RTC COUNTER frequency is 1024Hz (1/1024s period).

< Speed rotations per minute.

< Desired RTC COUNTER frequency is 1024Hz (1/1024s period).

< Computed value of the RTC prescaler register.

< Speed event interval in timer tick units.

< Desired RTC COUNTER frequency is 1024Hz (1/1024s period).

< Cadence rotations per minute.

< Desired RTC COUNTER frequency is 1024Hz (1/1024s period).

< Computed value of the RTC prescaler register.

< Speed event interval in timer tick units.

< Index of the cadence event time LSB field in the data page.

< Get low byte of a uint16_t.

< Index of the cadence event time MSB field in the data page.

< Get high byte of a uint16_t.

< Index of the cumulative cadence revolution count LSB field in the data page.

< Get low byte of a uint16_t.

< Index of the cumulative cadence revolution count MSB field in the data page.

< Get high byte of a uint16_t.

< Index of the speed event time LSB field in the data page.

< Get low byte of a uint16_t.

< Index of the speed event time MSB field in the data page.

< Get high byte of a uint16_t.

< Index of the cumulative speed revolution count LSB field in the data page.

< Get low byte of a uint16_t.

< Index of the cumulative speed revolution count MSB field in the data page.

< Get high byte of a uint16_t.

void main_cbsc_tx_run ( void  )

Function for configuring the device simulator, does not return.

< Minimum size of ANT event message buffer.

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.

Traces out the user supplied parameters and busy loops.

Parameters
[in]pcValue of the program counter.
[in]line_numLine number where the assert occurred.
[in]p_file_namePointer to the file name.