Demo starter application to connect WiGo to NSP and expose on-board sensors

Dependencies:   NVIC_set_all_priorities cc3000_hostdriver_mbedsocket mbed nsdl_lib TEMT6200 TSI Wi-Go_eCompass_Lib_V3 WiGo_BattCharger

This is the mbed project for the IoT World Hackathon event, June 17th and 18th in Palo Also.

The setup instructions for participants are at the Setup page of this wiki:

http://mbed.org/teams/MBED_DEMOS/code/IoT_World_Hackathon_WiGo_NSP_Demo/wiki/Setup-Guide-for-the-IoT-World-Hackathon

Committer:
michaeljkoster
Date:
Wed Jul 09 04:35:49 2014 +0000
Revision:
18:11b9d98ecae2
Parent:
0:07581223f90c
Checkpoint

Who changed what in which revision?

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