SimpleLink CC3120/CC3220 Host Driver  Version 2.0.1.18
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 (_u32)(10)
33 #define SL_TIMESTAMP_MAX_VALUE (_u32)(0xFFFFFFFF)
34 
54 #ifndef SL_TINY_EXT
55 #define MAX_CONCURRENT_ACTIONS 10
56 #else
57 #define MAX_CONCURRENT_ACTIONS 1
58 #endif
59 
70 /* #define CPU_FREQ_IN_MHZ 80 */
71 
72 
102 #define SL_RUNTIME_EVENT_REGISTERATION
103 
104 
125 #define SL_INC_ARG_CHECK
126 
127 
155 #define SL_INC_INTERNAL_ERRNO
156 
170 #define SL_INC_EXT_API
171 
172 
186 #define SL_INC_WLAN_PKG
187 
188 
202 #define SL_INC_SOCKET_PKG
203 
204 
218 #define SL_INC_NET_APP_PKG
219 
220 
234 #define SL_INC_NET_CFG_PKG
235 
236 
250 #define SL_INC_NVMEM_PKG
251 
252 
266 #define SL_INC_NVMEM_EXT_PKG
267 
268 
282 #define SL_INC_SOCK_SERVER_SIDE_API
283 
284 
298 #define SL_INC_SOCK_CLIENT_SIDE_API
299 
300 
314 #define SL_INC_SOCK_RECV_API
315 
316 
330 #define SL_INC_SOCK_SEND_API
331 
332 
366 #define sl_DeviceEnablePreamble()
367 
368 
369 
378 #define sl_DeviceEnable() NwpPowerOn()
379 
380 
388 #define sl_DeviceDisable() NwpPowerOff()
389 
390 
420 #define _SlFd_t Fd_t
421 
422 
456 #define sl_IfOpen spi_Open
457 
458 
476 #define sl_IfClose spi_Close
477 
478 
503 #define sl_IfRead spi_Read
504 
505 
534 #define sl_IfWrite spi_Write
535 
536 
560 #define sl_IfRegIntHdlr(InterruptHdl , pValue) NwpRegisterInterruptHandler(InterruptHdl , pValue)
561 
562 
574 #define sl_IfMaskIntHdlr() NwpMaskInterrupt()
575 
576 
588 #define sl_IfUnMaskIntHdlr() NwpUnMaskInterrupt()
589 
590 
607 /* #define SL_START_WRITE_STAT */
608 
609 #ifdef SL_START_WRITE_STAT
610 #define sl_IfStartWriteSequence
611 #define sl_IfEndWriteSequence
612 #endif
613 
614 
632 #ifndef SL_TINY_EXT
633 #undef slcb_GetTimestamp
634 /* A timer must be started before using this function */
635 #define slcb_GetTimestamp TimerGetCurrentTimestamp
636 #endif
637 
638 
649 #define WAIT_NWP_SHUTDOWN_READY NwpWaitForShutDownInd()
650 
666 #ifndef SL_INC_INTERNAL_ERRNO
667 #define slcb_SetErrno
668 #endif
669 
707 /*
708 #define SL_PLATFORM_MULTI_THREADED
709 */
710 
711 #ifdef SL_PLATFORM_MULTI_THREADED
712 
719 #define SL_OS_RET_CODE_OK ((int)OS_OK)
720 
727 #define SL_OS_WAIT_FOREVER ((uint32_t)OS_WAIT_FOREVER)
728 
735 #define SL_OS_NO_WAIT ((uint32_t)OS_NO_WAIT)
736 
744 #define _SlTime_t uint32_t
745 
746 
747 #endif //SL_PLATFORM_MULTI_THREADED
748 
762 #define _SlSyncObj_t SemaphoreP_Handle
763 
764 
779 #define sl_SyncObjCreate(pSyncObj,pName) Semaphore_create_handle(pSyncObj)
780 
781 
792 #define sl_SyncObjDelete(pSyncObj) SemaphoreP_delete_handle(pSyncObj)
793 
794 
807 #define sl_SyncObjSignal(pSyncObj) SemaphoreP_post_handle(pSyncObj)
808 
809 
822 #define sl_SyncObjSignalFromIRQ(pSyncObj) SemaphoreP_post_handle(pSyncObj)
823 
824 
840 #define sl_SyncObjWait(pSyncObj,Timeout) SemaphoreP_pend((*(pSyncObj)),Timeout)
841 
842 
853 #define _SlLockObj_t MutexP_Handle
854 
868 #define sl_LockObjCreate(pLockObj, pName) Mutex_create_handle(pLockObj)
869 
870 
881 #define sl_LockObjDelete(pLockObj) MutexP_delete_handle(pLockObj)
882 
883 
903 #define sl_LockObjLock(pLockObj,Timeout) Mutex_lock(*(pLockObj))
904 
905 
916 #define sl_LockObjUnlock(pLockObj) Mutex_unlock(*(pLockObj))
917 
918 
937 //#define SL_PLATFORM_EXTERNAL_SPAWN
938 
939 #ifdef SL_PLATFORM_EXTERNAL_SPAWN
940 #define sl_Spawn(pEntry,pValue,flags) os_Spawn(pEntry,pValue,flags)
941 #endif
942 
983 /*
984 #define SL_MEMORY_MGMT_DYNAMIC 1
985 #define SL_MEMORY_MGMT_STATIC 0
986 
987 #define SL_MEMORY_MGMT SL_MEMORY_MGMT_DYNAMIC
988 */
989 #ifdef SL_MEMORY_MGMT_DYNAMIC
990 
991 #ifdef SL_PLATFORM_MULTI_THREADED
992 
999 #define sl_Malloc(Size) mem_Malloc(Size)
1000 
1007 #define sl_Free(pMem) mem_Free(pMem)
1008 
1009 #else
1010 #include <stdlib.h>
1017 #define sl_Malloc(Size) malloc(Size)
1018 
1025 #define sl_Free(pMem) free(pMem)
1026 #endif
1027 
1028 #endif
1029 
1079 #define slcb_DeviceFatalErrorEvtHdlr SimpleLinkFatalErrorEventHandler
1080 
1091 #define slcb_DeviceGeneralEvtHdlr SimpleLinkGeneralEventHandler
1092 
1173 #define slcb_WlanEvtHdlr SimpleLinkWlanEventHandler
1174 
1175 
1209 #define slcb_NetAppEvtHdlr SimpleLinkNetAppEventHandler
1210 
1246 #define slcb_NetAppHttpServerHdlr SimpleLinkHttpServerEventHandler
1247 
1248 
1249 
1266 #define slcb_NetAppRequestHdlr SimpleLinkNetAppRequestEventHandler
1267 
1268 
1269 
1284 #define slcb_NetAppRequestMemFree SimpleLinkNetAppRequestMemFreeEventHandler
1285 
1286 
1287 
1312 #define slcb_SockEvtHdlr SimpleLinkSockEventHandler
1313 
1314 
1333 #ifndef SL_PLATFORM_MULTI_THREADED
1334 #define slcb_SocketTriggerEventHandler SimpleLinkSocketTriggerEventHandler
1335 #endif
1336 
1344 #ifdef __cplusplus
1345 }
1346 #endif // __cplusplus
1347 
1348 #endif // __USER_H__