CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
rf_antenna_switch.h
Go to the documentation of this file.
1#ifndef INCLUDE_GUARD__RF_ANTENNA_SWITCH
2#define INCLUDE_GUARD__RF_ANTENNA_SWITCH
3
4#include <stdint.h>
5
6typedef enum {
11 COMMS_RF_SWITCH_CONTROL_MODE_USE_ADCS_FLIPPED = 4, // Redundant implementation that assumes the antennas are backwards.
12 // TODO: Implement a RSSI auto-selection mode, where it selects based on the strongest uplink RSSI
13 COMMS_RF_SWITCH_CONTROL_MODE_UNKNOWN = 255, // Used for error handling in string parser.
15
19
20void COMMS_set_rf_switch_state(uint8_t antenna_num);
21
24
27
28
29#endif // INCLUDE_GUARD__RF_ANTENNA_SWITCH
uint8_t COMMS_active_rf_switch_antenna
Definition rf_antenna_switch.c:9
COMMS_rf_switch_control_mode_enum_t COMMS_rf_switch_control_mode_enum_from_string(const char *str)
Definition rf_antenna_switch.c:94
COMMS_rf_switch_control_mode_enum_t
Definition rf_antenna_switch.h:6
@ COMMS_RF_SWITCH_CONTROL_MODE_TOGGLE_BEFORE_EVERY_BEACON
Definition rf_antenna_switch.h:7
@ COMMS_RF_SWITCH_CONTROL_MODE_FORCE_ANT2
Definition rf_antenna_switch.h:9
@ COMMS_RF_SWITCH_CONTROL_MODE_USE_ADCS_NORMAL
Definition rf_antenna_switch.h:10
@ COMMS_RF_SWITCH_CONTROL_MODE_FORCE_ANT1
Definition rf_antenna_switch.h:8
@ COMMS_RF_SWITCH_CONTROL_MODE_UNKNOWN
Definition rf_antenna_switch.h:13
@ COMMS_RF_SWITCH_CONTROL_MODE_USE_ADCS_FLIPPED
Definition rf_antenna_switch.h:11
uint8_t COMMS_find_optimal_antenna_using_adcs()
Determines the optimal antenna to use based on the satellite's attitude angles.
Definition rf_antenna_switch.c:55
void COMMS_set_rf_switch_state(uint8_t antenna_num)
Sets the state of the dipole switch on the OBC to either Antenna 1 or Antenna 2.
Definition rf_antenna_switch.c:20
COMMS_rf_switch_control_mode_enum_t COMMS_rf_switch_control_mode
Definition rf_antenna_switch.c:10
void COMMS_toggle_rf_switch_state()
Toggles the active antenna (selected by RF switch), from 1 to 2 or from 2 to 1.
Definition rf_antenna_switch.c:85
uint32_t COMMS_max_duration_without_uplink_before_setting_default_rf_switch_mode_sec
If the satellite goes this long without receiving an uplink, the COMMS_rf_switch_control_mode will be...
Definition rf_antenna_switch.c:14
const char * COMMS_rf_switch_control_mode_enum_to_string(COMMS_rf_switch_control_mode_enum_t mode)
Definition rf_antenna_switch.c:144