![]() |
DVBCore
22.3.0
Open Source DVB Engine
|
Header file - Function prototypes for NVM database. More...
Go to the source code of this file.
Macros | |
#define | NVM_INVALID_BLOCK_ID 0xffff |
Functions | |
void | STB_InitNVMAccess (U16BIT offset) |
Initialises parameters needed for NVM block access. More... | |
void | STB_InitNVMMap (void) |
Initialises parameters needed for NVM block access (calcs num blocks if required) | |
BOOLEAN | STB_CheckNVMDatabaseIntegrity (void) |
Reads each database block from NVM and checks its checksum. If the data has already been read into the RAM cache then the data will be checked from here, but this data has been read from NVM and is an exact copy, so the check is still valid. Note: It's assumed that STB_InitNVMAccess has already been called. More... | |
void | STB_SetNVMAccessRAM (U8BIT *ram_ptr) |
Sets all DB NVM access to RAM block supplied instead of NVM (cancel if NULL). More... | |
U8BIT * | STB_GetNVMAccessRAM (void) |
Returns the current RAM pointer used for DB NVM access. More... | |
U16BIT | STB_GetNVMBlockCount (void) |
Returns total number of NVM database blocks. More... | |
U16BIT | STB_GetNVMBlocksUsed (void) |
Returns total number of NVM database blocks in use. More... | |
U16BIT | STB_GetNVMBlockSize (void) |
Returns the size of an NVM database block, in bytes. More... | |
U16BIT | STB_GetNVMBlocksNeeded (U16BIT size) |
Returns number of NVM database blocks needed for specified number of bytes. More... | |
U16BIT | STB_CreateNVMRecord (U8BIT rec_id, U16BIT size) |
Creates a record of the type given in NVM by overwriting invalid blocks. More... | |
void | STB_DestroyNVMRecord (U16BIT block_no) |
Destroys NVM record by marking all NVM blocks used by the record as invalid. More... | |
void | STB_SetNextNVMBlock (U16BIT block_no, U16BIT next_block) |
Repairs NVM linked list by pointing the NVM record starting at the specified block number to the record starting at the specified next block number. More... | |
U16BIT | STB_GetNextNVMBlock (U16BIT block_no) |
Returns the block number of the next NVM record pointed to by the NVM record starting at the specified block number. More... | |
U16BIT | STB_FindNVMRecordFromId (U8BIT rec_id, U16BIT last_blk) |
Finds next record of the type given in NVM. More... | |
void | STB_NVMChanged (BOOLEAN state) |
void | STB_NVMFlushCache (BOOLEAN clear) |
Flush cached changes. More... | |
void | STB_NVMSave (void) |
Saves the RAM cache data to NVM. | |
void | STB_SetNVMRecordString (U16BIT block_no, U16BIT offset, U16BIT size, U8BIT *string) |
Writes the specified value into a field of a NVM record. More... | |
void | STB_SetNVMRecordNumber (U16BIT block_no, U16BIT offset, U16BIT size, U32BIT value) |
Writes the specified value into a field of a NVM record. More... | |
U8BIT * | STB_GetNVMRecordString (U16BIT block_no, U16BIT offset, U16BIT size) |
Reads string of a field from a NVM record. More... | |
U32BIT | STB_GetNVMRecordNumber (U16BIT block_no, U16BIT offset, U16BIT size) |
Reads the specified value of a field from a NVM record. More... | |
void | STB_WriteNVMData (U16BIT offset, U16BIT size, U8BIT *data_ptr) |
Writes the given data to NVM. More... | |
BOOLEAN | STB_ReadNVMData (U16BIT offset, U16BIT size, U8BIT *data_ptr) |
Reads data from the NVM into the given buffer. More... | |
Header file - Function prototypes for NVM database.
BOOLEAN STB_CheckNVMDatabaseIntegrity | ( | void | ) |
Reads each database block from NVM and checks its checksum. If the data has already been read into the RAM cache then the data will be checked from here, but this data has been read from NVM and is an exact copy, so the check is still valid. Note: It's assumed that STB_InitNVMAccess has already been called.
U16BIT STB_CreateNVMRecord | ( | U8BIT | rec_id, |
U16BIT | size | ||
) |
Creates a record of the type given in NVM by overwriting invalid blocks.
U8BIT | rec_id - the ID of the record to be created |
U16BIT | size - the size the record to be created (in bytes) |
void STB_DestroyNVMRecord | ( | U16BIT | block_no | ) |
Destroys NVM record by marking all NVM blocks used by the record as invalid.
U16BIT | block_no - the first NVM block number of the record |
U16BIT STB_FindNVMRecordFromId | ( | U8BIT | rec_id, |
U16BIT | last_blk | ||
) |
Finds next record of the type given in NVM.
U8BIT | rec_id - the ID of the record |
U16BIT | last_blk - last block found (NVM_INVALID_BLOCK_ID if none) |
U16BIT STB_GetNextNVMBlock | ( | U16BIT | block_no | ) |
Returns the block number of the next NVM record pointed to by the NVM record starting at the specified block number.
U16BIT | block_no - the NVM block number of the current record |
U8BIT* STB_GetNVMAccessRAM | ( | void | ) |
Returns the current RAM pointer used for DB NVM access.
U16BIT STB_GetNVMBlockCount | ( | void | ) |
Returns total number of NVM database blocks.
U16BIT STB_GetNVMBlockSize | ( | void | ) |
Returns the size of an NVM database block, in bytes.
U16BIT STB_GetNVMBlocksNeeded | ( | U16BIT | size | ) |
Returns number of NVM database blocks needed for specified number of bytes.
U16BIT | size - the size (in bytes) |
U16BIT STB_GetNVMBlocksUsed | ( | void | ) |
Returns total number of NVM database blocks in use.
U32BIT STB_GetNVMRecordNumber | ( | U16BIT | block_no, |
U16BIT | offset, | ||
U16BIT | size | ||
) |
Reads the specified value of a field from a NVM record.
U16BIT | block_no - the first NVM block number of the record |
U16BIT | offset - field byte offset into the record |
U16BIT | size - field byte size in the record |
U8BIT* STB_GetNVMRecordString | ( | U16BIT | block_no, |
U16BIT | offset, | ||
U16BIT | size | ||
) |
Reads string of a field from a NVM record.
U16BIT | block_no - the first NVM block number of the record |
U16BIT | offset - field byte offset into the record |
U16BIT | size - field byte size in the record |
void STB_InitNVMAccess | ( | U16BIT | offset | ) |
Initialises parameters needed for NVM block access.
U16BIT | offset - offset to NVM blocks in bytes |
void STB_NVMFlushCache | ( | BOOLEAN | clear | ) |
Flush cached changes.
clear | TRUE clear the cache after flushing cached changes, FALSE do not clear the cache |
BOOLEAN STB_ReadNVMData | ( | U16BIT | offset, |
U16BIT | size, | ||
U8BIT * | data_ptr | ||
) |
Reads data from the NVM into the given buffer.
U16BIT | offset - byte offset from which to read the data |
U16BIT | size - number of bytes of data to read |
U8BIT* | data_ptr - address of buffer to read data into |
void STB_SetNextNVMBlock | ( | U16BIT | block_no, |
U16BIT | next_block | ||
) |
Repairs NVM linked list by pointing the NVM record starting at the specified block number to the record starting at the specified next block number.
U16BIT | block_no - the NVM block number of the current record |
U16BIT | next_block - the NVM block number of the next record |
void STB_SetNVMAccessRAM | ( | U8BIT * | ram_ptr | ) |
Sets all DB NVM access to RAM block supplied instead of NVM (cancel if NULL).
U8BIT* | ram_ptr - pointer to RAM area |
void STB_SetNVMRecordNumber | ( | U16BIT | block_no, |
U16BIT | offset, | ||
U16BIT | size, | ||
U32BIT | value | ||
) |
Writes the specified value into a field of a NVM record.
U16BIT | block_no - the first NVM block number of the record |
U16BIT | offset - field bit offset into the record |
U16BIT | size - field bit size in the record |
U32BIT | value - the numeric value of the field |
void STB_SetNVMRecordString | ( | U16BIT | block_no, |
U16BIT | offset, | ||
U16BIT | size, | ||
U8BIT * | string | ||
) |
Writes the specified value into a field of a NVM record.
U16BIT | block_no - the first NVM block number of the record |
U16BIT | offset - field bit offset into the record |
U16BIT | size - field bit size in the record |
U8BIT* | string - the string value of the field |
void STB_WriteNVMData | ( | U16BIT | offset, |
U16BIT | size, | ||
U8BIT * | data_ptr | ||
) |
Writes the given data to NVM.
U16BIT | offset - byte offset at which to write the data |
U16BIT | size - number of bytes of data to write |
U8BIT* | data_ptr - pointer to the data to be written |