![]() |
simple FS
v0.1.0
|
Interface that defines list of functions with basic operation with memory. More...
#include <memory_driver.h>
Public Attributes | |
uint8_t(* | Init )(void *hw_object, void *GPIOx, uint16_t GPIO_Pin) |
Init memory hardware peripheral. More... | |
uint16_t(* | Read )(uint32_t addr, uint8_t *buf, uint16_t n) |
Read amount data frommemory. More... | |
uint16_t(* | Write )(uint32_t addr, uint8_t *buf, int32_t n) |
Write amount of data in memory. More... | |
uint8_t(* | IsBusy )(void) |
Return state information from memory. More... | |
uint8_t(* | EraseAll )(void) |
Erase whole memory. More... | |
uint8_t(* | EraseSector )(uint32_t addr_start) |
Erase specified sector in memory. More... | |
uint8_t(* | PowerUp )(void) |
Power up memory. More... | |
uint8_t(* | PowerDown )(void) |
Power down memory. More... | |
void(* | Dump )(void) |
uint8_t(* | Capacity )(void) |
Return capacity code: More... | |
uint8_t(* | Manufacturer )(void) |
Return manufacturer code of memory: More... | |
uint8_t(* | Type )(void) |
Return type fo memory. | |
uint64_t(* | Id )(void) |
Return HW ID of used memory. More... | |
Interface that defines list of functions with basic operation with memory.
These functions must to be implemented in fina implementation of memory.
uint8_t(* MemoryDriver_t::Capacity) (void) |
Return capacity code:
EEPROM
FLASH
uint8_t(* MemoryDriver_t::EraseAll) (void) |
Erase whole memory.
This operation can be performed for several seconds.
uint8_t(* MemoryDriver_t::EraseSector) (uint32_t addr_start) |
Erase specified sector in memory.
Size of sector is hardware dependent. This operation can be performed for several seconds.
addr_start | starting address of sector. |
uint64_t(* MemoryDriver_t::Id) (void) |
Return HW ID of used memory.
uint8_t(* MemoryDriver_t::Init) (void *hw_object, void *GPIOx, uint16_t GPIO_Pin) |
Init memory hardware peripheral.
hw_object | represent pointer to used interface. SPI, I2C, UART, NULL (in simulation mode) |
GPIOx | additional HW resource. e.g. GPIOPort |
GPIO_Pin | additional HW resource. w.g. GPIOPin |
uint8_t(* MemoryDriver_t::IsBusy) (void) |
Return state information from memory.
uint8_t(* MemoryDriver_t::Manufacturer) (void) |
Return manufacturer code of memory:
uint8_t(* MemoryDriver_t::PowerDown) (void) |
Power down memory.
Only if it is supported by hardware.
uint8_t(* MemoryDriver_t::PowerUp) (void) |
Power up memory.
Only if it is supported by hardware.
uint16_t(* MemoryDriver_t::Read) (uint32_t addr, uint8_t *buf, uint16_t n) |
Read amount data frommemory.
addr | starting address for reading |
buf | pointer to array, where will data store. |
n | size of array buf |
uint16_t(* MemoryDriver_t::Write) (uint32_t addr, uint8_t *buf, int32_t n) |
Write amount of data in memory.
addr | starting address for writing |
buf | pointer to array, that will be written. |
n | size of array buf |