Skip to content

File SolidSyslogNorFlash.h

FileList > Core > Interface > SolidSyslogNorFlash.h

  • #include "SolidSyslogExternC.h"
  • #include <stdbool.h>
  • #include <stddef.h>

Detailed Description

The NOR flash role: a flash addressed by erase block and offset (Read / Program / Erase / GetBlockSize / GetBlockCount) beneath a SolidSyslogNorFlashBlockDevice.

These calls dispatch to the injected flash's vtable, so behaviour is that flash's.

Public Functions Documentation

SolidSyslogNorFlash_Erase

Set every byte of blockIndex to 0xFF, returning once the flash has finished.

bool SolidSyslogNorFlash_Erase (
    struct SolidSyslogNorFlash * flash,
    size_t blockIndex
) 

Return value:

  • false the flash did not carry the erase out.

SolidSyslogNorFlash_GetBlockCount

Blocks in the flash: every blockIndex it takes is below this.

size_t SolidSyslogNorFlash_GetBlockCount (
    struct SolidSyslogNorFlash * flash
) 

Fixed for the flash's lifetime.


SolidSyslogNorFlash_GetBlockSize

Bytes in a block, the unit Erase works on.

size_t SolidSyslogNorFlash_GetBlockSize (
    struct SolidSyslogNorFlash * flash
) 

Fixed for the flash's lifetime.


SolidSyslogNorFlash_Program

Program count bytes frombuffer intoblockIndex starting atoffset , returning once the flash has finished.

bool SolidSyslogNorFlash_Program (
    struct SolidSyslogNorFlash * flash,
    size_t blockIndex,
    size_t offset,
    const void * buffer,
    size_t count
) 

The span lies within the block, and may cross whatever unit the part programs in: splitting it is the implementation's work. A program clears bits and sets none, so each byte becomes its old value ANDed with the new one.

Return value:

  • false the flash did not carry the program out. A true says only that it was carried out, not that the bytes took: the caller reads back.

SolidSyslogNorFlash_Read

Read count bytes fromblockIndex starting atoffset into caller-ownedbuffer .

bool SolidSyslogNorFlash_Read (
    struct SolidSyslogNorFlash * flash,
    size_t blockIndex,
    size_t offset,
    void * buffer,
    size_t count
) 

The span lies within the block.

Return value:

  • false nothing usable was read; buffer is undefined.


The documentation for this class was generated from the following file Core/Interface/SolidSyslogNorFlash.h