TI's CC3100 host driver and demo. Experimental and a work in progress.
Revision 1:da33a9116bda, committed 2014-11-18
- Comitter:
- dflet
- Date:
- Tue Nov 18 15:45:17 2014 +0000
- Parent:
- 0:bbe98578d4c0
- Child:
- 2:a3e52cf86086
- Commit message:
- Added BoardInit.h so that boards can be added. This commit will compile for LPC1768 and nucleoF411.
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BoardInit.h Tue Nov 18 15:45:17 2014 +0000 @@ -0,0 +1,26 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2013 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef BoardInit_H +#define BoardInit_H + +#define MBED_BOARD_LPC1768 10 +#define ST_MBED_NUCLEOF411 20 +#define UNDEFINED 30 + +//#define THIS_BOARD MBED_BOARD_LPC1768 +#define THIS_BOARD ST_MBED_NUCLEOF411 + +#endif
--- a/main.cpp Mon Nov 17 19:38:34 2014 +0000
+++ b/main.cpp Tue Nov 18 15:45:17 2014 +0000
@@ -46,19 +46,21 @@
* doc\examples\getting_started_with_wlan_ap.pdf
*/
+#include "mbed.h"
#include "cc3100_simplelink.h"
#include "cc3100_sl_common.h"
-#
-#include "mbed.h"
+#include "BoardInit.h"
+
+#if (THIS_BOARD == MBED_BOARD_LPC1768)
+Serial pc(USBTX, USBRX);//lpc1768
+#elif (THIS_BOARD == ST_MBED_NUCLEOF411)
+Serial pc(SERIAL_TX, SERIAL_RX);//nucleoF411
+#else
+
+#endif
//using namespace mbed_cc3100;
-//cc3100_spi spi_con(p9, p10, p8, SPI(p5, p6, p7));
-Serial pc(SERIAL_TX, SERIAL_RX);//nucleoF411
-//Serial pc(USBTX, USBRX);//lpc1768
-
-//namespace mbed_cc3100 {
-
#define APPLICATION_VERSION "1.1.0"
#define SL_STOP_TIMEOUT 0xFF
--- a/simplelink/cc3100_spi.cpp Mon Nov 17 19:38:34 2014 +0000
+++ b/simplelink/cc3100_spi.cpp Tue Nov 18 15:45:17 2014 +0000
@@ -36,15 +36,20 @@
#include "cc3100_simplelink.h"
#include "cc3100_spi.h"
+#include "BoardInit.h"
- cc3100_spi spi_(PA_9, PC_7, PB_6, SPI(PA_7, PA_6, PA_5));//nucleoF411 nHib, irq, cs, mosi, miso, sck
-// cc3100_spi spi_(p9, p10, p8, SPI(p5, p6, p7));
-// cc3100_spi spi_(p9, p10, p8, SPI(p11, p12, p13));
+#if (THIS_BOARD == MBED_BOARD_LPC1768)
+ cc3100_spi spi_(p9, p10, p8, SPI(p5, p6, p7));//LPC1768 nHib, irq, cs, mosi, miso, sck
+/* cc3100_spi spi_(p9, p10, p8, SPI(p11, p12, p13));//LPC1768 nHib, irq, cs, mosi, miso, sck. Alt spi pins */
+#elif (THIS_BOARD == ST_MBED_NUCLEOF411)
+ cc3100_spi spi_(PA_9, PC_7, PB_6, SPI(PA_7, PA_6, PA_5));//nucleoF411 nHib, irq, cs, mosi, miso, sck
+#else
+
+#endif
P_EVENT_HANDLER pIraEventHandler = 0;
uint8_t IntIsMasked;
-int c = 0;
-int d =0;
+
cc3100_spi::cc3100_spi(PinName cc3100_irq, PinName cc3100_en, PinName cc3100_cs, SPI cc3100_spi)
: _wlan_irq(cc3100_irq), _wlan_nHIB(cc3100_en), _wlan_cs(cc3100_cs), _wlan_spi(cc3100_spi){