SpiStack homogenoues memory.
More...
#include <modm/driver/storage/block_device_spistack_flash.hpp>
|
using | bd_address_t = uint32_t |
|
using | bd_size_t = uint32_t |
|
|
modm::ResumableResult< bool > | initialize () |
| Initializes the storage hardware.
|
|
modm::ResumableResult< bool > | deinitialize () |
| Deinitializes the storage hardware.
|
|
modm::ResumableResult< bool > | read (uint8_t *buffer, bd_address_t address, bd_size_t size) |
|
modm::ResumableResult< bool > | program (const uint8_t *buffer, bd_address_t address, bd_size_t size) |
|
modm::ResumableResult< bool > | erase (bd_address_t address, bd_size_t size) |
|
modm::ResumableResult< bool > | write (const uint8_t *buffer, bd_address_t address, bd_size_t size) |
|
modm::ResumableResult< bool > | isBusy () |
|
modm::ResumableResult< void > | waitWhileBusy () |
|
modm::ResumableResult< bool > | deinitialize () |
| Deinitializes the storage hardware.
|
|
modm::ResumableResult< bool > | erase (bd_address_t address, bd_size_t size) |
|
modm::ResumableResult< bool > | initialize () |
| Initializes the storage hardware.
|
|
modm::ResumableResult< bool > | program (const uint8_t *buffer, bd_address_t address, bd_size_t size) |
|
modm::ResumableResult< bool > | read (uint8_t *buffer, bd_address_t address, bd_size_t size) |
|
modm::ResumableResult< bool > | write (const uint8_t *buffer, bd_address_t address, bd_size_t size) |
|
|
static constexpr bd_size_t | BlockSizeRead = SpiBlockDevice::BlockSizeRead |
|
static constexpr bd_size_t | BlockSizeWrite = SpiBlockDevice::BlockSizeWrite |
|
static constexpr bd_size_t | BlockSizeErase = SpiBlockDevice::BlockSizeErase |
|
static constexpr bd_size_t | DieSize = SpiBlockDevice::DeviceSize |
|
static constexpr bd_size_t | DeviceSize = DieCount * DieSize |
|
static constexpr bd_size_t | BlockSizeErase = 1 |
|
static constexpr bd_size_t | BlockSizeRead = 1 |
|
static constexpr bd_size_t | BlockSizeWrite = 1 |
|
|
int8_t | getResumableDepth () const |
|
bool | isResumableRunning () const |
|
void | stopResumable () |
|
template<typename SpiBlockDevice, uint8_t DieCount>
class modm::BdSpiStackFlash< SpiBlockDevice, DieCount >
SpiStack homogenoues memory.
The read()
, erase()
,program()
and write()
methodes wait for the chip to finish writing to the flash.
- Template Parameters
-
SpiBlockDevice | Base SPI block device of the homogenous stack |
- Author
- Rasmus Kleist Hørlyck Sørensen
template<typename SpiBlockDevice , uint8_t DieCount>
modm::ResumableResult<bool> modm::BdSpiStackFlash< SpiBlockDevice, DieCount >::erase |
( |
bd_address_t |
address, |
|
|
bd_size_t |
size |
|
) |
| |
Erase blocks
The state of an erased block is undefined until it has been programmed
- Parameters
-
address | Address of block to begin erasing |
size | Size to erase in bytes (multiple of read block size) |
- Returns
- True on success
Erase blocks
The state of an erased block is undefined until it has been programmed
- Parameters
-
address | Address of block to begin erasing |
size | Size to erase in bytes (multiple of read block size) |
- Returns
- True on success
template<typename SpiBlockDevice , uint8_t DieCount>
Check if device is busy
- Returns
- True if any die in the stack is busy.
template<typename SpiBlockDevice , uint8_t DieCount>
modm::ResumableResult<bool> modm::BdSpiStackFlash< SpiBlockDevice, DieCount >::program |
( |
const uint8_t * |
buffer, |
|
|
bd_address_t |
address, |
|
|
bd_size_t |
size |
|
) |
| |
Program blocks with data
Any block has to be erased prior to being programmed
- Parameters
-
buffer | Buffer of data to write to blocks |
address | Address of first block to begin writing to |
size | Size to write in bytes (multiple of read block size) |
- Returns
- True on success
modm::ResumableResult<bool> modm::BlockDevice::program |
( |
const uint8_t * |
buffer, |
|
|
bd_address_t |
address, |
|
|
bd_size_t |
size |
|
) |
| |
|
inherited |
Program blocks with data
Any block has to be erased prior to being programmed
- Parameters
-
buffer | Buffer of data to write to blocks |
address | Address of first block to begin writing to |
size | Size to write in bytes (multiple of read block size) |
- Returns
- True on success
template<typename SpiBlockDevice , uint8_t DieCount>
modm::ResumableResult<bool> modm::BdSpiStackFlash< SpiBlockDevice, DieCount >::read |
( |
uint8_t * |
buffer, |
|
|
bd_address_t |
address, |
|
|
bd_size_t |
size |
|
) |
| |
Read data from one or more blocks
- Parameters
-
buffer | Buffer to read data into |
address | Address to begin reading from |
size | Size to read in bytes (multiple of read block size) |
- Returns
- True on success
modm::ResumableResult<bool> modm::BlockDevice::read |
( |
uint8_t * |
buffer, |
|
|
bd_address_t |
address, |
|
|
bd_size_t |
size |
|
) |
| |
|
inherited |
Read data from one or more blocks
- Parameters
-
buffer | Buffer to read data into |
address | Address to begin reading from |
size | Size to read in bytes (multiple of read block size) |
- Returns
- True on success
template<typename SpiBlockDevice , uint8_t DieCount>
This function can be used in another resumable function to wait until the flash operation is finished.
template<typename SpiBlockDevice , uint8_t DieCount>
modm::ResumableResult<bool> modm::BdSpiStackFlash< SpiBlockDevice, DieCount >::write |
( |
const uint8_t * |
buffer, |
|
|
bd_address_t |
address, |
|
|
bd_size_t |
size |
|
) |
| |
Writes data to one or more blocks after erasing them
The blocks are erased prior to being programmed
- Parameters
-
buffer | Buffer of data to write to blocks |
address | Address of first block to begin writing to |
size | Size to write in bytes (multiple of read block size) |
- Returns
- True on success
modm::ResumableResult<bool> modm::BlockDevice::write |
( |
const uint8_t * |
buffer, |
|
|
bd_address_t |
address, |
|
|
bd_size_t |
size |
|
) |
| |
|
inherited |
Writes data to one or more blocks after erasing them
The blocks are erased proir to being programmed
- Parameters
-
buffer | Buffer of data to write to blocks |
address | Address of first block to begin writing to |
size | Size to write in bytes (multiple of read block size) |
- Returns
- True on success
constexpr bd_size_t modm::BlockDevice::BlockSizeRead = 1 |
|
inheritedstaticconstexpr |
Minimum block sizes for block device operations
Most persistent storage devices require program()
, erase()
and sometimes read()
operations to be executed on fixed sized blocks.
The documentation for this class was generated from the following file:
- block_device_spistack_flash.hpp