Martin Kojtal / Mbed 2 deprecated cc3000_simple_socket_demo

Dependencies:   NVIC_set_all_priorities cc3000_hostdriver_mbedsocket mbed

Committer:
Kojto
Date:
Tue Jun 03 08:31:20 2014 +0000
Revision:
15:af967b9898f8
Parent:
5:12ea15b9c2f4
update mbed lib to r84

Who changed what in which revision?

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