A Port of TI's Webserver for the CC3000

Dependencies:   mbed

Committer:
dflet
Date:
Mon Sep 16 18:37:14 2013 +0000
Revision:
2:e6a185df9e4c
Parent:
0:6ad60d78b315
ADC and Leds now work on board and config.html page.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dflet 0:6ad60d78b315 1 /*****************************************************************************
dflet 0:6ad60d78b315 2 *
dflet 0:6ad60d78b315 3 * nvmem.c - CC3000 Host Driver Implementation.
dflet 0:6ad60d78b315 4 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
dflet 0:6ad60d78b315 5 *
dflet 0:6ad60d78b315 6 * Redistribution and use in source and binary forms, with or without
dflet 0:6ad60d78b315 7 * modification, are permitted provided that the following conditions
dflet 0:6ad60d78b315 8 * are met:
dflet 0:6ad60d78b315 9 *
dflet 0:6ad60d78b315 10 * Redistributions of source code must retain the above copyright
dflet 0:6ad60d78b315 11 * notice, this list of conditions and the following disclaimer.
dflet 0:6ad60d78b315 12 *
dflet 0:6ad60d78b315 13 * Redistributions in binary form must reproduce the above copyright
dflet 0:6ad60d78b315 14 * notice, this list of conditions and the following disclaimer in the
dflet 0:6ad60d78b315 15 * documentation and/or other materials provided with the
dflet 0:6ad60d78b315 16 * distribution.
dflet 0:6ad60d78b315 17 *
dflet 0:6ad60d78b315 18 * Neither the name of Texas Instruments Incorporated nor the names of
dflet 0:6ad60d78b315 19 * its contributors may be used to endorse or promote products derived
dflet 0:6ad60d78b315 20 * from this software without specific prior written permission.
dflet 0:6ad60d78b315 21 *
dflet 0:6ad60d78b315 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
dflet 0:6ad60d78b315 23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
dflet 0:6ad60d78b315 24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
dflet 0:6ad60d78b315 25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
dflet 0:6ad60d78b315 26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dflet 0:6ad60d78b315 27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
dflet 0:6ad60d78b315 28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
dflet 0:6ad60d78b315 29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
dflet 0:6ad60d78b315 30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
dflet 0:6ad60d78b315 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
dflet 0:6ad60d78b315 32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dflet 0:6ad60d78b315 33 *
dflet 0:6ad60d78b315 34 *****************************************************************************/
dflet 0:6ad60d78b315 35
dflet 0:6ad60d78b315 36 //*****************************************************************************
dflet 0:6ad60d78b315 37 //
dflet 0:6ad60d78b315 38 //! \addtogroup nvmem_api
dflet 0:6ad60d78b315 39 //! @{
dflet 0:6ad60d78b315 40 //
dflet 0:6ad60d78b315 41 //*****************************************************************************
dflet 0:6ad60d78b315 42
dflet 0:6ad60d78b315 43 #include <stdio.h>
dflet 0:6ad60d78b315 44 #include <string.h>
dflet 0:6ad60d78b315 45 #include "nvmem.h"
dflet 0:6ad60d78b315 46 #include "hci.h"
dflet 0:6ad60d78b315 47 #include "socket.h"
dflet 0:6ad60d78b315 48 #include "evnt_handler.h"
dflet 0:6ad60d78b315 49
dflet 0:6ad60d78b315 50 //*****************************************************************************
dflet 0:6ad60d78b315 51 //
dflet 0:6ad60d78b315 52 // Prototypes for the structures for APIs.
dflet 0:6ad60d78b315 53 //
dflet 0:6ad60d78b315 54 //*****************************************************************************
dflet 0:6ad60d78b315 55
dflet 0:6ad60d78b315 56 #define NVMEM_READ_PARAMS_LEN (12)
dflet 0:6ad60d78b315 57 #define NVMEM_CREATE_PARAMS_LEN (8)
dflet 0:6ad60d78b315 58 #define NVMEM_WRITE_PARAMS_LEN (16)
dflet 0:6ad60d78b315 59
dflet 0:6ad60d78b315 60 //*****************************************************************************
dflet 0:6ad60d78b315 61 //
dflet 0:6ad60d78b315 62 //! nvmem_read
dflet 0:6ad60d78b315 63 //!
dflet 0:6ad60d78b315 64 //! @param ulFileId nvmem file id:\n
dflet 0:6ad60d78b315 65 //! NVMEM_NVS_FILEID, NVMEM_NVS_SHADOW_FILEID,
dflet 0:6ad60d78b315 66 //! NVMEM_WLAN_CONFIG_FILEID, NVMEM_WLAN_CONFIG_SHADOW_FILEID,
dflet 0:6ad60d78b315 67 //! NVMEM_WLAN_DRIVER_SP_FILEID, NVMEM_WLAN_FW_SP_FILEID,
dflet 0:6ad60d78b315 68 //! NVMEM_MAC_FILEID, NVMEM_FRONTEND_VARS_FILEID,
dflet 0:6ad60d78b315 69 //! NVMEM_IP_CONFIG_FILEID, NVMEM_IP_CONFIG_SHADOW_FILEID,
dflet 0:6ad60d78b315 70 //! NVMEM_BOOTLOADER_SP_FILEID, NVMEM_RM_FILEID,
dflet 0:6ad60d78b315 71 //! and user files 12-15.
dflet 0:6ad60d78b315 72 //! @param ulLength number of bytes to read
dflet 0:6ad60d78b315 73 //! @param ulOffset ulOffset in file from where to read
dflet 0:6ad60d78b315 74 //! @param buff output buffer pointer
dflet 0:6ad60d78b315 75 //!
dflet 0:6ad60d78b315 76 //! @return number of bytes read, otherwise error.
dflet 0:6ad60d78b315 77 //!
dflet 0:6ad60d78b315 78 //! @brief Reads data from the file referred by the ulFileId parameter.
dflet 0:6ad60d78b315 79 //! Reads data from file ulOffset till length. Err if the file can't
dflet 0:6ad60d78b315 80 //! be used, is invalid, or if the read is out of bounds.
dflet 0:6ad60d78b315 81 //!
dflet 0:6ad60d78b315 82 //*****************************************************************************
dflet 0:6ad60d78b315 83
dflet 0:6ad60d78b315 84 signed long
dflet 0:6ad60d78b315 85 nvmem_read(unsigned long ulFileId, unsigned long ulLength, unsigned long ulOffset, unsigned char *buff)
dflet 0:6ad60d78b315 86 {
dflet 0:6ad60d78b315 87 unsigned char ucStatus = 0xFF;
dflet 0:6ad60d78b315 88 unsigned char *ptr;
dflet 0:6ad60d78b315 89 unsigned char *args;
dflet 0:6ad60d78b315 90
dflet 0:6ad60d78b315 91 ptr = tSLInformation.pucTxCommandBuffer;
dflet 0:6ad60d78b315 92 args = (ptr + HEADERS_SIZE_CMD);
dflet 0:6ad60d78b315 93
dflet 0:6ad60d78b315 94 // Fill in HCI packet structure
dflet 0:6ad60d78b315 95 args = UINT32_TO_STREAM(args, ulFileId);
dflet 0:6ad60d78b315 96 args = UINT32_TO_STREAM(args, ulLength);
dflet 0:6ad60d78b315 97 args = UINT32_TO_STREAM(args, ulOffset);
dflet 0:6ad60d78b315 98
dflet 0:6ad60d78b315 99 // Initiate a HCI command
dflet 0:6ad60d78b315 100 hci_command_send(HCI_CMND_NVMEM_READ, ptr, NVMEM_READ_PARAMS_LEN);
dflet 0:6ad60d78b315 101 SimpleLinkWaitEvent(HCI_CMND_NVMEM_READ, &ucStatus);
dflet 0:6ad60d78b315 102
dflet 0:6ad60d78b315 103 // In case there is data - read it - even if an error code is returned
dflet 0:6ad60d78b315 104 // Note: It is the user responsibility to ignore the data in case of an error code
dflet 0:6ad60d78b315 105
dflet 0:6ad60d78b315 106 // Wait for the data in a synchronous way. Here we assume that the buffer is
dflet 0:6ad60d78b315 107 // big enough to store also parameters of nvmem
dflet 0:6ad60d78b315 108
dflet 0:6ad60d78b315 109 SimpleLinkWaitData(buff, 0, 0);
dflet 0:6ad60d78b315 110
dflet 0:6ad60d78b315 111 return(ucStatus);
dflet 0:6ad60d78b315 112 }
dflet 0:6ad60d78b315 113
dflet 0:6ad60d78b315 114 //*****************************************************************************
dflet 0:6ad60d78b315 115 //
dflet 0:6ad60d78b315 116 //! nvmem_write
dflet 0:6ad60d78b315 117 //!
dflet 0:6ad60d78b315 118 //! @param ulFileId nvmem file id:\n
dflet 0:6ad60d78b315 119 //! NVMEM_WLAN_DRIVER_SP_FILEID, NVMEM_WLAN_FW_SP_FILEID,
dflet 0:6ad60d78b315 120 //! NVMEM_MAC_FILEID, NVMEM_BOOTLOADER_SP_FILEID,
dflet 0:6ad60d78b315 121 //! and user files 12-15.
dflet 0:6ad60d78b315 122 //! @param ulLength number of bytes to write
dflet 0:6ad60d78b315 123 //! @param ulEntryOffset offset in file to start write operation from
dflet 0:6ad60d78b315 124 //! @param buff data to write
dflet 0:6ad60d78b315 125 //!
dflet 0:6ad60d78b315 126 //! @return on success 0, error otherwise.
dflet 0:6ad60d78b315 127 //!
dflet 0:6ad60d78b315 128 //! @brief Write data to nvmem.
dflet 0:6ad60d78b315 129 //! writes data to file referred by the ulFileId parameter.
dflet 0:6ad60d78b315 130 //! Writes data to file ulOffset till ulLength.The file id will be
dflet 0:6ad60d78b315 131 //! marked invalid till the write is done. The file entry doesn't
dflet 0:6ad60d78b315 132 //! need to be valid - only allocated.
dflet 0:6ad60d78b315 133 //!
dflet 0:6ad60d78b315 134 //*****************************************************************************
dflet 0:6ad60d78b315 135
dflet 0:6ad60d78b315 136 signed long
dflet 0:6ad60d78b315 137 nvmem_write(unsigned long ulFileId, unsigned long ulLength, unsigned long
dflet 0:6ad60d78b315 138 ulEntryOffset, unsigned char *buff)
dflet 0:6ad60d78b315 139 {
dflet 0:6ad60d78b315 140 long iRes;
dflet 0:6ad60d78b315 141 unsigned char *ptr;
dflet 0:6ad60d78b315 142 unsigned char *args;
dflet 0:6ad60d78b315 143
dflet 0:6ad60d78b315 144 iRes = EFAIL;
dflet 0:6ad60d78b315 145
dflet 0:6ad60d78b315 146 ptr = tSLInformation.pucTxCommandBuffer;
dflet 0:6ad60d78b315 147 args = (ptr + SPI_HEADER_SIZE + HCI_DATA_CMD_HEADER_SIZE);
dflet 0:6ad60d78b315 148
dflet 0:6ad60d78b315 149 // Fill in HCI packet structure
dflet 0:6ad60d78b315 150 args = UINT32_TO_STREAM(args, ulFileId);
dflet 0:6ad60d78b315 151 args = UINT32_TO_STREAM(args, 12);
dflet 0:6ad60d78b315 152 args = UINT32_TO_STREAM(args, ulLength);
dflet 0:6ad60d78b315 153 args = UINT32_TO_STREAM(args, ulEntryOffset);
dflet 0:6ad60d78b315 154
dflet 0:6ad60d78b315 155 memcpy((ptr + SPI_HEADER_SIZE + HCI_DATA_CMD_HEADER_SIZE +
dflet 0:6ad60d78b315 156 NVMEM_WRITE_PARAMS_LEN),buff,ulLength);
dflet 0:6ad60d78b315 157
dflet 0:6ad60d78b315 158 // Initiate a HCI command but it will come on data channel
dflet 0:6ad60d78b315 159 hci_data_command_send(HCI_CMND_NVMEM_WRITE, ptr, NVMEM_WRITE_PARAMS_LEN,
dflet 0:6ad60d78b315 160 ulLength);
dflet 0:6ad60d78b315 161
dflet 0:6ad60d78b315 162 SimpleLinkWaitEvent(HCI_EVNT_NVMEM_WRITE, &iRes);
dflet 0:6ad60d78b315 163
dflet 0:6ad60d78b315 164 return(iRes);
dflet 0:6ad60d78b315 165 }
dflet 0:6ad60d78b315 166
dflet 0:6ad60d78b315 167
dflet 0:6ad60d78b315 168 //*****************************************************************************
dflet 0:6ad60d78b315 169 //
dflet 0:6ad60d78b315 170 //! nvmem_set_mac_address
dflet 0:6ad60d78b315 171 //!
dflet 0:6ad60d78b315 172 //! @param mac mac address to be set
dflet 0:6ad60d78b315 173 //!
dflet 0:6ad60d78b315 174 //! @return on success 0, error otherwise.
dflet 0:6ad60d78b315 175 //!
dflet 0:6ad60d78b315 176 //! @brief Write MAC address to EEPROM.
dflet 0:6ad60d78b315 177 //! mac address as appears over the air (OUI first)
dflet 0:6ad60d78b315 178 //!
dflet 0:6ad60d78b315 179 //*****************************************************************************
dflet 0:6ad60d78b315 180
dflet 0:6ad60d78b315 181 unsigned char nvmem_set_mac_address(unsigned char *mac)
dflet 0:6ad60d78b315 182 {
dflet 0:6ad60d78b315 183 return nvmem_write(NVMEM_MAC_FILEID, MAC_ADDR_LEN, 0, mac);
dflet 0:6ad60d78b315 184 }
dflet 0:6ad60d78b315 185
dflet 0:6ad60d78b315 186 //*****************************************************************************
dflet 0:6ad60d78b315 187 //
dflet 0:6ad60d78b315 188 //! nvmem_get_mac_address
dflet 0:6ad60d78b315 189 //!
dflet 0:6ad60d78b315 190 //! @param[out] mac mac address
dflet 0:6ad60d78b315 191 //!
dflet 0:6ad60d78b315 192 //! @return on success 0, error otherwise.
dflet 0:6ad60d78b315 193 //!
dflet 0:6ad60d78b315 194 //! @brief Read MAC address from EEPROM.
dflet 0:6ad60d78b315 195 //! mac address as appears over the air (OUI first)
dflet 0:6ad60d78b315 196 //!
dflet 0:6ad60d78b315 197 //*****************************************************************************
dflet 0:6ad60d78b315 198
dflet 0:6ad60d78b315 199 unsigned char nvmem_get_mac_address(unsigned char *mac)
dflet 0:6ad60d78b315 200 {
dflet 0:6ad60d78b315 201 return nvmem_read(NVMEM_MAC_FILEID, MAC_ADDR_LEN, 0, mac);
dflet 0:6ad60d78b315 202 }
dflet 0:6ad60d78b315 203
dflet 0:6ad60d78b315 204 //*****************************************************************************
dflet 0:6ad60d78b315 205 //
dflet 0:6ad60d78b315 206 //! nvmem_write_patch
dflet 0:6ad60d78b315 207 //!
dflet 0:6ad60d78b315 208 //! @param ulFileId nvmem file id:\n
dflet 0:6ad60d78b315 209 //! NVMEM_WLAN_DRIVER_SP_FILEID, NVMEM_WLAN_FW_SP_FILEID,
dflet 0:6ad60d78b315 210 //! @param spLength number of bytes to write
dflet 0:6ad60d78b315 211 //! @param spData SP data to write
dflet 0:6ad60d78b315 212 //!
dflet 0:6ad60d78b315 213 //! @return on success 0, error otherwise.
dflet 0:6ad60d78b315 214 //!
dflet 0:6ad60d78b315 215 //! @brief program a patch to a specific file ID.
dflet 0:6ad60d78b315 216 //! The SP data is assumed to be organized in 2-dimensional.
dflet 0:6ad60d78b315 217 //! Each line is SP_PORTION_SIZE bytes long. Actual programming is
dflet 0:6ad60d78b315 218 //! applied in SP_PORTION_SIZE bytes portions.
dflet 0:6ad60d78b315 219 //!
dflet 0:6ad60d78b315 220 //*****************************************************************************
dflet 0:6ad60d78b315 221
dflet 0:6ad60d78b315 222 unsigned char nvmem_write_patch(unsigned long ulFileId, unsigned long spLength, const unsigned char *spData)
dflet 0:6ad60d78b315 223 {
dflet 0:6ad60d78b315 224 unsigned char status = 0;
dflet 0:6ad60d78b315 225 unsigned short offset = 0;
dflet 0:6ad60d78b315 226 unsigned char* spDataPtr = (unsigned char*)spData;
dflet 0:6ad60d78b315 227
dflet 0:6ad60d78b315 228 while ((status == 0) && (spLength >= SP_PORTION_SIZE))
dflet 0:6ad60d78b315 229 {
dflet 0:6ad60d78b315 230 status = nvmem_write(ulFileId, SP_PORTION_SIZE, offset, spDataPtr);
dflet 0:6ad60d78b315 231 offset += SP_PORTION_SIZE;
dflet 0:6ad60d78b315 232 spLength -= SP_PORTION_SIZE;
dflet 0:6ad60d78b315 233 spDataPtr += SP_PORTION_SIZE;
dflet 0:6ad60d78b315 234 }
dflet 0:6ad60d78b315 235
dflet 0:6ad60d78b315 236 if (status !=0)
dflet 0:6ad60d78b315 237 {
dflet 0:6ad60d78b315 238 // NVMEM error occurred
dflet 0:6ad60d78b315 239 return status;
dflet 0:6ad60d78b315 240 }
dflet 0:6ad60d78b315 241
dflet 0:6ad60d78b315 242 if (spLength != 0)
dflet 0:6ad60d78b315 243 {
dflet 0:6ad60d78b315 244 // if reached here, a reminder is left
dflet 0:6ad60d78b315 245 status = nvmem_write(ulFileId, spLength, offset, spDataPtr);
dflet 0:6ad60d78b315 246 }
dflet 0:6ad60d78b315 247
dflet 0:6ad60d78b315 248 return status;
dflet 0:6ad60d78b315 249 }
dflet 0:6ad60d78b315 250
dflet 0:6ad60d78b315 251 //*****************************************************************************
dflet 0:6ad60d78b315 252 //
dflet 0:6ad60d78b315 253 //! nvmem_read_sp_version
dflet 0:6ad60d78b315 254 //!
dflet 0:6ad60d78b315 255 //! @param[out] patchVer first number indicates package ID and the second
dflet 0:6ad60d78b315 256 //! number indicates package build number
dflet 0:6ad60d78b315 257 //!
dflet 0:6ad60d78b315 258 //! @return on success 0, error otherwise.
dflet 0:6ad60d78b315 259 //!
dflet 0:6ad60d78b315 260 //! @brief Read patch version. read package version (WiFi FW patch,
dflet 0:6ad60d78b315 261 //! driver-supplicant-NS patch, bootloader patch)
dflet 0:6ad60d78b315 262 //!
dflet 0:6ad60d78b315 263 //*****************************************************************************
dflet 0:6ad60d78b315 264
dflet 0:6ad60d78b315 265 #ifndef CC3000_TINY_DRIVER
dflet 0:6ad60d78b315 266 unsigned char nvmem_read_sp_version(unsigned char* patchVer)
dflet 0:6ad60d78b315 267 {
dflet 0:6ad60d78b315 268 unsigned char *ptr;
dflet 0:6ad60d78b315 269 // 1st byte is the status and the rest is the SP version
dflet 0:6ad60d78b315 270 unsigned char retBuf[5];
dflet 0:6ad60d78b315 271
dflet 0:6ad60d78b315 272 ptr = tSLInformation.pucTxCommandBuffer;
dflet 0:6ad60d78b315 273
dflet 0:6ad60d78b315 274 // Initiate a HCI command, no args are required
dflet 0:6ad60d78b315 275 hci_command_send(HCI_CMND_READ_SP_VERSION, ptr, 0);
dflet 0:6ad60d78b315 276 SimpleLinkWaitEvent(HCI_CMND_READ_SP_VERSION, retBuf);
dflet 0:6ad60d78b315 277
dflet 0:6ad60d78b315 278 // package ID
dflet 0:6ad60d78b315 279 *patchVer = retBuf[3];
dflet 0:6ad60d78b315 280 // package build number
dflet 0:6ad60d78b315 281 *(patchVer+1) = retBuf[4];
dflet 0:6ad60d78b315 282
dflet 0:6ad60d78b315 283 return(retBuf[0]);
dflet 0:6ad60d78b315 284 }
dflet 0:6ad60d78b315 285 #endif
dflet 0:6ad60d78b315 286
dflet 0:6ad60d78b315 287 //*****************************************************************************
dflet 0:6ad60d78b315 288 //
dflet 0:6ad60d78b315 289 //! nvmem_create_entry
dflet 0:6ad60d78b315 290 //!
dflet 0:6ad60d78b315 291 //! @param ulFileId nvmem file Id:\n
dflet 0:6ad60d78b315 292 //! * NVMEM_AES128_KEY_FILEID: 12
dflet 0:6ad60d78b315 293 //! * NVMEM_SHARED_MEM_FILEID: 13
dflet 0:6ad60d78b315 294 //! * and fileIDs 14 and 15
dflet 0:6ad60d78b315 295 //! @param ulNewLen entry ulLength
dflet 0:6ad60d78b315 296 //!
dflet 0:6ad60d78b315 297 //! @return on success 0, error otherwise.
dflet 0:6ad60d78b315 298 //!
dflet 0:6ad60d78b315 299 //! @brief Create new file entry and allocate space on the NVMEM.
dflet 0:6ad60d78b315 300 //! Applies only to user files.
dflet 0:6ad60d78b315 301 //! Modify the size of file.
dflet 0:6ad60d78b315 302 //! If the entry is unallocated - allocate it to size
dflet 0:6ad60d78b315 303 //! ulNewLen (marked invalid).
dflet 0:6ad60d78b315 304 //! If it is allocated then deallocate it first.
dflet 0:6ad60d78b315 305 //! To just mark the file as invalid without resizing -
dflet 0:6ad60d78b315 306 //! set ulNewLen=0.
dflet 0:6ad60d78b315 307 //!
dflet 0:6ad60d78b315 308 //*****************************************************************************
dflet 0:6ad60d78b315 309
dflet 0:6ad60d78b315 310 signed long
dflet 0:6ad60d78b315 311 nvmem_create_entry(unsigned long ulFileId, unsigned long ulNewLen)
dflet 0:6ad60d78b315 312 {
dflet 0:6ad60d78b315 313 unsigned char *ptr;
dflet 0:6ad60d78b315 314 unsigned char *args;
dflet 0:6ad60d78b315 315 unsigned short retval;
dflet 0:6ad60d78b315 316
dflet 0:6ad60d78b315 317 ptr = tSLInformation.pucTxCommandBuffer;
dflet 0:6ad60d78b315 318 args = (ptr + HEADERS_SIZE_CMD);
dflet 0:6ad60d78b315 319
dflet 0:6ad60d78b315 320 // Fill in HCI packet structure
dflet 0:6ad60d78b315 321 args = UINT32_TO_STREAM(args, ulFileId);
dflet 0:6ad60d78b315 322 args = UINT32_TO_STREAM(args, ulNewLen);
dflet 0:6ad60d78b315 323
dflet 0:6ad60d78b315 324 // Initiate a HCI command
dflet 0:6ad60d78b315 325 hci_command_send(HCI_CMND_NVMEM_CREATE_ENTRY,ptr, NVMEM_CREATE_PARAMS_LEN);
dflet 0:6ad60d78b315 326
dflet 0:6ad60d78b315 327 SimpleLinkWaitEvent(HCI_CMND_NVMEM_CREATE_ENTRY, &retval);
dflet 0:6ad60d78b315 328
dflet 0:6ad60d78b315 329 return(retval);
dflet 0:6ad60d78b315 330 }
dflet 0:6ad60d78b315 331
dflet 0:6ad60d78b315 332
dflet 0:6ad60d78b315 333
dflet 0:6ad60d78b315 334 //*****************************************************************************
dflet 0:6ad60d78b315 335 //
dflet 0:6ad60d78b315 336 // Close the Doxygen group.
dflet 0:6ad60d78b315 337 //! @}
dflet 0:6ad60d78b315 338 //
dflet 0:6ad60d78b315 339 //*****************************************************************************
dflet 0:6ad60d78b315 340
dflet 0:6ad60d78b315 341