CC3000 test App

Dependencies:   CC3000HostDriver mbed

Committer:
dflet
Date:
Fri Aug 02 15:14:41 2013 +0000
Revision:
0:305844973572
Test program for CC3000 including TI CC3000HostDriver Lib

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dflet 0:305844973572 1 /*****************************************************************************
dflet 0:305844973572 2 *
dflet 0:305844973572 3 * cc3000.h - CC3000 Function Definitions
dflet 0:305844973572 4 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
dflet 0:305844973572 5 *
dflet 0:305844973572 6 * Redistribution and use in source and binary forms, with or without
dflet 0:305844973572 7 * modification, are permitted provided that the following conditions
dflet 0:305844973572 8 * are met:
dflet 0:305844973572 9 *
dflet 0:305844973572 10 * Redistributions of source code must retain the above copyright
dflet 0:305844973572 11 * notice, this list of conditions and the following disclaimer.
dflet 0:305844973572 12 *
dflet 0:305844973572 13 * Redistributions in binary form must reproduce the above copyright
dflet 0:305844973572 14 * notice, this list of conditions and the following disclaimer in the
dflet 0:305844973572 15 * documentation and/or other materials provided with the
dflet 0:305844973572 16 * distribution.
dflet 0:305844973572 17 *
dflet 0:305844973572 18 * Neither the name of Texas Instruments Incorporated nor the names of
dflet 0:305844973572 19 * its contributors may be used to endorse or promote products derived
dflet 0:305844973572 20 * from this software without specific prior written permission.
dflet 0:305844973572 21 *
dflet 0:305844973572 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
dflet 0:305844973572 23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
dflet 0:305844973572 24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
dflet 0:305844973572 25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
dflet 0:305844973572 26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dflet 0:305844973572 27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
dflet 0:305844973572 28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
dflet 0:305844973572 29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
dflet 0:305844973572 30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
dflet 0:305844973572 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
dflet 0:305844973572 32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dflet 0:305844973572 33 *
dflet 0:305844973572 34 *****************************************************************************/
dflet 0:305844973572 35
dflet 0:305844973572 36 #ifndef CC3000_H
dflet 0:305844973572 37 #define CC3000_H
dflet 0:305844973572 38
dflet 0:305844973572 39 #include "netapp.h"
dflet 0:305844973572 40 //*****************************************************************************
dflet 0:305844973572 41 //
dflet 0:305844973572 42 // If building with a C++ compiler, make all of the definitions in this header
dflet 0:305844973572 43 // have a C binding.
dflet 0:305844973572 44 //
dflet 0:305844973572 45 //*****************************************************************************
dflet 0:305844973572 46 #ifdef __cplusplus
dflet 0:305844973572 47 extern "C" {
dflet 0:305844973572 48 #endif
dflet 0:305844973572 49
dflet 0:305844973572 50 #define NUM_STATES 6
dflet 0:305844973572 51 #define FIRST_STATE_LED_NUM 1
dflet 0:305844973572 52 #define MAX_SSID_LEN 32
dflet 0:305844973572 53 #define PALTFORM_VERSION (6)
dflet 0:305844973572 54
dflet 0:305844973572 55 //extern char digits[100];
dflet 0:305844973572 56 extern unsigned char ConnectUsingSmartConfig;
dflet 0:305844973572 57 extern volatile unsigned long ulCC3000Connected;
dflet 0:305844973572 58
dflet 0:305844973572 59
dflet 0:305844973572 60
dflet 0:305844973572 61 // CC3000 State Machine Definitions
dflet 0:305844973572 62 enum cc3000StateEnum
dflet 0:305844973572 63 {
dflet 0:305844973572 64 CC3000_UNINIT = 0x01, // CC3000 Driver Uninitialized
dflet 0:305844973572 65 CC3000_INIT = 0x02, // CC3000 Driver Initialized
dflet 0:305844973572 66 CC3000_ASSOC = 0x04, // CC3000 Associated to AP
dflet 0:305844973572 67 CC3000_IP_ALLOC = 0x08, // CC3000 has IP Address
dflet 0:305844973572 68 CC3000_SERVER_INIT = 0x10, // CC3000 Server Initialized
dflet 0:305844973572 69 };
dflet 0:305844973572 70
dflet 0:305844973572 71 int ConnectUsingSSID(char * ssidName);
dflet 0:305844973572 72 void setupLocalSocket(void);
dflet 0:305844973572 73 void ConnectToServer(void);
dflet 0:305844973572 74 void ConnectToServer(void);
dflet 0:305844973572 75
dflet 0:305844973572 76
dflet 0:305844973572 77 char *sendDriverPatch(unsigned long *Length);
dflet 0:305844973572 78 char *sendBootLoaderPatch(unsigned long *Length);
dflet 0:305844973572 79 char *sendWLFWPatch(unsigned long *Length);
dflet 0:305844973572 80
dflet 0:305844973572 81 void CC3000_UsynchCallback(long lEventType, char * data, unsigned char length);
dflet 0:305844973572 82
dflet 0:305844973572 83 int initDriver(void);
dflet 0:305844973572 84 void StartSmartConfig(void);
dflet 0:305844973572 85 void closeLocalSocket(void);
dflet 0:305844973572 86 void disconnectAll();
dflet 0:305844973572 87
dflet 0:305844973572 88 char isFTCSet();
dflet 0:305844973572 89 void setFTCFlag();
dflet 0:305844973572 90
dflet 0:305844973572 91
dflet 0:305844973572 92 // Machine State
dflet 0:305844973572 93 char currentCC3000State();
dflet 0:305844973572 94 void setCC3000MachineState(char stat);
dflet 0:305844973572 95 void unsetCC3000MachineState(char stat);
dflet 0:305844973572 96 void resetCC3000StateMachine();
dflet 0:305844973572 97 char highestCC3000State();
dflet 0:305844973572 98 //static void StartUnsolicitedEventTimer(void);
dflet 0:305844973572 99 static void DemoInitSpi(void);
dflet 0:305844973572 100
dflet 0:305844973572 101 tNetappIpconfigRetArgs * getCC3000Info();
dflet 0:305844973572 102
dflet 0:305844973572 103 #ifdef __cplusplus
dflet 0:305844973572 104 }
dflet 0:305844973572 105 #endif // __cplusplus
dflet 0:305844973572 106 #endif
dflet 0:305844973572 107