|
VSF Documented
|
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. | |
| #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 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.
| #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 | ) |
| 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.
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.
| typedef struct vsf_flash_op_t vsf_flash_op_t |
| enum vsf_flash_irq_mask_t |
Predefined VSF Flash interrupts that can be reimplemented in specific HAL drivers.
| enum vsf_flash_ctrl_t |
Predefined VSF Flash control commands that can be reimplemented in specific HAL drivers.
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.
|
extern |
Initialize a FLASH instance.
| [in] | flash_ptr | a pointer to structure vsf_flash_t |
| [in] | cfg_ptr | a pointer to configuration structure vsf_flash_cfg_t |
|
extern |
|
extern |
Get current configuration of a FLASH instance.
| [in] | flash_ptr | Pointer to FLASH instance |
| [out] | cfg_ptr | Pointer to FLASH configuration structure to store current settings |
|
extern |
Enable a FLASH instance.
| [in] | flash_ptr | a pointer to structure vsf_flash_t |
|
extern |
Disable a FLASH instance.
| [in] | flash_ptr | a pointer to structure vsf_flash_t |
|
extern |
Get the status of FLASH instance.
| [in] | flash_ptr | a pointer to structure vsf_flash_t |
|
extern |
Get the capabilities of FLASH instance.
| [in] | flash_ptr | a pointer to structure vsf_flash_t |
|
extern |
Enable interrupt masks of FLASH instance.
| [in] | flash_ptr | a pointer to structure vsf_flash_t |
| [in] | irq_mask | one or more value of enum vsf_flash_irq_mask_t |
|
extern |
Disable interrupt masks of FLASH instance.
| [in] | flash_ptr | a pointer to structure vsf_flash_t |
| [in] | irq_mask | one or more value of enum vsf_flash_irq_mask_t, vsf_flash_irq_mask_t |
|
extern |
FLASH erase one sector.
| [in] | flash_ptr | a pointer to structure vsf_flash_t |
| [in] | offset_of_bytes | The address of the sector to be erased, needs to be an integer multiple of the smallest erasable sector size |
|
extern |
Flash erase a continuous range.
| [in] | flash_ptr | a pointer to structure vsf_flash_t |
| [in] | offset_of_bytes | The address of the sector to be erased, needs to be an integer multiple of the smallest erasable sector size |
| [in] | size_of_bytes | Size in bytes to erase, needs to be an integer multiple of the smallest erasable sector size |
|
extern |
Flash chip erase.
| [in] | flash_ptr | a pointer to structure vsf_flash_t |
|
extern |
Flash write one sector.
| [in] | flash_ptr | a pointer to structure vsf_flash_t |
| [in] | offset_of_bytes | Address of the sector to be written, some flash requires an integer multiple of the smallest writable sector size |
| [in] | buffer | a pointer to data |
| [in] | size_of_bytes | a pointer to data |
|
extern |
Flash write multi sector.
| [in] | flash_ptr | a pointer to structure vsf_flash_t |
| [in] | offset_of_bytes | Address of the sector to be written, some flash requires an integer multiple of the smallest writable sector size |
| [in] | buffer | a pointer to data |
| [in] | size_of_bytes | size of data to write |
|
extern |
flash read one sector
| [in] | flash_ptr | a pointer to structure vsf_flash_t |
| [in] | offset_of_bytes | Address of the sector to be written, some flash requires an integer multiple of the smallest writable sector size |
| [in] | buffer | a pointer to data |
| [in] | size_of_bytes | a pointer to data |
|
extern |
flash read multi sector
| [in] | flash_ptr | a pointer to structure vsf_flash_t |
| [in] | offset_of_bytes | Address of the sector to be written, some flash requires an integer multiple of the smallest writable sector size |
| [in] | buffer | a pointer to data |
| [in] | size_of_bytes | a pointer to data |
|
extern |
Execute a control command on the Flash instance.
| [in,out] | flash_ptr | Pointer to Flash instance structure vsf_flash_t |
| [in] | ctrl | Control command from vsf_flash_ctrl_t enumeration |
| [in] | param | Command-specific parameter (can be NULL depending on command) |