1 /* 2 * Copyright (c) 2020 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 /* PDU_ANTENNA is defined outside of the #if block below because 8 * radio_df_pdu_antenna_switch_pattern_get() can get called even when 9 * the preprocessor condition being tested is 0. In this case, we use 10 * the default value of 0. 11 */ 12 #define PDU_ANTENNA DT_PROP_OR(RADIO_NODE, dfe_pdu_antenna, 0) 13 14 /* Function configures Radio with information about GPIO pins that may be 15 * used to drive antenna switching during CTE Tx/RX. 16 */ 17 void radio_df_ant_switching_pin_sel_cfg(void); 18 /* Configures GPIO pins in GPIO peripheral. The pins will be used for antenna 19 * switching during CTE Rx/Tx. 20 */ 21 void radio_df_ant_switching_gpios_cfg(void); 22 /* Provides number of available antennas for Direction Finding. */ 23 uint8_t radio_df_ant_num_get(void); 24 25 /* Sets Direction Finding AOA mode. */ 26 void radio_df_mode_set_aoa(void); 27 /* Sets Direction Finding AOD mode. */ 28 void radio_df_mode_set_aod(void); 29 30 /* Configure CTE transmission with 2us antenna switching for AoD. */ 31 void radio_df_cte_tx_aod_2us_set(uint8_t cte_len); 32 /* Configure CTE transmission with 4us antenna switching for AoD. */ 33 void radio_df_cte_tx_aod_4us_set(uint8_t cte_len); 34 /* Configure CTE transmission with for AoA. */ 35 void radio_df_cte_tx_aoa_set(uint8_t cte_len); 36 /* Configure CTE reception with optional AoA mode and 2us antenna switching. */ 37 void radio_df_cte_rx_2us_switching(bool cte_info_in_s1, uint8_t phy); 38 /* Configure CTE reception with optional AoA mode and 4us antenna switching. */ 39 void radio_df_cte_rx_4us_switching(bool cte_info_in_s1, uint8_t phy); 40 41 /* Clears antenna switch pattern. */ 42 void radio_df_ant_switch_pattern_clear(void); 43 /* Set antenna switch pattern. Pay attention, patterns are added to 44 * Radio internal list. Before start of new patterns clear the list 45 * by call to @ref radio_df_ant_switch_pattern_clear. 46 */ 47 void radio_df_ant_switch_pattern_set(const uint8_t *patterns, uint8_t len); 48 /* Provides switch pattern of antenna used to transmit PDU that is used to 49 * transmit CTE 50 */ 51 uint8_t radio_df_pdu_antenna_switch_pattern_get(void); 52 /* Resets Direction Finding radio configuration */ 53 void radio_df_reset(void); 54 55 /* Completes switching and enables shortcut between PHYEND and TXEN events */ 56 void radio_switch_complete_and_phy_end_b2b_tx(uint8_t phy_curr, uint8_t flags_curr, 57 uint8_t phy_next, uint8_t flags_next); 58 59 /* Set buffer to store IQ samples collected during CTE sampling */ 60 void radio_df_iq_data_packet_set(uint8_t *buffer, size_t len); 61 /* Get number of stored IQ samples during CTE receive */ 62 uint32_t radio_df_iq_samples_amount_get(void); 63 /* Get CTE status (CTEInfo) parsed by Radio from received PDU */ 64 uint8_t radio_df_cte_status_get(void); 65 /* Get information if CTE was present in a received packet */ 66 bool radio_df_cte_ready(void); 67