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

Functions

uint8_t EPS_send_cmd_get_response (const uint8_t cmd_buf[], uint8_t cmd_buf_len, uint8_t rx_buf[], uint16_t rx_buf_len)
 Sends a command to the EPS, and receives the response.
 
uint8_t EPS_run_argumentless_cmd (uint8_t command_code)
 Sends an argumentless command to the EPS (expecting no data in the response).
 

Variables

UART_HandleTypeDef * UART_eps_port_handle
 
static const uint32_t EPS_TX_TIMEOUT_MS = 1000
 
static const uint32_t EPS_RX_TIMEOUT_BEFORE_FIRST_BYTE_MS = 50
 
static const uint32_t EPS_RX_TIMEOUT_BETWEEN_BYTES_MS = 25
 
uint32_t CONFIG_EPS_enable_uart_debug_print = 0
 When enabled, the EPS's raw data is sent to the debug UART.
 

Function Documentation

◆ EPS_run_argumentless_cmd()

uint8_t EPS_run_argumentless_cmd ( uint8_t command_code)

Sends an argumentless command to the EPS (expecting no data in the response).

Parameters
command_codeCommand code number.
Returns
0 on success, >0 if error.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ EPS_send_cmd_get_response()

uint8_t EPS_send_cmd_get_response ( const uint8_t cmd_buf[],
uint8_t cmd_buf_len,
uint8_t rx_buf[],
uint16_t rx_buf_len )

Sends a command to the EPS, and receives the response.

Parameters
cmd_bufArray of bytes to send to the EPS, including the command code, STID, IVID, etc.
cmd_buf_lenExact length of the command buffer.
rx_bufBuffer to store the response. Is filled with the response, without tags.
rx_buf_lenLength of the response buffer. Must be the command length.
Returns
0 on success, >0 if error.
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ CONFIG_EPS_enable_uart_debug_print

uint32_t CONFIG_EPS_enable_uart_debug_print = 0

When enabled, the EPS's raw data is sent to the debug UART.

◆ EPS_RX_TIMEOUT_BEFORE_FIRST_BYTE_MS

const uint32_t EPS_RX_TIMEOUT_BEFORE_FIRST_BYTE_MS = 50
static

◆ EPS_RX_TIMEOUT_BETWEEN_BYTES_MS

const uint32_t EPS_RX_TIMEOUT_BETWEEN_BYTES_MS = 25
static

◆ EPS_TX_TIMEOUT_MS

const uint32_t EPS_TX_TIMEOUT_MS = 1000
static

◆ UART_eps_port_handle

UART_HandleTypeDef* UART_eps_port_handle
extern