Driver for CC3000 Wi-Fi module

Dependencies:   NVIC_set_all_priorities

Dependents:   CC3000_Simple_Socket Wi-Go_IOT_Demo

Embed: (wiki syntax)

« Back to documentation index

Nvmem

Nvmem

Functions

signed long nvmem_read (unsigned long file_id, unsigned long length, unsigned long offset, unsigned char *buff)
 Read 'length' data at offset 'ulOffset' from nvmem to file 'ulFileId'.
signed long nvmem_write (unsigned long ulFileId, unsigned long ulLength, unsigned long ulEntryOffset, unsigned char *buff)
 Write 'length' data at offset 'ulOffset' from file 'ulFileId' to nvmem.
unsigned char nvmem_set_mac_address (unsigned char *mac)
 Write the MAC address to EEPROM (OUI first)
unsigned char nvmem_get_mac_address (unsigned char *mac)
 Read the MAC address from EEPROM (OUI first)
unsigned char nvmem_write_patch (unsigned long ulFileId, unsigned long spLength, const unsigned char *spData)
 Write patch code to a specific file ID.
unsigned char nvmem_read_sp_version (unsigned char *patchVer)
 Read the patch version.
signed long nvmem_create_entry (unsigned long file_id, unsigned long newlen)
 Create a new file entry and allocate space in NVMEM.

Function Documentation

signed long nvmem_create_entry ( unsigned long  file_id,
unsigned long  newlen 
)

Create a new file entry and allocate space in 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.

Parameters:
ulFileIdPossible nvmem file Ids:
* NVMEM_AES128_KEY_FILEID: 12
* NVMEM_SHARED_MEM_FILEID: 13
* and fileIDs 14 and 15
ulNewLenentry ulLength
Returns:
0 on success, error otherwise.

Definition at line 161 of file nvmem.cpp.

unsigned char nvmem_get_mac_address ( unsigned char *  mac )

Read the MAC address from EEPROM (OUI first)

Parameters:
[out]macmac address
Returns:
on success 0, error otherwise.

Definition at line 101 of file nvmem.cpp.

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

Read 'length' data at offset 'ulOffset' from nvmem to file 'ulFileId'.

Parameters:
ulFileIdPossible nvmem file id values:
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.
Error conditions : file can't be used
file is invalid
read out of bounds.

Definition at line 39 of file nvmem.cpp.

unsigned char nvmem_read_sp_version ( unsigned char *  patchVer )

Read the patch version.

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

Parameters:
[out]patchVerfirst number indicates package ID and the second number indicates package build number
Returns:
0 on success, error otherwise.

Definition at line 138 of file nvmem.cpp.

unsigned char nvmem_set_mac_address ( unsigned char *  mac )

Write the MAC address to EEPROM (OUI first)

Parameters:
macmac address to be set
Returns:
0 on success, error otherwise.

Definition at line 95 of file nvmem.cpp.

signed long nvmem_write ( unsigned long  ulFileId,
unsigned long  ulLength,
unsigned long  ulEntryOffset,
unsigned char *  buff 
)

Write 'length' data at offset 'ulOffset' from file 'ulFileId' to nvmem.

The file id is marked as invalid until writing is ended.
The file entry doesn't need to be valid - only allocated.

Parameters:
ulFileIdPossible nvmem file id values:
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:
0 on success, error otherwise.

Definition at line 66 of file nvmem.cpp.

unsigned char nvmem_write_patch ( unsigned long  ulFileId,
unsigned long  spLength,
const unsigned char *  spData 
)

Write patch code to a specific file ID.

Each write contains SP_PORTION_SIZE bytes.

Parameters:
ulFileIdPossible nvmem file id values:
NVMEM_WLAN_DRIVER_SP_FILEID, NVMEM_WLAN_FW_SP_FILEID,
spLengthnumber of bytes to write
spDataSP data to write
Returns:
0 on success, error otherwise.

Definition at line 107 of file nvmem.cpp.