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

Go to the source code of this file.

Classes

struct  FLASH_SPI_Data_t
 

Enumerations

enum  FLASH_error_enum_t {
  FLASH_ERR_OK = 0 , FLASH_ERR_SPI_TRANSMIT_FAILED = -3 , FLASH_ERR_SPI_RECEIVE_FAILED = -4 , FLASH_ERR_DEVICE_BUSY_TIMEOUT = -6 ,
  FLASH_ERR_UNKNOWN = -7 , FLASH_ERR_STATUS_REG_ERROR = -8 , FLASH_ERR_SPI_TRANSMIT_TIMEOUT = -10 , FLASH_ERR_SPI_RECEIVE_TIMEOUT = -11
}
 
enum  FLASH_command_t {
  FLASH_CMD_PAGE_READ = 0x13 , FLASH_CMD_READ_FROM_CACHE = 0x03 , FLASH_CMD_PROGRAM_LOAD = 0x02 , FLASH_CMD_PROGRAM_EXECUTE = 0x10 ,
  FLASH_CMD_BLOCK_ERASE = 0xD8 , FLASH_CMD_WRITE_ENABLE = 0x06 , FLASH_CMD_WRITE_DISABLE = 0x04 , FLASH_CMD_GET_FEATURES = 0x0F ,
  FLASH_CMD_SET_FEATURES = 0x1F , FLASH_CMD_READ_ID = 0x9F , FLASH_CMD_RESET = 0xFF
}
 

Functions

FLASH_error_enum_t FLASH_SPI_send_command (const FLASH_SPI_Data_t cmd[], uint8_t chip_number)
 
FLASH_error_enum_t FLASH_SPI_send_command_with_data (const FLASH_SPI_Data_t cmd[], FLASH_SPI_Data_t *data, uint8_t chip_number)
 
FLASH_error_enum_t FLASH_SPI_send_command_receive_response (const FLASH_SPI_Data_t cmd[], uint8_t *response, uint16_t response_size, uint8_t chip_number)
 
void FLASH_SPI_enable_then_disable_chip_select (uint8_t chip_number)
 

Enumeration Type Documentation

◆ FLASH_command_t

Enumerator
FLASH_CMD_PAGE_READ 
FLASH_CMD_READ_FROM_CACHE 
FLASH_CMD_PROGRAM_LOAD 
FLASH_CMD_PROGRAM_EXECUTE 
FLASH_CMD_BLOCK_ERASE 
FLASH_CMD_WRITE_ENABLE 
FLASH_CMD_WRITE_DISABLE 
FLASH_CMD_GET_FEATURES 
FLASH_CMD_SET_FEATURES 
FLASH_CMD_READ_ID 
FLASH_CMD_RESET 

◆ FLASH_error_enum_t

Enumerator
FLASH_ERR_OK 
FLASH_ERR_SPI_TRANSMIT_FAILED 
FLASH_ERR_SPI_RECEIVE_FAILED 
FLASH_ERR_DEVICE_BUSY_TIMEOUT 
FLASH_ERR_UNKNOWN 
FLASH_ERR_STATUS_REG_ERROR 
FLASH_ERR_SPI_TRANSMIT_TIMEOUT 
FLASH_ERR_SPI_RECEIVE_TIMEOUT 

Function Documentation

◆ FLASH_SPI_enable_then_disable_chip_select()

void FLASH_SPI_enable_then_disable_chip_select ( uint8_t chip_number)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLASH_SPI_send_command()

FLASH_error_enum_t FLASH_SPI_send_command ( const FLASH_SPI_Data_t cmd[],
uint8_t chip_number )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLASH_SPI_send_command_receive_response()

FLASH_error_enum_t FLASH_SPI_send_command_receive_response ( const FLASH_SPI_Data_t cmd[],
uint8_t * response,
uint16_t response_size,
uint8_t chip_number )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLASH_SPI_send_command_with_data()

FLASH_error_enum_t FLASH_SPI_send_command_with_data ( const FLASH_SPI_Data_t cmd[],
FLASH_SPI_Data_t * data,
uint8_t chip_number )
Here is the call graph for this function:
Here is the caller graph for this function: