Files | Data Structures | Enumerations | Functions

Interface header for the non-volatile memory (NVM) More...

+ Collaboration diagram for NVM:

Files

file  BCDS_NVM.h
 

Data Structures

struct  NVM_Item_S
 meta data description of items More...
 
struct  NVM_S
 Represents an NVM object. More...
 
struct  NVM_Section_S
 meta data description of sections More...
 

Enumerations

enum  NVM_Endianness_E
 
enum  NVM_Mode_E
 
enum  NVM_Retcode_E
 return values for Nvm_read* and Nvm_write* More...
 

Functions

Retcode_T NVM_Deinitialize (const struct NVM_S *Nvm_obj)
 De-initializes the NVM interface and makes sure all items are written back to flash. More...
 
Retcode_T NVM_Flush (const struct NVM_S *Nvm_obj)
 Flush all items from an NVM internal buffer to the flash memory. More...
 
Retcode_T NVM_Initialize (struct NVM_S *Nvm_obj)
 Initializes the NVM for a certain section specified by the user and the given function parameter nvm_obj. NVM_Init() reads the section content of the flash memory and stores it in the NVM internal buffer for later read and write operations. More...
 
Retcode_T NVM_Read (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, void *Value, uint32_t Length)
 Reads an item from NVM. This function only operates on the NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_ReadInt16 (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, int16_t *Value)
 Reads an signed int8 item. This function only operates on an NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_ReadInt32 (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, int32_t *Value)
 Reads an signed int8 item. This function only operates on an NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_ReadInt64 (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, int64_t *Value)
 Reads an signed int8 item. This function only operates on an NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_ReadInt8 (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, int8_t *Value)
 Reads an signed int8 item. This function only operates on the NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_ReadUInt16 (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, uint16_t *Value)
 Reads an signed int8 item. This function only operates on an NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_ReadUInt32 (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, uint32_t *Value)
 Reads an signed int8 item. This function only operates on an NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_ReadUInt64 (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, uint64_t *Value)
 Reads an signed int8 item. This function only operates on an NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_ReadUInt8 (const struct NVM_S *nvm_obj, struct NVM_Item_S item, uint8_t *value)
 Reads an signed int8 item. This function only operates on an NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_Write (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, const void *Value, uint32_t Length)
 Writes an item to NVM. This function only operates on the NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_WriteInt16 (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, const int16_t *Value)
 Writes an unsigned uint8 item to NVM. This function only operates on an NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_WriteInt32 (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, const int32_t *Value)
 Writes an unsigned uint8 item to NVM. This function only operates on an NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_WriteInt64 (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, const int64_t *Value)
 Writes an unsigned uint8 item to NVM. This function only operates on an NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_WriteInt8 (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, const int8_t *Value)
 Writes an unsigned uint8 item to NVM. This function only operates on an NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_WriteUInt16 (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, const uint16_t *Value)
 Writes an unsigned uint8 item to NVM. This function only operates on an NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_WriteUInt32 (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, const uint32_t *Value)
 Writes an unsigned uint8 item to NVM. This function only operates on an NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_WriteUInt64 (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, const uint64_t *Value)
 Writes an unsigned uint8 item to NVM. This function only operates on an NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 
Retcode_T NVM_WriteUInt8 (const struct NVM_S *Nvm_obj, struct NVM_Item_S Item, const uint8_t *Value)
 Writes an unsigned uint8 item to NVM. This function only operates on an NVM internal buffer. In order to store the buffers content to the flash memory use NVM_Flush(). More...
 

Detailed Description


Data Structure Documentation

struct NVM_Item_S

Data Fields

enum NVM_Endianness_E endianness
 
uint32_t length_byte
 
enum NVM_Mode_E mode
 
uint8_t section_id
 
uint32_t start_address
 

Field Documentation

enum NVM_Endianness_E endianness
uint32_t length_byte
enum NVM_Mode_E mode
uint8_t section_id
uint32_t start_address

absolute start address of item

struct NVM_S
Warning
any manual modification to an instance of that struct leads to undefined behavior of the NVM
+ Collaboration diagram for NVM_S:

Data Fields

uint8_t * page_buffer
 
uint32_t page_buffer_size_byte
 
struct NVM_Section_S section
 

Field Documentation

uint8_t* page_buffer
uint32_t page_buffer_size_byte
struct NVM_Section_S section
struct NVM_Section_S

Data Fields

uint32_t length_byte
 
uint32_t page_length_byte
 
uint8_t section_id
 
uint32_t start_address
 

Field Documentation

uint32_t length_byte

length of section in bytes

uint32_t page_length_byte

length of page the section is located in

uint8_t section_id

unique section identifier

uint32_t start_address

absolute start address of section

Enumeration Type Documentation

Enumerator
NVM_ENDIANNESS_NONE 
NVM_ENDIANNESS_BIG 
NVM_ENDIANNESS_LITTLE 
enum NVM_Mode_E
Enumerator
NVM_MODE_R 
NVM_MODE_RW 
See also
BCDS_Retcode.h for generic return codes
Enumerator
NVM_RETCODE_INVALID_ITEM 
NVM_RETCODE_INVALID_BUFFER 
NVM_RETCODE_INVALID_SECTION 
NVM_RETCODE_INVALID_SIZE 
NVM_RETCODE_WRITE_FORBIDDEN 
NVM_RETCODE_INTEGRITY_FAILED 

reserved

Function Documentation

Retcode_T NVM_Deinitialize ( const struct NVM_S Nvm_obj)
Parameters
[in]nvm_objobject instance\
Returns
RETCODE_OK NVM de-initialization successful.
RETCODE_NULL_POINTER nvm_obj is a null pointer
Warning
any further usage of nvm_obj after that function call leads to undefined behavior of the NVM
Retcode_T NVM_Flush ( const struct NVM_S Nvm_obj)
Parameters
[in]nvm_objnvm object holding the used page and section specification
Returns
RETCODE_OK Flushing all items from an NVM internal buffer to the flash memory successful
RETCODE_FAILURE Flushing all items from an NVM internal buffer to the flash memory failed
In case of any other error refer #MCU_Flash_ErasePage or #MCU_Flash_Write error codes.

+ Here is the caller graph for this function:

Retcode_T NVM_Initialize ( struct NVM_S Nvm_obj)
Parameters
[in,out]nvm_objobject instance
Returns
RETCODE_OK NVM Initialization successful.
RETCODE_FAILURE NVM Initialization successful.
In case of any other error refer #MCU_Flash_Read error codes.

+ Here is the caller graph for this function:

Retcode_T NVM_Read ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
void *  Value,
uint32_t  Length 
)
Parameters
[in]nvm_objobject instance
itemidentifies an item
[out]valuemust point to a properly sized buffer
lengthlength of provided value buffer
Returns
RETCODE_OK Reading an item from NVM successful
NVM_RETCODE_INVALID_SIZE Provided buffer length does not match item length
NVM_RETCODE_INTEGRITY_FAILED The item's content is corrupt

+ Here is the caller graph for this function:

Retcode_T NVM_ReadInt16 ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
int16_t *  Value 
)
Parameters
[in]nvm_objnvm object holding the used page and section specification
[in]itemitem to be read
[out]valueread value
Returns
RETCODE_OK If the item has been read successfully
NVM_RETCODE_INVALID_SIZE If the item size is invalid
In case of any other error refer NVM_Read error codes.
Retcode_T NVM_ReadInt32 ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
int32_t *  Value 
)
Parameters
[in]nvm_objnvm object holding the used page and section specification
[in]itemitem to be read
[out]valueread value
Returns
RETCODE_OK If the item has been read successfully
NVM_RETCODE_INVALID_SIZE If the item size is invalid
In case of any other error refer NVM_Read error codes.
Retcode_T NVM_ReadInt64 ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
int64_t *  Value 
)
Parameters
[in]nvm_objnvm object holding the used page and section specification
[in]itemitem to be read
[out]valueread value
Returns
RETCODE_OK If the item has been read successfully
NVM_RETCODE_INVALID_SIZE If the item size is invalid
In case of any other error refer NVM_Read error codes.
Retcode_T NVM_ReadInt8 ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
int8_t *  Value 
)
Parameters
[in]nvm_objnvm object holding the used page and section specification
[in]itemitem to be read
[out]valueread value
Returns
RETCODE_OK If the item has been read successfully
NVM_RETCODE_INVALID_SIZE If the item size is invalid
In case of any other error refer NVM_Read error codes.
Retcode_T NVM_ReadUInt16 ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
uint16_t *  Value 
)
Parameters
[in]nvm_objnvm object holding the used page and section specification
[in]itemitem to be read
[out]valueread value
Returns
RETCODE_OK If the item has been read successfully
NVM_RETCODE_INVALID_SIZE If the item size is invalid
In case of any other error refer NVM_Read error codes.
Retcode_T NVM_ReadUInt32 ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
uint32_t *  Value 
)
Parameters
[in]nvm_objnvm object holding the used page and section specification
[in]itemitem to be read
[out]valueread value
Returns
RETCODE_OK If the item has been read successfully
NVM_RETCODE_INVALID_SIZE If the item size is invalid
In case of any other error refer NVM_Read error codes.
Retcode_T NVM_ReadUInt64 ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
uint64_t *  Value 
)
Parameters
[in]nvm_objnvm object holding the used page and section specification
[in]itemitem to be read
[out]valueread value
Returns
RETCODE_OK if the item has been read successfully
NVM_RETCODE_INVALID_SIZE If the item size is invalid
In case of any other error refer NVM_Read error codes.
Retcode_T NVM_ReadUInt8 ( const struct NVM_S nvm_obj,
struct NVM_Item_S  item,
uint8_t *  value 
)
Parameters
[in]nvm_objnvm object holding the used page and section specification
[in]itemitem to be read
[out]valueread value
Returns
RETCODE_OK If the item has been read successfully
NVM_RETCODE_INVALID_SIZE If the item size is invalid
In case of any other error refer NVM_Read error codes.

+ Here is the caller graph for this function:

Retcode_T NVM_Write ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
const void *  Value,
uint32_t  Length 
)
Parameters
[in]nvm_objobject instance
itemidentifies an item
[in]valuemust point to a properly sized buffer which includes data to be written
[in]lengthof provided value buffer, amount of bytes to be written
Returns
RETCODE_OK Writing an item from NVM successful
NVM_RETCODE_INVALID_SIZE Provided buffer length does not match item length
NVM_RETCODE_WRITE_FORBIDDEN Item is read-only
Retcode_T NVM_WriteInt16 ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
const int16_t *  Value 
)
Parameters
[in]nvm_objnvm object holding the used page and section specification
[in]itemitem specification
[in]valuedesired value to write
Returns
RETCODE_OK if the item has been successfully written
NVM_RETCODE_INVALID_SIZE If the item size is invalid
In case of any other error refer NVM_Write error codes.
Retcode_T NVM_WriteInt32 ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
const int32_t *  Value 
)
Parameters
[in]nvm_objnvm object holding the used page and section specification
[in]itemitem specification
[in]valuedesired value to write
Returns
RETCODE_OK if the item has been successfully written
NVM_RETCODE_INVALID_SIZE If the item size is invalid
In case of any other error refer NVM_Write error codes.
Retcode_T NVM_WriteInt64 ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
const int64_t *  Value 
)
Parameters
[in]nvm_objnvm object holding the used page and section specification
[in]itemitem specification
[in]valuedesired value to write
Returns
RETCODE_OK if the item has been successfully written
NVM_RETCODE_INVALID_SIZE If the item size is invalid
In case of any other error refer NVM_Write error codes.
Retcode_T NVM_WriteInt8 ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
const int8_t *  Value 
)
Parameters
[in]nvm_objnvm object holding the used page and section specification
[in]itemitem specification
[in]valuedesired value to write
Returns
RETCODE_OK if the item has been successfully written
NVM_RETCODE_INVALID_SIZE If the item size is invalid
In case of any other error refer NVM_Write error codes.
Retcode_T NVM_WriteUInt16 ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
const uint16_t *  Value 
)
Parameters
[in]nvm_objnvm object holding the used page and section specification
[in]itemitem specification
[in]valuedesired value to write
Returns
RETCODE_OK if the item has been successfully written
NVM_RETCODE_INVALID_SIZE If the item size is invalid
In case of any other error refer NVM_Write error codes.
Retcode_T NVM_WriteUInt32 ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
const uint32_t *  Value 
)
Parameters
[in]nvm_objnvm object holding the used page and section specification
[in]itemitem specification
[in]valuedesired value to write
Returns
RETCODE_OK if the item has been successfully written
NVM_RETCODE_INVALID_SIZE If the item size is invalid
In case of any other error refer NVM_Write error codes.

+ Here is the caller graph for this function:

Retcode_T NVM_WriteUInt64 ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
const uint64_t *  Value 
)
Parameters
[in]nvm_objnvm object holding the used page and section specification
[in]itemitem specification
[in]valuedesired value to write
Returns
RETCODE_OK if the item has been successfully written
NVM_RETCODE_INVALID_SIZE If the item size is invalid
In case of any other error refer NVM_Write error codes.
Retcode_T NVM_WriteUInt8 ( const struct NVM_S Nvm_obj,
struct NVM_Item_S  Item,
const uint8_t *  Value 
)
Parameters
[in]nvm_objnvm object holding the used page and section specification
[in]itemitem specification
[in]valuedesired value to write
Returns
RETCODE_OK if the item has been successfully written
NVM_RETCODE_INVALID_SIZE If the item size is invalid
In case of any other error refer NVM_Write error codes.

+ Here is the caller graph for this function:


This documentation file has been automatically generated on Fri Oct 4 2019 03:47:41 by doxygen 1.8.8