CC3000 test App

Dependencies:   CC3000HostDriver mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers cc3000.h Source File

cc3000.h

00001 /*****************************************************************************
00002 *
00003 *  cc3000.h - CC3000 Function Definitions
00004 *  Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
00005 *
00006 *  Redistribution and use in source and binary forms, with or without
00007 *  modification, are permitted provided that the following conditions
00008 *  are met:
00009 *
00010 *    Redistributions of source code must retain the above copyright
00011 *    notice, this list of conditions and the following disclaimer.
00012 *
00013 *    Redistributions in binary form must reproduce the above copyright
00014 *    notice, this list of conditions and the following disclaimer in the
00015 *    documentation and/or other materials provided with the   
00016 *    distribution.
00017 *
00018 *    Neither the name of Texas Instruments Incorporated nor the names of
00019 *    its contributors may be used to endorse or promote products derived
00020 *    from this software without specific prior written permission.
00021 *
00022 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
00023 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
00024 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00025 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
00026 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
00027 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
00028 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00029 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00030 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
00031 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
00032 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033 *
00034 *****************************************************************************/
00035 
00036 #ifndef CC3000_H
00037 #define CC3000_H
00038 
00039 #include "netapp.h"
00040 //*****************************************************************************
00041 //
00042 // If building with a C++ compiler, make all of the definitions in this header
00043 // have a C binding.
00044 //
00045 //*****************************************************************************
00046 #ifdef  __cplusplus
00047 extern "C" {
00048 #endif
00049 
00050 #define NUM_STATES 6
00051 #define FIRST_STATE_LED_NUM 1
00052 #define MAX_SSID_LEN        32
00053 #define PALTFORM_VERSION                        (6)
00054 
00055 //extern char digits[100];
00056 extern unsigned char ConnectUsingSmartConfig; 
00057 extern volatile unsigned long ulCC3000Connected;
00058 
00059 
00060 
00061 // CC3000 State Machine Definitions
00062 enum cc3000StateEnum
00063 {
00064     CC3000_UNINIT           = 0x01, // CC3000 Driver Uninitialized
00065     CC3000_INIT             = 0x02, // CC3000 Driver Initialized
00066     CC3000_ASSOC            = 0x04, // CC3000 Associated to AP
00067     CC3000_IP_ALLOC         = 0x08, // CC3000 has IP Address
00068     CC3000_SERVER_INIT      = 0x10, // CC3000 Server Initialized
00069 };
00070 
00071 int ConnectUsingSSID(char * ssidName);
00072 void setupLocalSocket(void);
00073 void ConnectToServer(void);
00074 void ConnectToServer(void);
00075 
00076 
00077 char *sendDriverPatch(unsigned long *Length);
00078 char *sendBootLoaderPatch(unsigned long *Length);
00079 char *sendWLFWPatch(unsigned long *Length);
00080 
00081 void CC3000_UsynchCallback(long lEventType, char * data, unsigned char length);
00082 
00083 int initDriver(void);
00084 void StartSmartConfig(void);
00085 void closeLocalSocket(void);
00086 void disconnectAll();
00087 
00088 char isFTCSet();
00089 void setFTCFlag();
00090 
00091 
00092 // Machine State
00093 char currentCC3000State();
00094 void setCC3000MachineState(char stat);
00095 void unsetCC3000MachineState(char stat);
00096 void resetCC3000StateMachine();
00097 char highestCC3000State();
00098 //static void StartUnsolicitedEventTimer(void);
00099 static void DemoInitSpi(void);
00100 
00101 tNetappIpconfigRetArgs * getCC3000Info();
00102 
00103 #ifdef  __cplusplus
00104 }
00105 #endif // __cplusplus
00106 #endif
00107