erez i / cc3000_hostdriver_mbedsocket

Dependents:   cc3000_ping_demo_try_2

Fork of cc3000_hostdriver_mbedsocket by Martin Kojtal

Embed: (wiki syntax)

« Back to documentation index

cc3000_nvmem Class Reference

cc3000_nvmem Class Reference

NVMEM layer. More...

#include <cc3000.h>

Public Member Functions

 cc3000_nvmem (cc3000_hci &hci, cc3000_event &event, cc3000_simple_link &simple_link)
 Ctor.
 ~cc3000_nvmem ()
 Dtor.
int32_t read (uint32_t file_id, uint32_t length, uint32_t offset, uint8_t *buff)
 Reads data from the file referred by the file_id parameter.
int32_t write (uint32_t file_id, uint32_t length, uint32_t entry_offset, uint8_t *buff)
 Write data to nvmem.
uint8_t set_mac_address (uint8_t *mac)
 Write MAC address to EEPROM.
uint8_t get_mac_address (uint8_t *mac)
 Read MAC address from EEPROM.
uint8_t write_patch (uint32_t file_id, uint32_t length, const uint8_t *data)
 Program a patch to a specific file ID.
int32_t create_entry (uint32_t file_id, uint32_t new_len)
 Create new file entry and allocate space on the NVMEM.
uint8_t read_sp_version (uint8_t *patch_ver)
 Read patch version.

Detailed Description

NVMEM layer.

Definition at line 1244 of file cc3000.h.


Constructor & Destructor Documentation

cc3000_nvmem ( cc3000_hci hci,
cc3000_event event,
cc3000_simple_link simple_link 
)

Ctor.

Parameters:
hciReference to the hci object.
eventReference to the event object.
simple_linkReference to the simple link object.
Returns:
none

Definition at line 47 of file cc3000_nvmem.cpp.

~cc3000_nvmem (  )

Dtor.

Parameters:
none
Returns:
none

Definition at line 52 of file cc3000_nvmem.cpp.


Member Function Documentation

int32_t create_entry ( uint32_t  file_id,
uint32_t  new_len 
)

Create new file entry and allocate space on the NVMEM.

Applies only to user files.

Parameters:
file_idnvmem file Id
new_lenentry ulLength
Returns:

Definition at line 141 of file cc3000_nvmem.cpp.

uint8_t get_mac_address ( uint8_t *  mac )

Read MAC address from EEPROM.

Parameters:
macMac address
Returns:
On success 0, error otherwise.

Definition at line 112 of file cc3000_nvmem.cpp.

int32_t read ( uint32_t  file_id,
uint32_t  length,
uint32_t  offset,
uint8_t *  buff 
)

Reads data from the file referred by the file_id parameter.

Reads data from file offset till length. Err if the file can't be used, is invalid, or if the read is out of bounds.

Parameters:
file_idnvmem file id.
lengthnumber of bytes to read.
offsetoffset in file from where to read.
buffoutput buffer pointer.
Returns:
Number of bytes read, otherwise error.

Definition at line 56 of file cc3000_nvmem.cpp.

uint8_t read_sp_version ( uint8_t *  patch_ver )

Read patch version.

read package version (WiFi FW patch, river-supplicant-NS patch, bootloader patch)

Parameters:
patch_verFirst number indicates package ID and the second number indicates package build number
Returns:
On success 0, error otherwise.

Definition at line 162 of file cc3000_nvmem.cpp.

uint8_t set_mac_address ( uint8_t *  mac )

Write MAC address to EEPROM.

Parameters:
macMac address to be set
Returns:
On success 0, error otherwise.

Definition at line 108 of file cc3000_nvmem.cpp.

int32_t write ( uint32_t  file_id,
uint32_t  length,
uint32_t  entry_offset,
uint8_t *  buff 
)

Write data to nvmem.

Parameters:
file_idNvmem file id
lengthnumber of bytes to write
entry_offsetoffset in file to start write operation from
buffdata to write
Returns:
On success 0, error otherwise.

Definition at line 81 of file cc3000_nvmem.cpp.

uint8_t write_patch ( uint32_t  file_id,
uint32_t  length,
const uint8_t *  data 
)

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.

Parameters:
file_idnvmem file id/
lengthnumber of bytes to write
dataSP data to write
Returns:
On success 0, error otherwise.

Definition at line 116 of file cc3000_nvmem.cpp.