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

Go to the source code of this file.

Classes

struct  FLASH_Physical_Address_t
 

Macros

#define FLASH_NUMBER_OF_FLASH_DEVICES   8
 
#define FLASH_CHIP_SIZE_BYTES   134217728
 
#define FLASH_CHIP_PAGES_PER_BLOCK   64
 
#define FLASH_CHIP_PAGE_SIZE_BYTES   2048
 
#define FLASH_CHIP_BLOCK_SIZE_BYTES   (FLASH_CHIP_PAGE_SIZE_BYTES * FLASH_CHIP_PAGES_PER_BLOCK)
 

Enumerations

enum  FLASH_FEATURE_REGISTER_ADDR { FLASH_FEAT_BLOCK_LOCK = 0xA0 , FLASH_FEAT_CONFIG = 0xB0 , FLASH_FEAT_STATUS = 0xC0 , FLASH_FEAT_DIE_SELECT = 0xD0 }
 
enum  FLASH_Feat_State_Enum_t { FLASH_FEAT_STATE_ENABLED = 0x01 , FLASH_FEAT_STATE_DISABLED = 0x00 }
 

Functions

FLASH_error_enum_t FLASH_init (uint8_t chip_number)
 
FLASH_error_enum_t FLASH_read_status_register (uint8_t chip_number, uint8_t *response)
 
FLASH_error_enum_t FLASH_erase_block (uint8_t chip_number, FLASH_Physical_Address_t address)
 
FLASH_error_enum_t FLASH_program_page (uint8_t chip_number, FLASH_Physical_Address_t address, uint8_t *data, uint32_t data_len)
 
FLASH_error_enum_t FLASH_read_page (uint8_t chip_number, FLASH_Physical_Address_t address, uint8_t *rx_buffer, uint32_t rx_buffer_size)
 
FLASH_error_enum_t FLASH_is_reachable (uint8_t chip_number)
 
FLASH_error_enum_t FLASH_reset (uint8_t chip_number)
 
void FLASH_enable_then_disable_chip_select (uint8_t chip_number)
 Here for testing purposes.
 

Variables

static const uint8_t FLASH_OP_IN_PROGRESS_MASK = (1 << 0)
 
static const uint8_t FLASH_SR1_WRITE_ENABLE_LATCH_MASK = (1 << 1)
 
static const uint8_t FLASH_SR1_PROGRAMMING_ERROR_MASK = (1 << 3)
 
static const uint8_t FLASH_SR1_ERASE_ERROR_MASK = (1 << 2)
 

Macro Definition Documentation

◆ FLASH_CHIP_BLOCK_SIZE_BYTES

#define FLASH_CHIP_BLOCK_SIZE_BYTES   (FLASH_CHIP_PAGE_SIZE_BYTES * FLASH_CHIP_PAGES_PER_BLOCK)

◆ FLASH_CHIP_PAGE_SIZE_BYTES

#define FLASH_CHIP_PAGE_SIZE_BYTES   2048

◆ FLASH_CHIP_PAGES_PER_BLOCK

#define FLASH_CHIP_PAGES_PER_BLOCK   64

◆ FLASH_CHIP_SIZE_BYTES

#define FLASH_CHIP_SIZE_BYTES   134217728

◆ FLASH_NUMBER_OF_FLASH_DEVICES

#define FLASH_NUMBER_OF_FLASH_DEVICES   8

Enumeration Type Documentation

◆ FLASH_Feat_State_Enum_t

Enumerator
FLASH_FEAT_STATE_ENABLED 
FLASH_FEAT_STATE_DISABLED 

◆ FLASH_FEATURE_REGISTER_ADDR

Enumerator
FLASH_FEAT_BLOCK_LOCK 
FLASH_FEAT_CONFIG 
FLASH_FEAT_STATUS 
FLASH_FEAT_DIE_SELECT 

Function Documentation

◆ FLASH_enable_then_disable_chip_select()

void FLASH_enable_then_disable_chip_select ( uint8_t chip_number)

Here for testing purposes.

Parameters
chip_numberthe chip select line to enable.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLASH_erase_block()

FLASH_error_enum_t FLASH_erase_block ( uint8_t chip_number,
FLASH_Physical_Address_t address )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLASH_init()

FLASH_error_enum_t FLASH_init ( uint8_t chip_number)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLASH_is_reachable()

FLASH_error_enum_t FLASH_is_reachable ( uint8_t chip_number)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLASH_program_page()

FLASH_error_enum_t FLASH_program_page ( uint8_t chip_number,
FLASH_Physical_Address_t address,
uint8_t * data,
uint32_t data_len )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLASH_read_page()

FLASH_error_enum_t FLASH_read_page ( uint8_t chip_number,
FLASH_Physical_Address_t address,
uint8_t * rx_buffer,
uint32_t rx_buffer_size )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLASH_read_status_register()

FLASH_error_enum_t FLASH_read_status_register ( uint8_t chip_number,
uint8_t * response )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FLASH_reset()

FLASH_error_enum_t FLASH_reset ( uint8_t chip_number)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ FLASH_OP_IN_PROGRESS_MASK

const uint8_t FLASH_OP_IN_PROGRESS_MASK = (1 << 0)
static

◆ FLASH_SR1_ERASE_ERROR_MASK

const uint8_t FLASH_SR1_ERASE_ERROR_MASK = (1 << 2)
static

◆ FLASH_SR1_PROGRAMMING_ERROR_MASK

const uint8_t FLASH_SR1_PROGRAMMING_ERROR_MASK = (1 << 3)
static

◆ FLASH_SR1_WRITE_ENABLE_LATCH_MASK

const uint8_t FLASH_SR1_WRITE_ENABLE_LATCH_MASK = (1 << 1)
static