tcp client for cc3000, using mbed socket interface

Dependencies:   NVIC_set_all_priorities cc3000_hostdriver_mbedsocket mbed

Committer:
Kojto
Date:
Tue Jun 03 08:44:14 2014 +0000
Revision:
6:5fbda2ed5f0f
Parent:
4:51ad2e8bedb9
update mbed lib to r84

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 2:c8cd9df34be9 1 /* mbed Microcontroller Library
Kojto 2:c8cd9df34be9 2 * Copyright (c) 2006-2013 ARM Limited
Kojto 2:c8cd9df34be9 3 *
Kojto 2:c8cd9df34be9 4 * Licensed under the Apache License, Version 2.0 (the "License");
Kojto 2:c8cd9df34be9 5 * you may not use this file except in compliance with the License.
Kojto 2:c8cd9df34be9 6 * You may obtain a copy of the License at
Kojto 2:c8cd9df34be9 7 *
Kojto 2:c8cd9df34be9 8 * http://www.apache.org/licenses/LICENSE-2.0
Kojto 2:c8cd9df34be9 9 *
Kojto 2:c8cd9df34be9 10 * Unless required by applicable law or agreed to in writing, software
Kojto 2:c8cd9df34be9 11 * distributed under the License is distributed on an "AS IS" BASIS,
Kojto 2:c8cd9df34be9 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Kojto 2:c8cd9df34be9 13 * See the License for the specific language governing permissions and
Kojto 2:c8cd9df34be9 14 * limitations under the License.
Kojto 2:c8cd9df34be9 15 */
Kojto 2:c8cd9df34be9 16 #include "main.h"
Kojto 2:c8cd9df34be9 17 #include "mbed.h"
Kojto 2:c8cd9df34be9 18
Kojto 2:c8cd9df34be9 19 #if (MY_BOARD == WIGO)
Kojto 2:c8cd9df34be9 20
Kojto 2:c8cd9df34be9 21 #include "NVIC_set_all_priorities.h"
Kojto 2:c8cd9df34be9 22
Kojto 2:c8cd9df34be9 23 /**
Kojto 2:c8cd9df34be9 24 * \brief Wi-Go initialization
Kojto 2:c8cd9df34be9 25 * \param none
Kojto 2:c8cd9df34be9 26 * \return none
Kojto 2:c8cd9df34be9 27 */
Kojto 2:c8cd9df34be9 28 void init() {
Kojto 2:c8cd9df34be9 29 DigitalOut PWR_EN1(PTB2);
Kojto 2:c8cd9df34be9 30 DigitalOut PWR_EN2(PTB3);
Kojto 2:c8cd9df34be9 31
Kojto 2:c8cd9df34be9 32 // Wi-Go set current to 500mA since we're turning on the Wi-Fi
Kojto 2:c8cd9df34be9 33 PWR_EN1 = 0;
Kojto 2:c8cd9df34be9 34 PWR_EN2 = 1;
Kojto 2:c8cd9df34be9 35
Kojto 4:51ad2e8bedb9 36 NVIC_set_all_irq_priorities(0x3);
Kojto 2:c8cd9df34be9 37 NVIC_SetPriority(SPI0_IRQn, 0x0); // Wi-Fi SPI interrupt must be higher priority than SysTick
Kojto 2:c8cd9df34be9 38 NVIC_SetPriority(PORTA_IRQn, 0x1);
Kojto 2:c8cd9df34be9 39 NVIC_SetPriority(SysTick_IRQn, 0x2); // SysTick set to lower priority than Wi-Fi SPI bus interrupt
Kojto 4:51ad2e8bedb9 40 PORTA->PCR[16] |= PORT_PCR_ISF_MASK;
Kojto 2:c8cd9df34be9 41 PORTA->ISFR |= (1 << 16);
Kojto 2:c8cd9df34be9 42 }
Kojto 2:c8cd9df34be9 43
Kojto 2:c8cd9df34be9 44 #elif (MY_BOARD == WIFI_DIPCORTEX)
Kojto 2:c8cd9df34be9 45
Kojto 2:c8cd9df34be9 46 /**
Kojto 2:c8cd9df34be9 47 * \brief Wifi DipCortex initialization
Kojto 2:c8cd9df34be9 48 * \param none
Kojto 2:c8cd9df34be9 49 * \return none
Kojto 2:c8cd9df34be9 50 */
Kojto 2:c8cd9df34be9 51 void init() {
Kojto 2:c8cd9df34be9 52 NVIC_SetPriority(SSP1_IRQn, 0x0);
Kojto 2:c8cd9df34be9 53 NVIC_SetPriority(PIN_INT0_IRQn, 0x1);
Kojto 2:c8cd9df34be9 54
Kojto 2:c8cd9df34be9 55 // SysTick set to lower priority than Wi-Fi SPI bus interrupt
Kojto 2:c8cd9df34be9 56 NVIC_SetPriority(SysTick_IRQn, 0x2);
Kojto 2:c8cd9df34be9 57 }
Kojto 2:c8cd9df34be9 58
Kojto 2:c8cd9df34be9 59 #else
Kojto 2:c8cd9df34be9 60
Kojto 2:c8cd9df34be9 61 /**
Kojto 2:c8cd9df34be9 62 * \brief Place here init routine for your board
Kojto 2:c8cd9df34be9 63 * \param none
Kojto 2:c8cd9df34be9 64 * \return none
Kojto 2:c8cd9df34be9 65 */
Kojto 2:c8cd9df34be9 66 void init() {
Kojto 2:c8cd9df34be9 67
Kojto 2:c8cd9df34be9 68 }
Kojto 2:c8cd9df34be9 69
Kojto 2:c8cd9df34be9 70 #endif