Connect to SSID, get ip by dhcp, ping google.com, display statistics
Dependencies: NVIC_set_all_priorities cc3000_hostdriver_mbedsocket mbed
Fork of cc3000_ping_demo by
main.h@1:1ef047ffeef4, 2013-09-15 (annotated)
- Committer:
- Kojto
- Date:
- Sun Sep 15 14:41:26 2013 +0000
- Revision:
- 1:1ef047ffeef4
- Parent:
- 0:26d9788555b6
- Child:
- 3:f38499c4000e
Smart config addition, removed non-used macros from the main header file
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 0:26d9788555b6 | 1 | /* mbed Microcontroller Library |
Kojto | 0:26d9788555b6 | 2 | * Copyright (c) 2006-2013 ARM Limited |
Kojto | 0:26d9788555b6 | 3 | * |
Kojto | 0:26d9788555b6 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
Kojto | 0:26d9788555b6 | 5 | * you may not use this file except in compliance with the License. |
Kojto | 0:26d9788555b6 | 6 | * You may obtain a copy of the License at |
Kojto | 0:26d9788555b6 | 7 | * |
Kojto | 0:26d9788555b6 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Kojto | 0:26d9788555b6 | 9 | * |
Kojto | 0:26d9788555b6 | 10 | * Unless required by applicable law or agreed to in writing, software |
Kojto | 0:26d9788555b6 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
Kojto | 0:26d9788555b6 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Kojto | 0:26d9788555b6 | 13 | * See the License for the specific language governing permissions and |
Kojto | 0:26d9788555b6 | 14 | * limitations under the License. |
Kojto | 0:26d9788555b6 | 15 | */ |
Kojto | 0:26d9788555b6 | 16 | #ifndef MAIN_H |
Kojto | 0:26d9788555b6 | 17 | #define MAIN_H |
Kojto | 0:26d9788555b6 | 18 | |
Kojto | 1:1ef047ffeef4 | 19 | /* use this defines in AP_SECURITY */ |
Kojto | 0:26d9788555b6 | 20 | #define NONE 0 |
Kojto | 0:26d9788555b6 | 21 | #define WEP 1 |
Kojto | 0:26d9788555b6 | 22 | #define WPA 2 |
Kojto | 0:26d9788555b6 | 23 | #define WPA2 3 |
Kojto | 0:26d9788555b6 | 24 | |
Kojto | 1:1ef047ffeef4 | 25 | // use smart config |
Kojto | 1:1ef047ffeef4 | 26 | #define USE_SMART_CONFIG 0 |
Kojto | 0:26d9788555b6 | 27 | |
Kojto | 1:1ef047ffeef4 | 28 | // Default SSID Settings |
Kojto | 1:1ef047ffeef4 | 29 | #define AP_KEY "test" |
Kojto | 0:26d9788555b6 | 30 | #define AP_SECURITY WPA2 // WPA2 must be enabled for use with iPhone or Android phone hotspot! |
Kojto | 0:26d9788555b6 | 31 | #define SSID "test" |
Kojto | 1:1ef047ffeef4 | 32 | /* Board specific */ |
Kojto | 0:26d9788555b6 | 33 | #define WIGO_BOARD 1 |
Kojto | 0:26d9788555b6 | 34 | |
Kojto | 0:26d9788555b6 | 35 | #if (WIGO_BOARD == 1) |
Kojto | 0:26d9788555b6 | 36 | |
Kojto | 0:26d9788555b6 | 37 | #define SET_PWR_EN1 PWR_EN1 = 0 |
Kojto | 0:26d9788555b6 | 38 | #define SET_PWR_EN2 PWR_EN2 = 1 |
Kojto | 0:26d9788555b6 | 39 | |
Kojto | 0:26d9788555b6 | 40 | #define WLAN_ISF_PCR PORTA->PCR[16] |
Kojto | 0:26d9788555b6 | 41 | #define WLAN_ISF_ISFR PORTA->ISFR |
Kojto | 0:26d9788555b6 | 42 | #define WLAN_ISF_MASK (1<<16) |
Kojto | 0:26d9788555b6 | 43 | |
Kojto | 0:26d9788555b6 | 44 | #define CLEAR_PCR_INTERRUPT WLAN_ISF_PCR|=PORT_PCR_ISF_MASK; |
Kojto | 0:26d9788555b6 | 45 | #define CLEAN_PORT_INTERRUPT WLAN_ISF_ISFR|=WLAN_ISF_MASK; |
Kojto | 0:26d9788555b6 | 46 | |
Kojto | 0:26d9788555b6 | 47 | #else |
Kojto | 0:26d9788555b6 | 48 | |
Kojto | 0:26d9788555b6 | 49 | #endif |
Kojto | 0:26d9788555b6 | 50 | |
Kojto | 0:26d9788555b6 | 51 | #endif |