CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
ant_commands.h File Reference
#include <stdint.h>
#include "antenna_deploy_drivers/ant_internal_drivers.h"
Include dependency graph for ant_commands.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ANT_deployment_status_struct_t
 

Functions

uint8_t ANT_CMD_reset (enum ANT_i2c_bus_mcu i2c_bus_mcu)
 Performs a reset of the antenna deployment systems microcontroller which is specified.
 
uint8_t ANT_CMD_arm_antenna_system (enum ANT_i2c_bus_mcu i2c_bus_mcu)
 Arm the antenna deploy system.
 
uint8_t ANT_CMD_disarm_antenna_system (enum ANT_i2c_bus_mcu i2c_bus_mcu)
 Disarms the antenna deploy system.
 
uint8_t ANT_CMD_deploy_antenna (enum ANT_i2c_bus_mcu i2c_bus_mcu, uint8_t antenna, uint8_t activation_time_seconds)
 activates the deployment system for the selected antenna for the specified amount of time
 
uint8_t ANT_CMD_start_automated_sequential_deployment (enum ANT_i2c_bus_mcu i2c_bus_mcu, uint8_t activation_time_seconds)
 deploys all antennas one by one sequentially.
 
uint8_t ANT_CMD_deploy_antenna_with_override (enum ANT_i2c_bus_mcu i2c_bus_mcu, uint8_t antenna, uint8_t activation_time_seconds)
 initiates deployment of the selected antenna, ignoring whether the current status of that antenna is deployed
 
uint8_t ANT_CMD_cancel_deployment_system_activation (enum ANT_i2c_bus_mcu i2c_bus_mcu)
 cancels any active attempts to deploy an antenna
 
uint8_t ANT_CMD_measure_temp (enum ANT_i2c_bus_mcu i2c_bus_mcu, uint16_t *result)
 Measures the temperature at the antenna controller system.
 
int16_t ANT_convert_raw_temp_to_cCelsius (uint16_t measurement)
 Converts temperature measurement to centi-degrees celsius.
 
uint8_t ANT_CMD_report_deployment_status (enum ANT_i2c_bus_mcu i2c_bus_mcu, ANT_deployment_status_struct_t *response)
 Writes 2 bytes of information representing the deployment status of the antennas to the passed buffer, information on interpreting the response may be found in the ISIS Antenna System user manual. Doc ID: ISIS.ANTS.UM.001 pg. 42.
 
uint8_t ANT_CMD_report_antenna_deployment_activation_count (enum ANT_i2c_bus_mcu i2c_bus_mcu, uint8_t antenna, uint8_t *response)
 writes the number of times deployment has been attempted (for a specified antenna and mcu) in a response buffer.
 
uint8_t ANT_CMD_get_antenna_deployment_activation_time (enum ANT_i2c_bus_mcu i2c_bus_mcu, uint8_t antenna, uint32_t *result)
 writes the cumulative time (in ms increments) that the deployment system has been active (for a specified antenna and mcu) in a response buffer.
 

Variables

static const uint32_t ANT_POWER_ON_BOOTUP_DURATION_MS = 800
 Duration to wait after enabling power to the antenna deployment system before sending commands.
 

Function Documentation

◆ ANT_CMD_arm_antenna_system()

uint8_t ANT_CMD_arm_antenna_system ( enum ANT_i2c_bus_mcu i2c_bus_mcu)

Arm the antenna deploy system.

Parameters
i2c_bus_mcuspecifies which mcu on the antenna deployment system to arm, and which i2c bus to use
Returns
0 when the antenna deployment system has received the command, >0 otherwise
Note
arming one mcu does not arm the other. Each mcu must be armed before it can be used to deploy
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ANT_CMD_cancel_deployment_system_activation()

uint8_t ANT_CMD_cancel_deployment_system_activation ( enum ANT_i2c_bus_mcu i2c_bus_mcu)

cancels any active attempts to deploy an antenna

Parameters
i2c_bus_mcuspecifies which mcu on the antenna deployment system to transmit to, and which i2c bus to use
Returns
0 when the antenna deployment system has received the command, >0 otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ANT_CMD_deploy_antenna()

uint8_t ANT_CMD_deploy_antenna ( enum ANT_i2c_bus_mcu i2c_bus_mcu,
uint8_t antenna,
uint8_t activation_time_seconds )

activates the deployment system for the selected antenna for the specified amount of time

Parameters
i2c_bus_mcuspecifies which mcu on the antenna deployment system to use, and which i2c bus to use
antennaThe antenna number of the antenna to deploy, this is a number between 1-4.
activation_time_secondsthe amount of time the deployment system should be active for in seconds.
Returns
0 when the antenna deployment system has received the command, >0 otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ANT_CMD_deploy_antenna_with_override()

uint8_t ANT_CMD_deploy_antenna_with_override ( enum ANT_i2c_bus_mcu i2c_bus_mcu,
uint8_t antenna,
uint8_t activation_time_seconds )

initiates deployment of the selected antenna, ignoring whether the current status of that antenna is deployed

Parameters
i2c_bus_mcuspecifies which mcu on the antenna deployment system to use, and which i2c bus to use
antennathe antenna to deploy
activation_time_secondsthe amount of time the deployment system should be active for in seconds.
Returns
0 when the antenna deployment system has received the command, >0 otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ANT_CMD_disarm_antenna_system()

uint8_t ANT_CMD_disarm_antenna_system ( enum ANT_i2c_bus_mcu i2c_bus_mcu)

Disarms the antenna deploy system.

Parameters
i2c_bus_mcuspecifies which mcu on the antenna deployment system to disarm, and which i2c bus to use
Returns
0 when the antenna deployment system has received the command, >0 otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ANT_CMD_get_antenna_deployment_activation_time()

uint8_t ANT_CMD_get_antenna_deployment_activation_time ( enum ANT_i2c_bus_mcu i2c_bus_mcu,
uint8_t antenna,
uint32_t * result_ms )

writes the cumulative time (in ms increments) that the deployment system has been active (for a specified antenna and mcu) in a response buffer.

Parameters
i2c_bus_mcuspecifies which mcu on the antenna deployment system to transmit to, and which i2c bus to use
antennathe antenna to check. A number between 1-4
result_msa 2 byte buffer where the cumulative deployment time (in ms increments) will be written. divide the response by 20 to get seconds.
Returns
0 when the antenna deployment system has received the command, >0 otherwise
Note
data written to the result buffer is only valid if 0 was returned. One should check this before using the result.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ANT_CMD_measure_temp()

uint8_t ANT_CMD_measure_temp ( enum ANT_i2c_bus_mcu i2c_bus_mcu,
uint16_t * result )

Measures the temperature at the antenna controller system.

Parameters
i2c_bus_mcuspecifies which mcu on the antenna deployment system to transmit to, and which i2c bus to use
resulta pointer to a 16 bit unsigned integer where the temperature measurement is written. Refer to the "ISIS.ANTS.UM.001" datasheet by ISISpace for information on interpreting this measurement
Returns
0 when the antenna deployment system has received the command, > 0 otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ANT_CMD_report_antenna_deployment_activation_count()

uint8_t ANT_CMD_report_antenna_deployment_activation_count ( enum ANT_i2c_bus_mcu i2c_bus_mcu,
uint8_t antenna,
uint8_t * response )

writes the number of times deployment has been attempted (for a specified antenna and mcu) in a response buffer.

Parameters
i2c_bus_mcuspecifies which mcu on the antenna deployment system to check, and which i2c bus to use
antennathe antenna to check
responsea 1 byte buffer where the count of attempted deployments will be written
Returns
0 when the antenna deployment system has received the command, >0 otherwise
Note
data written to the response buffer is only valid if 0 was returned. One should check this before using the response.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ANT_CMD_report_deployment_status()

uint8_t ANT_CMD_report_deployment_status ( enum ANT_i2c_bus_mcu i2c_bus_mcu,
ANT_deployment_status_struct_t * response )

Writes 2 bytes of information representing the deployment status of the antennas to the passed buffer, information on interpreting the response may be found in the ISIS Antenna System user manual. Doc ID: ISIS.ANTS.UM.001 pg. 42.

Parameters
i2c_bus_mcuspecifies which mcu on the antenna deployment system to transmit to, and which i2c bus to use
responsea two byte buffer where the status information is written to.
Returns
0 when the antenna deployment system has received the command, >0 otherwise
Note
- Data written to the response struct is only valid if 0 was returned. One should check this before using the response.
- This command probes the micro controller specified. data from each mcu may differ.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ANT_CMD_reset()

uint8_t ANT_CMD_reset ( enum ANT_i2c_bus_mcu i2c_bus_mcu)

Performs a reset of the antenna deployment systems microcontroller which is specified.

Parameters
i2c_bus_mcuspecifies which mcu on the antenna deployment system to reset, and which i2c bus to use
Returns
0 when the antenna deployment system has received the command, >0 otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ANT_CMD_start_automated_sequential_deployment()

uint8_t ANT_CMD_start_automated_sequential_deployment ( enum ANT_i2c_bus_mcu i2c_bus_mcu,
uint8_t activation_time_seconds )

deploys all antennas one by one sequentially.

Parameters
i2c_bus_mcuspecifies which mcu on the antenna deployment system to use, and which i2c bus to use
activation_time_secondsthe amount of time the deployment system for each antenna should be active for in seconds
Returns
0 when the antenna deployment system has received the command, >0 otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ANT_convert_raw_temp_to_cCelsius()

int16_t ANT_convert_raw_temp_to_cCelsius ( uint16_t measurement)

Converts temperature measurement to centi-degrees celsius.

Parameters
measurementmeasurement result from ANT_CMD_measure_temp()
Returns
returns the temperature in centi-degrees celsius
Note
The formula used is based on the formula found in the data sheet for the LM94022. Derivation can be found on github issue#146.
Here is the caller graph for this function:

Variable Documentation

◆ ANT_POWER_ON_BOOTUP_DURATION_MS

const uint32_t ANT_POWER_ON_BOOTUP_DURATION_MS = 800
static

Duration to wait after enabling power to the antenna deployment system before sending commands.

Note
100ms seems too short. 800ms seems to be a good value.