VSF Documented
Data Structures | Macros | Typedefs | Enumerations | Functions
vsf_template_flash.h File Reference
#include "./vsf_template_hal_driver.h"
#include "hal/arch/vsf_arch.h"

Go to the source code of this file.

Data Structures

struct  vsf_flash_isr_t
 
struct  vsf_flash_cfg_t
 
struct  vsf_flash_status_t
 Flash status structure that can be reimplemented in specific HAL drivers. More...
 
struct  vsf_flash_capability_t
 
struct  vsf_flash_op_t
 
struct  vsf_flash_t
 

Macros

#define VSF_FLASH_CFG_MULTI_CLASS   ENABLED
 Enable multi-class support by default for maximum availability.
 
#define VSF_FLASH_CFG_PREFIX   vsf
 Define flash hardware mask if count is defined.
 
#define VSF_FLASH_CFG_FUNCTION_RENAME   ENABLED
 Disable VSF_FLASH_CFG_FUNCTION_RENAME to use the original function names (e.g., vsf_flash_init()).
 
#define VSF_FLASH_CFG_REIMPLEMENT_TYPE_IRQ_MASK   DISABLED
 Enable option to reimplement interrupt mask type in specific hardware drivers.
 
#define VSF_FLASH_CFG_REIMPLEMENT_TYPE_FLASH_SIZE   DISABLED
 Enable option to reimplement flash size type in specific hardware drivers.
 
#define VSF_FLASH_CFG_REIMPLEMENT_TYPE_STATUS   DISABLED
 Enable option to reimplement status type in specific hardware drivers.
 
#define VSF_FLASH_CFG_REIMPLEMENT_TYPE_CFG   DISABLED
 Enable option to reimplement configuration type. For compatibility, members should not be deleted when redefining.
 
#define VSF_FLASH_CFG_REIMPLEMENT_TYPE_CAPABILITY   DISABLED
 Enable option to reimplement capability type. For compatibility, members should not be deleted when redefining.
 
#define VSF_FLASH_CFG_INHERIT_HAL_CAPABILITY   ENABLED
 Enable inheriting HAL capability to reuse common capability definitions.
 
#define VSF_FLASH_CFG_REIMPLEMENT_TYPE_CTRL   DISABLED
 In specific hardware driver, enable macro VSF_FLASH_CFG_REIMPLEMENT_TYPE_CTRL to redefine enum vsf_flash_ctrl_t.
 
#define VSF_FLASH_APIS(__prefix_name)
 

Typedefs

typedef enum vsf_flash_irq_mask_t vsf_flash_irq_mask_t
 Predefined VSF Flash interrupts that can be reimplemented in specific HAL drivers.
 
typedef uint_fast32_t vsf_flash_size_t
 
typedef struct vsf_flash_t vsf_flash_t
 Flash structure and related types for configuration.
 
typedef void vsf_flash_isr_handler_t(void *target_ptr, vsf_flash_t *flash_ptr, vsf_flash_irq_mask_t mask)
 
typedef struct vsf_flash_isr_t vsf_flash_isr_t
 
typedef struct vsf_flash_cfg_t vsf_flash_cfg_t
 
typedef struct vsf_flash_status_t vsf_flash_status_t
 Flash status structure that can be reimplemented in specific HAL drivers.
 
typedef struct vsf_flash_capability_t vsf_flash_capability_t
 
typedef enum vsf_flash_ctrl_t vsf_flash_ctrl_t
 Predefined VSF Flash control commands that can be reimplemented in specific HAL drivers.
 
typedef struct vsf_flash_op_t vsf_flash_op_t
 

Enumerations

enum  vsf_flash_irq_mask_t {
  VSF_FLASH_IRQ_ERASE_MASK = (0x1ul << 0) ,
  VSF_FLASH_IRQ_WRITE_MASK = (0x1ul << 1) ,
  VSF_FLASH_IRQ_READ_MASK = (0x1ul << 2) ,
  VSF_FLASH_IRQ_ERASE_ERROR_MASK = (0x1ul << 3) ,
  VSF_FLASH_IRQ_WRITE_ERROR_MASK = (0x1ul << 4) ,
  VSF_FLASH_IRQ_READ_ERROR_MASK = (0x1ul << 5)
}
 Predefined VSF Flash interrupts that can be reimplemented in specific HAL drivers. More...
 
enum  {
  VSF_FLASH_IRQ_COUNT = 6 ,
  VSF_FLASH_IRQ_ALL_BITS_MASK
}
 
enum  vsf_flash_ctrl_t { __VSF_FLASH_CTRL_DUMMY = 0 }
 Predefined VSF Flash control commands that can be reimplemented in specific HAL drivers. More...
 

Functions

vsf_err_t vsf_flash_init (vsf_flash_t *flash_ptr, vsf_flash_cfg_t *cfg_ptr)
 Initialize a FLASH instance.
 
void vsf_flash_fini (vsf_flash_t *flash_ptr)
 Finalize a FLASH instance.
 
vsf_err_t vsf_flash_get_configuration (vsf_flash_t *flash_ptr, vsf_flash_cfg_t *cfg_ptr)
 Get current configuration of a FLASH instance.
 
fsm_rt_t vsf_flash_enable (vsf_flash_t *flash_ptr)
 Enable a FLASH instance.
 
fsm_rt_t vsf_flash_disable (vsf_flash_t *flash_ptr)
 Disable a FLASH instance.
 
vsf_flash_status_t vsf_flash_status (vsf_flash_t *flash_ptr)
 Get the status of FLASH instance.
 
vsf_flash_capability_t vsf_flash_capability (vsf_flash_t *flash_ptr)
 Get the capabilities of FLASH instance.
 
void vsf_flash_irq_enable (vsf_flash_t *flash_ptr, vsf_flash_irq_mask_t irq_mask)
 Enable interrupt masks of FLASH instance.
 
void vsf_flash_irq_disable (vsf_flash_t *flash_ptr, vsf_flash_irq_mask_t irq_mask)
 Disable interrupt masks of FLASH instance.
 
vsf_err_t vsf_flash_erase_one_sector (vsf_flash_t *flash_ptr, vsf_flash_size_t offset_of_bytes)
 FLASH erase one sector.
 
vsf_err_t vsf_flash_erase_multi_sector (vsf_flash_t *flash_ptr, vsf_flash_size_t offset_of_bytes, vsf_flash_size_t size_of_bytes)
 Flash erase a continuous range.
 
vsf_err_t vsf_flash_erase_all (vsf_flash_t *flash_ptr)
 Flash chip erase.
 
vsf_err_t vsf_flash_write_one_sector (vsf_flash_t *flash_ptr, vsf_flash_size_t offset_of_bytes, uint8_t *buffer, vsf_flash_size_t size_of_bytes)
 Flash write one sector.
 
vsf_err_t vsf_flash_write_multi_sector (vsf_flash_t *flash_ptr, vsf_flash_size_t offset_of_bytes, uint8_t *buffer, vsf_flash_size_t size_of_bytes)
 Flash write multi sector.
 
vsf_err_t vsf_flash_read_one_sector (vsf_flash_t *flash_ptr, vsf_flash_size_t offset_of_bytes, uint8_t *buffer, vsf_flash_size_t size_of_bytes)
 flash read one sector
 
vsf_err_t vsf_flash_read_multi_sector (vsf_flash_t *flash_ptr, vsf_flash_size_t offset_of_bytes, uint8_t *buffer, vsf_flash_size_t size_of_bytes)
 flash read multi sector
 
vsf_err_t vsf_flash_ctrl (vsf_flash_t *flash_ptr, vsf_flash_ctrl_t ctrl, void *param)
 Execute a control command on the Flash instance.
 

Macro Definition Documentation

◆ VSF_FLASH_CFG_MULTI_CLASS

#define VSF_FLASH_CFG_MULTI_CLASS   ENABLED

Enable multi-class support by default for maximum availability.

◆ VSF_FLASH_CFG_PREFIX

#define VSF_FLASH_CFG_PREFIX   vsf

Define flash hardware mask if count is defined.

Define flash hardware count if mask is defined

We can redefine VSF_FLASH_CFG_PREFIX to specify a prefix to call a specific driver directly in the application code.

◆ VSF_FLASH_CFG_FUNCTION_RENAME

#define VSF_FLASH_CFG_FUNCTION_RENAME   ENABLED

Disable VSF_FLASH_CFG_FUNCTION_RENAME to use the original function names (e.g., vsf_flash_init()).

◆ VSF_FLASH_CFG_REIMPLEMENT_TYPE_IRQ_MASK

#define VSF_FLASH_CFG_REIMPLEMENT_TYPE_IRQ_MASK   DISABLED

Enable option to reimplement interrupt mask type in specific hardware drivers.

◆ VSF_FLASH_CFG_REIMPLEMENT_TYPE_FLASH_SIZE

#define VSF_FLASH_CFG_REIMPLEMENT_TYPE_FLASH_SIZE   DISABLED

Enable option to reimplement flash size type in specific hardware drivers.

◆ VSF_FLASH_CFG_REIMPLEMENT_TYPE_STATUS

#define VSF_FLASH_CFG_REIMPLEMENT_TYPE_STATUS   DISABLED

Enable option to reimplement status type in specific hardware drivers.

◆ VSF_FLASH_CFG_REIMPLEMENT_TYPE_CFG

#define VSF_FLASH_CFG_REIMPLEMENT_TYPE_CFG   DISABLED

Enable option to reimplement configuration type. For compatibility, members should not be deleted when redefining.

◆ VSF_FLASH_CFG_REIMPLEMENT_TYPE_CAPABILITY

#define VSF_FLASH_CFG_REIMPLEMENT_TYPE_CAPABILITY   DISABLED

Enable option to reimplement capability type. For compatibility, members should not be deleted when redefining.

◆ VSF_FLASH_CFG_INHERIT_HAL_CAPABILITY

#define VSF_FLASH_CFG_INHERIT_HAL_CAPABILITY   ENABLED

Enable inheriting HAL capability to reuse common capability definitions.

◆ VSF_FLASH_CFG_REIMPLEMENT_TYPE_CTRL

#define VSF_FLASH_CFG_REIMPLEMENT_TYPE_CTRL   DISABLED

In specific hardware driver, enable macro VSF_FLASH_CFG_REIMPLEMENT_TYPE_CTRL to redefine enum vsf_flash_ctrl_t.

◆ VSF_FLASH_APIS

#define VSF_FLASH_APIS (   __prefix_name)
Value:
__VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, flash, init, VSF_MCONNECT(__prefix_name, _t) *flash_ptr, vsf_flash_cfg_t *cfg_ptr) \
__VSF_HAL_TEMPLATE_API(__prefix_name, void, flash, fini, VSF_MCONNECT(__prefix_name, _t) *flash_ptr) \
__VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, flash, get_configuration, VSF_MCONNECT(__prefix_name, _t) *flash_ptr, vsf_flash_cfg_t *cfg_ptr) \
__VSF_HAL_TEMPLATE_API(__prefix_name, fsm_rt_t, flash, enable, VSF_MCONNECT(__prefix_name, _t) *flash_ptr) \
__VSF_HAL_TEMPLATE_API(__prefix_name, fsm_rt_t, flash, disable, VSF_MCONNECT(__prefix_name, _t) *flash_ptr) \
__VSF_HAL_TEMPLATE_API(__prefix_name, vsf_flash_status_t, flash, status, VSF_MCONNECT(__prefix_name, _t) *flash_ptr) \
__VSF_HAL_TEMPLATE_API(__prefix_name, vsf_flash_capability_t, flash, capability, VSF_MCONNECT(__prefix_name, _t) *flash_ptr) \
__VSF_HAL_TEMPLATE_API(__prefix_name, void, flash, irq_enable, VSF_MCONNECT(__prefix_name, _t) *flash_ptr, vsf_flash_irq_mask_t irq_mask) \
__VSF_HAL_TEMPLATE_API(__prefix_name, void, flash, irq_disable, VSF_MCONNECT(__prefix_name, _t) *flash_ptr, vsf_flash_irq_mask_t irq_mask) \
__VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, flash, erase_one_sector, VSF_MCONNECT(__prefix_name, _t) *flash_ptr, vsf_flash_size_t offset_of_bytes) \
__VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, flash, erase_multi_sector, VSF_MCONNECT(__prefix_name, _t) *flash_ptr, vsf_flash_size_t offset_of_bytes, vsf_flash_size_t size_of_bytes) \
__VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, flash, erase_all, VSF_MCONNECT(__prefix_name, _t) *flash_ptr) \
__VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, flash, write_one_sector, VSF_MCONNECT(__prefix_name, _t) *flash_ptr, vsf_flash_size_t offset_of_bytes, uint8_t* buffer, vsf_flash_size_t size_of_bytes) \
__VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, flash, write_multi_sector, VSF_MCONNECT(__prefix_name, _t) *flash_ptr, vsf_flash_size_t offset_of_bytes, uint8_t* buffer, vsf_flash_size_t size_of_bytes) \
__VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, flash, read_one_sector, VSF_MCONNECT(__prefix_name, _t) *flash_ptr, vsf_flash_size_t offset_of_bytes, uint8_t* buffer, vsf_flash_size_t size_of_bytes) \
__VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, flash, read_multi_sector, VSF_MCONNECT(__prefix_name, _t) *flash_ptr, vsf_flash_size_t offset_of_bytes, uint8_t* buffer, vsf_flash_size_t size_of_bytes) \
__VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, flash, ctrl, VSF_MCONNECT(__prefix_name, _t) *flash_ptr, vsf_flash_ctrl_t ctrl, void* param)
vsf_err_t
Definition __type.h:42
vsf_flash_irq_mask_t
Definition flash.h:69
struct VSF_MCONNECT(VSF_EXTI_CFG_IMP_PREFIX, _exti_irq_t)
Definition exti.c:54
__le16 capability
Definition ieee80211.h:134
const i_spi_t vsf_spi_irq_mask_t irq_mask
Definition spi_interface.h:38
unsigned char uint8_t
Definition stdint.h:5
Definition vsf_template_flash.h:277
Definition vsf_template_flash.h:253
Flash status structure that can be reimplemented in specific HAL drivers.
Definition flash.h:86
fsm_rt_t
Definition vsf_fsm.h:315
vsf_flash_ctrl_t
Predefined VSF Flash control commands that can be reimplemented in specific HAL drivers.
Definition vsf_template_flash.h:315
uint_fast32_t vsf_flash_size_t
Definition vsf_template_flash.h:234
#define __VSF_HAL_TEMPLATE_API
Definition vsf_template_instance_declaration.h:117
uint8_t status
Definition vsf_tgui.h:144

Typedef Documentation

◆ vsf_flash_irq_mask_t

Predefined VSF Flash interrupts that can be reimplemented in specific HAL drivers.

◆ vsf_flash_size_t

◆ vsf_flash_t

typedef struct vsf_flash_t vsf_flash_t

Flash structure and related types for configuration.

◆ vsf_flash_isr_handler_t

typedef void vsf_flash_isr_handler_t(void *target_ptr, vsf_flash_t *flash_ptr, vsf_flash_irq_mask_t mask)

◆ vsf_flash_isr_t

◆ vsf_flash_cfg_t

◆ vsf_flash_status_t

Flash status structure that can be reimplemented in specific HAL drivers.

◆ vsf_flash_capability_t

◆ vsf_flash_ctrl_t

Predefined VSF Flash control commands that can be reimplemented in specific HAL drivers.

Note
Used as the 'ctrl' parameter (second parameter) in vsf_flash_ctrl(vsf_flash_t *flash_ptr, vsf_flash_ctrl_t ctrl, void *param) function
The 'param' parameter (third parameter) type depends on the specific control command

Optional control commands require one or more enumeration options and a macro with the same name to determine if they are supported at runtime. If the feature supports more than one option, it is recommended to provide the corresponding MASK option, so that the user can check for supported features at compile-time.

◆ vsf_flash_op_t

Enumeration Type Documentation

◆ vsf_flash_irq_mask_t

Predefined VSF Flash interrupts that can be reimplemented in specific HAL drivers.

Enumerator
VSF_FLASH_IRQ_ERASE_MASK 

Erase operation complete.

VSF_FLASH_IRQ_WRITE_MASK 

Write operation complete.

VSF_FLASH_IRQ_READ_MASK 

Read operation complete.

VSF_FLASH_IRQ_ERASE_ERROR_MASK 

Erase operation error.

VSF_FLASH_IRQ_WRITE_ERROR_MASK 

Write operation error.

VSF_FLASH_IRQ_READ_ERROR_MASK 

Read operation error.

◆ anonymous enum

anonymous enum
Enumerator
VSF_FLASH_IRQ_COUNT 
VSF_FLASH_IRQ_ALL_BITS_MASK 

◆ vsf_flash_ctrl_t

Predefined VSF Flash control commands that can be reimplemented in specific HAL drivers.

Note
Used as the 'ctrl' parameter (second parameter) in vsf_flash_ctrl(vsf_flash_t *flash_ptr, vsf_flash_ctrl_t ctrl, void *param) function
The 'param' parameter (third parameter) type depends on the specific control command

Optional control commands require one or more enumeration options and a macro with the same name to determine if they are supported at runtime. If the feature supports more than one option, it is recommended to provide the corresponding MASK option, so that the user can check for supported features at compile-time.

Enumerator
__VSF_FLASH_CTRL_DUMMY 

Dummy value for compilation, required when no actual control commands are defined.

Note
This value is needed only when using the template default enum definition (VSF_FLASH_CFG_REIMPLEMENT_TYPE_CTRL == DISABLED) and all optional control commands are commented out. It ensures the enum has at least one member to avoid compilation errors with some C compilers that don't allow empty enums.
If you enable any control commands below (uncomment them), or if you redefine the enum in a specific hardware driver (VSF_FLASH_CFG_REIMPLEMENT_TYPE_CTRL == ENABLED), you can remove this DUMMY value as long as at least one actual command is defined.

Function Documentation

◆ vsf_flash_init()

vsf_err_t vsf_flash_init ( vsf_flash_t flash_ptr,
vsf_flash_cfg_t cfg_ptr 
)
extern

Initialize a FLASH instance.

Parameters
[in]flash_ptra pointer to structure vsf_flash_t
[in]cfg_ptra pointer to configuration structure vsf_flash_cfg_t
Returns
vsf_err_t: VSF_ERR_NONE if initialization successful, otherwise returns error code
Note
It is not necessary to call vsf_flash_fini() to deinitialization.
vsf_flash_init() should be called before any other FLASH API except vsf_flash_capability().

◆ vsf_flash_fini()

void vsf_flash_fini ( vsf_flash_t flash_ptr)
extern

Finalize a FLASH instance.

Parameters
[in]flash_ptra pointer to structure vsf_flash_t
Returns
none

◆ vsf_flash_get_configuration()

vsf_err_t vsf_flash_get_configuration ( vsf_flash_t flash_ptr,
vsf_flash_cfg_t cfg_ptr 
)
extern

Get current configuration of a FLASH instance.

Parameters
[in]flash_ptrPointer to FLASH instance
[out]cfg_ptrPointer to FLASH configuration structure to store current settings
Returns
vsf_err_t VSF_ERR_NONE if successful, otherwise an error code
Note
This function retrieves the current configuration of the FLASH instance

◆ vsf_flash_enable()

fsm_rt_t vsf_flash_enable ( vsf_flash_t flash_ptr)
extern

Enable a FLASH instance.

Parameters
[in]flash_ptra pointer to structure vsf_flash_t
Returns
fsm_rt_t: fsm_rt_cpl if FLASH was enabled, fsm_rt_on_going if FLASH is still enabling

◆ vsf_flash_disable()

fsm_rt_t vsf_flash_disable ( vsf_flash_t flash_ptr)
extern

Disable a FLASH instance.

Parameters
[in]flash_ptra pointer to structure vsf_flash_t
Returns
fsm_rt_t: fsm_rt_cpl if FLASH was disabled, fsm_rt_on_going if FLASH is still disabling

◆ vsf_flash_status()

vsf_flash_status_t vsf_flash_status ( vsf_flash_t flash_ptr)
extern

Get the status of FLASH instance.

Parameters
[in]flash_ptra pointer to structure vsf_flash_t
Returns
vsf_flash_status_t: All status of current FLASH vsf_flash_status_t

◆ vsf_flash_capability()

vsf_flash_capability_t vsf_flash_capability ( vsf_flash_t flash_ptr)
extern

Get the capabilities of FLASH instance.

Parameters
[in]flash_ptra pointer to structure vsf_flash_t
Returns
vsf_flash_capability_t: All capabilities of current FLASH vsf_flash_capability_t

◆ vsf_flash_irq_enable()

void vsf_flash_irq_enable ( vsf_flash_t flash_ptr,
vsf_flash_irq_mask_t  irq_mask 
)
extern

Enable interrupt masks of FLASH instance.

Parameters
[in]flash_ptra pointer to structure vsf_flash_t
[in]irq_maskone or more value of enum vsf_flash_irq_mask_t
Returns
none
Note
All pending interrupts should be cleared before interrupts are enabled.

◆ vsf_flash_irq_disable()

void vsf_flash_irq_disable ( vsf_flash_t flash_ptr,
vsf_flash_irq_mask_t  irq_mask 
)
extern

Disable interrupt masks of FLASH instance.

Parameters
[in]flash_ptra pointer to structure vsf_flash_t
[in]irq_maskone or more value of enum vsf_flash_irq_mask_t, vsf_flash_irq_mask_t
Returns
none

◆ vsf_flash_erase_one_sector()

vsf_err_t vsf_flash_erase_one_sector ( vsf_flash_t flash_ptr,
vsf_flash_size_t  offset_of_bytes 
)
extern

FLASH erase one sector.

Parameters
[in]flash_ptra pointer to structure vsf_flash_t
[in]offset_of_bytesThe address of the sector to be erased, needs to be an integer multiple of the smallest erasable sector size
Returns
vsf_err_t: VSF_ERR_NONE if FLASH starts to perform the erase, otherwise returns error code

◆ vsf_flash_erase_multi_sector()

vsf_err_t vsf_flash_erase_multi_sector ( vsf_flash_t flash_ptr,
vsf_flash_size_t  offset_of_bytes,
vsf_flash_size_t  size_of_bytes 
)
extern

Flash erase a continuous range.

Parameters
[in]flash_ptra pointer to structure vsf_flash_t
[in]offset_of_bytesThe address of the sector to be erased, needs to be an integer multiple of the smallest erasable sector size
[in]size_of_bytesSize in bytes to erase, needs to be an integer multiple of the smallest erasable sector size
Returns
vsf_err_t: VSF_ERR_NONE if flash starts to perform the erase, or a negative error code

◆ vsf_flash_erase_all()

vsf_err_t vsf_flash_erase_all ( vsf_flash_t flash_ptr)
extern

Flash chip erase.

Parameters
[in]flash_ptra pointer to structure vsf_flash_t
Returns
vsf_err_t: VSF_ERR_NONE if flash starts to perform the chip erase, or a negative error code

◆ vsf_flash_write_one_sector()

vsf_err_t vsf_flash_write_one_sector ( vsf_flash_t flash_ptr,
vsf_flash_size_t  offset_of_bytes,
uint8_t buffer,
vsf_flash_size_t  size_of_bytes 
)
extern

Flash write one sector.

Parameters
[in]flash_ptra pointer to structure vsf_flash_t
[in]offset_of_bytesAddress of the sector to be written, some flash requires an integer multiple of the smallest writable sector size
[in]buffera pointer to data
[in]size_of_bytesa pointer to data
Returns
vsf_err_t: VSF_ERR_NONE if flash starts to perform the write, or a negative error code

◆ vsf_flash_write_multi_sector()

vsf_err_t vsf_flash_write_multi_sector ( vsf_flash_t flash_ptr,
vsf_flash_size_t  offset_of_bytes,
uint8_t buffer,
vsf_flash_size_t  size_of_bytes 
)
extern

Flash write multi sector.

Parameters
[in]flash_ptra pointer to structure vsf_flash_t
[in]offset_of_bytesAddress of the sector to be written, some flash requires an integer multiple of the smallest writable sector size
[in]buffera pointer to data
[in]size_of_bytessize of data to write
Returns
vsf_err_t: VSF_ERR_NONE if flash starts to perform the write, or a negative error code

◆ vsf_flash_read_one_sector()

vsf_err_t vsf_flash_read_one_sector ( vsf_flash_t flash_ptr,
vsf_flash_size_t  offset_of_bytes,
uint8_t buffer,
vsf_flash_size_t  size_of_bytes 
)
extern

flash read one sector

Parameters
[in]flash_ptra pointer to structure vsf_flash_t
[in]offset_of_bytesAddress of the sector to be written, some flash requires an integer multiple of the smallest writable sector size
[in]buffera pointer to data
[in]size_of_bytesa pointer to data
Returns
vsf_err_t: VSF_ERR_NONE if flash starts to perform the chip erase, or a negative error code

◆ vsf_flash_read_multi_sector()

vsf_err_t vsf_flash_read_multi_sector ( vsf_flash_t flash_ptr,
vsf_flash_size_t  offset_of_bytes,
uint8_t buffer,
vsf_flash_size_t  size_of_bytes 
)
extern

flash read multi sector

Parameters
[in]flash_ptra pointer to structure vsf_flash_t
[in]offset_of_bytesAddress of the sector to be written, some flash requires an integer multiple of the smallest writable sector size
[in]buffera pointer to data
[in]size_of_bytesa pointer to data
Returns
vsf_err_t: VSF_ERR_NONE if flash starts to perform the chip erase, or a negative error code

◆ vsf_flash_ctrl()

vsf_err_t vsf_flash_ctrl ( vsf_flash_t flash_ptr,
vsf_flash_ctrl_t  ctrl,
void *  param 
)
extern

Execute a control command on the Flash instance.

Parameters
[in,out]flash_ptrPointer to Flash instance structure vsf_flash_t
[in]ctrlControl command from vsf_flash_ctrl_t enumeration
[in]paramCommand-specific parameter (can be NULL depending on command)
Returns
vsf_err_t: VSF_ERR_NONE if command executed successfully, VSF_ERR_NOT_SUPPORT if command is not supported, other error codes defined by vsf_err_t for specific failures
Note
Available commands and their parameters are hardware-dependent
Some commands may not be supported on all hardware platforms
Generated from commit: vsfteam/vsf@368bfa6