TI's CC3100 host driver and demo. Experimental and a work in progress.

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers cc3100_user.h Source File

cc3100_user.h

00001 /*
00002  * user.h - CC31xx/CC32xx Host Driver Implementation
00003  *
00004  * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/ 
00005  * 
00006  * 
00007  *  Redistribution and use in source and binary forms, with or without 
00008  *  modification, are permitted provided that the following conditions 
00009  *  are met:
00010  *
00011  *    Redistributions of source code must retain the above copyright 
00012  *    notice, this list of conditions and the following disclaimer.
00013  *
00014  *    Redistributions in binary form must reproduce the above copyright
00015  *    notice, this list of conditions and the following disclaimer in the 
00016  *    documentation and/or other materials provided with the   
00017  *    distribution.
00018  *
00019  *    Neither the name of Texas Instruments Incorporated nor the names of
00020  *    its contributors may be used to endorse or promote products derived
00021  *    from this software without specific prior written permission.
00022  *
00023  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
00024  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
00025  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00026  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
00027  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
00028  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
00029  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00030  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00031  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
00032  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
00033  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034 *
00035 */
00036     
00037 
00038 #ifndef __USER_H__
00039 #define __USER_H__
00040 
00041 
00042 /*!
00043 
00044     \addtogroup Porting
00045     @{
00046 
00047 */
00048 
00049 /*!
00050  ******************************************************************************
00051 
00052     \defgroup       porting_user_include        User Include Files
00053  
00054     This section IS NOT REQUIRED in case user provided primitives are handled 
00055     in makefiles or project configurations (IDE) 
00056 
00057     PORTING ACTION: 
00058         - Include all required header files for the definition of:
00059             -# Transport layer library API (e.g. SPI, UART)
00060             -# OS primitives definitions (e.g. Task spawn, Semaphores)
00061             -# Memory management primitives (e.g. alloc, free)
00062 
00063  ******************************************************************************
00064  */
00065 
00066 //#include <string.h>
00067 #include "cc3100_spi.h"
00068 
00069 #ifdef  __cplusplus
00070 extern "C" {
00071 #endif
00072 
00073 //namespace mbed_cc3100 {       
00074 
00075 typedef P_EVENT_HANDLER   SL_P_EVENT_HANDLER;
00076 
00077 /*!
00078  ******************************************************************************
00079 
00080     \defgroup       porting_capabilities        Capability Set Definition
00081 
00082     This section IS NOT REQUIRED in case one of the following pre defined 
00083     capabilities set is in use:
00084     - SL_TINY
00085     - SL_SMALL
00086     - SL_FULL
00087 
00088     PORTING ACTION: 
00089         - Define one of the pre-defined capabilities set or uncomment the
00090           relevant definitions below to select the required capabilities
00091     @{
00092  *******************************************************************************
00093  */
00094 
00095 /*!
00096     \def        MAX_CONCURRENT_ACTIONS
00097 
00098     \brief      Defines the maximum number of concurrent action in the system
00099                 Min:1 , Max: 32
00100                     
00101                 Actions which has async events as return, can be 
00102 
00103     \sa             
00104 
00105     \note       In case there are not enough resources for the actions needed in the system,
00106                 error is received: POOL_IS_EMPTY
00107                 one option is to increase MAX_CONCURRENT_ACTIONS 
00108                 (improves performance but results in memory consumption)
00109                 Other option is to call the API later (decrease performance)
00110 
00111     \warning    In case of setting to one, recommend to use non-blocking recv\recvfrom to allow
00112                 multiple socket recv
00113 */
00114 #define MAX_CONCURRENT_ACTIONS 10
00115 
00116 /*!
00117     \def        CPU_FREQ_IN_MHZ
00118     \brief      Defines CPU frequency for Host side, for better accuracy of busy loops, if any
00119     \sa             
00120     \note       
00121 
00122     \warning    If not set the default CPU frequency is set to 200MHz
00123                 This option will be deprecated in future release
00124 */ 
00125 /*
00126 #define CPU_FREQ_IN_MHZ        25
00127 */
00128 
00129 
00130 /*!
00131     \def        SL_INC_ARG_CHECK
00132 
00133     \brief      Defines whether the SimpleLink driver perform argument check 
00134                 or not
00135                     
00136                 When defined, the SimpleLink driver perform argument check on 
00137                 function call. Removing this define could reduce some code 
00138                 size and improve slightly the performances but may impact in 
00139                 unpredictable behaviour in case of invalid arguments
00140 
00141     \sa             
00142 
00143     \note       belongs to \ref porting_sec
00144 
00145     \warning    Removing argument check may cause unpredictable behaviour in 
00146                 case of invalid arguments. 
00147                 In this case the user is responsible to argument validity 
00148                 (for example all handlers must not be NULL)
00149 */
00150 #define SL_INC_ARG_CHECK
00151 
00152 
00153 /*!
00154     \def        SL_INC_STD_BSD_API_NAMING
00155 
00156     \brief      Defines whether SimpleLink driver should expose standard BSD 
00157                 APIs or not
00158     
00159                 When defined, the SimpleLink driver in addition to its alternative
00160                 BSD APIs expose also standard BSD APIs.
00161                 Standard BSD API includes the following functions:
00162                 socket , close , accept , bind , listen , connect , select , 
00163                 setsockopt  , getsockopt , recv , recvfrom , write , send , sendto , 
00164                 gethostbyname
00165 
00166     \sa         
00167 
00168     \note       belongs to \ref porting_sec
00169 
00170     \warning        
00171 */
00172 
00173 #define SL_INC_STD_BSD_API_NAMING
00174 
00175 
00176 /*!
00177     \brief      Defines whether to include extended API in SimpleLink driver
00178                 or not
00179     
00180                 When defined, the SimpleLink driver will include also all 
00181                 extended API of the included packages
00182 
00183     \sa         ext_api
00184 
00185     \note       belongs to \ref porting_sec
00186 
00187     \warning    
00188 */
00189 #define SL_INC_EXT_API
00190 
00191 /*!
00192     \brief      Defines whether to include WLAN package in SimpleLink driver 
00193                 or not
00194     
00195                 When defined, the SimpleLink driver will include also 
00196                 the WLAN package
00197 
00198     \sa         
00199 
00200     \note       belongs to \ref porting_sec
00201 
00202     \warning        
00203 */
00204 #define SL_INC_WLAN_PKG
00205 
00206 /*!
00207     \brief      Defines whether to include SOCKET package in SimpleLink 
00208                 driver or not
00209     
00210                 When defined, the SimpleLink driver will include also 
00211                 the SOCKET package
00212 
00213     \sa         
00214 
00215     \note       belongs to \ref porting_sec
00216 
00217     \warning        
00218 */
00219 #define SL_INC_SOCKET_PKG
00220 
00221 /*!
00222     \brief      Defines whether to include NET_APP package in SimpleLink 
00223                 driver or not
00224     
00225                 When defined, the SimpleLink driver will include also the 
00226                 NET_APP package
00227 
00228     \sa         
00229 
00230     \note       belongs to \ref porting_sec
00231 
00232     \warning        
00233 */
00234 #define SL_INC_NET_APP_PKG
00235 
00236 /*!
00237     \brief      Defines whether to include NET_CFG package in SimpleLink 
00238                 driver or not
00239     
00240                 When defined, the SimpleLink driver will include also 
00241                 the NET_CFG package
00242 
00243     \sa         
00244 
00245     \note       belongs to \ref porting_sec
00246 
00247     \warning        
00248 */
00249 #define SL_INC_NET_CFG_PKG
00250 
00251 /*!
00252     \brief      Defines whether to include NVMEM package in SimpleLink 
00253                 driver or not
00254     
00255                 When defined, the SimpleLink driver will include also the 
00256                 NVMEM package
00257 
00258     \sa         
00259 
00260     \note       belongs to \ref porting_sec
00261 
00262     \warning        
00263 */ 
00264 #define SL_INC_NVMEM_PKG
00265 
00266 /*!
00267     \brief      Defines whether to include socket server side APIs 
00268                 in SimpleLink driver or not
00269     
00270                 When defined, the SimpleLink driver will include also socket 
00271                 server side APIs
00272 
00273     \sa         server_side
00274 
00275     \note       
00276 
00277     \warning        
00278 */
00279 #define SL_INC_SOCK_SERVER_SIDE_API
00280 
00281 /*!
00282     \brief      Defines whether to include socket client side APIs in SimpleLink 
00283                 driver or not
00284     
00285                 When defined, the SimpleLink driver will include also socket 
00286                 client side APIs
00287 
00288     \sa         client_side
00289 
00290     \note       belongs to \ref porting_sec
00291 
00292     \warning        
00293 */
00294 #define SL_INC_SOCK_CLIENT_SIDE_API
00295 
00296 /*!
00297     \brief      Defines whether to include socket receive APIs in SimpleLink 
00298                 driver or not
00299     
00300                 When defined, the SimpleLink driver will include also socket 
00301                 receive side APIs
00302 
00303     \sa         recv_api
00304 
00305     \note       belongs to \ref porting_sec
00306 
00307     \warning        
00308 */
00309 #define SL_INC_SOCK_RECV_API
00310 
00311 /*!
00312     \brief      Defines whether to include socket send APIs in SimpleLink 
00313                 driver or not
00314     
00315                 When defined, the SimpleLink driver will include also socket 
00316                 send side APIs
00317 
00318     \sa         send_api
00319 
00320     \note       belongs to \ref porting_sec
00321 
00322     \warning        
00323 */
00324 #define SL_INC_SOCK_SEND_API
00325 
00326 /*!
00327 
00328  Close the Doxygen group.
00329  @}
00330 
00331  */
00332 
00333 
00334 /*!
00335  ******************************************************************************
00336 
00337     \defgroup   porting_enable_device       Device Enable/Disable IO
00338 
00339     The enable/disable API provide mechanism to enable/disable the network processor
00340 
00341 
00342     PORTING ACTION:
00343         - None
00344     @{
00345 
00346  ******************************************************************************
00347  */
00348 /*!
00349     \brief      Preamble to the enabling the Network Processor.
00350                         Placeholder to implement any pre-process operations
00351                         before enabling networking operations.
00352 
00353     \sa         sl_DeviceEnable
00354 
00355     \note       belongs to \ref ported_sec
00356 
00357 */
00358 #define sl_DeviceEnablePreamble()       
00359 
00360 /*!
00361     \brief      Enable the Network Processor
00362 
00363     \sa         sl_DeviceDisable
00364 
00365     \note       belongs to \ref porting_sec
00366 
00367 */
00368 #define sl_DeviceEnable       CC3100_enable
00369 
00370 /*!
00371     \brief      Disable the Network Processor
00372 
00373     \sa         sl_DeviceEnable
00374 
00375     \note       belongs to \ref porting_sec
00376 */
00377 #define sl_DeviceDisable      CC3100_disable
00378 
00379 /*!
00380 
00381  Close the Doxygen group.
00382  @}
00383 
00384  */
00385 
00386 /*!
00387  ******************************************************************************
00388 
00389     \defgroup   porting_interface         Hardware Transport Interface
00390 
00391     The simple link device can work with different transport interfaces
00392     (namely,SPI or UART). Texas Instruments provides single driver
00393     that can work with all these types. This section binds the
00394     physical transport interface with the SimpleLink driver
00395 
00396 
00397     \note       Correct and efficient implementation of this driver is critical
00398                 for the performances of the SimpleLink device on this platform.
00399 
00400 
00401     PORTING ACTION:
00402         - None
00403 
00404     @{
00405 
00406  ******************************************************************************
00407  */
00408 
00409 #define _SlFd_t                    int
00410 
00411 /*!
00412     \brief      Opens an interface communication port to be used for communicating
00413                 with a SimpleLink device
00414     
00415                 Given an interface name and option flags, this function opens 
00416                 the communication port and creates a file descriptor. 
00417                 This file descriptor is used afterwards to read and write 
00418                 data from and to this specific communication channel.
00419                 The speed, clock polarity, clock phase, chip select and all other 
00420                 specific attributes of the channel are all should be set to hardcoded
00421                 in this function.
00422     
00423     \param      ifName  -   points to the interface name/path. The interface name is an 
00424                             optional attributes that the simple link driver receives
00425                             on opening the driver (sl_Start). 
00426                             In systems that the spi channel is not implemented as 
00427                             part of the OS device drivers, this parameter could be NULL.
00428 
00429     \param      flags   -   optional flags parameters for future use
00430 
00431     \return     upon successful completion, the function shall open the channel 
00432                 and return a non-negative integer representing the file descriptor.
00433                 Otherwise, -1 shall be returned 
00434                     
00435     \sa         sl_IfClose , sl_IfRead , sl_IfWrite
00436 
00437     \note       The prototype of the function is as follow:
00438                     Fd_t xxx_IfOpen(char* pIfName , unsigned long flags);
00439 
00440     \note       belongs to \ref porting_sec
00441 
00442     \warning        
00443 */
00444 
00445 #define sl_IfOpen                           spi_Open
00446 
00447 /*!
00448     \brief      Closes an opened interface communication port
00449     
00450     \param      fd  -   file descriptor of opened communication channel
00451 
00452     \return     upon successful completion, the function shall return 0. 
00453                 Otherwise, -1 shall be returned 
00454                     
00455     \sa         sl_IfOpen , sl_IfRead , sl_IfWrite
00456 
00457     \note       The prototype of the function is as follow:
00458                     int xxx_IfClose(Fd_t Fd);
00459 
00460     \note       belongs to \ref porting_sec
00461 
00462     \warning        
00463 */
00464 #define sl_IfClose                          spi_Close
00465 
00466 /*!
00467     \brief      Attempts to read up to len bytes from an opened communication channel 
00468                 into a buffer starting at pBuff.
00469     
00470     \param      fd      -   file descriptor of an opened communication channel
00471     
00472     \param      pBuff   -   pointer to the first location of a buffer that contains enough 
00473                             space for all expected data
00474 
00475     \param      len     -   number of bytes to read from the communication channel
00476 
00477     \return     upon successful completion, the function shall return the number of read bytes. 
00478                 Otherwise, 0 shall be returned 
00479                     
00480     \sa         sl_IfClose , sl_IfOpen , sl_IfWrite
00481 
00482 
00483     \note       The prototype of the function is as follow:
00484                     int xxx_IfRead(Fd_t Fd , char* pBuff , int Len);
00485 
00486     \note       belongs to \ref porting_sec
00487 
00488     \warning        
00489 */
00490 #define sl_IfRead                           spi_Read
00491 
00492 /*!
00493     \brief attempts to write up to len bytes to the SPI channel
00494     
00495     \param      fd      -   file descriptor of an opened communication channel
00496     
00497     \param      pBuff   -   pointer to the first location of a buffer that contains 
00498                             the data to send over the communication channel
00499 
00500     \param      len     -   number of bytes to write to the communication channel
00501 
00502     \return     upon successful completion, the function shall return the number of sent bytes. 
00503                 otherwise, 0 shall be returned 
00504                     
00505     \sa         sl_IfClose , sl_IfOpen , sl_IfRead
00506 
00507     \note       This function could be implemented as zero copy and return only upon successful completion
00508                 of writing the whole buffer, but in cases that memory allocation is not too tight, the 
00509                 function could copy the data to internal buffer, return back and complete the write in 
00510                 parallel to other activities as long as the other SPI activities would be blocked until 
00511                 the entire buffer write would be completed 
00512 
00513                The prototype of the function is as follow:
00514                     int xxx_IfWrite(Fd_t Fd , char* pBuff , int Len);
00515 
00516     \note       belongs to \ref porting_sec
00517 
00518     \warning        
00519 */
00520 #define sl_IfWrite                          spi_Write
00521 
00522 /*!
00523     \brief      register an interrupt handler routine for the host IRQ
00524 
00525     \param      InterruptHdl    -   pointer to interrupt handler routine
00526 
00527     \param      pValue          -   pointer to a memory structure that is passed
00528                                     to the interrupt handler.
00529 
00530     \return     upon successful registration, the function shall return 0.
00531                 Otherwise, -1 shall be returned
00532 
00533     \sa
00534 
00535     \note       If there is already registered interrupt handler, the function
00536                 should overwrite the old handler with the new one
00537 
00538     \note       If the handler is a null pointer, the function should un-register the
00539                 interrupt handler, and the interrupts can be disabled.
00540 
00541     \note       belongs to \ref porting_sec
00542 
00543     \warning        
00544 */
00545 #define sl_IfRegIntHdlr(InterruptHdl , pValue) \
00546                                 registerInterruptHandler(InterruptHdl , pValue)
00547 /*!
00548     \brief      Masks the Host IRQ
00549 
00550     \sa     sl_IfUnMaskIntHdlr
00551 
00552 
00553 
00554     \note       belongs to \ref porting_sec
00555 
00556     \warning
00557 */
00558 
00559 #define sl_IfMaskIntHdlr        MaskIntHdlr
00560 
00561 /*!
00562     \brief      Unmasks the Host IRQ
00563 
00564     \sa     sl_IfMaskIntHdlr
00565 
00566 
00567 
00568     \note       belongs to \ref porting_sec
00569 
00570     \warning
00571 */
00572 
00573 #define sl_IfUnMaskIntHdlr     UnMaskIntHdlr
00574     
00575 /*!
00576     \brief      Write Handers for statistics debug on write 
00577 
00578     \param      interface handler   -   pointer to interrupt handler routine
00579 
00580 
00581     \return     no return value
00582 
00583     \sa
00584 
00585     \note       An optional hooks for monitoring before and after write info
00586 
00587     \note       belongs to \ref porting_sec
00588 
00589     \warning        
00590 */
00591 /*
00592 #define SL_START_WRITE_STAT
00593 */
00594 
00595 #ifdef SL_START_WRITE_STAT
00596 #define sl_IfStartWriteSequence                      
00597 #define sl_IfEndWriteSequence                        
00598 #endif
00599 /*!
00600 
00601  Close the Doxygen group.
00602  @}
00603 
00604  */
00605 
00606 /*!
00607  ******************************************************************************
00608 
00609     \defgroup   porting_mem_mgm             Memory Management
00610 
00611     This section declare in which memory management model the SimpleLink driver
00612     will run:
00613         -# Static
00614         -# Dynamic
00615 
00616     This section IS NOT REQUIRED in case Static model is selected.
00617 
00618     The default memory model is Static
00619 
00620     PORTING ACTION:
00621         - If dynamic model is selected, define the alloc and free functions.
00622 
00623     @{
00624 
00625  *****************************************************************************
00626  */
00627 
00628 /*!
00629     \brief      Defines whether the SimpleLink driver is working in dynamic
00630                 memory model or not
00631 
00632                 When defined, the SimpleLink driver use dynamic allocations
00633                 if dynamic allocation is selected malloc and free functions
00634                 must be retrieved
00635 
00636     \sa
00637 
00638     \note       belongs to \ref porting_sec
00639 
00640     \warning
00641 */
00642 /*
00643 #define SL_MEMORY_MGMT_DYNAMIC
00644 */
00645 
00646 #ifdef SL_MEMORY_MGMT_DYNAMIC
00647 
00648 /*!
00649     \brief
00650 
00651     \sa
00652 
00653     \note           belongs to \ref porting_sec
00654 
00655     \warning        
00656 */
00657 #define sl_Malloc(Size)
00658 
00659 /*!
00660     \brief
00661 
00662     \sa
00663 
00664     \note           belongs to \ref porting_sec
00665 
00666     \warning        
00667 */
00668 #define sl_Free(pMem)
00669 
00670 #endif
00671 
00672 /*!
00673 
00674  Close the Doxygen group.
00675  @}
00676 
00677  */
00678 
00679 /*!
00680  ******************************************************************************
00681 
00682     \defgroup   porting_os          Operating System (OS)
00683 
00684     The simple link driver can run on multi-threaded environment as well
00685     as non-os environment (main loop)
00686 
00687     This section IS NOT REQUIRED in case you are working on non-os environment.
00688 
00689     If you choose to work in multi-threaded environment under any operating system
00690     you will have to provide some basic adaptation routines to allow the driver
00691     to protect access to resources from different threads (locking object) and
00692     to allow synchronization between threads (sync objects).
00693 
00694     PORTING ACTION:
00695         -# Uncomment SL_PLATFORM_MULTI_THREADED define
00696         -# Bind locking object routines
00697         -# Bind synchronization object routines
00698         -# Optional - Bind spawn thread routine
00699 
00700     @{
00701 
00702  ******************************************************************************
00703  */
00704 
00705 /*
00706 #define SL_PLATFORM_MULTI_THREADED
00707 */
00708 
00709 #ifdef SL_PLATFORM_MULTI_THREADED
00710 
00711 /*!
00712     \brief
00713     \sa
00714     \note           belongs to \ref porting_sec
00715     \warning
00716 */
00717 #define SL_OS_RET_CODE_OK
00718 
00719 /*!
00720     \brief
00721     \sa
00722     \note           belongs to \ref porting_sec
00723     \warning
00724 */
00725 #define SL_OS_WAIT_FOREVER
00726 
00727 /*!
00728     \brief
00729     \sa
00730     \note           belongs to \ref porting_sec
00731     \warning
00732 */
00733 #define SL_OS_NO_WAIT
00734 
00735 /*!
00736     \brief type definition for a time value
00737 
00738     \note   On each porting or platform the type could be whatever is needed - integer, pointer to structure etc.
00739 
00740     \note       belongs to \ref porting_sec
00741 */
00742 #define _SlTime_t               
00743 
00744 /*!
00745     \brief  type definition for a sync object container
00746 
00747     Sync object is object used to synchronize between two threads or thread and interrupt handler.
00748     One thread is waiting on the object and the other thread send a signal, which then
00749     release the waiting thread.
00750     The signal must be able to be sent from interrupt context.
00751     This object is generally implemented by binary semaphore or events.
00752 
00753     \note   On each porting or platform the type could be whatever is needed - integer, structure etc.
00754 
00755     \note       belongs to \ref porting_sec
00756 */
00757 #define _SlSyncObj_t            
00758 
00759     
00760 /*!
00761     \brief  This function creates a sync object
00762 
00763     The sync object is used for synchronization between different thread or ISR and
00764     a thread.
00765 
00766     \param  pSyncObj    -   pointer to the sync object control block
00767 
00768     \return upon successful creation the function should return 0
00769             Otherwise, a negative value indicating the error code shall be returned
00770 
00771     \note       belongs to \ref porting_sec
00772     \warning
00773 */
00774 #define sl_SyncObjCreate(pSyncObj,pName)           
00775 
00776     
00777 /*!
00778     \brief  This function deletes a sync object
00779 
00780     \param  pSyncObj    -   pointer to the sync object control block
00781 
00782     \return upon successful deletion the function should return 0
00783             Otherwise, a negative value indicating the error code shall be returned
00784     \note       belongs to \ref porting_sec
00785     \warning
00786 */
00787 #define sl_SyncObjDelete(pSyncObj)                  
00788 
00789     
00790 /*!
00791     \brief      This function generates a sync signal for the object.
00792 
00793     All suspended threads waiting on this sync object are resumed
00794 
00795     \param      pSyncObj    -   pointer to the sync object control block
00796 
00797     \return     upon successful signalling the function should return 0
00798                 Otherwise, a negative value indicating the error code shall be returned
00799     \note       the function could be called from ISR context
00800     \warning
00801 */
00802 #define sl_SyncObjSignal(pSyncObj)                
00803 
00804 /*!
00805     \brief      This function generates a sync signal for the object from Interrupt
00806 
00807     This is for RTOS that should signal from IRQ using a dedicated API
00808 
00809     \param      pSyncObj    -   pointer to the sync object control block
00810 
00811     \return     upon successful signalling the function should return 0
00812                 Otherwise, a negative value indicating the error code shall be returned
00813     \note       the function could be called from ISR context
00814     \warning
00815 */
00816 #define sl_SyncObjSignalFromIRQ(pSyncObj)           
00817 /*!
00818     \brief  This function waits for a sync signal of the specific sync object
00819 
00820     \param  pSyncObj    -   pointer to the sync object control block
00821     \param  Timeout     -   numeric value specifies the maximum number of mSec to
00822                             stay suspended while waiting for the sync signal
00823                             Currently, the simple link driver uses only two values:
00824                                 - OSI_WAIT_FOREVER
00825                                 - OSI_NO_WAIT
00826 
00827     \return upon successful reception of the signal within the timeout window return 0
00828             Otherwise, a negative value indicating the error code shall be returned
00829     \note       belongs to \ref porting_sec
00830     \warning
00831 */
00832 #define sl_SyncObjWait(pSyncObj,Timeout)             
00833     
00834 /*!
00835     \brief  type definition for a locking object container
00836 
00837     Locking object are used to protect a resource from mutual accesses of two or more threads.
00838     The locking object should support reentrant locks by a signal thread.
00839     This object is generally implemented by mutex semaphore
00840 
00841     \note   On each porting or platform the type could be whatever is needed - integer, structure etc.
00842     \note       belongs to \ref porting_sec
00843 */
00844 #define _SlLockObj_t            
00845 
00846 /*!
00847     \brief  This function creates a locking object.
00848 
00849     The locking object is used for protecting a shared resources between different
00850     threads.
00851 
00852     \param  pLockObj    -   pointer to the locking object control block
00853 
00854     \return upon successful creation the function should return 0
00855             Otherwise, a negative value indicating the error code shall be returned
00856     \note       belongs to \ref porting_sec
00857     \warning
00858 */
00859 #define sl_LockObjCreate(pLockObj,pName)            
00860     
00861 /*!
00862     \brief  This function deletes a locking object.
00863 
00864     \param  pLockObj    -   pointer to the locking object control block
00865 
00866     \return upon successful deletion the function should return 0
00867             Otherwise, a negative value indicating the error code shall be returned
00868     \note       belongs to \ref porting_sec
00869     \warning
00870 */
00871 #define sl_LockObjDelete(pLockObj)                 
00872     
00873 /*!
00874     \brief  This function locks a locking object.
00875 
00876     All other threads that call this function before this thread calls
00877     the osi_LockObjUnlock would be suspended
00878 
00879     \param  pLockObj    -   pointer to the locking object control block
00880     \param  Timeout     -   numeric value specifies the maximum number of mSec to
00881                             stay suspended while waiting for the locking object
00882                             Currently, the simple link driver uses only two values:
00883                                 - OSI_WAIT_FOREVER
00884                                 - OSI_NO_WAIT
00885 
00886 
00887     \return upon successful reception of the locking object the function should return 0
00888             Otherwise, a negative value indicating the error code shall be returned
00889     \note       belongs to \ref porting_sec
00890     \warning
00891 */
00892 #define sl_LockObjLock(pLockObj,Timeout)            
00893     
00894 /*!
00895     \brief  This function unlock a locking object.
00896 
00897     \param  pLockObj    -   pointer to the locking object control block
00898 
00899     \return upon successful unlocking the function should return 0
00900             Otherwise, a negative value indicating the error code shall be returned
00901     \note       belongs to \ref porting_sec
00902     \warning
00903 */
00904 #define sl_LockObjUnlock(pLockObj)                 
00905 
00906 #endif
00907 /*!
00908     \brief  This function call the pEntry callback from a different context
00909 
00910     \param  pEntry      -   pointer to the entry callback function
00911 
00912     \param  pValue      -   pointer to any type of memory structure that would be
00913                             passed to pEntry callback from the execution thread.
00914 
00915     \param  flags       -   execution flags - reserved for future usage
00916 
00917     \return upon successful registration of the spawn the function should return 0
00918             (the function is not blocked till the end of the execution of the function
00919             and could be returned before the execution is actually completed)
00920             Otherwise, a negative value indicating the error code shall be returned
00921     \note       belongs to \ref porting_sec
00922     \warning
00923 */
00924 /*
00925 #define SL_PLATFORM_EXTERNAL_SPAWN
00926 */
00927 
00928 #ifdef SL_PLATFORM_EXTERNAL_SPAWN
00929 #define sl_Spawn(pEntry,pValue,flags)               
00930 #endif
00931 
00932 /*!
00933 
00934  Close the Doxygen group.
00935  @}
00936 
00937  */
00938 
00939 
00940 /*!
00941  ******************************************************************************
00942 
00943     \defgroup       porting_events      Event Handlers
00944 
00945     This section includes the asynchronous event handlers routines
00946 
00947     PORTING ACTION:
00948         -Uncomment the required handler and define your routine as the value
00949         of this handler
00950 
00951     @{
00952 
00953  ******************************************************************************
00954  */
00955 
00956 /*!
00957     \brief
00958 
00959     \sa
00960 
00961     \note       belongs to \ref porting_sec
00962 
00963     \warning
00964 */
00965 #define sl_GeneralEvtHdlr       SimpleLinkGeneralEventHandler
00966 
00967 
00968 /*!
00969     \brief          An event handler for WLAN connection or disconnection indication
00970                     This event handles async WLAN events. 
00971                     Possible events are:
00972                     SL_WLAN_CONNECT_EVENT - indicates WLAN is connected 
00973                     SL_WLAN_DISCONNECT_EVENT - indicates WLAN is disconnected
00974     \sa
00975 
00976     \note           belongs to \ref porting_sec
00977 
00978     \warning
00979 */
00980 #define sl_WlanEvtHdlr          SimpleLinkWlanEventHandler
00981 
00982 /*!
00983     \brief          An event handler for IP address asynchronous event. Usually accepted after new WLAN connection.
00984                     This event handles networking events.
00985                     Possible events are:
00986                     SL_NETAPP_IPV4_ACQUIRED - IP address was acquired (DHCP or Static)
00987 
00988     \sa
00989 
00990     \note           belongs to \ref porting_sec
00991 
00992     \warning
00993 */
00994 
00995 #define sl_NetAppEvtHdlr        SimpleLinkNetAppEventHandler
00996 
00997 /*!
00998     \brief          A callback for HTTP server events.
00999                     Possible events are:
01000                     SL_NETAPP_HTTPGETTOKENVALUE - NWP requests to get the value of a specific token
01001                     SL_NETAPP_HTTPPOSTTOKENVALUE - NWP post to the host a new value for a specific token
01002 
01003     \param          pServerEvent - Contains the relevant event information (SL_NETAPP_HTTPGETTOKENVALUE or SL_NETAPP_HTTPPOSTTOKENVALUE)
01004 
01005     \param          pServerResponse - Should be filled by the user with the relevant response information (i.e SL_NETAPP_HTTPSETTOKENVALUE as a response to SL_NETAPP_HTTPGETTOKENVALUE event)
01006 
01007     \sa
01008 
01009     \note           belongs to \ref porting_sec
01010 
01011     \warning
01012 */
01013 
01014 #define sl_HttpServerCallback   SimpleLinkHttpServerCallback
01015 
01016 /*!
01017     \brief
01018 
01019     \sa
01020 
01021     \note           belongs to \ref porting_sec
01022 
01023     \warning
01024 */
01025 #define sl_SockEvtHdlr          SimpleLinkSockEventHandler
01026 
01027 //}//namespace mbed_cc3100 
01028 
01029 /*!
01030 
01031  Close the Doxygen group.
01032  @}
01033 
01034  */
01035 
01036 
01037 #ifdef  __cplusplus
01038 }
01039 #endif /* __cplusplus */
01040 
01041 #endif /* __USER_H__ */
01042