SimpleLink API Reference Manual  1.11.1
 All Data Structures Files Functions Variables Typedefs Macros Groups
Nvmem_api

Macros

#define NVMEM_NVS_FILEID   (0)
 
#define NVMEM_NVS_SHADOW_FILEID   (1)
 
#define NVMEM_WLAN_CONFIG_FILEID   (2)
 
#define NVMEM_WLAN_CONFIG_SHADOW_FILEID   (3)
 
#define NVMEM_WLAN_DRIVER_SP_FILEID   (4)
 
#define NVMEM_WLAN_FW_SP_FILEID   (5)
 
#define NVMEM_MAC_FILEID   (6)
 
#define NVMEM_FRONTEND_VARS_FILEID   (7)
 
#define NVMEM_IP_CONFIG_FILEID   (8)
 
#define NVMEM_IP_CONFIG_SHADOW_FILEID   (9)
 
#define NVMEM_BOOTLOADER_SP_FILEID   (10)
 
#define NVMEM_RM_FILEID   (11)
 
#define NVMEM_AES128_KEY_FILEID   (12)
 
#define NVMEM_SHARED_MEM_FILEID   (13)
 
#define NVMEM_MAX_ENTRY   (16)
 

Functions

signed long nvmem_read (unsigned long file_id, unsigned long length, unsigned long offset, unsigned char *buff)
 Reads data from the file referred by the ulFileId parameter. Reads data from file ulOffset till length. Err if the file can't be used, is invalid, or if the read is out of bounds.
 
signed long nvmem_write (unsigned long ulFileId, unsigned long ulLength, unsigned long ulEntryOffset, unsigned char *buff)
 Write data to nvmem. writes data to file referred by the ulFileId parameter. Writes data to file ulOffset till ulLength.The file id will be marked invalid till the write is done. The file entry doesn't need to be valid - only allocated.
 
unsigned char nvmem_set_mac_address (unsigned char *mac)
 Write MAC address to EEPROM. mac address as appears over the air (OUI first)
 
unsigned char nvmem_get_mac_address (unsigned char *mac)
 Read MAC address from EEPROM. mac address as appears over the air (OUI first)
 
unsigned char nvmem_write_patch (unsigned long ulFileId, unsigned long spLength, const unsigned char *spData)
 program a patch to a specific file ID. The SP data is assumed to be organized in 2-dimensional. Each line is SP_PORTION_SIZE bytes long. Actual programming is applied in SP_PORTION_SIZE bytes portions.
 
unsigned char nvmem_read_sp_version (unsigned char *patchVer)
 Read patch version. read package version (WiFi FW patch, driver-supplicant-NS patch, bootloader patch)
 
signed long nvmem_create_entry (unsigned long file_id, unsigned long newlen)
 Create new file entry and allocate space on the NVMEM. Applies only to user files. Modify the size of file. If the entry is unallocated - allocate it to size ulNewLen (marked invalid). If it is allocated then deallocate it first. To just mark the file as invalid without resizing - set ulNewLen=0.
 

Detailed Description

Macro Definition Documentation

#define NVMEM_NVS_FILEID   (0)

Definition at line 65 of file nvmem.h.

#define NVMEM_NVS_SHADOW_FILEID   (1)

Definition at line 66 of file nvmem.h.

#define NVMEM_WLAN_CONFIG_FILEID   (2)

Definition at line 67 of file nvmem.h.

#define NVMEM_WLAN_CONFIG_SHADOW_FILEID   (3)

Definition at line 68 of file nvmem.h.

#define NVMEM_WLAN_DRIVER_SP_FILEID   (4)

Definition at line 69 of file nvmem.h.

#define NVMEM_WLAN_FW_SP_FILEID   (5)

Definition at line 70 of file nvmem.h.

#define NVMEM_MAC_FILEID   (6)

Definition at line 71 of file nvmem.h.

#define NVMEM_FRONTEND_VARS_FILEID   (7)

Definition at line 72 of file nvmem.h.

#define NVMEM_IP_CONFIG_FILEID   (8)

Definition at line 73 of file nvmem.h.

#define NVMEM_IP_CONFIG_SHADOW_FILEID   (9)

Definition at line 74 of file nvmem.h.

#define NVMEM_BOOTLOADER_SP_FILEID   (10)

Definition at line 75 of file nvmem.h.

#define NVMEM_RM_FILEID   (11)

Definition at line 76 of file nvmem.h.

#define NVMEM_AES128_KEY_FILEID   (12)

Definition at line 79 of file nvmem.h.

#define NVMEM_SHARED_MEM_FILEID   (13)

Definition at line 80 of file nvmem.h.

#define NVMEM_MAX_ENTRY   (16)

Definition at line 83 of file nvmem.h.

Function Documentation

signed long nvmem_read ( unsigned long  file_id,
unsigned long  length,
unsigned long  offset,
unsigned char *  buff 
)

Reads data from the file referred by the ulFileId parameter. Reads data from file ulOffset till length. Err if the file can't be used, is invalid, or if the read is out of bounds.

nvmem_read

Parameters
ulFileIdnvmem file id:
NVMEM_NVS_FILEID, NVMEM_NVS_SHADOW_FILEID, NVMEM_WLAN_CONFIG_FILEID, NVMEM_WLAN_CONFIG_SHADOW_FILEID, NVMEM_WLAN_DRIVER_SP_FILEID, NVMEM_WLAN_FW_SP_FILEID, NVMEM_MAC_FILEID, NVMEM_FRONTEND_VARS_FILEID, NVMEM_IP_CONFIG_FILEID, NVMEM_IP_CONFIG_SHADOW_FILEID, NVMEM_BOOTLOADER_SP_FILEID, NVMEM_RM_FILEID, and user files 12-15.
ulLengthnumber of bytes to read
ulOffsetulOffset in file from where to read
buffoutput buffer pointer
Returns
number of bytes read, otherwise error.
signed long nvmem_write ( unsigned long  ulFileId,
unsigned long  ulLength,
unsigned long  ulEntryOffset,
unsigned char *  buff 
)

Write data to nvmem. writes data to file referred by the ulFileId parameter. Writes data to file ulOffset till ulLength.The file id will be marked invalid till the write is done. The file entry doesn't need to be valid - only allocated.

nvmem_write

Parameters
ulFileIdnvmem file id:
NVMEM_WLAN_DRIVER_SP_FILEID, NVMEM_WLAN_FW_SP_FILEID, NVMEM_MAC_FILEID, NVMEM_BOOTLOADER_SP_FILEID, and user files 12-15.
ulLengthnumber of bytes to write
ulEntryOffsetoffset in file to start write operation from
buffdata to write
Returns
on success 0, error otherwise.
unsigned char nvmem_set_mac_address ( unsigned char *  mac)

Write MAC address to EEPROM. mac address as appears over the air (OUI first)

nvmem_set_mac_address

Parameters
macmac address to be set
Returns
on success 0, error otherwise.
unsigned char nvmem_get_mac_address ( unsigned char *  mac)

Read MAC address from EEPROM. mac address as appears over the air (OUI first)

nvmem_get_mac_address

Parameters
[out]macmac address
Returns
on success 0, error otherwise.
unsigned char nvmem_write_patch ( unsigned long  ulFileId,
unsigned long  spLength,
const unsigned char *  spData 
)

program a patch to a specific file ID. The SP data is assumed to be organized in 2-dimensional. Each line is SP_PORTION_SIZE bytes long. Actual programming is applied in SP_PORTION_SIZE bytes portions.

nvmem_write_patch

Parameters
ulFileIdnvmem file id:
NVMEM_WLAN_DRIVER_SP_FILEID, NVMEM_WLAN_FW_SP_FILEID,
spLengthnumber of bytes to write
spDataSP data to write
Returns
on success 0, error otherwise.
unsigned char nvmem_read_sp_version ( unsigned char *  patchVer)

Read patch version. read package version (WiFi FW patch, driver-supplicant-NS patch, bootloader patch)

nvmem_read_sp_version

Parameters
[out]patchVerfirst number indicates package ID and the second number indicates package build number
Returns
on success 0, error otherwise.
signed long nvmem_create_entry ( unsigned long  file_id,
unsigned long  newlen 
)

Create new file entry and allocate space on the NVMEM. Applies only to user files. Modify the size of file. If the entry is unallocated - allocate it to size ulNewLen (marked invalid). If it is allocated then deallocate it first. To just mark the file as invalid without resizing - set ulNewLen=0.

nvmem_create_entry

Parameters
ulFileIdnvmem file Id:
  • NVMEM_AES128_KEY_FILEID: 12
  • NVMEM_SHARED_MEM_FILEID: 13
  • and fileIDs 14 and 15
ulNewLenentry ulLength
Returns
on success 0, error otherwise.