CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
flash_telecommand_defs.c File Reference
#include "telecommand_exec/telecommand_args_helpers.h"
#include "telecommands/flash_telecommand_defs.h"
#include "littlefs/flash_driver.h"
#include "littlefs/flash_benchmark.h"
#include "debug_tools/debug_uart.h"
#include "log/log.h"
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
Include dependency graph for flash_telecommand_defs.c:

Functions

uint8_t TCMDEXEC_flash_activate_each_cs (const char *args_str, char *response_output_buf, uint16_t response_output_buf_len)
 Telecommand: Read bytes as hex from a flash address.
 
uint8_t TCMDEXEC_flash_each_is_reachable (const char *args_str, char *response_output_buf, uint16_t response_output_buf_len)
 Telecommand: Read bytes as hex from a flash address.
 
uint8_t TCMDEXEC_flash_read_hex (const char *args_str, char *response_output_buf, uint16_t response_output_buf_len)
 Telecommand: Read bytes as hex from a page number.
 
uint8_t TCMDEXEC_flash_write_hex (const char *args_str, char *response_output_buf, uint16_t response_output_buf_len)
 Telecommand: Write a hex string of bytes to a page number.
 
uint8_t TCMDEXEC_flash_erase (const char *args_str, char *response_output_buf, uint16_t response_output_buf_len)
 Telecommand: Erase a block of flash memory containing the given page number.
 
uint8_t TCMDEXEC_flash_benchmark_erase_write_read (const char *args_str, char *response_output_buf, uint16_t response_output_buf_len)
 Telecommand: Benchmarks the erase/write/read operations on the flash memory module.
 
uint8_t TCMDEXEC_flash_reset (const char *args_str, char *response_output_buf, uint16_t response_output_buf_len)
 Telecommand: Reset the flash memory module.
 
uint8_t TCMDEXEC_flash_read_status_register (const char *args_str, char *response_output_buf, uint16_t response_output_buf_len)
 Telecommand: Read and print Status Register value as hex from the flash memory module.
 
uint8_t TCMDEXEC_flash_write_enable (const char *args_str, char *response_output_buf, uint16_t response_output_buf_len)
 Telecommand: Set the write enable lath to high on the flash memory module.
 

Variables

uint8_t read_buf [FLASH_MAX_BYTES_PER_PAGE]
 
uint8_t bytes_to_write [FLASH_MAX_BYTES_PER_PAGE]
 

Function Documentation

◆ TCMDEXEC_flash_activate_each_cs()

uint8_t TCMDEXEC_flash_activate_each_cs ( const char * args_str,
char * response_output_buf,
uint16_t response_output_buf_len )

Telecommand: Read bytes as hex from a flash address.

Parameters
args_strNo args.
Returns
0 always
Here is the call graph for this function:

◆ TCMDEXEC_flash_benchmark_erase_write_read()

uint8_t TCMDEXEC_flash_benchmark_erase_write_read ( const char * args_str,
char * response_output_buf,
uint16_t response_output_buf_len )

Telecommand: Benchmarks the erase/write/read operations on the flash memory module.

Parameters
args_str
  • Arg 0: Chip Number (CS number) as uint
  • Arg 1: Test Data Address as uint
  • Arg 2: Test Data Length as uint
Returns
0 on success, >0 on error
Here is the call graph for this function:

◆ TCMDEXEC_flash_each_is_reachable()

uint8_t TCMDEXEC_flash_each_is_reachable ( const char * args_str,
char * response_output_buf,
uint16_t response_output_buf_len )

Telecommand: Read bytes as hex from a flash address.

Parameters
args_strNo args.
Returns
0 always
Here is the call graph for this function:

◆ TCMDEXEC_flash_erase()

uint8_t TCMDEXEC_flash_erase ( const char * args_str,
char * response_output_buf,
uint16_t response_output_buf_len )

Telecommand: Erase a block of flash memory containing the given page number.

Parameters
args_str
  • Arg 0: Chip Number (CS number) as uint
  • Arg 1: Page number as uint
Returns
0 on success, >0 on error
Here is the call graph for this function:

◆ TCMDEXEC_flash_read_hex()

uint8_t TCMDEXEC_flash_read_hex ( const char * args_str,
char * response_output_buf,
uint16_t response_output_buf_len )

Telecommand: Read bytes as hex from a page number.

Parameters
args_str
  • Arg 0: Chip Number (CS number) as uint
  • Arg 1: Page number as uint
  • Arg 2: Number of bytes to read as uint
Returns
0 on success, >0 on error
Here is the call graph for this function:

◆ TCMDEXEC_flash_read_status_register()

uint8_t TCMDEXEC_flash_read_status_register ( const char * args_str,
char * response_output_buf,
uint16_t response_output_buf_len )

Telecommand: Read and print Status Register value as hex from the flash memory module.

Parameters
args_str
  • Arg 0: Chip Number (CS number) as uint
Returns
0 on success, >0 on error
Here is the call graph for this function:

◆ TCMDEXEC_flash_reset()

uint8_t TCMDEXEC_flash_reset ( const char * args_str,
char * response_output_buf,
uint16_t response_output_buf_len )

Telecommand: Reset the flash memory module.

Parameters
args_str
  • Arg 0: Chip Number (CS number) as uint
Returns
0 on success, >0 on error
Here is the call graph for this function:

◆ TCMDEXEC_flash_write_enable()

uint8_t TCMDEXEC_flash_write_enable ( const char * args_str,
char * response_output_buf,
uint16_t response_output_buf_len )

Telecommand: Set the write enable lath to high on the flash memory module.

Parameters
args_str
  • Arg 0: Chip Number (CS number) as uint
Returns
0 on success, >0 on error
Here is the call graph for this function:

◆ TCMDEXEC_flash_write_hex()

uint8_t TCMDEXEC_flash_write_hex ( const char * args_str,
char * response_output_buf,
uint16_t response_output_buf_len )

Telecommand: Write a hex string of bytes to a page number.

Parameters
args_str
  • Arg 0: Chip Number (CS number) as uint
  • Arg 1: Page number as uint
  • Arg 2: Hex string of bytes to write (any case, allows space/underscore separators)
Returns
0 on success, >0 on error
Here is the call graph for this function:

Variable Documentation

◆ bytes_to_write

uint8_t bytes_to_write[FLASH_MAX_BYTES_PER_PAGE]

◆ read_buf

uint8_t read_buf[FLASH_MAX_BYTES_PER_PAGE]