1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- #include "sdk_common.h"
- #if NRF_MODULE_ENABLED(ANT_CHANNEL_CONFIG)
- #include "nrf_error.h"
- #include "ant_channel_config.h"
- #include "ant_interface.h"
- #include "ant_parameters.h"
- uint32_t ant_channel_init(ant_channel_config_t const * p_config)
- {
- uint32_t err_code;
-
- err_code = sd_ant_channel_assign(p_config->channel_number,
- p_config->channel_type,
- p_config->network_number,
- p_config->ext_assign);
- VERIFY_SUCCESS(err_code);
-
- err_code = sd_ant_channel_id_set(p_config->channel_number,
- p_config->device_number,
- p_config->device_type,
- p_config->transmission_type);
- VERIFY_SUCCESS(err_code);
-
- err_code = sd_ant_channel_radio_freq_set(p_config->channel_number, p_config->rf_freq);
- VERIFY_SUCCESS(err_code);
-
- if (!(p_config->ext_assign & EXT_PARAM_ALWAYS_SEARCH) && (p_config->channel_period != 0))
- {
- err_code = sd_ant_channel_period_set(p_config->channel_number, p_config->channel_period);
- }
- #if NRF_SDH_ANT_ENCRYPTED_CHANNELS > 0
- VERIFY_SUCCESS(err_code);
- err_code = ant_channel_encrypt_config(p_config->channel_type , p_config->channel_number, p_config->p_crypto_settings);
- #endif
- return err_code;
- }
- #endif
|