cc3000 twitter demo, uses supertweet services. Set your account there and then fill a user and a secret inside the demo.

Dependencies:   HTTPClient NVIC_set_all_priorities cc3000_hostdriver_mbedsocket mbed

Uses http://www.supertweet.net/, please register there and fill user and secret inside the application.

Committer:
Kojto
Date:
Tue Jun 03 09:30:35 2014 +0000
Revision:
4:450623485778
Parent:
0:5aa9273cb749
update mbed lib to r84

Who changed what in which revision?

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