CC32XX SimpleLink Host Driver  1.0.0.10
 All Data Structures Functions Variables Groups Pages
user.h
1 /*
2  * user.h - CC31xx/CC32xx Host Driver Implementation
3  *
4  * Copyright (C) 2015 Texas Instruments Incorporated - https://www.ti.com/
5  *
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the
17  * distribution.
18  *
19  * Neither the name of Texas Instruments Incorporated nor the names of
20  * its contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  *
35 */
36 
37 
38 
39 #ifndef __USER_H__
40 #define __USER_H__
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 
47 #include <string.h>
48 #include "cc_pal.h"
49 
69 #define MAX_CONCURRENT_ACTIONS 10
70 
80 #define CPU_FREQ_IN_MHZ 80
81 
82 
123 #define SL_INC_ARG_CHECK
124 
125 
145 #define SL_INC_STD_BSD_API_NAMING
146 
147 
161 #define SL_INC_EXT_API
162 
176 #define SL_INC_WLAN_PKG
177 
191 #define SL_INC_SOCKET_PKG
192 
206 #define SL_INC_NET_APP_PKG
207 
221 #define SL_INC_NET_CFG_PKG
222 
236 #define SL_INC_NVMEM_PKG
237 
251 #define SL_INC_SOCK_SERVER_SIDE_API
252 
266 #define SL_INC_SOCK_CLIENT_SIDE_API
267 
281 #define SL_INC_SOCK_RECV_API
282 
296 #define SL_INC_SOCK_SEND_API
297 
331 #ifndef DISABLE_DEBUGGER_RECONNECT
332 #define sl_DeviceEnablePreamble() NwpPowerOnPreamble()
333 #else
334 #define sl_DeviceEnablePreamble()
335 #endif
336 
345 #define sl_DeviceEnable() NwpPowerOn()
346 
354 #define sl_DeviceDisable() NwpPowerOff()
355 
385 #define _SlFd_t Fd_t
386 
420 #define sl_IfOpen spi_Open
421 
439 #define sl_IfClose spi_Close
440 
465 #define sl_IfRead spi_Read
466 
495 #define sl_IfWrite spi_Write
496 
520 #define sl_IfRegIntHdlr(InterruptHdl , pValue) NwpRegisterInterruptHandler(InterruptHdl , pValue)
521 
535 #define sl_IfMaskIntHdlr() NwpMaskInterrupt()
536 
549 #define sl_IfUnMaskIntHdlr() NwpUnMaskInterrupt()
550 
567 /* #define SL_START_WRITE_STAT */
568 
609 /*
610 #define SL_PLATFORM_MULTI_THREADED
611 */
612 
613 #ifdef SL_PLATFORM_MULTI_THREADED
614 #include "osi.h"
615 
616 
623 #define SL_OS_RET_CODE_OK ((int)OSI_OK)
624 
631 #define SL_OS_WAIT_FOREVER ((OsiTime_t)OSI_WAIT_FOREVER)
632 
639 #define SL_OS_NO_WAIT ((OsiTime_t)OSI_NO_WAIT)
640 
648 #define _SlTime_t OsiTime_t
649 
663 typedef OsiSyncObj_t _SlSyncObj_t;
664 
665 
680 #define sl_SyncObjCreate(pSyncObj,pName) osi_SyncObjCreate(pSyncObj)
681 
682 
693 #define sl_SyncObjDelete(pSyncObj) osi_SyncObjDelete(pSyncObj)
694 
695 
708 #define sl_SyncObjSignal(pSyncObj) osi_SyncObjSignal(pSyncObj)
709 
722 #define sl_SyncObjSignalFromIRQ(pSyncObj) osi_SyncObjSignalFromISR(pSyncObj)
723 
739 #define sl_SyncObjWait(pSyncObj,Timeout) osi_SyncObjWait(pSyncObj,Timeout)
740 
751 typedef OsiLockObj_t _SlLockObj_t;
752 
766 #define sl_LockObjCreate(pLockObj,pName) osi_LockObjCreate(pLockObj)
767 
778 #define sl_LockObjDelete(pLockObj) osi_LockObjDelete(pLockObj)
779 
799 #define sl_LockObjLock(pLockObj,Timeout) osi_LockObjLock(pLockObj,Timeout)
800 
811 #define sl_LockObjUnlock(pLockObj) osi_LockObjUnlock(pLockObj)
812 #else
813 #ifdef NON_OS_PM
814 #define _SlSyncWaitLoopCallback SimpleLinkSyncWaitLoopCallback
815 #endif
816 #endif
817 
834 #define SL_PLATFORM_EXTERNAL_SPAWN
835 
836 #ifdef SL_PLATFORM_EXTERNAL_SPAWN
837 #define sl_Spawn(pEntry,pValue,flags) osi_Spawn(pEntry,pValue,flags)
838 #endif
839 
880 /*
881 #define SL_MEMORY_MGMT_DYNAMIC 1
882 #define SL_MEMORY_MGMT_STATIC 0
883 
884 #define SL_MEMORY_MGMT SL_MEMORY_MGMT_DYNAMIC
885 */
886 #ifdef SL_MEMORY_MGMT_DYNAMIC
887 
888 #ifdef SL_PLATFORM_MULTI_THREADED
889 
896 #define sl_Malloc(Size) mem_Malloc(Size)
897 
904 #define sl_Free(pMem) mem_Free(pMem)
905 
906 #else
907 #include <stdlib.h>
914 #define sl_Malloc(Size) malloc(Size)
915 
922 #define sl_Free(pMem) free(pMem)
923 #endif
924 
925 #endif
926 
976 /*
977 #define sl_GeneralEvtHdlr
978 */
979 
1060 #define sl_WlanEvtHdlr SimpleLinkWlanEventHandler
1061 
1062 
1096 #define sl_NetAppEvtHdlr SimpleLinkNetAppEventHandler
1097 
1133 #define sl_HttpServerCallback SimpleLinkHttpServerCallback
1134 
1158 #define sl_SockEvtHdlr SimpleLinkSockEventHandler
1159 
1160 
1169 #ifdef __cplusplus
1170 }
1171 #endif // __cplusplus
1172 
1173 #endif // __USER_H__