CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
ant_internal_drivers.c File Reference
#include "main.h"
#include "antenna_deploy_drivers/ant_internal_drivers.h"
#include "debug_tools/debug_i2c.h"
#include "debug_tools/debug_uart.h"
#include "log/log.h"
#include <stdint.h>
#include <string.h>
Include dependency graph for ant_internal_drivers.c:

Functions

uint8_t ANT_send_cmd (enum ANT_i2c_bus_mcu i2c_bus_mcu, uint8_t cmd_buf[], uint8_t cmd_len)
 Sends a command to the antenna controller.
 
uint8_t ANT_get_response (enum ANT_i2c_bus_mcu i2c_bus_mcu, uint8_t rx_buf[], uint16_t rx_len)
 Receives a response from the antenna controller.
 

Variables

const uint8_t ANT_i2c_timeout_ms = 100
 This file contains commands for communicating with the antenna deploy system(ADS). The ADS has two microcontrollers which control the deployment of the antennas. It also has two separate i2c buses which can be used to communicate with the ADS. The combination of microcontroller (mcu) to communicate to and i2c line to use is specified using a value from the Ant_i2c_bus_mcu enum.
 
I2C_HandleTypeDef hi2c2
 
I2C_HandleTypeDef hi2c3
 

Function Documentation

◆ ANT_get_response()

uint8_t ANT_get_response ( enum ANT_i2c_bus_mcu i2c_bus_mcu,
uint8_t rx_buf[],
uint16_t rx_len )

Receives a response from the antenna controller.

Parameters
i2c_bus_mcuthe i2c_bus_mcu to read from. Either ANT_I2C_BUS_A_MCU_A or ANT_I2C_BUS_B_MCU_B
rx_bufArray to store the response from the antenna controller
rx_lenLength of the response buffer
Returns
0 upon success, 1 if read_status received HAL_ERROR
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ANT_send_cmd()

uint8_t ANT_send_cmd ( enum ANT_i2c_bus_mcu i2c_bus_mcu,
uint8_t cmd_buf[],
uint8_t cmd_len )

Sends a command to the antenna controller.

Parameters
i2c_bus_mcuthe i2c_bus and mcu combination to use/transmit to. Either ANT_I2C_BUS_A_MCU_A or ANT_I2C_BUS_B_MCU_B
cmd_bufArray of bytes to send to the antenna controller
cmd_lenLength of the command buffer
Returns
0 upon success, 1 if tx_status received HAL_ERROR, 2 if tx_status received HAL_BUSY, 3 if tx_status received HAL_TIMEOUT, 4 if invalid i2c bus/mcu is passed
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ ANT_i2c_timeout_ms

const uint8_t ANT_i2c_timeout_ms = 100

This file contains commands for communicating with the antenna deploy system(ADS). The ADS has two microcontrollers which control the deployment of the antennas. It also has two separate i2c buses which can be used to communicate with the ADS. The combination of microcontroller (mcu) to communicate to and i2c line to use is specified using a value from the Ant_i2c_bus_mcu enum.

Timeout (ms) for both RX and TX I2C operations. 50ms seems adequate, but perhaps right on the limit.

◆ hi2c2

I2C_HandleTypeDef hi2c2
extern

◆ hi2c3

I2C_HandleTypeDef hi2c3
extern