#include <stdint.h>
#include <stddef.h>
#include "mpi/mpi_types.h"
#include "littlefs/lfs.h"
Go to the source code of this file.
◆ MPI_disable_active_mode()
uint8_t MPI_disable_active_mode |
( |
| ) |
|
◆ MPI_enable_active_mode()
uint8_t MPI_enable_active_mode |
( |
const char | output_file_path[] | ) |
|
Turns on MPI science mode and Enables DMA interrupt for MPI channel.
- Returns
- 0: MPI and DMA successfully enabled, < 0: Error
◆ MPI_send_command_get_response()
uint8_t MPI_send_command_get_response |
( |
const uint8_t * | bytes_to_send, |
|
|
const size_t | bytes_to_send_len, |
|
|
uint8_t * | rx_buffer, |
|
|
const size_t | rx_buffer_max_size, |
|
|
uint16_t * | rx_buffer_len ) |
Sends commandcode+params to the MPI as bytes.
- Parameters
-
bytes_to_send | Buffer containing the telecommand + params (IF ANY) as hex bytes |
bytes_to_send_len | Size of telecommand buffer |
rx_buffer | Buffer to store incoming response from the MPI |
rx_buffer_max_size | The maximum size of the MPI response buffer |
rx_buffer_len | Pointer to variable that will contain the length of the populated MPI response buffer |
- Returns
- 0: Success, 2: Failed UART transmission, 3: Failed UART reception, 4: Timeout waiting for 1st byte from MPI, 8: Not enough space in the MPI response buffer
- Note
- If the MPI is in "science data" mode, it will be disabled after the command is executed.
◆ MPI_validate_command_response()
uint8_t MPI_validate_command_response |
( |
const uint8_t | command_code, |
|
|
uint8_t * | rx_buffer, |
|
|
const uint16_t | rx_buffer_len ) |
The MPI responds to each telecommand with a response code consisting of an echo of the telecommand code byte and a status byte (either 254 or OxFE) for success or error code otherwise.
- Parameters
-
tx_buffer | MPI telecommand buffer containing bytes sent |
rx_buffer | MPI response buffer containing bytes received |
tx_buffer_size | Size of the MPI response buffer |
- Returns
- 0: MPI successfully executed telecommand, 5: MPI failed to execute telecommand, 6: Invalid response from the MPI
◆ MPI_COMMAND_SUCCESS_RESPONSE_VALUE
const uint8_t MPI_COMMAND_SUCCESS_RESPONSE_VALUE = 0xFE |
|
static |
◆ MPI_current_uart_rx_mode
Current mode under which the MPI is being operated.
◆ MPI_recording_start_uptime_ms
uint32_t MPI_recording_start_uptime_ms |
|
extern |
◆ MPI_science_data_bytes_lost
uint32_t MPI_science_data_bytes_lost |
|
extern |
◆ MPI_science_data_file_is_open
uint8_t MPI_science_data_file_is_open |
|
extern |
◆ MPI_science_data_file_pointer