TI's CC3100. A test demo with very little testing done!
Fork of cc3100_Test_Demo2 by
simplelink/cc3100_nonos.h@0:e89ba455dbcf, 2015-02-10 (annotated)
- Committer:
- dflet
- Date:
- Tue Feb 10 12:09:29 2015 +0000
- Revision:
- 0:e89ba455dbcf
For test only! Not much has been tested, but the 2 demo apps run ok. Alot more work needs to be done!
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dflet | 0:e89ba455dbcf | 1 | /* |
dflet | 0:e89ba455dbcf | 2 | * nonos.h - CC31xx/CC32xx Host Driver Implementation |
dflet | 0:e89ba455dbcf | 3 | * |
dflet | 0:e89ba455dbcf | 4 | * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/ |
dflet | 0:e89ba455dbcf | 5 | * |
dflet | 0:e89ba455dbcf | 6 | * |
dflet | 0:e89ba455dbcf | 7 | * Redistribution and use in source and binary forms, with or without |
dflet | 0:e89ba455dbcf | 8 | * modification, are permitted provided that the following conditions |
dflet | 0:e89ba455dbcf | 9 | * are met: |
dflet | 0:e89ba455dbcf | 10 | * |
dflet | 0:e89ba455dbcf | 11 | * Redistributions of source code must retain the above copyright |
dflet | 0:e89ba455dbcf | 12 | * notice, this list of conditions and the following disclaimer. |
dflet | 0:e89ba455dbcf | 13 | * |
dflet | 0:e89ba455dbcf | 14 | * Redistributions in binary form must reproduce the above copyright |
dflet | 0:e89ba455dbcf | 15 | * notice, this list of conditions and the following disclaimer in the |
dflet | 0:e89ba455dbcf | 16 | * documentation and/or other materials provided with the |
dflet | 0:e89ba455dbcf | 17 | * distribution. |
dflet | 0:e89ba455dbcf | 18 | * |
dflet | 0:e89ba455dbcf | 19 | * Neither the name of Texas Instruments Incorporated nor the names of |
dflet | 0:e89ba455dbcf | 20 | * its contributors may be used to endorse or promote products derived |
dflet | 0:e89ba455dbcf | 21 | * from this software without specific prior written permission. |
dflet | 0:e89ba455dbcf | 22 | * |
dflet | 0:e89ba455dbcf | 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
dflet | 0:e89ba455dbcf | 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
dflet | 0:e89ba455dbcf | 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
dflet | 0:e89ba455dbcf | 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
dflet | 0:e89ba455dbcf | 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
dflet | 0:e89ba455dbcf | 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
dflet | 0:e89ba455dbcf | 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
dflet | 0:e89ba455dbcf | 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
dflet | 0:e89ba455dbcf | 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
dflet | 0:e89ba455dbcf | 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
dflet | 0:e89ba455dbcf | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
dflet | 0:e89ba455dbcf | 34 | * |
dflet | 0:e89ba455dbcf | 35 | */ |
dflet | 0:e89ba455dbcf | 36 | |
dflet | 0:e89ba455dbcf | 37 | #ifndef NONOS_H_ |
dflet | 0:e89ba455dbcf | 38 | #define NONOS_H_ |
dflet | 0:e89ba455dbcf | 39 | |
dflet | 0:e89ba455dbcf | 40 | #include "cc3100_simplelink.h" |
dflet | 0:e89ba455dbcf | 41 | |
dflet | 0:e89ba455dbcf | 42 | namespace mbed_cc3100 { |
dflet | 0:e89ba455dbcf | 43 | |
dflet | 0:e89ba455dbcf | 44 | /*****************************************************************************/ |
dflet | 0:e89ba455dbcf | 45 | /* Macro declarations */ |
dflet | 0:e89ba455dbcf | 46 | /*****************************************************************************/ |
dflet | 0:e89ba455dbcf | 47 | |
dflet | 0:e89ba455dbcf | 48 | |
dflet | 0:e89ba455dbcf | 49 | #ifndef SL_PLATFORM_MULTI_THREADED |
dflet | 0:e89ba455dbcf | 50 | |
dflet | 0:e89ba455dbcf | 51 | /* This function call the user defined function, if defined, from the sync wait loop */ |
dflet | 0:e89ba455dbcf | 52 | /* The use case of this function is to allow nonos system to call a user function to put the device into sleep */ |
dflet | 0:e89ba455dbcf | 53 | /* The wake up should be activated after getting an interrupt from the device to Host */ |
dflet | 0:e89ba455dbcf | 54 | /* The user function must return without blocking to prevent a delay on the event handling */ |
dflet | 0:e89ba455dbcf | 55 | /* |
dflet | 0:e89ba455dbcf | 56 | #define _SlSyncWaitLoopCallback UserSleepFunction |
dflet | 0:e89ba455dbcf | 57 | */ |
dflet | 0:e89ba455dbcf | 58 | |
dflet | 0:e89ba455dbcf | 59 | const uint8_t NONOS_WAIT_FOREVER = 0xFF; |
dflet | 0:e89ba455dbcf | 60 | const uint8_t NONOS_NO_WAIT = 0x01; |
dflet | 0:e89ba455dbcf | 61 | |
dflet | 0:e89ba455dbcf | 62 | const uint8_t NONOS_RET_OK = (0); |
dflet | 0:e89ba455dbcf | 63 | const int8_t NONOS_RET_ERR = (0xFF); |
dflet | 0:e89ba455dbcf | 64 | const uint8_t OSI_OK = NONOS_RET_OK; |
dflet | 0:e89ba455dbcf | 65 | |
dflet | 0:e89ba455dbcf | 66 | const uint8_t NON_OS_SYNC_OBJ_CLEAR_VALUE = 0x11; |
dflet | 0:e89ba455dbcf | 67 | const uint8_t NON_OS_SYNC_OBJ_SIGNAL_VALUE = 0x22; |
dflet | 0:e89ba455dbcf | 68 | const uint8_t NON_OS_LOCK_OBJ_UNLOCK_VALUE = 0x33; |
dflet | 0:e89ba455dbcf | 69 | const uint8_t NON_OS_LOCK_OBJ_LOCK_VALUE = 0x44; |
dflet | 0:e89ba455dbcf | 70 | |
dflet | 0:e89ba455dbcf | 71 | #define _SlTime_t _SlNonOsTime_t |
dflet | 0:e89ba455dbcf | 72 | |
dflet | 0:e89ba455dbcf | 73 | #define _SlSyncObj_t _SlNonOsSemObj_t |
dflet | 0:e89ba455dbcf | 74 | |
dflet | 0:e89ba455dbcf | 75 | #define _SlLockObj_t _SlNonOsSemObj_t |
dflet | 0:e89ba455dbcf | 76 | |
dflet | 0:e89ba455dbcf | 77 | const uint8_t SL_OS_WAIT_FOREVER = NONOS_WAIT_FOREVER; |
dflet | 0:e89ba455dbcf | 78 | |
dflet | 0:e89ba455dbcf | 79 | const uint8_t SL_OS_RET_CODE_OK = NONOS_RET_OK; |
dflet | 0:e89ba455dbcf | 80 | |
dflet | 0:e89ba455dbcf | 81 | const uint8_t SL_OS_NO_WAIT = NONOS_NO_WAIT; |
dflet | 0:e89ba455dbcf | 82 | |
dflet | 0:e89ba455dbcf | 83 | |
dflet | 0:e89ba455dbcf | 84 | /*****************************************************************************/ |
dflet | 0:e89ba455dbcf | 85 | /* Function prototypes */ |
dflet | 0:e89ba455dbcf | 86 | /*****************************************************************************/ |
dflet | 0:e89ba455dbcf | 87 | |
dflet | 0:e89ba455dbcf | 88 | /*! |
dflet | 0:e89ba455dbcf | 89 | \brief This function creates a sync object |
dflet | 0:e89ba455dbcf | 90 | |
dflet | 0:e89ba455dbcf | 91 | The sync object is used for synchronization between different thread or ISR and |
dflet | 0:e89ba455dbcf | 92 | a thread. |
dflet | 0:e89ba455dbcf | 93 | |
dflet | 0:e89ba455dbcf | 94 | \param pSyncObj - pointer to the sync object control block |
dflet | 0:e89ba455dbcf | 95 | |
dflet | 0:e89ba455dbcf | 96 | \return upon successful creation the function return 0 |
dflet | 0:e89ba455dbcf | 97 | Otherwise, a negative value indicating the error code shall be returned |
dflet | 0:e89ba455dbcf | 98 | \note |
dflet | 0:e89ba455dbcf | 99 | \warning |
dflet | 0:e89ba455dbcf | 100 | */ |
dflet | 0:e89ba455dbcf | 101 | #define _SlNonOsSyncObjCreate(pSyncObj) _SlNonOsSemSet(pSyncObj,NON_OS_SYNC_OBJ_CLEAR_VALUE) |
dflet | 0:e89ba455dbcf | 102 | |
dflet | 0:e89ba455dbcf | 103 | /*! |
dflet | 0:e89ba455dbcf | 104 | \brief This function deletes a sync object |
dflet | 0:e89ba455dbcf | 105 | |
dflet | 0:e89ba455dbcf | 106 | \param pSyncObj - pointer to the sync object control block |
dflet | 0:e89ba455dbcf | 107 | |
dflet | 0:e89ba455dbcf | 108 | \return upon successful deletion the function should return 0 |
dflet | 0:e89ba455dbcf | 109 | Otherwise, a negative value indicating the error code shall be returned |
dflet | 0:e89ba455dbcf | 110 | \note |
dflet | 0:e89ba455dbcf | 111 | \warning |
dflet | 0:e89ba455dbcf | 112 | */ |
dflet | 0:e89ba455dbcf | 113 | //#define _SlNonOsSyncObjDelete(pSyncObj) _SlNonOsSemSet(pSyncObj,0) |
dflet | 0:e89ba455dbcf | 114 | |
dflet | 0:e89ba455dbcf | 115 | /*! |
dflet | 0:e89ba455dbcf | 116 | \brief This function generates a sync signal for the object. |
dflet | 0:e89ba455dbcf | 117 | |
dflet | 0:e89ba455dbcf | 118 | All suspended threads waiting on this sync object are resumed |
dflet | 0:e89ba455dbcf | 119 | |
dflet | 0:e89ba455dbcf | 120 | \param pSyncObj - pointer to the sync object control block |
dflet | 0:e89ba455dbcf | 121 | |
dflet | 0:e89ba455dbcf | 122 | \return upon successful signaling the function should return 0 |
dflet | 0:e89ba455dbcf | 123 | Otherwise, a negative value indicating the error code shall be returned |
dflet | 0:e89ba455dbcf | 124 | \note the function could be called from ISR context |
dflet | 0:e89ba455dbcf | 125 | \warning |
dflet | 0:e89ba455dbcf | 126 | */ |
dflet | 0:e89ba455dbcf | 127 | //#define _SlNonOsSyncObjSignal(pSyncObj) _SlNonOsSemSet(pSyncObj,NON_OS_SYNC_OBJ_SIGNAL_VALUE) |
dflet | 0:e89ba455dbcf | 128 | |
dflet | 0:e89ba455dbcf | 129 | /*! |
dflet | 0:e89ba455dbcf | 130 | \brief This function waits for a sync signal of the specific sync object |
dflet | 0:e89ba455dbcf | 131 | |
dflet | 0:e89ba455dbcf | 132 | \param pSyncObj - pointer to the sync object control block |
dflet | 0:e89ba455dbcf | 133 | \param Timeout - numeric value specifies the maximum number of mSec to |
dflet | 0:e89ba455dbcf | 134 | stay suspended while waiting for the sync signal |
dflet | 0:e89ba455dbcf | 135 | Currently, the simple link driver uses only two values: |
dflet | 0:e89ba455dbcf | 136 | - NONOS_WAIT_FOREVER |
dflet | 0:e89ba455dbcf | 137 | - NONOS_NO_WAIT |
dflet | 0:e89ba455dbcf | 138 | |
dflet | 0:e89ba455dbcf | 139 | \return upon successful reception of the signal within the timeout window return 0 |
dflet | 0:e89ba455dbcf | 140 | Otherwise, a negative value indicating the error code shall be returned |
dflet | 0:e89ba455dbcf | 141 | \note |
dflet | 0:e89ba455dbcf | 142 | \warning |
dflet | 0:e89ba455dbcf | 143 | */ |
dflet | 0:e89ba455dbcf | 144 | //#define _SlNonOsSyncObjWait(pSyncObj , Timeout) _SlNonOsSemGet(pSyncObj,NON_OS_SYNC_OBJ_SIGNAL_VALUE,NON_OS_SYNC_OBJ_CLEAR_VALUE,Timeout) |
dflet | 0:e89ba455dbcf | 145 | |
dflet | 0:e89ba455dbcf | 146 | /*! |
dflet | 0:e89ba455dbcf | 147 | \brief This function clears a sync object |
dflet | 0:e89ba455dbcf | 148 | |
dflet | 0:e89ba455dbcf | 149 | \param pSyncObj - pointer to the sync object control block |
dflet | 0:e89ba455dbcf | 150 | |
dflet | 0:e89ba455dbcf | 151 | \return upon successful clearing the function should return 0 |
dflet | 0:e89ba455dbcf | 152 | Otherwise, a negative value indicating the error code shall be returned |
dflet | 0:e89ba455dbcf | 153 | \note |
dflet | 0:e89ba455dbcf | 154 | \warning |
dflet | 0:e89ba455dbcf | 155 | */ |
dflet | 0:e89ba455dbcf | 156 | //#define _SlNonOsSyncObjClear(pSyncObj) _SlNonOsSemSet(pSyncObj,NON_OS_SYNC_OBJ_CLEAR_VALUE) |
dflet | 0:e89ba455dbcf | 157 | |
dflet | 0:e89ba455dbcf | 158 | /*! |
dflet | 0:e89ba455dbcf | 159 | \brief This function creates a locking object. |
dflet | 0:e89ba455dbcf | 160 | |
dflet | 0:e89ba455dbcf | 161 | The locking object is used for protecting a shared resources between different |
dflet | 0:e89ba455dbcf | 162 | threads. |
dflet | 0:e89ba455dbcf | 163 | |
dflet | 0:e89ba455dbcf | 164 | \param pLockObj - pointer to the locking object control block |
dflet | 0:e89ba455dbcf | 165 | |
dflet | 0:e89ba455dbcf | 166 | \return upon successful creation the function should return 0 |
dflet | 0:e89ba455dbcf | 167 | Otherwise, a negative value indicating the error code shall be returned |
dflet | 0:e89ba455dbcf | 168 | \note |
dflet | 0:e89ba455dbcf | 169 | \warning |
dflet | 0:e89ba455dbcf | 170 | */ |
dflet | 0:e89ba455dbcf | 171 | #define _SlNonOsLockObjCreate(pLockObj) _SlNonOsSemSet(pLockObj,NON_OS_LOCK_OBJ_UNLOCK_VALUE) |
dflet | 0:e89ba455dbcf | 172 | |
dflet | 0:e89ba455dbcf | 173 | /*! |
dflet | 0:e89ba455dbcf | 174 | \brief This function deletes a locking object. |
dflet | 0:e89ba455dbcf | 175 | |
dflet | 0:e89ba455dbcf | 176 | \param pLockObj - pointer to the locking object control block |
dflet | 0:e89ba455dbcf | 177 | |
dflet | 0:e89ba455dbcf | 178 | \return upon successful deletion the function should return 0 |
dflet | 0:e89ba455dbcf | 179 | Otherwise, a negative value indicating the error code shall be returned |
dflet | 0:e89ba455dbcf | 180 | \note |
dflet | 0:e89ba455dbcf | 181 | \warning |
dflet | 0:e89ba455dbcf | 182 | */ |
dflet | 0:e89ba455dbcf | 183 | //#define _SlNonOsLockObjDelete(pLockObj) _SlNonOsSemSet(pLockObj,0) |
dflet | 0:e89ba455dbcf | 184 | |
dflet | 0:e89ba455dbcf | 185 | /*! |
dflet | 0:e89ba455dbcf | 186 | \brief This function locks a locking object. |
dflet | 0:e89ba455dbcf | 187 | |
dflet | 0:e89ba455dbcf | 188 | All other threads that call this function before this thread calls |
dflet | 0:e89ba455dbcf | 189 | the _SlNonOsLockObjUnlock would be suspended |
dflet | 0:e89ba455dbcf | 190 | |
dflet | 0:e89ba455dbcf | 191 | \param pLockObj - pointer to the locking object control block |
dflet | 0:e89ba455dbcf | 192 | \param Timeout - numeric value specifies the maximum number of mSec to |
dflet | 0:e89ba455dbcf | 193 | stay suspended while waiting for the locking object |
dflet | 0:e89ba455dbcf | 194 | Currently, the simple link driver uses only two values: |
dflet | 0:e89ba455dbcf | 195 | - NONOS_WAIT_FOREVER |
dflet | 0:e89ba455dbcf | 196 | - NONOS_NO_WAIT |
dflet | 0:e89ba455dbcf | 197 | |
dflet | 0:e89ba455dbcf | 198 | |
dflet | 0:e89ba455dbcf | 199 | \return upon successful reception of the locking object the function should return 0 |
dflet | 0:e89ba455dbcf | 200 | Otherwise, a negative value indicating the error code shall be returned |
dflet | 0:e89ba455dbcf | 201 | \note |
dflet | 0:e89ba455dbcf | 202 | \warning |
dflet | 0:e89ba455dbcf | 203 | */ |
dflet | 0:e89ba455dbcf | 204 | //#define _SlNonOsLockObjLock(pLockObj , Timeout) _SlNonOsSemGet(pLockObj,NON_OS_LOCK_OBJ_UNLOCK_VALUE,NON_OS_LOCK_OBJ_LOCK_VALUE,Timeout) |
dflet | 0:e89ba455dbcf | 205 | |
dflet | 0:e89ba455dbcf | 206 | /*! |
dflet | 0:e89ba455dbcf | 207 | \brief This function unlock a locking object. |
dflet | 0:e89ba455dbcf | 208 | |
dflet | 0:e89ba455dbcf | 209 | \param pLockObj - pointer to the locking object control block |
dflet | 0:e89ba455dbcf | 210 | |
dflet | 0:e89ba455dbcf | 211 | \return upon successful unlocking the function should return 0 |
dflet | 0:e89ba455dbcf | 212 | Otherwise, a negative value indicating the error code shall be returned |
dflet | 0:e89ba455dbcf | 213 | \note |
dflet | 0:e89ba455dbcf | 214 | \warning |
dflet | 0:e89ba455dbcf | 215 | */ |
dflet | 0:e89ba455dbcf | 216 | //#define _SlNonOsLockObjUnlock(pLockObj) _SlNonOsSemSet(pLockObj,NON_OS_LOCK_OBJ_UNLOCK_VALUE) |
dflet | 0:e89ba455dbcf | 217 | |
dflet | 0:e89ba455dbcf | 218 | /***************************************************************************** |
dflet | 0:e89ba455dbcf | 219 | |
dflet | 0:e89ba455dbcf | 220 | Overwrite SimpleLink driver OS adaptation functions |
dflet | 0:e89ba455dbcf | 221 | |
dflet | 0:e89ba455dbcf | 222 | |
dflet | 0:e89ba455dbcf | 223 | *****************************************************************************/ |
dflet | 0:e89ba455dbcf | 224 | |
dflet | 0:e89ba455dbcf | 225 | #undef sl_SyncObjCreate |
dflet | 0:e89ba455dbcf | 226 | #define sl_SyncObjCreate(pSyncObj,pName) _SlNonOsSemSet(pSyncObj,NON_OS_SYNC_OBJ_CLEAR_VALUE) |
dflet | 0:e89ba455dbcf | 227 | |
dflet | 0:e89ba455dbcf | 228 | #undef sl_LockObjCreate |
dflet | 0:e89ba455dbcf | 229 | #define sl_LockObjCreate(pLockObj,pName) _SlNonOsSemSet(pLockObj,NON_OS_LOCK_OBJ_UNLOCK_VALUE) |
dflet | 0:e89ba455dbcf | 230 | |
dflet | 0:e89ba455dbcf | 231 | /*! |
dflet | 0:e89ba455dbcf | 232 | \brief type definition for the return values of this adaptation layer |
dflet | 0:e89ba455dbcf | 233 | */ |
dflet | 0:e89ba455dbcf | 234 | typedef int8_t _SlNonOsRetVal_t; |
dflet | 0:e89ba455dbcf | 235 | |
dflet | 0:e89ba455dbcf | 236 | /*! |
dflet | 0:e89ba455dbcf | 237 | \brief type definition for a time value |
dflet | 0:e89ba455dbcf | 238 | */ |
dflet | 0:e89ba455dbcf | 239 | typedef uint8_t _SlNonOsTime_t; |
dflet | 0:e89ba455dbcf | 240 | |
dflet | 0:e89ba455dbcf | 241 | /*! |
dflet | 0:e89ba455dbcf | 242 | \brief type definition for a sync object container |
dflet | 0:e89ba455dbcf | 243 | |
dflet | 0:e89ba455dbcf | 244 | Sync object is object used to synchronize between two threads or thread and interrupt handler. |
dflet | 0:e89ba455dbcf | 245 | One thread is waiting on the object and the other thread send a signal, which then |
dflet | 0:e89ba455dbcf | 246 | release the waiting thread. |
dflet | 0:e89ba455dbcf | 247 | The signal must be able to be sent from interrupt context. |
dflet | 0:e89ba455dbcf | 248 | This object is generally implemented by binary semaphore or events. |
dflet | 0:e89ba455dbcf | 249 | */ |
dflet | 0:e89ba455dbcf | 250 | typedef uint8_t _SlNonOsSemObj_t; |
dflet | 0:e89ba455dbcf | 251 | |
dflet | 0:e89ba455dbcf | 252 | class cc3100_driver; |
dflet | 0:e89ba455dbcf | 253 | |
dflet | 0:e89ba455dbcf | 254 | class cc3100_nonos |
dflet | 0:e89ba455dbcf | 255 | { |
dflet | 0:e89ba455dbcf | 256 | |
dflet | 0:e89ba455dbcf | 257 | public: |
dflet | 0:e89ba455dbcf | 258 | |
dflet | 0:e89ba455dbcf | 259 | cc3100_nonos(cc3100_driver &driver); |
dflet | 0:e89ba455dbcf | 260 | |
dflet | 0:e89ba455dbcf | 261 | ~cc3100_nonos(); |
dflet | 0:e89ba455dbcf | 262 | |
dflet | 0:e89ba455dbcf | 263 | /*! |
dflet | 0:e89ba455dbcf | 264 | \brief This function call the pEntry callback from a different context |
dflet | 0:e89ba455dbcf | 265 | |
dflet | 0:e89ba455dbcf | 266 | \param pEntry - pointer to the entry callback function |
dflet | 0:e89ba455dbcf | 267 | |
dflet | 0:e89ba455dbcf | 268 | \param pValue - pointer to any type of memory structure that would be |
dflet | 0:e89ba455dbcf | 269 | passed to pEntry callback from the execution thread. |
dflet | 0:e89ba455dbcf | 270 | |
dflet | 0:e89ba455dbcf | 271 | \param flags - execution flags - reserved for future usage |
dflet | 0:e89ba455dbcf | 272 | |
dflet | 0:e89ba455dbcf | 273 | \return upon successful registration of the spawn the function return 0 |
dflet | 0:e89ba455dbcf | 274 | (the function is not blocked till the end of the execution of the function |
dflet | 0:e89ba455dbcf | 275 | and could be returned before the execution is actually completed) |
dflet | 0:e89ba455dbcf | 276 | Otherwise, a negative value indicating the error code shall be returned |
dflet | 0:e89ba455dbcf | 277 | \note |
dflet | 0:e89ba455dbcf | 278 | \warning |
dflet | 0:e89ba455dbcf | 279 | */ |
dflet | 0:e89ba455dbcf | 280 | _SlNonOsRetVal_t _SlNonOsSpawn(_SlSpawnEntryFunc_t pEntry , void* pValue , uint32_t flags); |
dflet | 0:e89ba455dbcf | 281 | |
dflet | 0:e89ba455dbcf | 282 | |
dflet | 0:e89ba455dbcf | 283 | /*! |
dflet | 0:e89ba455dbcf | 284 | \brief This function must be called from the main loop in non-os paltforms |
dflet | 0:e89ba455dbcf | 285 | |
dflet | 0:e89ba455dbcf | 286 | \param None |
dflet | 0:e89ba455dbcf | 287 | |
dflet | 0:e89ba455dbcf | 288 | \return 0 - No more activities |
dflet | 0:e89ba455dbcf | 289 | 1 - Activity still in progress |
dflet | 0:e89ba455dbcf | 290 | \note |
dflet | 0:e89ba455dbcf | 291 | \warning |
dflet | 0:e89ba455dbcf | 292 | */ |
dflet | 0:e89ba455dbcf | 293 | _SlNonOsRetVal_t _SlNonOsMainLoopTask(void); |
dflet | 0:e89ba455dbcf | 294 | |
dflet | 0:e89ba455dbcf | 295 | _SlNonOsRetVal_t _SlNonOsSemGet(_SlNonOsSemObj_t* pSyncObj, _SlNonOsSemObj_t WaitValue, _SlNonOsSemObj_t SetValue, _SlNonOsTime_t Timeout); |
dflet | 0:e89ba455dbcf | 296 | _SlNonOsRetVal_t _SlNonOsSemSet(_SlNonOsSemObj_t* pSemObj , _SlNonOsSemObj_t Value); |
dflet | 0:e89ba455dbcf | 297 | // _SlNonOsRetVal_t _SlNonOsSpawn(_SlSpawnEntryFunc_t pEntry , void* pValue , uint32_t flags); |
dflet | 0:e89ba455dbcf | 298 | // _SlNonOsRetVal_t sl_SyncObjCreate(_SlNonOsSemObj_t* pSemObj, _SlNonOsSemObj_t NON_OS_SYNC_OBJ_CLEAR_VALUE); |
dflet | 0:e89ba455dbcf | 299 | _SlNonOsRetVal_t sl_SyncObjDelete(_SlNonOsSemObj_t* pSemObj, _SlNonOsSemObj_t ); |
dflet | 0:e89ba455dbcf | 300 | _SlNonOsRetVal_t sl_SyncObjSignal(_SlNonOsSemObj_t* pSemObj, _SlNonOsSemObj_t NON_OS_SYNC_OBJ_SIGNAL_VALUE); |
dflet | 0:e89ba455dbcf | 301 | _SlNonOsRetVal_t sl_SyncObjSignalFromIRQ(_SlNonOsSemObj_t* pSemObj, _SlNonOsSemObj_t NON_OS_SYNC_OBJ_SIGNAL_VALUE); |
dflet | 0:e89ba455dbcf | 302 | // _SlNonOsRetVal_t sl_LockObjCreate(_SlNonOsSemObj_t* pSemObj, _SlNonOsSemObj_t NON_OS_LOCK_OBJ_UNLOCK_VALUE); |
dflet | 0:e89ba455dbcf | 303 | _SlNonOsRetVal_t sl_LockObjDelete(_SlNonOsSemObj_t* pSemObj, _SlNonOsSemObj_t ); |
dflet | 0:e89ba455dbcf | 304 | _SlNonOsRetVal_t sl_LockObjUnlock(_SlNonOsSemObj_t* pSemObj, _SlNonOsSemObj_t NON_OS_LOCK_OBJ_UNLOCK_VALUE); |
dflet | 0:e89ba455dbcf | 305 | _SlNonOsRetVal_t sl_SyncObjWait(_SlNonOsSemObj_t* pSyncObj, _SlNonOsSemObj_t NON_OS_SYNC_OBJ_SIGNAL_VALUE, _SlNonOsSemObj_t NON_OS_SYNC_OBJ_CLEAR_VALUE, _SlNonOsTime_t Timeout); |
dflet | 0:e89ba455dbcf | 306 | _SlNonOsRetVal_t sl_LockObjLock(_SlNonOsSemObj_t* pSyncObj, _SlNonOsSemObj_t NON_OS_LOCK_OBJ_UNLOCK_VALUE, _SlNonOsSemObj_t NON_OS_LOCK_OBJ_LOCK_VALUE, _SlNonOsTime_t Timeout); |
dflet | 0:e89ba455dbcf | 307 | |
dflet | 0:e89ba455dbcf | 308 | |
dflet | 0:e89ba455dbcf | 309 | #if (defined(_SlSyncWaitLoopCallback)) |
dflet | 0:e89ba455dbcf | 310 | void _SlSyncWaitLoopCallback(void); |
dflet | 0:e89ba455dbcf | 311 | #endif |
dflet | 0:e89ba455dbcf | 312 | |
dflet | 0:e89ba455dbcf | 313 | private: |
dflet | 0:e89ba455dbcf | 314 | |
dflet | 0:e89ba455dbcf | 315 | cc3100_driver &_driver; |
dflet | 0:e89ba455dbcf | 316 | |
dflet | 0:e89ba455dbcf | 317 | };//class |
dflet | 0:e89ba455dbcf | 318 | |
dflet | 0:e89ba455dbcf | 319 | }//namespace mbed_cc3100 |
dflet | 0:e89ba455dbcf | 320 | |
dflet | 0:e89ba455dbcf | 321 | #endif /* !SL_PLATFORM_MULTI_THREADED */ |
dflet | 0:e89ba455dbcf | 322 | |
dflet | 0:e89ba455dbcf | 323 | |
dflet | 0:e89ba455dbcf | 324 | |
dflet | 0:e89ba455dbcf | 325 | #endif |
dflet | 0:e89ba455dbcf | 326 |