Skip to content

Commit 2b8a718

Browse files
committed
drivers: Update CC3100 driver library to SDK release version 1.1.0.
1 parent c292632 commit 2b8a718

21 files changed

Lines changed: 2308 additions & 1351 deletions

drivers/cc3100/inc/device.h

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@
3434
*
3535
*/
3636

37-
#ifndef __DEVICE_H__
38-
#define __DEVICE_H__
39-
4037
/*****************************************************************************/
4138
/* Include files */
4239
/*****************************************************************************/
4340
#include "simplelink.h"
4441

42+
#ifndef __DEVICE_H__
43+
#define __DEVICE_H__
44+
45+
46+
4547
#ifdef __cplusplus
4648
extern "C" {
4749
#endif
@@ -79,6 +81,10 @@ extern "C" {
7981
/* User supplied invalid parameter */
8082
#define SL_INVALPARAM (-2003)
8183

84+
85+
/* Failed to open interface */
86+
#define SL_BAD_INTERFACE (-2004)
87+
8288
/* End of SL internal Error codes */
8389

8490

@@ -171,6 +177,8 @@ typedef enum
171177
#define SL_WLAN_CONNECTION_FAILED_EVENT (9)
172178
/* SL_EVENT_CLASS_DEVICE user events */
173179
#define SL_DEVICE_FATAL_ERROR_EVENT (1)
180+
#define SL_DEVICE_ABORT_ERROR_EVENT (2)
181+
174182
/* SL_EVENT_CLASS_BSD user events */
175183
#define SL_SOCKET_TX_FAILED_EVENT (1)
176184
#define SL_SOCKET_ASYNC_EVENT (2)
@@ -228,6 +236,8 @@ typedef enum
228236
/* Structure/Enum declarations */
229237
/*****************************************************************************/
230238

239+
#define ROLE_UNKNOWN_ERR (-1)
240+
231241
#ifdef SL_IF_TYPE_UART
232242
typedef struct
233243
{
@@ -252,6 +262,14 @@ typedef struct
252262
_u16 Padding;
253263
}SlVersionFull;
254264

265+
266+
typedef struct
267+
{
268+
_u32 AbortType;
269+
_u32 AbortData;
270+
}sl_DeviceReportAbort;
271+
272+
255273
typedef struct
256274
{
257275
_i8 status;
@@ -261,6 +279,7 @@ typedef struct
261279
typedef union
262280
{
263281
sl_DeviceReport deviceEvent;
282+
sl_DeviceReportAbort deviceReport;
264283
} _SlDeviceEventData_u;
265284

266285
typedef struct
@@ -376,7 +395,7 @@ _i16 sl_Start(const void* pIfHdl, _i8* pDevName, const P_INIT_CALLBACK pInitCal
376395
\warning
377396
*/
378397
#if _SL_INCLUDE_FUNC(sl_Stop)
379-
_i16 sl_Stop(_u16 timeout);
398+
_i16 sl_Stop(const _u16 timeout);
380399
#endif
381400

382401

@@ -399,7 +418,7 @@ _i16 sl_Stop(_u16 timeout);
399418
Setting device time and date example:
400419
401420
SlDateTime_t dateTime= {0};
402-
dateTime.sl_tm_day = (_u32)23; // Day of month (DD format) range 1-13
421+
dateTime.sl_tm_day = (_u32)23; // Day of month (DD format) range 1-31
403422
dateTime.sl_tm_mon = (_u32)6; // Month (MM format) in the range of 1-12
404423
dateTime.sl_tm_year = (_u32)2014; // Year (YYYY format)
405424
dateTime.sl_tm_hour = (_u32)17; // Hours in the range of 0-23
@@ -413,7 +432,7 @@ _i16 sl_Stop(_u16 timeout);
413432
\endcode
414433
*/
415434
#if _SL_INCLUDE_FUNC(sl_DevSet)
416-
_i32 sl_DevSet(_u8 DeviceSetId ,_u8 Option,_u8 ConfigLen, _u8 *pValues);
435+
_i32 sl_DevSet(const _u8 DeviceSetId ,const _u8 Option,const _u8 ConfigLen,const _u8 *pValues);
417436
#endif
418437

419438
/*!
@@ -446,9 +465,11 @@ _i32 sl_DevSet(_u8 DeviceSetId ,_u8 Option,_u8 ConfigLen, _u8 *pValues);
446465
_u8 pConfigOpt;
447466
_u8 pConfigLen;
448467
pConfigOpt = SL_EVENT_CLASS_WLAN;
468+
pConfigLen = sizeof(_u32);
449469
sl_DevGet(SL_DEVICE_STATUS,&pConfigOpt,&pConfigLen,(_u8 *)(&statusWlan));
450470
Example for getting version:
451471
SlVersionFull ver;
472+
pConfigLen = sizeof(ver);
452473
pConfigOpt = SL_DEVICE_GENERAL_VERSION;
453474
sl_DevGet(SL_DEVICE_GENERAL_CONFIGURATION,&pConfigOpt,&pConfigLen,(_u8 *)(&ver));
454475
printf("CHIP %d\nMAC 31.%d.%d.%d.%d\nPHY %d.%d.%d.%d\nNWP %d.%d.%d.%d\nROM %d\nHOST %d.%d.%d.%d\n",
@@ -475,7 +496,7 @@ _i32 sl_DevSet(_u8 DeviceSetId ,_u8 Option,_u8 ConfigLen, _u8 *pValues);
475496
\endcode
476497
*/
477498
#if _SL_INCLUDE_FUNC(sl_DevGet)
478-
_i32 sl_DevGet(_u8 DeviceGetId, _u8 *pOption,_u8 *pConfigLen, _u8 *pValues);
499+
_i32 sl_DevGet(const _u8 DeviceGetId,_u8 *pOption,_u8 *pConfigLen, _u8 *pValues);
479500
#endif
480501

481502

@@ -527,7 +548,7 @@ _i32 sl_DevGet(_u8 DeviceGetId, _u8 *pOption,_u8 *pConfigLen, _u8 *pValues);
527548
\endcode
528549
*/
529550
#if _SL_INCLUDE_FUNC(sl_EventMaskSet)
530-
_i16 sl_EventMaskSet(_u8 EventClass , _u32 Mask);
551+
_i16 sl_EventMaskSet(const _u8 EventClass ,const _u32 Mask);
531552
#endif
532553

533554
/*!
@@ -567,7 +588,7 @@ _i16 sl_EventMaskSet(_u8 EventClass , _u32 Mask);
567588
\endcode
568589
*/
569590
#if _SL_INCLUDE_FUNC(sl_EventMaskGet)
570-
_i16 sl_EventMaskGet(_u8 EventClass, _u32 *pMask);
591+
_i16 sl_EventMaskGet(const _u8 EventClass,_u32 *pMask);
571592
#endif
572593

573594

drivers/cc3100/inc/driver.h

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ typedef struct
6161
typedef struct
6262
{
6363
_u16 TxPayloadLen;
64-
_u16 RxPayloadLen;
65-
_u16 ActualRxPayloadLen;
64+
_i16 RxPayloadLen;
65+
_i16 ActualRxPayloadLen;
6666
_u8 *pTxPayload;
6767
_u8 *pRxPayload;
6868
}_SlCmdExt_t;
@@ -97,12 +97,20 @@ typedef enum
9797
SOCKET_6,
9898
SOCKET_7,
9999
MAX_SOCKET_ENUM_IDX,
100+
#ifndef SL_TINY_EXT
100101
ACCEPT_ID = MAX_SOCKET_ENUM_IDX,
101102
CONNECT_ID,
103+
#else
104+
CONNECT_ID = MAX_SOCKET_ENUM_IDX,
105+
#endif
106+
#ifndef SL_TINY_EXT
102107
SELECT_ID,
108+
#endif
103109
GETHOSYBYNAME_ID,
110+
#ifndef SL_TINY_EXT
104111
GETHOSYBYSERVICE_ID,
105112
PING_ID,
113+
#endif
106114
START_STOP_ID,
107115
RECV_ID
108116
}_SlActionID_e;
@@ -166,21 +174,18 @@ typedef struct
166174

167175
_SlSyncObj_t CmdSyncObj;
168176
_u8 IsCmdRespWaited;
169-
170-
_SlFlowContCB_t FlowContCB;
171-
177+
_SlFlowContCB_t FlowContCB;
172178
_u8 TxSeqNum;
173-
_volatile _u8 RxIrqCnt;
174179
_u8 RxDoneCnt;
175180
_u8 SocketNonBlocking;
176181
_u8 SocketTXFailure;
177-
_u8 RelayFlagsViaRxPayload;
178182
/* for stack reduction the parameters are globals */
179183
_SlFunctionParams_t FunctionParams;
180184

185+
_u8 ActionIndex;
181186
}_SlDriverCb_t;
182187

183-
188+
extern _volatile _u8 RxIrqCnt;
184189

185190
extern _SlDriverCb_t* g_pCB;
186191
extern P_SL_DEV_PING_CALLBACK pPingCallBackFunc;
@@ -195,25 +200,47 @@ extern _SlReturnVal_t _SlDrvCmdOp(_SlCmdCtrl_t *pCmdCtrl , void* pTxRxDescBuff
195200
extern _SlReturnVal_t _SlDrvCmdSend(_SlCmdCtrl_t *pCmdCtrl , void* pTxRxDescBuff , _SlCmdExt_t* pCmdExt);
196201
extern _SlReturnVal_t _SlDrvDataReadOp(_SlSd_t Sd, _SlCmdCtrl_t *pCmdCtrl , void* pTxRxDescBuff , _SlCmdExt_t* pCmdExt);
197202
extern _SlReturnVal_t _SlDrvDataWriteOp(_SlSd_t Sd, _SlCmdCtrl_t *pCmdCtrl , void* pTxRxDescBuff , _SlCmdExt_t* pCmdExt);
198-
extern _i16 _SlDrvBasicCmd(_SlOpcode_t Opcode);
199-
200203
extern void _sl_HandleAsync_InitComplete(void *pVoidBuf);
201204
extern void _sl_HandleAsync_Connect(void *pVoidBuf);
205+
206+
207+
#ifndef SL_TINY_EXT
208+
extern _i16 _SlDrvBasicCmd(_SlOpcode_t Opcode);
202209
extern void _sl_HandleAsync_Accept(void *pVoidBuf);
210+
extern void _sl_HandleAsync_DnsGetHostByService(void *pVoidBuf);
203211
extern void _sl_HandleAsync_Select(void *pVoidBuf);
212+
#endif
213+
214+
204215
extern void _sl_HandleAsync_DnsGetHostByName(void *pVoidBuf);
205-
extern void _sl_HandleAsync_DnsGetHostByService(void *pVoidBuf);
206216
extern void _sl_HandleAsync_DnsGetHostByAddr(void *pVoidBuf);
207217
extern void _sl_HandleAsync_PingResponse(void *pVoidBuf);
208-
extern void _SlDrvNetAppEventHandler(void *pArgs);
209-
extern void _SlDrvDeviceEventHandler(void *pArgs);
218+
extern void _SlDrvNetAppEventHandler(void* pArgs);
219+
extern void _SlDrvDeviceEventHandler(void* pArgs);
210220
extern void _sl_HandleAsync_Stop(void *pVoidBuf);
211-
extern _i16 _SlDrvWaitForPoolObj(_u32 ActionID, _u8 SocketID);
221+
extern _u8 _SlDrvWaitForPoolObj(_u8 ActionID, _u8 SocketID);
212222
extern void _SlDrvReleasePoolObj(_u8 pObj);
213-
extern void _SlDrvObjInit(void);
223+
extern _u16 _SlDrvAlignSize(_u16 msgLen);
224+
extern _u8 _SlDrvProtectAsyncRespSetting(_u8 *pAsyncRsp, _u8 ActionID, _u8 SocketID);
225+
226+
227+
extern void _SlDrvSyncObjWaitForever(_SlSyncObj_t *pSyncObj);
228+
extern void _SlDrvSyncObjSignal(_SlSyncObj_t *pSyncObj);
229+
extern void _SlDrvObjLock(_SlLockObj_t *pLockObj, _SlTime_t Timeout);
230+
extern void _SlDrvObjLockWaitForever(_SlLockObj_t *pLockObj);
231+
extern void _SlDrvProtectionObjLockWaitForever();
232+
extern void _SlDrvObjUnLock(_SlLockObj_t *pLockObj);
233+
extern void _SlDrvProtectionObjUnLock();
234+
235+
extern void _SlDrvMemZero(void* Addr, _u16 size);
236+
extern void _SlDrvResetCmdExt(_SlCmdExt_t* pCmdExt);
237+
238+
214239

215240
#define _SL_PROTOCOL_ALIGN_SIZE(msgLen) (((msgLen)+3) & (~3))
216241
#define _SL_IS_PROTOCOL_ALIGNED_SIZE(msgLen) (!((msgLen) & 3))
242+
243+
217244
#define _SL_PROTOCOL_CALC_LEN(pCmdCtrl,pCmdExt) ((pCmdExt) ? \
218245
(_SL_PROTOCOL_ALIGN_SIZE(pCmdCtrl->TxDescLen) + _SL_PROTOCOL_ALIGN_SIZE(pCmdExt->TxPayloadLen)) : \
219246
(_SL_PROTOCOL_ALIGN_SIZE(pCmdCtrl->TxDescLen)))

drivers/cc3100/inc/fs.h

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,17 @@
3333
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3434
*
3535
*/
36-
37-
#ifndef __FS_H__
38-
#define __FS_H__
3936

4037
/*****************************************************************************/
4138
/* Include files */
4239
/*****************************************************************************/
4340

4441
#include "simplelink.h"
42+
43+
#ifndef __FS_H__
44+
#define __FS_H__
45+
46+
4547

4648
#ifdef __cplusplus
4749
extern "C" {
@@ -180,7 +182,7 @@ typedef enum
180182
_FS_FILE_OPEN_FLAG_NO_SIGNATURE_TEST = 0x4, /* Relevant to secure file only */
181183
_FS_FILE_OPEN_FLAG_STATIC = 0x8, /* Relevant to secure file only */
182184
_FS_FILE_OPEN_FLAG_VENDOR = 0x10, /* Relevant to secure file only */
183-
_FS_FILE_PUBLIC_WRITE = 0x20, /* Relevant to secure file only, the file can be opened for write without Token */
185+
_FS_FILE_PUBLIC_WRITE= 0x20, /* Relevant to secure file only, the file can be opened for write without Token */
184186
_FS_FILE_PUBLIC_READ = 0x40 /* Relevant to secure file only, the file can be opened for read without Token */
185187
}SlFileOpenFlags_e;
186188

@@ -256,7 +258,7 @@ _u32 _sl_GetCreateFsMode(_u32 maxSizeInBytes,_u32 accessFlags);
256258
\endcode
257259
*/
258260
#if _SL_INCLUDE_FUNC(sl_FsOpen)
259-
_i32 sl_FsOpen(_u8 *pFileName,_u32 AccessModeAndMaxSize,_u32 *pToken,_i32 *pFileHandle);
261+
_i32 sl_FsOpen(const _u8 *pFileName,const _u32 AccessModeAndMaxSize,_u32 *pToken,_i32 *pFileHandle);
260262
#endif
261263

262264
/*!
@@ -279,7 +281,7 @@ _i32 sl_FsOpen(_u8 *pFileName,_u32 AccessModeAndMaxSize,_u32 *pToken,_i32 *pFile
279281
\endcode
280282
*/
281283
#if _SL_INCLUDE_FUNC(sl_FsClose)
282-
_i16 sl_FsClose(_i32 FileHdl,_u8* pCeritificateFileName,_u8* pSignature,_u32 SignatureLen);
284+
_i16 sl_FsClose(const _i32 FileHdl,const _u8* pCeritificateFileName,const _u8* pSignature,const _u32 SignatureLen);
283285
#endif
284286

285287
/*!
@@ -301,7 +303,7 @@ _i16 sl_FsClose(_i32 FileHdl,_u8* pCeritificateFileName,_u8* pSignature,_u32 Sig
301303
\endcode
302304
*/
303305
#if _SL_INCLUDE_FUNC(sl_FsRead)
304-
_i32 sl_FsRead(_i32 FileHdl,_u32 Offset ,_u8* pData,_u32 Len);
306+
_i32 sl_FsRead(const _i32 FileHdl,_u32 Offset ,_u8* pData,_u32 Len);
305307
#endif
306308

307309
/*!
@@ -323,7 +325,7 @@ _i32 sl_FsRead(_i32 FileHdl,_u32 Offset ,_u8* pData,_u32 Len);
323325
\endcode
324326
*/
325327
#if _SL_INCLUDE_FUNC(sl_FsWrite)
326-
_i32 sl_FsWrite(_i32 FileHdl,_u32 Offset,_u8* pData,_u32 Len);
328+
_i32 sl_FsWrite(const _i32 FileHdl,_u32 Offset,_u8* pData,_u32 Len);
327329
#endif
328330

329331
/*!
@@ -344,7 +346,7 @@ _i32 sl_FsWrite(_i32 FileHdl,_u32 Offset,_u8* pData,_u32 Len);
344346
\endcode
345347
*/
346348
#if _SL_INCLUDE_FUNC(sl_FsGetInfo)
347-
_i16 sl_FsGetInfo(_u8 *pFileName,_u32 Token,SlFsFileInfo_t* pFsFileInfo);
349+
_i16 sl_FsGetInfo(const _u8 *pFileName,const _u32 Token,SlFsFileInfo_t* pFsFileInfo);
348350
#endif
349351

350352
/*!
@@ -363,7 +365,7 @@ _i16 sl_FsGetInfo(_u8 *pFileName,_u32 Token,SlFsFileInfo_t* pFsFileInfo);
363365
\endcode
364366
*/
365367
#if _SL_INCLUDE_FUNC(sl_FsDel)
366-
_i16 sl_FsDel(_u8 *pFileName,_u32 Token);
368+
_i16 sl_FsDel(const _u8 *pFileName,const _u32 Token);
367369
#endif
368370
/*!
369371

0 commit comments

Comments
 (0)