SimpleLink CC31xx/CC32xx Host Driver  Version 3.0.1.70
Simplifies the implementation of Internet connectivity
nonos.h
1 /*
2  * nonos.h - CC31xx/CC32xx Host Driver Implementation
3  *
4  * Copyright (C) 2017 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 #ifndef __NONOS_H__
38 #define __NONOS_H__
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 #ifndef SL_PLATFORM_MULTI_THREADED
45 
46 /* This function call the user defined function, if defined, from the sync wait loop */
47 /* The use case of this function is to allow nonos system to call a user function to put the device into sleep */
48 /* The wake up should be activated after getting an interrupt from the device to Host */
49 /* The user function must return without blocking to prevent a delay on the event handling */
50 /*
51 #define _SlSyncWaitLoopCallback UserSleepFunction
52 */
53 
54 #define NONOS_MAX_SPAWN_ENTRIES (5)
55 
56 #define NONOS_WAIT_FOREVER ~(0UL)
57 #define NONOS_NO_WAIT (0x0)
58 
59 #define NONOS_RET_OK (0)
60 #define NONOS_RET_ERR (0xFF)
61 #define OSI_OK (NONOS_RET_OK)
62 
63 typedef struct
64 {
65  _SlSpawnEntryFunc_t pEntry;
66  void* pValue;
67  _u8 IsAllocated;
69 
70 typedef struct
71 {
72  _SlNonOsSpawnEntry_t SpawnEntries[NONOS_MAX_SPAWN_ENTRIES];
74 
75 
79 typedef _u32 _SlNonOsRetVal_t;
80 
84 typedef _u32 _SlNonOsTime_t;
85 
86 
87 #define _SlTime_t _SlNonOsTime_t
88 
89 #define SL_OS_WAIT_FOREVER NONOS_WAIT_FOREVER
90 
91 #define SL_OS_RET_CODE_OK NONOS_RET_OK
92 
93 #define SL_OS_NO_WAIT NONOS_NO_WAIT
94 
95 
113 _SlNonOsRetVal_t _SlNonOsSpawn(_SlSpawnEntryFunc_t pEntry , void* pValue , _u32 flags);
114 
115 
126 void tiDriverSpawnCallback(void);
127 
128 
139 _SlNonOsRetVal_t _SlNonOsHandleSpawnTask(void);
140 
141 extern _SlNonOsRetVal_t _SlNonOsSpawn(_SlSpawnEntryFunc_t pEntry , void* pValue , _u32 flags);
142 
143 /*****************************************************************************
144 
145  Overwrite SimpleLink driver OS adaptation functions
146 
147  *****************************************************************************/
148 
149 #undef sl_Spawn
150 #define sl_Spawn(pEntry,pValue,flags) _SlNonOsSpawn(pEntry,pValue,flags)
151 
152 #undef _SlTaskEntry
153 #define _SlTaskEntry _SlNonOsHandleSpawnTask
154 
155 #endif /* !SL_PLATFORM_MULTI_THREADED */
156 
157 #ifdef __cplusplus
158 }
159 #endif /* __cplusplus */
160 
161 #endif
Definition: nonos.h:63