SimpleLink CC3120/CC3220 Host Driver  Version 2.0.1.15
Simplifies the implementation of Internet connectivity
nonos.h
1 /*
2  * Copyright (C) 2016 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 #ifndef __NONOS_H__
16 #define __NONOS_H__
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 #ifndef SL_PLATFORM_MULTI_THREADED
23 
24 /* This function call the user defined function, if defined, from the sync wait loop */
25 /* The use case of this function is to allow nonos system to call a user function to put the device into sleep */
26 /* The wake up should be activated after getting an interrupt from the device to Host */
27 /* The user function must return without blocking to prevent a delay on the event handling */
28 /*
29 #define _SlSyncWaitLoopCallback UserSleepFunction
30 */
31 
32 #ifndef SL_TINY_EXT
33 #define NONOS_MAX_SPAWN_ENTRIES (5)
34 #else
35 #define NONOS_MAX_SPAWN_ENTRIES (1)
36 #endif
37 
38 #define NONOS_WAIT_FOREVER ~(0UL)
39 #define NONOS_NO_WAIT (0x0)
40 
41 #define NONOS_RET_OK (0)
42 #define NONOS_RET_ERR (0xFF)
43 #define OSI_OK (NONOS_RET_OK)
44 
45 typedef struct
46 {
47  _SlSpawnEntryFunc_t pEntry;
48  void* pValue;
49  _u8 IsAllocated;
51 
52 typedef struct
53 {
54  _SlNonOsSpawnEntry_t SpawnEntries[NONOS_MAX_SPAWN_ENTRIES];
56 
57 
61 typedef _u32 _SlNonOsRetVal_t;
62 
66 typedef _u32 _SlNonOsTime_t;
67 
68 
69 #define _SlTime_t _SlNonOsTime_t
70 
71 #define SL_OS_WAIT_FOREVER NONOS_WAIT_FOREVER
72 
73 #define SL_OS_RET_CODE_OK NONOS_RET_OK
74 
75 #define SL_OS_NO_WAIT NONOS_NO_WAIT
76 
77 
95 _SlNonOsRetVal_t _SlNonOsSpawn(_SlSpawnEntryFunc_t pEntry , void* pValue , _u32 flags);
96 
97 
108 void tiDriverSpawnCallback(void);
109 
110 
121 _SlNonOsRetVal_t _SlNonOsHandleSpawnTask(void);
122 
123 extern _SlNonOsRetVal_t _SlNonOsSpawn(_SlSpawnEntryFunc_t pEntry , void* pValue , _u32 flags);
124 
125 /*****************************************************************************
126 
127  Overwrite SimpleLink driver OS adaptation functions
128 
129  *****************************************************************************/
130 
131 #undef sl_Spawn
132 #define sl_Spawn(pEntry,pValue,flags) _SlNonOsSpawn(pEntry,pValue,flags)
133 
134 #undef _SlTaskEntry
135 #define _SlTaskEntry _SlNonOsHandleSpawnTask
136 
137 #endif /* !SL_PLATFORM_MULTI_THREADED */
138 
139 #ifdef __cplusplus
140 }
141 #endif /* __cplusplus */
142 
143 #endif
Definition: nonos.h:45