Go to the source code of this file.
|static void||flashfsAdvanceTailInBuffer (uint32_t delta)|
|static bool||flashfsBufferIsEmpty ()|
|static void||flashfsClearBuffer ()|
|void||flashfsEraseRange (uint32_t start, uint32_t end)|
|static void||flashfsGetDirtyDataBuffers (uint8_t const *buffers, uint32_t bufferSizes)|
|const flashGeometry_t *||flashfsGetGeometry ()|
|int||flashfsReadAbs (uint32_t address, uint8_t *buffer, unsigned int len)|
|void||flashfsSeekAbs (uint32_t offset)|
|void||flashfsSeekRel (int32_t offset)|
|static void||flashfsSetTailAddress (uint32_t address)|
|static uint32_t||flashfsTransmitBufferUsed ()|
|void||flashfsWrite (const uint8_t *data, unsigned int len, bool sync)|
|static uint32_t||flashfsWriteBuffers (uint8_t const **buffers, uint32_t *bufferSizes, int bufferCount, bool sync)|
|void||flashfsWriteByte (uint8_t byte)|
|static uint8_t||bufferHead = 0|
|static uint8_t||bufferTail = 0|
|static uint8_t||flashWriteBuffer [FLASHFS_WRITE_BUFFER_SIZE]|
|static uint32_t||tailAddress = 0|
Called after bytes have been written from the buffer to advance the position of the tail by the given amount.
Definition at line 290 of file drv_flashfs.c.
Definition at line 62 of file drv_flashfs.c.
Definition at line 57 of file drv_flashfs.c.
Definition at line 72 of file drv_flashfs.c.
Start and end must lie on sector boundaries, or they will be rounded out to sector boundaries such that all the bytes in the range [start...end) are erased.
Definition at line 85 of file drv_flashfs.c.
If the flash is ready to accept writes, flush the buffer to it.
Returns true if all data in the buffer has been flushed to the device, or false if there is still data to be written (call flush again later).
Definition at line 310 of file drv_flashfs.c.
Wait for the flash to become ready and begin flushing any buffered data to flash.
The flash will still be busy some time after this sync completes, but space will be freed up to accept more writes in the write buffer.
Definition at line 333 of file drv_flashfs.c.
Definition at line 258 of file drv_flashfs.c.
|const flashGeometry_t* flashfsGetGeometry||(||)|
Definition at line 145 of file drv_flashfs.c.
Get the current offset of the file pointer within the volume.
Definition at line 275 of file drv_flashfs.c.
Definition at line 116 of file drv_flashfs.c.
Get the number of bytes that can currently be written to flashfs without any blocking or data loss.
Definition at line 140 of file drv_flashfs.c.
Get the size of the largest single write that flashfs could ever accept without blocking or data loss.
Definition at line 132 of file drv_flashfs.c.
Find the offset of the start of the free space on the device (or the size of the device if it is full).
Definition at line 489 of file drv_flashfs.c.
Call after initializing the flash chip in order to set up the filesystem.
Definition at line 565 of file drv_flashfs.c.
Returns true if the file pointer is at the end of the device.
Definition at line 558 of file drv_flashfs.c.
Return true if the flash is not currently occupied with an operation.
Definition at line 111 of file drv_flashfs.c.
len bytes from the given address into the supplied buffer.
Returns the number of bytes actually read which may be less than that requested.
Definition at line 468 of file drv_flashfs.c.
Definition at line 349 of file drv_flashfs.c.
Definition at line 356 of file drv_flashfs.c.
Definition at line 67 of file drv_flashfs.c.
Definition at line 121 of file drv_flashfs.c.
|void flashfsWrite||(||const uint8_t *||data,|
Write the given buffer to the flash either synchronously or asynchronously depending on the 'sync' parameter.
If writing asynchronously, data will be silently discarded if the buffer overflows. If writing synchronously, the routine will block waiting for the flash to become ready so will never drop data.
Definition at line 385 of file drv_flashfs.c.
Write the given buffers to flash sequentially at the current tail address, advancing the tail address after each write.
In synchronous mode, waits for the flash to become ready before writing so that every byte requested can be written.
In asynchronous mode, if the flash is busy, then the write is aborted and the routine returns immediately. In this case the returned number of bytes written will be less than the total amount requested.
Modifies the supplied buffer pointers and sizes to reflect how many bytes remain in each of them.
bufferCount: the number of buffers provided buffers: an array of pointers to the beginning of buffers bufferSizes: an array of the sizes of those buffers sync: true if we should wait for the device to be idle before writes, otherwise if the device is busy the write will be aborted and this routine will return immediately.
Returns the number of bytes written
Definition at line 169 of file drv_flashfs.c.
Write the given byte asynchronously to the flash. If the buffer overflows, data is silently discarded.
Definition at line 366 of file drv_flashfs.c.
Definition at line 52 of file drv_flashfs.c.
Definition at line 52 of file drv_flashfs.c.
This provides a stream interface to a flash chip if one is present.
On statup, call flashfsInit() after initialising the flash chip in order to init the filesystem. This will result in the file pointer being pointed at the first free block found, or at the end of the device if the flash chip is full.
Note that bits can only be set to 0 when writing, not back to 1 from 0. You must erase sectors in order to bring bits back to 1 again.
In future, we can add support for multiple different flash chips by adding a flash device driver vtable and make calls through that, at the moment flashfs just calls m25p16_* routines explicitly.
Definition at line 43 of file drv_flashfs.c.
Definition at line 55 of file drv_flashfs.c.