SimpleLink CC3120/CC3220 Host Driver  Version 2.0.1.15
Simplifies the implementation of Internet connectivity
user.h
1 /*
2  * Copyright (C) 2015 Texas Instruments Incorporated
3  *
4  * All rights reserved. Property of Texas Instruments Incorporated.
5  * Restricted rights to use, duplicate or disclose this code are
6  * granted through contract.
7  *
8  * The program may not be used without the written permission of
9  * Texas Instruments Incorporated or against the terms and conditions
10  * stipulated in the agreement under which this program has been supplied,
11  * and under no circumstances can it be used with non-TI connectivity device.
12  *
13  */
14 /******************************************************************************
15 * user.h - CC31xx/CC32xx Host Driver Implementation
16 ******************************************************************************/
17 
18 
19 #ifndef __USER_H__
20 #define __USER_H__
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 
27 #include <string.h>
28 #include <ti/drivers/net/wifi/porting/cc_pal.h>
29 
30 typedef signed int _SlFd_t;
31 
32 #define SL_TIMESTAMP_TICKS_IN_10_MILLISECONDS (10)
33 #define SL_TIMESTAMP_MAX_VALUE (0xFFFFFFFF)
34 
54 #ifndef SL_TINY_EXT
55 #define MAX_CONCURRENT_ACTIONS 10
56 #else
57 #define MAX_CONCURRENT_ACTIONS 1
58 #endif
59 
69 /* #define CPU_FREQ_IN_MHZ 80 */
70 
71 
101 #define SL_RUNTIME_EVENT_REGISTERATION
102 
123 #define SL_INC_ARG_CHECK
124 
125 
153 #define SL_INC_INTERNAL_ERRNO
154 
155 
169 #define SL_INC_EXT_API
170 
184 #define SL_INC_WLAN_PKG
185 
199 #define SL_INC_SOCKET_PKG
200 
214 #define SL_INC_NET_APP_PKG
215 
229 #define SL_INC_NET_CFG_PKG
230 
244 #define SL_INC_NVMEM_PKG
245 
258 #define SL_INC_NVMEM_EXT_PKG
259 
273 #define SL_INC_SOCK_SERVER_SIDE_API
274 
288 #define SL_INC_SOCK_CLIENT_SIDE_API
289 
303 #define SL_INC_SOCK_RECV_API
304 
318 #define SL_INC_SOCK_SEND_API
319 
353 #define sl_DeviceEnablePreamble()
354 
363 #define sl_DeviceEnable() NwpPowerOn()
364 
372 #define sl_DeviceDisable() NwpPowerOff()
373 
403 /* #define _SlFd_t Fd_t */
404 
438 #define sl_IfOpen spi_Open
439 
457 #define sl_IfClose spi_Close
458 
483 #define sl_IfRead spi_Read
484 
513 #define sl_IfWrite spi_Write
514 
538 #define sl_IfRegIntHdlr(InterruptHdl , pValue) NwpRegisterInterruptHandler(InterruptHdl , pValue)
539 
553 #define sl_IfMaskIntHdlr()
554 
567 #define sl_IfUnMaskIntHdlr()
568 
585 /*
586 #define SL_START_WRITE_STAT
587 */
588 
589 #ifdef SL_START_WRITE_STAT
590 #define sl_IfStartWriteSequence
591 #define sl_IfEndWriteSequence
592 #endif
593 
611 #ifndef SL_TINY_EXT
612 #undef slcb_GetTimestamp
613 /* A timer must be started before using this function */
614 #define slcb_GetTimestamp TimerGetCurrentTimestamp
615 #endif
616 
617 
628 #define WAIT_NWP_SHUTDOWN_READY
629 
645 #ifndef SL_INC_INTERNAL_ERRNO
646 #define slcb_SetErrno
647 #endif
648 
686 /*
687 #define SL_PLATFORM_MULTI_THREADED
688 */
689 
690 #ifdef SL_PLATFORM_MULTI_THREADED
691 
692 
699 #define SL_OS_RET_CODE_OK ((int)OS_OK)
700 
707 #define SL_OS_WAIT_FOREVER ((time_t)OS_WAIT_FOREVER)
708 
715 #define SL_OS_NO_WAIT ((time_t)OS_NO_WAIT)
716 
724 #define _SlTime_t time_t
725 
726 
727 #endif //SL_PLATFORM_MULTI_THREADED
728 
742 #define _SlSyncObj_t SemaphoreP_Handle
743 
744 
759 #define sl_SyncObjCreate(pSyncObj,pName) Semaphore_create_handle(pSyncObj)
760 
761 
772 #define sl_SyncObjDelete(pSyncObj) SemaphoreP_delete(*(pSyncObj))
773 
774 
787 #define sl_SyncObjSignal(pSyncObj) SemaphoreP_post(*(pSyncObj))
788 
801 #define sl_SyncObjSignalFromIRQ(pSyncObj) SemaphoreP_post(*(pSyncObj))
802 
818 #define sl_SyncObjWait(pSyncObj,Timeout) SemaphoreP_pend((*(pSyncObj)),Timeout)
819 
830 #define _SlLockObj_t MutexP_Handle
831 
845 #define sl_LockObjCreate(pLockObj, pName) Mutex_create_handle(pLockObj)
846 
857 #define sl_LockObjDelete(pLockObj) MutexP_delete(*(pLockObj))
858 
878 #define sl_LockObjLock(pLockObj,Timeout) Mutex_lock(*(pLockObj))
879 
890 #define sl_LockObjUnlock(pLockObj) Mutex_unlock(*(pLockObj))
891 
892 
911 //#define SL_PLATFORM_EXTERNAL_SPAWN
912 
913 #ifdef SL_PLATFORM_EXTERNAL_SPAWN
914 #define sl_Spawn(pEntry,pValue,flags) os_Spawn(pEntry,pValue,flags)
915 #endif
916 
957 /*
958 #define SL_MEMORY_MGMT_DYNAMIC 1
959 #define SL_MEMORY_MGMT_STATIC 0
960 
961 #define SL_MEMORY_MGMT SL_MEMORY_MGMT_DYNAMIC
962 */
963 #ifdef SL_MEMORY_MGMT_DYNAMIC
964 
965 #ifdef SL_PLATFORM_MULTI_THREADED
966 
973 #define sl_Malloc(Size) mem_Malloc(Size)
974 
981 #define sl_Free(pMem) mem_Free(pMem)
982 
983 #else
984 #include <stdlib.h>
991 #define sl_Malloc(Size) malloc(Size)
992 
999 #define sl_Free(pMem) free(pMem)
1000 #endif
1001 
1002 #endif
1003 
1053 #define slcb_DeviceFatalErrorEvtHdlr SimpleLinkFatalErrorEventHandler
1054 
1065 #define slcb_DeviceGeneralEvtHdlr SimpleLinkGeneralEventHandler
1066 
1147 #define slcb_WlanEvtHdlr SimpleLinkWlanEventHandler
1148 
1149 
1183 #define slcb_NetAppEvtHdlr SimpleLinkNetAppEventHandler
1184 
1220 #define slcb_NetAppHttpServerHdlr SimpleLinkHttpServerEventHandler
1221 
1222 
1223 
1240 #define slcb_NetAppRequestHdlr SimpleLinkNetAppRequestEventHandler
1241 
1242 
1243 
1258 #define slcb_NetAppRequestMemFree SimpleLinkNetAppRequestMemFreeEventHandler
1259 
1260 
1261 
1286 #define slcb_SockEvtHdlr SimpleLinkSockEventHandler
1287 
1288 
1307 #ifndef SL_PLATFORM_MULTI_THREADED
1308 #define slcb_SocketTriggerEventHandler SimpleLinkSocketTriggerEventHandler
1309 #endif
1310 
1318 #ifdef __cplusplus
1319 }
1320 #endif // __cplusplus
1321 
1322 #endif // __USER_H__
1323