distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
distortos::anonymous_namespace{Littlefs1FileSystem.cpp} Namespace Reference

Functions

int countUsedBlocks (void *const data, lfs1_block_t)
 Callback for lfs1_traverse() that counts block used by file system. More...
 
int errorCodeToLittlefs1Error (const int errorCode)
 Converts error code to littlefs-v1 error. More...
 
int littlefs1MemoryTechnologyDeviceErase (const lfs1_config *const configuration, const lfs1_block_t block)
 Wrapper for MemoryTechnologyDevice::erase() More...
 
int littlefs1MemoryTechnologyDeviceProgram (const lfs1_config *const configuration, const lfs1_block_t block, const lfs1_off_t offset, const void *const buffer, const lfs1_size_t size)
 Wrapper for MemoryTechnologyDevice::program() More...
 
int littlefs1MemoryTechnologyDeviceRead (const lfs1_config *const configuration, const lfs1_block_t block, const lfs1_off_t offset, void *const buffer, const lfs1_size_t size)
 Wrapper for MemoryTechnologyDevice::read() More...
 
int littlefs1MemoryTechnologyDeviceSynchronize (const lfs1_config *const configuration)
 Wrapper for MemoryTechnologyDevice::synchronize() More...
 

Variables

constexpr size_t alignment {DISTORTOS_MEMORYTECHNOLOGYDEVICE_BUFFER_ALIGNMENT}
 required buffer alignment of memory technology device More...
 
constexpr size_t alignmentMargin {alignment > 8 ? alignment - 8 : 0}
 margin between platform's biggest alignment and required buffer alignment More...
 

Function Documentation

◆ countUsedBlocks()

int distortos::anonymous_namespace{Littlefs1FileSystem.cpp}::countUsedBlocks ( void *const  data,
lfs1_block_t   
)

Callback for lfs1_traverse() that counts block used by file system.

Idea from https://github.com/ARMmbed/littlefs1/issues/1#issuecomment-355116984

Parameters
[out]datais a pointer to size_t variable with number of used blocks
Returns
always 0
Here is the caller graph for this function:

◆ errorCodeToLittlefs1Error()

int distortos::anonymous_namespace{Littlefs1FileSystem.cpp}::errorCodeToLittlefs1Error ( const int  errorCode)

Converts error code to littlefs-v1 error.

Parameters
[in]errorCodeis an error code
Returns
errorCode converted to littlefs-v1 error
Here is the caller graph for this function:

◆ littlefs1MemoryTechnologyDeviceErase()

int distortos::anonymous_namespace{Littlefs1FileSystem.cpp}::littlefs1MemoryTechnologyDeviceErase ( const lfs1_config *const  configuration,
const lfs1_block_t  block 
)

Wrapper for MemoryTechnologyDevice::erase()

Parameters
[in]configurationis a pointer to littlefs-v1 configuration
[in]blockis the index of block that will be erased
Returns
LFS1_ERR_OK on success, error code otherwise:
  • converted error codes returned by MemoryTechnologyDevice::erase();
Here is the call graph for this function:
Here is the caller graph for this function:

◆ littlefs1MemoryTechnologyDeviceProgram()

int distortos::anonymous_namespace{Littlefs1FileSystem.cpp}::littlefs1MemoryTechnologyDeviceProgram ( const lfs1_config *const  configuration,
const lfs1_block_t  block,
const lfs1_off_t  offset,
const void *const  buffer,
const lfs1_size_t  size 
)

Wrapper for MemoryTechnologyDevice::program()

Parameters
[in]configurationis a pointer to littlefs-v1 configuration
[in]blockis the index of block that will be programmed
[in]offsetis the offset of area that will be programmed, bytes
[in]bufferis the buffer with data that will be programmed
[in]sizeis the size of buffer, bytes
Returns
LFS1_ERR_OK on success, error code otherwise:
  • converted error codes returned by MemoryTechnologyDevice::program();
Here is the call graph for this function:
Here is the caller graph for this function:

◆ littlefs1MemoryTechnologyDeviceRead()

int distortos::anonymous_namespace{Littlefs1FileSystem.cpp}::littlefs1MemoryTechnologyDeviceRead ( const lfs1_config *const  configuration,
const lfs1_block_t  block,
const lfs1_off_t  offset,
void *const  buffer,
const lfs1_size_t  size 
)

Wrapper for MemoryTechnologyDevice::read()

Parameters
[in]configurationis a pointer to littlefs-v1 configuration
[in]blockis the index of block that will be read
[in]offsetis the offset of area that will be read, bytes
[out]bufferis the buffer into which the data will be read
[in]sizeis the size of buffer, bytes
Returns
LFS1_ERR_OK on success, error code otherwise:
  • converted error codes returned by MemoryTechnologyDevice::read();
Here is the call graph for this function:
Here is the caller graph for this function:

◆ littlefs1MemoryTechnologyDeviceSynchronize()

int distortos::anonymous_namespace{Littlefs1FileSystem.cpp}::littlefs1MemoryTechnologyDeviceSynchronize ( const lfs1_config *const  configuration)

Wrapper for MemoryTechnologyDevice::synchronize()

Parameters
[in]configurationis a pointer to littlefs-v1 configuration
Returns
LFS1_ERR_OK on success, error code otherwise:
  • converted error codes returned by MemoryTechnologyDevice::synchronize();
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ alignment

constexpr size_t distortos::anonymous_namespace{Littlefs1FileSystem.cpp}::alignment {DISTORTOS_MEMORYTECHNOLOGYDEVICE_BUFFER_ALIGNMENT}

required buffer alignment of memory technology device

◆ alignmentMargin

constexpr size_t distortos::anonymous_namespace{Littlefs1FileSystem.cpp}::alignmentMargin {alignment > 8 ? alignment - 8 : 0}

margin between platform's biggest alignment and required buffer alignment