diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html
index a0e22807cf..3b15a38a06 100644
--- a/Documentation/NuttX.html
+++ b/Documentation/NuttX.html
@@ -8,7 +8,7 @@
NuttX RTOS
- Last Updated: March 2, 2017
+ Last Updated: April 4, 2018
|
@@ -974,7 +974,7 @@
- Support for networking modules (e.g., the TI CC3000 WLAN module and ESP8266).
+ Support for networking modules (e.g., ESP8266).
|
@@ -1504,7 +1504,7 @@
ARM Cortex-A9 (1)
ARM Cortex-R4 (1)
ARM Cortex-M0/M0+ (10)
- ARM Cortex-M3 (38)
+ ARM Cortex-M3 (37)
ARM Cortex-M4 (44)
ARM Cortex-M7 (10)
@@ -3128,7 +3128,7 @@ nsh>
STMicro STM32F103x (STM32 F1 Family).
- Support for four MCUs and four board configurations are available.
+ Support for five board configurations are available.
MCU support includes all of the high density and connectivity line families.
Board supported is available specifically for: STM32F103ZET6, STM32F103RET6, STM32F103VCT, STM32F103VET6, STM32F103RBT6, and STM32103CBT6.
Boards supported include:
@@ -3164,19 +3164,6 @@ nsh>
see the NuttX board README file for further information about the NuttX port.
-
-
- Spark (and emulated Spark).
- The Spark boards are based on the STM32F103CBT6 chip and feature wireless networking using the TI CC3000 WLAN module.
- See the Spark web site for hardware information;
- The emulated Spark is a base board for the Maple Mini board (see above) developed by David Sidrane that supports Spark development while we all way breathlessly for or Spark boards.
- see the NuttX board README file for further information about the NuttX port.
-
-
- Initially Spark support was introduced in NuttX 6.31 and completed in NuttX 6.32.
- Most of this work is the result of the effort of David Sidrane.
-
-
Olimexino-STM32.
@@ -3229,13 +3216,6 @@ nsh>
Support for the Maple boards was contributed by Yiran Liao and first appear in NuttX 6-30.
-
-
- Spark.
- David Sidrane has the emulated Spark board up-and-running with a functional CC3000 network, SST25 FAT file system, an NSH shell, and a composite USB CDC/ACM and USBMSC devices. This configuration is was first available NuttX 6.31 and completed in NuttX 6.32.
- That is really quite a lot of high end functionality on an STM32 that only has 20KB of RAM! I am impressed!
-
-
Olimexino-STM32.
diff --git a/Documentation/README.html b/Documentation/README.html
index 0083b25137..098e098b8d 100644
--- a/Documentation/README.html
+++ b/Documentation/README.html
@@ -275,8 +275,6 @@ nuttx/
| | `- README.txt
| |- skp16c26/
| | `- README.txt
- | |- spark/
- | | `- README.txt
| |- stm3210e-eval/
| | |- RIDE/README.txt
| | `- README.txt
diff --git a/README.txt b/README.txt
index 0f8958db95..9cc67a34e9 100644
--- a/README.txt
+++ b/README.txt
@@ -1843,8 +1843,6 @@ nuttx/
| | `- README.txt
| |- skp16c26/
| | `- README.txt
- | |- spark/
- | | `- README.txt
| |- stm3210e-eval/
| | |- RIDE/README.txt
| | `- README.txt
diff --git a/configs/Kconfig b/configs/Kconfig
index 3a567d65b1..c97c384935 100644
--- a/configs/Kconfig
+++ b/configs/Kconfig
@@ -1111,17 +1111,6 @@ config ARCH_BOARD_SKP16C26
uses the GNU m32c toolchain. STATUS: The port is complete but untested
due to issues with compiler internal errors.
-config ARCH_BOARD_SPARK
- bool "Spark Core"
- depends on ARCH_CHIP_STM32F103CB
- select ARCH_HAVE_LEDS
- select ARCH_HAVE_BUTTONS
- select ARCH_HAVE_IRQBUTTONS
- ---help---
- A configuration for the Spark Core from Spark Devices
- (http://www.spark.io). This board features the STM32103CBT6
- MCU from STMicro.
-
config ARCH_BOARD_PHOTON
bool "Photon wifi board"
depends on ARCH_CHIP_STM32F205RG
@@ -1726,7 +1715,6 @@ config ARCH_BOARD
default "samv71-xult" if ARCH_BOARD_SAMV71_XULT
default "shenzhou" if ARCH_BOARD_SHENZHOU
default "skp16c26" if ARCH_BOARD_SKP16C26
- default "spark" if ARCH_BOARD_SPARK
default "photon" if ARCH_BOARD_PHOTON
default "stm32butterfly2" if ARCH_BOARD_STM32_BUTTERFLY2
default "stm32_tiny" if ARCH_BOARD_STM32_TINY
@@ -2120,9 +2108,6 @@ endif
if ARCH_BOARD_SKP16C26
source "configs/skp16c26/Kconfig"
endif
-if ARCH_BOARD_SPARK
-source "configs/spark/Kconfig"
-endif
if ARCH_BOARD_PHOTON
source "configs/photon/Kconfig"
endif
diff --git a/configs/README.txt b/configs/README.txt
index ec53cde7fa..34ee5a821e 100644
--- a/configs/README.txt
+++ b/configs/README.txt
@@ -664,10 +664,6 @@ configs/shenzhou
This is the port of NuttX to the Shenzhou development board from
www.armjishu.com. This board features the STMicro STM32F107VCT MCU.
-configs/spark
- Board support for the Spark Core from Spark Devices http://www.sparkdevices.com).
- This board features the STM32103CBT6 MCU from STMicro.
-
configs/skp16c26
Renesas M16C processor on the Renesas SKP16C26 StarterKit. This port
uses the GNU m32c toolchain. STATUS: The port is complete but untested
diff --git a/configs/freedom-kl25z/README.txt b/configs/freedom-kl25z/README.txt
index d8b5da82a5..b043df6144 100644
--- a/configs/freedom-kl25z/README.txt
+++ b/configs/freedom-kl25z/README.txt
@@ -369,25 +369,3 @@ Where is one of the following:
5. This configurations has support for NSH built-in applications. However,
in the default configuration no built-in applications are enabled.
-
- 6. This configuration has been used to verify the TI CC3000 wireless
- networking module. In order to enable this module, you would need to
- make the following changes to the default configuration files:
-
- System Type -> Kinetis peripheral support
- CONFIG_KL_SPI0=y : Enable SPI
- CONFIG_KL_SPI1=y
-
- Drivers -> SPI
- CONFIG_SPI=y : Enable SPI
- CONFIG_SPI_EXCHANGE=y
-
- Drivers -> Wireless
- CONFIG_DRIVERS_WIRELESS=y : Enable wireless support
- CONFIG_WL_CC3000=y : Build the CC3000 driver
-
- Applications -> Examples
- CONFIG_EXAMPLES_CC3000BASIC=y : CC3000 test example
-
- Applications -> NSH Library
- CONFIG_NSH_ARCHINIT=y : Build in CC3000 initialization logic
diff --git a/configs/freedom-kl25z/include/board.h b/configs/freedom-kl25z/include/board.h
index 918b00d73d..42a7454a8b 100644
--- a/configs/freedom-kl25z/include/board.h
+++ b/configs/freedom-kl25z/include/board.h
@@ -218,12 +218,6 @@
#define PIN_SPI1_MISO (PIN_SPI1_MISO_3 | PIN_ALT2_PULLUP)
#define PIN_SPI1_MOSI (PIN_SPI0_MOSI_7 | PIN_ALT2_PULLUP)
-/* These pins are used by CC3000 module */
-
-#define GPIO_WIFI_EN (GPIO_OUTPUT | GPIO_OUTPUT_ZER0 | PIN_PORTC | PIN12)
-#define GPIO_WIFI_IRQ (GPIO_INPUT | PIN_PORTA | PIN16)
-#define GPIO_WIFI_CS (GPIO_OUTPUT | GPIO_OUTPUT_ONE | PIN_PORTE | PIN1)
-
/* Interrupt pin used by ADXL345
*
* CS = PTD0 (D10 at connector J2 pin 6 of Freedom Board)
diff --git a/configs/freedom-kl25z/include/kl_cc3000.h b/configs/freedom-kl25z/include/kl_cc3000.h
deleted file mode 100644
index ce252a67a0..0000000000
--- a/configs/freedom-kl25z/include/kl_cc3000.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
- * configs/freedom-kl25z/include/kl_cc300.h
- *
- * Copyright (C) 2013 Alan Carvalho de Assis
- * Author: Alan Carvalho de Assis
- * with adaptions from Gregory Nutt
- *
- * Reference: https://community.freescale.com/community/
- * the-embedded-beat/blog/2012/10/15/
- * using-the-touch-interface-on-the-freescale-freedom-development-platform
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-#ifndef __CONFIGS_FREEDOM_KL25Z_INCLUDE_KL_CC3000_H
-#define __CONFIGS_FREEDOM_KL25Z_INCLUDE_KL_CC3000_H 1
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-#include
-
-/****************************************************************************
- * Public Function Prototypes
- ****************************************************************************/
-
-long ReadWlanInterruptPin(void);
-
-/* Enable WiFi Interrupt */
-
-void WlanInterruptEnable(void);
-
-/* Disable WiFi Interrupt */
-
-void WlanInterruptDisable(void);
-
-/* Enable/Disable WiFi */
-
-void WriteWlanEnablePin(uint8_t val);
-
-/* Assert CC3000 CS */
-
-void AssertWlanCS(void);
-
-/* Deassert CC3000 CS */
-
-void DeassertWlanCS(void);
-
-/* Setup needed pins */
-
-void Wlan_Setup(void);
-
-#endif /* __CONFIGS_FREEDOM_KL25Z_INCLUDE_KL_CC3000_H */
-
diff --git a/configs/freedom-kl25z/src/Makefile b/configs/freedom-kl25z/src/Makefile
index 843155c3bc..9da4c3d8db 100644
--- a/configs/freedom-kl25z/src/Makefile
+++ b/configs/freedom-kl25z/src/Makefile
@@ -42,10 +42,6 @@ ifeq ($(CONFIG_LIB_BOARDCTL),y)
CSRCS += kl_appinit.c
endif
-ifeq ($(CONFIG_WL_CC3000),y)
-CSRCS += kl_cc3000.c
-endif
-
ifeq ($(CONFIG_KL_TSI),y)
CSRCS += kl_tsi.c
endif
diff --git a/configs/freedom-kl25z/src/kl_boardinitialize.c b/configs/freedom-kl25z/src/kl_boardinitialize.c
index 4da407d238..81eea49cfd 100644
--- a/configs/freedom-kl25z/src/kl_boardinitialize.c
+++ b/configs/freedom-kl25z/src/kl_boardinitialize.c
@@ -127,10 +127,5 @@ void board_initialize(void)
(void)board_app_initialize(0);
#endif
- /* CC3000 wireless initialization */
-
-#ifdef CONFIG_WL_CC3000
- wireless_archinitialize(0);
-#endif
}
#endif
diff --git a/configs/freedom-kl25z/src/kl_cc3000.c b/configs/freedom-kl25z/src/kl_cc3000.c
deleted file mode 100644
index c446ff870b..0000000000
--- a/configs/freedom-kl25z/src/kl_cc3000.c
+++ /dev/null
@@ -1,375 +0,0 @@
-/****************************************************************************
- * configs/freedom-kl25z/src/kl_cc3000.c
- *
- * Copyright (C) 2014 Alan Carvalho de Assis
- * Author: Alan Carvalho de Assis
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include "up_arch.h"
-#include "kl_gpio.h"
-#include "chip/kl_pinmux.h"
-#include "chip/kl_sim.h"
-#include "freedom-kl25z.h"
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#ifdef CONFIG_WL_CC3000
-#ifndef CONFIG_DRIVERS_WIRELESS
-# error "Wireless support requires CONFIG_DRIVERS_WIRELESS"
-#endif
-
-#ifndef CONFIG_KL_SPI0
-# error "CC3000 Wireless support requires CONFIG_KL_SPI0"
-#endif
-
-#ifndef CC3000_SPI_FREQUENCY
-# define CC3000_SPI_FREQUENCY 16000000
-#endif
-
-#ifndef CC3000_SPIDEV
-# define CC3000_SPIDEV 0
-#endif
-
-#if CC3000_SPIDEV != 0
-# error "CC3000_SPIDEV must be 0"
-#endif
-
-#ifndef CC3000_DEVMINOR
-# define CC3000_DEVMINOR 0
-#endif
-
-#ifndef CONFIG_CC3000_RX_BUFFER_SIZE
-# define CONFIG_CC3000_RX_BUFFER_SIZE 132
-#endif
-
-/****************************************************************************
- * Private Types
- ****************************************************************************/
-
-struct kl_config_s
-{
- struct cc3000_config_s dev;
- xcpt_t handler;
-};
-
-/****************************************************************************
- * Private Function Prototypes
- ****************************************************************************/
-
-/* IRQ/GPIO access callbacks. These operations all hidden behind callbacks
- * to isolate the CC3000 driver from differences in GPIO interrupt handling
- * by varying boards and MCUs. If possible, interrupts should be configured
- * on falling edges to detect the Ready Condition At T2: The normal master
- * SPI write sequence is SPI_CS low, followed by SPI_IRQ low CC3000 to host,
- * indicating that the CC3000 core module is ready to accept data. T2
- * duration is approximately 7 ms.
- *
- * irq_attach - Attach the CC3000 interrupt handler to the GPIO
- * interrupt
- * irq_enable - Enable or disable the GPIO interrupt
- * irq_clear - Acknowledge/clear any pending GPIO interrupt
- * power_enable - Enable or disable Module enable.
- * chip_chip_select - The Chip Select
- * irq_read - Return the state of the interrupt GPIO input
- * probe - Debug support
- */
-
-static int wl_attach_irq(FAR struct cc3000_config_s *state, xcpt_t handler,
- FAR void *arg);
-static void wl_enable_irq(FAR struct cc3000_config_s *state, bool enable);
-static void wl_clear_irq(FAR struct cc3000_config_s *state);
-static void wl_select(FAR struct cc3000_config_s *state, bool enable);
-static void wl_enable_power(FAR struct cc3000_config_s *state, bool enable);
-static bool wl_read_irq(FAR struct cc3000_config_s *state);
-#ifdef CONFIG_CC3000_PROBES
-static bool probe(FAR struct cc3000_config_s *state,int n, bool s);
-#endif
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-/* A reference to a structure of this type must be passed to the CC3000
- * driver. This structure provides information about the configuration
- * of the CC3000 and provides some board-specific hooks.
- *
- * Memory for this structure is provided by the caller. It is not copied
- * by the driver and is presumed to persist while the driver is active. The
- * memory must be writable because, under certain circumstances, the driver
- * may modify frequency or X plate resistance values.
- */
-
-static struct kl_config_s g_cc3000_info =
-{
- .dev.spi_frequency = CONFIG_CC3000_SPI_FREQUENCY,
- .dev.spi_mode = CONFIG_CC3000_SPI_MODE,
- .dev.max_rx_size = 0,
- .dev.irq_attach = wl_attach_irq,
- .dev.irq_enable = wl_enable_irq,
- .dev.irq_clear = wl_clear_irq,
- .dev.power_enable = wl_enable_power,
- .dev.chip_chip_select = wl_select,
- .dev.irq_read = wl_read_irq,
-#ifdef CONFIG_CC3000_PROBES
- .dev.probe = probe, /* This is used for debugging */
-#endif
- .handler = NULL,
- .arg = NULL,
-};
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
-/* IRQ/GPIO access callbacks. These operations all hidden behind
- * callbacks to isolate the CC3000 driver from differences in GPIO
- * interrupt handling by varying boards and MCUs. If possible,
- * interrupts should be configured on both rising and falling edges
- * so that contact and loss-of-contact events can be detected.
- *
- * irq_attach - Attach the CC3000 interrupt handler to the GPIO
- * interrupt
- * irq_enable - Enable or disable the GPIO interrupt
- * irq_clear - Acknowledge/clear any pending GPIO interrupt
- * power_enable - Enable or disable Module enable.
- * chip_chip_select - The Chip Select
- * irq_read - Return the state of the interrupt GPIO input
- * probe - Debug support
- */
-
-static int wl_attach_irq(FAR struct cc3000_config_s *state, xcpt_t handler,
- FAR void *arg)
-{
- FAR struct kl_config_s *priv = (FAR struct kl_config_s *)state;
-
- /* Just save the handler for use when the interrupt is enabled */
-
- priv->handler = handler;
- priv->arg = arg;
- return OK;
-}
-
-static void wl_enable_irq(FAR struct cc3000_config_s *state, bool enable)
-{
- FAR struct kl_config_s *priv = (FAR struct kl_config_s *)state;
-
- /* The caller should not attempt to enable interrupts if the handler
- * has not yet been 'attached'
- */
-
- DEBUGASSERT(priv->handler || !enable);
-
- /* Attach and enable, or detach and disable */
-
- iinfo("enable:%d\n", enable);
- if (enable)
- {
- (void)kl_gpioirqattach(GPIO_WIFI_INT, priv->handler, priv->arg);
- kl_gpioirqenable(GPIO_WIFI_INT);
- }
- else
- {
- (void)kl_gpioirqattach(GPIO_WIFI_INT, NULL, NULL);
- kl_gpioirqdisable(GPIO_WIFI_INT);
- }
-}
-
-static void wl_enable_power(FAR struct cc3000_config_s *state, bool enable)
-{
- iinfo("enable:%d\n", enable);
-
- /* Active high enable */
-
- kl_gpiowrite(GPIO_WIFI_EN, enable);
-}
-
-static void wl_select(FAR struct cc3000_config_s *state, bool enable)
-{
- iinfo("enable:%d\n", enable);
-
- /* Active high enable */
-
- kl_gpiowrite(GPIO_WIFI_CS, enable);
-}
-
-static void wl_clear_irq(FAR struct cc3000_config_s *state)
-{
- /* Does nothing */
-}
-
-static bool wl_read_irq(FAR struct cc3000_config_s *state)
-{
- /* Active low*/
-
- return kl_gpioread(GPIO_WIFI_INT) ? false : true;
-}
-
-#ifdef CONFIG_CC3000_PROBES
-static bool probe(FAR struct cc3000_config_s *state,int n, bool s)
-{
- if (n == 0)
- {
- kl_gpiowrite(GPIO_D0, s);
- }
-
- if (n == 1)
- {
- kl_gpiowrite(GPIO_D1, s);
- }
-
- return true;
-}
-#endif
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: arch_wlinitialize
- *
- * Description:
- * Each board that supports a wireless device must provide this function.
- * This function is called by application-specific, setup logic to
- * configure the wireless device. This function will register the driver
- * as /dev/wirelessN where N is the minor device number.
- *
- * Returned Value:
- * Zero is returned on success. Otherwise, a negated errno value is
- * returned to indicate the nature of the failure.
- *
- ****************************************************************************/
-
-int wireless_archinitialize(size_t max_rx_size)
-{
- FAR struct spi_dev_s *spi;
-
- /* Init SPI bus */
-
- iinfo("minor %d\n", minor);
- DEBUGASSERT(CONFIG_CC3000_DEVMINOR == 0);
-
-#ifdef CONFIG_CC3000_PROBES
- kl_configgpio(GPIO_D0);
- kl_configgpio(GPIO_D1);
- kl_gpiowrite(GPIO_D0, 1);
- kl_gpiowrite(GPIO_D1, 1);
-#endif
-
- /* Get an instance of the SPI interface */
-
- spi = kl_spibus_initialize(CONFIG_CC3000_SPIDEV);
- if (!spi)
- {
- ierr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV);
- return -ENODEV;
- }
-
- /* Initialize and register the SPI CC3000 device */
-
- g_cc3000_info.dev.max_rx_size = max_rx_size ? max_rx_size : CONFIG_CC3000_RX_BUFFER_SIZE;
- int ret = cc3000_register(spi, &g_cc3000_info.dev, CONFIG_CC3000_DEVMINOR);
- if (ret < 0)
- {
- ierr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV);
- return -ENODEV;
- }
-
- return OK;
-}
-
-/****************************************************************************
- * Name: C3000_wlan_init
- *
- * Description:
- * Initialize wlan driver
- *
- * Warning: This function must be called before ANY other wlan driver
- * function
- *
- * Input Parameters:
- * sWlanCB Asynchronous events callback.
- * 0 no event call back.
- * - Call back parameters:
- * 1) event_type: HCI_EVNT_WLAN_UNSOL_CONNECT connect event,
- * HCI_EVNT_WLAN_UNSOL_DISCONNECT disconnect event,
- * HCI_EVNT_WLAN_ASYNC_SIMPLE_CONFIG_DONE config done,
- * HCI_EVNT_WLAN_UNSOL_DHCP dhcp report,
- * HCI_EVNT_WLAN_ASYNC_PING_REPORT ping report OR
- * HCI_EVNT_WLAN_KEEPALIVE keepalive.
- * 2) data: pointer to extra data that received by the event
- * (NULL no data).
- * 3) length: data length.
- * - Events with extra data:
- * HCI_EVNT_WLAN_UNSOL_DHCP: 4 bytes IP, 4 bytes Mask,
- * 4 bytes default gateway, 4 bytes DHCP server and 4 bytes
- * for DNS server.
- * HCI_EVNT_WLAN_ASYNC_PING_REPORT: 4 bytes Packets sent,
- * 4 bytes Packets received, 4 bytes Min round time,
- * 4 bytes Max round time and 4 bytes for Avg round time.
- *
- * sFWPatches 0 no patch or pointer to FW patches
- * sDriverPatches 0 no patch or pointer to driver patches
- * sBootLoaderPatches 0 no patch or pointer to bootloader patches
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-void cc3000_wlan_init(size_t max_tx_len,
- tWlanCB sWlanCB,
- tFWPatches sFWPatches, tDriverPatches
- sDriverPatches, tBootLoaderPatches sBootLoaderPatches)
-{
- wlan_init(max_tx_len, sWlanCB, sFWPatches, sDriverPatches, sBootLoaderPatches);
-}
-
-#endif /* CONFIG_WL_CC3000 */
diff --git a/configs/freedom-kl25z/src/kl_spi.c b/configs/freedom-kl25z/src/kl_spi.c
index 566af53909..99c562f02b 100644
--- a/configs/freedom-kl25z/src/kl_spi.c
+++ b/configs/freedom-kl25z/src/kl_spi.c
@@ -71,12 +71,6 @@ void weak_function kl_spidev_initialize(void)
# ifdef CONFIG_ADXL345_SPI
kl_configgpio(GPIO_ADXL345_CS);
#endif
-
-# ifdef CONFIG_WL_CC3000
- kl_configgpio(GPIO_WIFI_CS);
- kl_configgpio(GPIO_WIFI_EN);
- kl_configgpio(GPIO_WIFI_INT);
-# endif
#endif
/* Configure SPI1 chip selects */
@@ -153,14 +147,6 @@ void kl_spi0select(FAR struct spi_dev_s *dev, uint32_t devid,
kl_gpiowrite(GPIO_ADXL345_CS, !selected);
}
#endif
-
-#if defined(CONFIG_WL_CC3000)
- if (devid == SPIDEV_WIRELESS(0))
- {
- kl_gpiowrite(GPIO_WIFI_CS, !selected);
- }
-#endif
-
}
#endif
diff --git a/configs/nucleo-f4x1re/src/Makefile b/configs/nucleo-f4x1re/src/Makefile
index 0636f64f5c..a836bb6370 100644
--- a/configs/nucleo-f4x1re/src/Makefile
+++ b/configs/nucleo-f4x1re/src/Makefile
@@ -48,13 +48,6 @@ ifeq ($(CONFIG_ARCH_BUTTONS),y)
CSRCS += stm32_buttons.c
endif
-ifeq ($(CONFIG_WL_CC3000),y)
-CSRCS += stm32_wireless.c
-ifeq ($(CONFIG_CC3000_PROBES),)
-CSRCS += stm32_io.c
-endif
-endif
-
ifeq ($(CONFIG_ADC),y)
CSRCS += stm32_adc.c
ifeq ($(CONFIG_AJOYSTICK),y)
diff --git a/configs/nucleo-f4x1re/src/nucleo-f4x1re.h b/configs/nucleo-f4x1re/src/nucleo-f4x1re.h
index 88a7cf4440..59d96c0604 100644
--- a/configs/nucleo-f4x1re/src/nucleo-f4x1re.h
+++ b/configs/nucleo-f4x1re/src/nucleo-f4x1re.h
@@ -103,33 +103,6 @@
*
*/
-#ifdef CONFIG_WL_CC3000
-# define GPIO_WIFI_INT (GPIO_PORTB | GPIO_PIN3 | GPIO_INPUT | \
- GPIO_PULLUP | GPIO_EXTI)
-# define GPIO_WIFI_EN (GPIO_PORTB | GPIO_PIN4 | GPIO_OUTPUT_CLEAR | \
- GPIO_OUTPUT | GPIO_PULLUP | GPIO_SPEED_50MHz)
-# define GPIO_WIFI_CS (GPIO_PORTB | GPIO_PIN6 | GPIO_OUTPUT_SET | \
- GPIO_OUTPUT | GPIO_PULLUP | GPIO_SPEED_50MHz)
-# define GPIO_D14 (GPIO_PORTB | GPIO_PIN9 | GPIO_OUTPUT_CLEAR | \
- GPIO_OUTPUT | GPIO_PULLUP | GPIO_SPEED_50MHz)
-# define GPIO_D15 (GPIO_PORTB | GPIO_PIN8 | GPIO_OUTPUT_CLEAR | \
- GPIO_OUTPUT | GPIO_PULLUP | GPIO_SPEED_50MHz)
-# define GPIO_D0 (GPIO_PORTA | GPIO_PIN3 | GPIO_INPUT | \
- GPIO_PULLUP)
-# define GPIO_D1 (GPIO_PORTA | GPIO_PIN2 | GPIO_OUTPUT_CLEAR | \
- GPIO_PULLUP)
-# define GPIO_D2 (GPIO_PORTA | GPIO_PIN10 | GPIO_OUTPUT_CLEAR | \
- GPIO_OUTPUT | GPIO_PULLUP | GPIO_SPEED_50MHz)
-# define GPIO_A0 (GPIO_PORTA | GPIO_PIN0 | GPIO_OUTPUT_SET | \
- GPIO_OUTPUT | GPIO_PULLUP | GPIO_SPEED_50MHz)
-# define GPIO_A1 (GPIO_PORTA | GPIO_PIN1 | GPIO_OUTPUT_SET | \
- GPIO_OUTPUT | GPIO_PULLUP | GPIO_SPEED_50MHz)
-# define GPIO_A2 (GPIO_PORTA | GPIO_PIN4 | GPIO_INPUT | \
- GPIO_PULLUP)
-# define GPIO_A3 (GPIO_PORTB | GPIO_PIN0 | GPIO_INPUT | \
- GPIO_PULLUP)
-#endif
-
/* SPI1 off */
#define GPIO_SPI1_MOSI_OFF (GPIO_INPUT | GPIO_PULLDOWN | \
@@ -139,28 +112,12 @@
#define GPIO_SPI1_SCK_OFF (GPIO_INPUT | GPIO_PULLDOWN | \
GPIO_PORTA | GPIO_PIN5)
-/* SPI1 chip selects off */
-
-#ifdef CONFIG_WL_CC3000
-# define GPIO_SPI_CS_WIFI_OFF \
- (GPIO_INPUT | GPIO_PULLDOWN | GPIO_SPEED_2MHz | \
- GPIO_PORTB | GPIO_PIN6)
-#endif
-
#ifdef HAVE_MMCSD
# define GPIO_SPI_CS_SD_CARD_OFF \
(GPIO_INPUT | GPIO_PULLDOWN | GPIO_SPEED_2MHz | \
GPIO_PORTB | GPIO_PIN5)
#endif
-/* SPI chip selects */
-
-#ifdef CONFIG_WL_CC3000
-# define GPIO_SPI_CS_WIFI \
- (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_2MHz | \
- GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN6)
-#endif
-
#ifdef HAVE_MMCSD
# define GPIO_SPI_CS_SD_CARD \
(GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_2MHz | \
@@ -175,24 +132,6 @@
#define NUCLEO_I2C_OBDEV_LED 0x55
#define NUCLEO_I2C_OBDEV_HMC5883 0x1e
-/* User GPIOs
- *
- * GPIO0-1 are for probing WIFI status
- */
-
-#ifdef CONFIG_WL_CC3000
-# define GPIO_GPIO0_INPUT \
- (GPIO_INPUT | GPIO_PULLUP | GPIO_PORTB | GPIO_PIN8)
-# define GPIO_GPIO1_INPUT \
- (GPIO_INPUT | GPIO_PULLUP | GPIO_PORTB | GPIO_PIN9)
-# define GPIO_GPIO0_OUTPUT \
- (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_2MHz | \
- GPIO_OUTPUT_CLEAR | GPIO_PORTB | GPIO_PIN8)
-# define GPIO_GPIO1_OUTPUT \
- (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_2MHz | \
- GPIO_OUTPUT_CLEAR | GPIO_PORTB | GPIO_PIN9)
-#endif
-
/* Itead Joystick Shield
*
* See http://imall.iteadstudio.com/im120417014.html for more information
diff --git a/configs/nucleo-f4x1re/src/stm32_appinit.c b/configs/nucleo-f4x1re/src/stm32_appinit.c
index 05b0c54880..7028c55a21 100644
--- a/configs/nucleo-f4x1re/src/stm32_appinit.c
+++ b/configs/nucleo-f4x1re/src/stm32_appinit.c
@@ -59,20 +59,6 @@
* Public Functions
****************************************************************************/
-/****************************************************************************
- * Name: up_netinitialize
- *
- * Description:
- * Dummy function expected to start-up logic.
- *
- ****************************************************************************/
-
-#ifdef CONFIG_WL_CC3000
-void up_netinitialize(void)
-{
-}
-#endif
-
/****************************************************************************
* Name: board_app_initialize
*
diff --git a/configs/nucleo-f4x1re/src/stm32_boot.c b/configs/nucleo-f4x1re/src/stm32_boot.c
index 2b6f69e65e..1fb22f61e7 100644
--- a/configs/nucleo-f4x1re/src/stm32_boot.c
+++ b/configs/nucleo-f4x1re/src/stm32_boot.c
@@ -123,11 +123,5 @@ void board_initialize(void)
#if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL)
board_app_initialize(0);
#endif
-
- /* CC3000 wireless initialization */
-
-#ifdef CONFIG_WL_CC3000
- wireless_archinitialize(0);
-#endif
}
#endif
diff --git a/configs/nucleo-f4x1re/src/stm32_io.c b/configs/nucleo-f4x1re/src/stm32_io.c
deleted file mode 100644
index a319e69a83..0000000000
--- a/configs/nucleo-f4x1re/src/stm32_io.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/****************************************************************************
- * configs/nucleo-f4x1re/src/stm32_io.c
- *
- * Copyright (C) 2014, 2017 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-
-#include
-#include
-
-#include
-#include "chip/stm32_tim.h"
-
-#include "nucleo-f4x1re.h"
-
-#ifndef CONFIG_CC3000_PROBES
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: up_leds
- *
- * Description:
- *
- ****************************************************************************/
-
-void up_leds(int r, int g ,int b, int freqs)
-{
- long fosc = 72000000;
- long prescale = 2048;
- long p1s = fosc/prescale;
- long p0p5s = p1s/2;
- long p;
-
- static struct stm32_tim_dev_s *tim1 = 0;
-
- if (tim1 == 0)
- {
- tim1 = stm32_tim_init(1);
- STM32_TIM_SETMODE(tim1, STM32_TIM_MODE_UP);
- STM32_TIM_SETCLOCK(tim1, p1s-8);
- STM32_TIM_SETPERIOD(tim1, p1s);
- STM32_TIM_SETCOMPARE(tim1, 1, 0);
- STM32_TIM_SETCOMPARE(tim1, 2, 0);
- STM32_TIM_SETCOMPARE(tim1, 3, 0);
- STM32_TIM_SETCHANNEL(tim1, 1, STM32_TIM_CH_OUTPWM | STM32_TIM_CH_POLARITY_NEG);
- STM32_TIM_SETCHANNEL(tim1, 2, STM32_TIM_CH_OUTPWM | STM32_TIM_CH_POLARITY_NEG);
- STM32_TIM_SETCHANNEL(tim1, 3, STM32_TIM_CH_OUTPWM | STM32_TIM_CH_POLARITY_NEG);
- }
-
- p = freqs == 0 ? p1s : p1s / freqs;
- STM32_TIM_SETPERIOD(tim1, p);
-
- p = freqs == 0 ? p1s + 1 : p0p5s / freqs;
-
- STM32_TIM_SETCOMPARE(tim1, 2, (r * p) / 255);
- STM32_TIM_SETCOMPARE(tim1, 1, (b * p) / 255);
- STM32_TIM_SETCOMPARE(tim1, 3, (g * p) / 255);
-}
-
-/****************************************************************************
- * Name: up_ioinit
- *
- * Description:
- *
- ****************************************************************************/
-
-void up_ioinit(void)
-{
- /* Configure the GPIO pins as inputs. NOTE that EXTI interrupts are
- * configured for all pins.
- */
-
- up_leds(0,0,0,0);
- stm32_configgpio(GPIO_A0); /* Probes */
- stm32_configgpio(GPIO_A1); /* Probes */
- stm32_configgpio(GPIO_A2); /* Smart Config */
- stm32_configgpio(GPIO_A3); /* not used */
- stm32_configgpio(GPIO_BTN_USER); /* Sw 1 */
- stm32_configgpio(GPIO_D0); /* USART2 RX*/
- stm32_configgpio(GPIO_D1); /* uSART2 TX*/
- stm32_configgpio(GPIO_D2); /* Activate */
-}
-
-/****************************************************************************
- * Name: up_read_inputs
- *
- * N.B The return state in true logic, the button polarity is dealt here in
- *
- ****************************************************************************/
-
-uint8_t up_read_inputs(void)
-{
- uint8_t bits = 0;
- bits |= stm32_gpioread(GPIO_D14) == 0 ? 1 : 0;
- bits |= stm32_gpioread(GPIO_D15) == 0 ? 2 : 0;
- bits |= stm32_gpioread(GPIO_A2) == 0 ? 4 : 0;
- bits |= stm32_gpioread(GPIO_A3) == 0 ? 8 : 0;
- return bits;
-}
-
-/****************************************************************************
- * Name: up_write_outputs
- *
- * N.B The return state in true logic, the button polarity is dealt here in
- *
- ****************************************************************************/
-
-void up_write_outputs(int id, bool bits)
-{
- if (id == 2)
- {
- stm32_gpiowrite(GPIO_D2, bits);
- }
- else if (id == 0)
- {
- stm32_gpiowrite(GPIO_A0, bits);
- }
- else if (id == 1)
- {
- stm32_gpiowrite(GPIO_A1, bits);
- }
-}
-
-/****************************************************************************
- * Name: up_irqio
- *
- * Description:
- *
- ****************************************************************************/
-
-int up_irqio(int id, xcpt_t irqhandler, void *arg)
-{
- int ret = -EINVAL;
-
- /* The following should be atomic */
-
- if (id == 0)
- {
- ret = stm32_gpiosetevent(GPIO_D14, true, true, true, irqhandler, arg);
- }
- else if (id == 1)
- {
- ret = stm32_gpiosetevent(GPIO_D15, true, true, true, irqhandler, arg);
- }
-
- return ret;
-}
-#endif /* CONFIG_CC3000_PROBES */
diff --git a/configs/nucleo-f4x1re/src/stm32_spi.c b/configs/nucleo-f4x1re/src/stm32_spi.c
index cdcb582fd5..4f8027a596 100644
--- a/configs/nucleo-f4x1re/src/stm32_spi.c
+++ b/configs/nucleo-f4x1re/src/stm32_spi.c
@@ -91,10 +91,6 @@ void weak_function stm32_spidev_initialize(void)
spierr("ERROR: FAILED to initialize SPI port 1\n");
}
-#ifdef CONFIG_WL_CC3000
- stm32_configgpio(GPIO_SPI_CS_WIFI);
-#endif
-
#ifdef HAVE_MMCSD
stm32_configgpio(GPIO_SPI_CS_SD_CARD);
#endif
@@ -104,14 +100,6 @@ void weak_function stm32_spidev_initialize(void)
/* Configure SPI-based devices */
g_spi2 = stm32_spibus_initialize(2);
-
- /* Setup CS, EN & IRQ line IOs */
-
-#ifdef CONFIG_WL_CC3000
- stm32_configgpio(GPIO_WIFI_CS);
- stm32_configgpio(GPIO_WIFI_EN);
- stm32_configgpio(GPIO_WIFI_INT);
-#endif
#endif
}
@@ -145,13 +133,6 @@ void stm32_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
-#ifdef CONFIG_WL_CC3000
- if (devid == SPIDEV_WIRELESS(0))
- {
- stm32_gpiowrite(GPIO_SPI_CS_WIFI, !selected);
- }
- else
-#endif
#ifdef HAVE_MMCSD
if (devid == SPIDEV_MMCSD(0))
{
@@ -170,13 +151,6 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
void stm32_spi2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
-
-#ifdef CONFIG_WL_CC3000
- if (devid == SPIDEV_WIRELESS(0))
- {
- stm32_gpiowrite(GPIO_WIFI_CS, !selected);
- }
-#endif
}
uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, uint32_t devid)
diff --git a/configs/nucleo-f4x1re/src/stm32_wireless.c b/configs/nucleo-f4x1re/src/stm32_wireless.c
deleted file mode 100644
index b868cad46c..0000000000
--- a/configs/nucleo-f4x1re/src/stm32_wireless.c
+++ /dev/null
@@ -1,367 +0,0 @@
-/************************************************************************************
- * configs/nucleo-f4x1re/src/stm32_wireless.c
- *
- * Copyright (C) 2014 Gregory Nutt. All rights reserved.
- * Author: Laurent Latil
- * David Sidrane
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ************************************************************************************/
-
-/************************************************************************************
- * Included Files
- ************************************************************************************/
-
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include "stm32.h"
-#include "nucleo-f4x1re.h"
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-/* Configuration ************************************************************/
-
-#ifdef CONFIG_WL_CC3000
-#ifndef CONFIG_DRIVERS_WIRELESS
-# error "Wireless support requires CONFIG_DRIVERS_WIRELESS"
-#endif
-
-#ifndef CONFIG_STM32_SPI2
-# error "CC3000 Wireless support requires CONFIG_STM32_SPI2"
-#endif
-
-#ifndef CC3000_SPI_FREQUENCY
-# define CC3000_SPI_FREQUENCY 16000000
-#endif
-
-#ifndef CC3000_SPIDEV
-# define CC3000_SPIDEV 2
-#endif
-
-#if CC3000_SPIDEV != 2
-# error "CC3000_SPIDEV must be 2"
-#endif
-
-#ifndef CC3000_DEVMINOR
-# define CC3000_DEVMINOR 0
-#endif
-
-#ifndef CONFIG_CC3000_RX_BUFFER_SIZE
-#define CONFIG_CC3000_RX_BUFFER_SIZE 132
-#endif
-
-/****************************************************************************
- * Private Types
- ****************************************************************************/
-
-struct stm32_config_s
-{
- struct cc3000_config_s dev;
- xcpt_t handler;
-};
-
-/****************************************************************************
- * Private Function Prototypes
- ****************************************************************************/
-
-/* IRQ/GPIO access callbacks. These operations all hidden behind callbacks
- * to isolate the CC3000 driver from differences in GPIO interrupt handling
- * by varying boards and MCUs. If possible, interrupts should be configured
- * on falling edges to detect the Ready Condition At T2: The normal master
- * SPI write sequence is SPI_CS low, followed by SPI_IRQ low CC3000 to host,
- * indicating that the CC3000 core module is ready to accept data. T2
- * duration is approximately 7 ms.
- *
- * irq_attach - Attach the CC3000 interrupt handler to the GPIO interrupt
- * irq_enable - Enable or disable the GPIO interrupt
- * clear_irq - Acknowledge/clear any pending GPIO interrupt
- * power_enable - Enable or disable Module enable.
- * chip_chip_select - The Chip Select
- * wl_read_irq - Return the state of the interrupt GPIO input
- */
-
-static int wl_attach_irq(FAR struct cc3000_config_s *state, xcpt_t handler,
- FAR void *arg);
-static void wl_enable_irq(FAR struct cc3000_config_s *state, bool enable);
-static void wl_clear_irq(FAR struct cc3000_config_s *state);
-static void wl_select(FAR struct cc3000_config_s *state, bool enable);
-static void wl_enable_power(FAR struct cc3000_config_s *state, bool enable);
-static bool wl_read_irq(FAR struct cc3000_config_s *state);
-#ifdef CONFIG_CC3000_PROBES
-static bool probe(FAR struct cc3000_config_s *state,int n, bool s);
-#endif
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-/* A reference to a structure of this type must be passed to the CC3000
- * driver. This structure provides information about the configuration
- * of the CC3000 and provides some board-specific hooks.
- *
- * Memory for this structure is provided by the caller. It is not copied
- * by the driver and is presumed to persist while the driver is active. The
- * memory must be writable because, under certain circumstances, the driver
- * may modify frequency or X plate resistance values.
- */
-
-static struct stm32_config_s g_cc3000_info =
-{
- .dev.spi_frequency = CONFIG_CC3000_SPI_FREQUENCY,
- .dev.spi_mode = CONFIG_CC3000_SPI_MODE,
- .dev.max_rx_size = 0,
- .dev.irq_attach = wl_attach_irq,
- .dev.irq_enable = wl_enable_irq,
- .dev.irq_clear = wl_clear_irq,
- .dev.power_enable = wl_enable_power,
- .dev.chip_chip_select = wl_select,
- .dev.irq_read = wl_read_irq,
-#ifdef CONFIG_CC3000_PROBES
- .dev.probe = probe, /* This is used for debugging */
-#endif
- .handler = NULL,
- .arg = NULL,
-};
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
-/* IRQ/GPIO access callbacks. These operations all hidden behind
- * callbacks to isolate the CC3000 driver from differences in GPIO
- * interrupt handling by varying boards and MCUs. If possible,
- * interrupts should be configured on both rising and falling edges
- * so that contact and loss-of-contact events can be detected.
- *
- * attach - Attach the CC3000 interrupt handler to the GPIO interrupt
- * enable - Enable or disable the GPIO interrupt
- * clear - Acknowledge/clear any pending GPIO interrupt
- * pendown - Return the state of the pen down GPIO input
- */
-
-static int wl_attach_irq(FAR struct cc3000_config_s *state, xcpt_t handler,
- FAR void *arg)
-{
- FAR struct stm32_config_s *priv = (FAR struct stm32_config_s *)state;
-
- /* Just save the handler for use when the interrupt is enabled */
-
- priv->handler = handler;
- priv->arg = arg;
- return OK;
-}
-
-static void wl_enable_irq(FAR struct cc3000_config_s *state, bool enable)
-{
- FAR struct stm32_config_s *priv = (FAR struct stm32_config_s *)state;
-
- /* The caller should not attempt to enable interrupts if the handler
- * has not yet been 'attached'
- */
-
- DEBUGASSERT(priv->handler || !enable);
-
- /* Attach and enable, or detach and disable */
-
- iinfo("enable:%d\n", enable);
- if (enable)
- {
- (void)stm32_gpiosetevent(GPIO_WIFI_INT, false, true, false,
- priv->handler, priv->arg);
- }
- else
- {
- (void)stm32_gpiosetevent(GPIO_WIFI_INT, false, false, false,
- NULL, NULL);
- }
-}
-
-static void wl_enable_power(FAR struct cc3000_config_s *state, bool enable)
-{
- iinfo("enable:%d\n", enable);
-
- /* Active high enable */
-
- stm32_gpiowrite(GPIO_WIFI_EN, enable);
-}
-
-static void wl_select(FAR struct cc3000_config_s *state, bool enable)
-{
- iinfo("enable:%d\n", enable);
-
- /* Active high enable */
-
- stm32_gpiowrite(GPIO_WIFI_CS, enable);
-}
-
-static void wl_clear_irq(FAR struct cc3000_config_s *state)
-{
- /* Does nothing */
-}
-
-static bool wl_read_irq(FAR struct cc3000_config_s *state)
-{
- /* Active low*/
-
- return stm32_gpioread(GPIO_WIFI_INT) ? false : true;
-}
-
-#ifdef CONFIG_CC3000_PROBES
-static bool probe(FAR struct cc3000_config_s *state,int n, bool s)
-{
- if (n == 0)
- {
- stm32_gpiowrite(GPIO_D14, s);
- }
-
- if (n == 1)
- {
- stm32_gpiowrite(GPIO_D15, s);
- }
-
- return true;
-}
-#endif
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: arch_wlinitialize
- *
- * Description:
- * Each board that supports a wireless device must provide this function.
- * This function is called by application-specific, setup logic to
- * configure the wireless device. This function will register the driver
- * as /dev/wirelessN where N is the minor device number.
- *
- * Returned Value:
- * Zero is returned on success. Otherwise, a negated errno value is
- * returned to indicate the nature of the failure.
- *
- ****************************************************************************/
-
-int wireless_archinitialize(size_t max_rx_size)
-{
- FAR struct spi_dev_s *spi;
-
- /* Init SPI bus */
-
- iinfo("minor %d\n", minor);
- DEBUGASSERT(CONFIG_CC3000_DEVMINOR == 0);
-
-#ifdef CONFIG_CC3000_PROBES
- stm32_configgpio(GPIO_D14);
- stm32_configgpio(GPIO_D15);
- stm32_gpiowrite(GPIO_D14, 1);
- stm32_gpiowrite(GPIO_D15, 1);
-#endif
-
- /* Get an instance of the SPI interface */
-
- spi = stm32_spibus_initialize(CONFIG_CC3000_SPIDEV);
- if (!spi)
- {
- ierr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV);
- return -ENODEV;
- }
-
- /* Initialize and register the SPI CC3000 device */
-
- g_cc3000_info.dev.max_rx_size = max_rx_size ? max_rx_size : CONFIG_CC3000_RX_BUFFER_SIZE;
- int ret = cc3000_register(spi, &g_cc3000_info.dev, CONFIG_CC3000_DEVMINOR);
- if (ret < 0)
- {
- ierr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV);
- return -ENODEV;
- }
-
- return OK;
-}
-
-/****************************************************************************
- * Name: C3000_wlan_init
- *
- * Description:
- * Initialize wlan driver
- *
- * Warning: This function must be called before ANY other wlan driver
- * function
- *
- * Input Parameters:
- * sWlanCB Asynchronous events callback.
- * 0 no event call back.
- * - Call back parameters:
- * 1) event_type: HCI_EVNT_WLAN_UNSOL_CONNECT connect event,
- * HCI_EVNT_WLAN_UNSOL_DISCONNECT disconnect event,
- * HCI_EVNT_WLAN_ASYNC_SIMPLE_CONFIG_DONE config done,
- * HCI_EVNT_WLAN_UNSOL_DHCP dhcp report,
- * HCI_EVNT_WLAN_ASYNC_PING_REPORT ping report OR
- * HCI_EVNT_WLAN_KEEPALIVE keepalive.
- * 2) data: pointer to extra data that received by the event
- * (NULL no data).
- * 3) length: data length.
- * - Events with extra data:
- * HCI_EVNT_WLAN_UNSOL_DHCP: 4 bytes IP, 4 bytes Mask,
- * 4 bytes default gateway, 4 bytes DHCP server and 4 bytes
- * for DNS server.
- * HCI_EVNT_WLAN_ASYNC_PING_REPORT: 4 bytes Packets sent,
- * 4 bytes Packets received, 4 bytes Min round time,
- * 4 bytes Max round time and 4 bytes for Avg round time.
- *
- * sFWPatches 0 no patch or pointer to FW patches
- * sDriverPatches 0 no patch or pointer to driver patches
- * sBootLoaderPatches 0 no patch or pointer to bootloader patches
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-void cc3000_wlan_init(size_t max_tx_len,
- tWlanCB sWlanCB,
- tFWPatches sFWPatches, tDriverPatches
- sDriverPatches, tBootLoaderPatches sBootLoaderPatches)
-{
- wlan_init(max_tx_len, sWlanCB, sFWPatches, sDriverPatches, sBootLoaderPatches);
-}
-
-#endif /* CONFIG_WL_CC3000 */
diff --git a/configs/nucleo-l476rg/src/Makefile b/configs/nucleo-l476rg/src/Makefile
index a21fd2956d..cfa6ae2baf 100644
--- a/configs/nucleo-l476rg/src/Makefile
+++ b/configs/nucleo-l476rg/src/Makefile
@@ -48,13 +48,6 @@ ifeq ($(CONFIG_ARCH_BUTTONS),y)
CSRCS += stm32_buttons.c
endif
-ifeq ($(CONFIG_WL_CC3000),y)
-CSRCS += stm32_cc3000.c
-ifeq ($(CONFIG_CC3000_PROBES),)
-CSRCS += stm32_io.c
-endif
-endif
-
ifeq ($(CONFIG_WL_CC1101),y)
CSRCS += stm32_cc1101.c
endif
diff --git a/configs/nucleo-l476rg/src/nucleo-l476rg.h b/configs/nucleo-l476rg/src/nucleo-l476rg.h
index d8524b3340..4921bdd08d 100644
--- a/configs/nucleo-l476rg/src/nucleo-l476rg.h
+++ b/configs/nucleo-l476rg/src/nucleo-l476rg.h
@@ -122,33 +122,6 @@
*
*/
-#ifdef CONFIG_WL_CC3000
-# define GPIO_WIFI_INT (GPIO_PORTB | GPIO_PIN3 | GPIO_INPUT | \
- GPIO_PULLUP | GPIO_EXTI)
-# define GPIO_WIFI_EN (GPIO_PORTB | GPIO_PIN4 | GPIO_OUTPUT_CLEAR | \
- GPIO_OUTPUT | GPIO_PULLUP | GPIO_SPEED_50MHz)
-# define GPIO_WIFI_CS (GPIO_PORTB | GPIO_PIN6 | GPIO_OUTPUT_SET | \
- GPIO_OUTPUT | GPIO_PULLUP | GPIO_SPEED_50MHz)
-# define GPIO_D14 (GPIO_PORTB | GPIO_PIN9 | GPIO_OUTPUT_CLEAR | \
- GPIO_OUTPUT | GPIO_PULLUP | GPIO_SPEED_50MHz)
-# define GPIO_D15 (GPIO_PORTB | GPIO_PIN8 | GPIO_OUTPUT_CLEAR | \
- GPIO_OUTPUT | GPIO_PULLUP | GPIO_SPEED_50MHz)
-# define GPIO_D0 (GPIO_PORTA | GPIO_PIN3 | GPIO_INPUT | \
- GPIO_PULLUP)
-# define GPIO_D1 (GPIO_PORTA | GPIO_PIN2 | GPIO_OUTPUT_CLEAR | \
- GPIO_PULLUP)
-# define GPIO_D2 (GPIO_PORTA | GPIO_PIN10 | GPIO_OUTPUT_CLEAR | \
- GPIO_OUTPUT | GPIO_PULLUP | GPIO_SPEED_50MHz)
-# define GPIO_A0 (GPIO_PORTA | GPIO_PIN0 | GPIO_OUTPUT_SET | \
- GPIO_OUTPUT | GPIO_PULLUP | GPIO_SPEED_50MHz)
-# define GPIO_A1 (GPIO_PORTA | GPIO_PIN1 | GPIO_OUTPUT_SET | \
- GPIO_OUTPUT | GPIO_PULLUP | GPIO_SPEED_50MHz)
-# define GPIO_A2 (GPIO_PORTA | GPIO_PIN4 | GPIO_INPUT | \
- GPIO_PULLUP)
-# define GPIO_A3 (GPIO_PORTB | GPIO_PIN0 | GPIO_INPUT | \
- GPIO_PULLUP)
-#endif
-
/* SPI1 off */
#define GPIO_SPI1_MOSI_OFF (GPIO_INPUT | GPIO_PULLDOWN | \
@@ -158,14 +131,6 @@
#define GPIO_SPI1_SCK_OFF (GPIO_INPUT | GPIO_PULLDOWN | \
GPIO_PORTA | GPIO_PIN5)
-/* SPI1 chip selects off */
-
-#ifdef CONFIG_WL_CC3000
-# define GPIO_SPI_CS_WIFI_OFF \
- (GPIO_INPUT | GPIO_PULLDOWN | GPIO_SPEED_2MHz | \
- GPIO_PORTB | GPIO_PIN6)
-#endif
-
#ifdef CONFIG_WL_CC1101
# define GPIO_CC1101_PWR (GPIO_PORTC | GPIO_PIN6 | GPIO_OUTPUT_SET | \
GPIO_OUTPUT | GPIO_PULLUP | GPIO_SPEED_50MHz)
@@ -184,12 +149,6 @@
/* SPI chip selects */
-#ifdef CONFIG_WL_CC3000
-# define GPIO_SPI_CS_WIFI \
- (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_2MHz | \
- GPIO_OUTPUT_SET | GPIO_PORTB | GPIO_PIN6)
-#endif
-
#ifdef HAVE_MMCSD
# define GPIO_SPI_CS_SD_CARD \
(GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_2MHz | \
@@ -209,19 +168,6 @@
* GPIO0-1 are for probing WIFI status
*/
-#ifdef CONFIG_WL_CC3000
-# define GPIO_GPIO0_INPUT \
- (GPIO_INPUT | GPIO_PULLUP | GPIO_PORTB | GPIO_PIN8)
-# define GPIO_GPIO1_INPUT \
- (GPIO_INPUT | GPIO_PULLUP | GPIO_PORTB | GPIO_PIN9)
-# define GPIO_GPIO0_OUTPUT \
- (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_2MHz | \
- GPIO_OUTPUT_CLEAR | GPIO_PORTB | GPIO_PIN8)
-# define GPIO_GPIO1_OUTPUT \
- (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_2MHz | \
- GPIO_OUTPUT_CLEAR | GPIO_PORTB | GPIO_PIN9)
-#endif
-
/* Itead Joystick Shield
*
* See http://imall.iteadstudio.com/im120417014.html for more information
diff --git a/configs/nucleo-l476rg/src/stm32_appinit.c b/configs/nucleo-l476rg/src/stm32_appinit.c
index 5dbfa215b4..b9a8b2d9ec 100644
--- a/configs/nucleo-l476rg/src/stm32_appinit.c
+++ b/configs/nucleo-l476rg/src/stm32_appinit.c
@@ -68,20 +68,6 @@
* Public Functions
****************************************************************************/
-/****************************************************************************
- * Name: up_netinitialize
- *
- * Description:
- * Dummy function expected to start-up logic.
- *
- ****************************************************************************/
-
-#ifdef CONFIG_WL_CC3000
-void up_netinitialize(void)
-{
-}
-#endif
-
/****************************************************************************
* Name: board_app_initialize
*
diff --git a/configs/nucleo-l476rg/src/stm32_boot.c b/configs/nucleo-l476rg/src/stm32_boot.c
index a8af653206..08bc45ded0 100644
--- a/configs/nucleo-l476rg/src/stm32_boot.c
+++ b/configs/nucleo-l476rg/src/stm32_boot.c
@@ -123,11 +123,5 @@ void board_initialize(void)
#if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_NSH_ARCHINIT)
board_app_initialize(0);
#endif
-
- /* CC3000 wireless initialization */
-
-#ifdef CONFIG_WL_CC3000
- wireless_archinitialize(0);
-#endif
}
#endif
diff --git a/configs/nucleo-l476rg/src/stm32_cc3000.c b/configs/nucleo-l476rg/src/stm32_cc3000.c
deleted file mode 100644
index ac935e929f..0000000000
--- a/configs/nucleo-l476rg/src/stm32_cc3000.c
+++ /dev/null
@@ -1,367 +0,0 @@
-/************************************************************************************
- * configs/nucleo-l476rg/src/stm32_cc3000.c
- *
- * Copyright (C) 2014 Gregory Nutt. All rights reserved.
- * Author: Laurent Latil
- * David Sidrane
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ************************************************************************************/
-
-/************************************************************************************
- * Included Files
- ************************************************************************************/
-
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include "stm32l4.h"
-#include "nucleo-l476rg.h"
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-/* Configuration ************************************************************/
-
-#ifdef CONFIG_WL_CC3000
-#ifndef CONFIG_WIRELESS
-# error "Wireless support requires CONFIG_WIRELESS"
-#endif
-
-#ifndef CONFIG_STM32_SPI2
-# error "CC3000 Wireless support requires CONFIG_STM32_SPI2"
-#endif
-
-#ifndef CC3000_SPI_FREQUENCY
-# define CC3000_SPI_FREQUENCY 16000000
-#endif
-
-#ifndef CC3000_SPIDEV
-# define CC3000_SPIDEV 2
-#endif
-
-#if CC3000_SPIDEV != 2
-# error "CC3000_SPIDEV must be 2"
-#endif
-
-#ifndef CC3000_DEVMINOR
-# define CC3000_DEVMINOR 0
-#endif
-
-#ifndef CONFIG_CC3000_RX_BUFFER_SIZE
-#define CONFIG_CC3000_RX_BUFFER_SIZE 132
-#endif
-
-/****************************************************************************
- * Private Types
- ****************************************************************************/
-
-struct stm32_config_s
-{
- struct cc3000_config_s dev;
- xcpt_t handler;
-};
-
-/****************************************************************************
- * Private Function Prototypes
- ****************************************************************************/
-
-/* IRQ/GPIO access callbacks. These operations all hidden behind callbacks
- * to isolate the CC3000 driver from differences in GPIO interrupt handling
- * by varying boards and MCUs. If possible, interrupts should be configured
- * on falling edges to detect the Ready Condition At T2: The normal master
- * SPI write sequence is SPI_CS low, followed by SPI_IRQ low CC3000 to host,
- * indicating that the CC3000 core module is ready to accept data. T2
- * duration is approximately 7 ms.
- *
- * irq_attach - Attach the CC3000 interrupt handler to the GPIO interrupt
- * irq_enable - Enable or disable the GPIO interrupt
- * clear_irq - Acknowledge/clear any pending GPIO interrupt
- * power_enable - Enable or disable Module enable.
- * chip_chip_select - The Chip Select
- * wl_read_irq - Return the state of the interrupt GPIO input
- */
-
-static int wl_attach_irq(FAR struct cc3000_config_s *state, xcpt_t handler,
- FAR void *arg);
-static void wl_enable_irq(FAR struct cc3000_config_s *state, bool enable);
-static void wl_clear_irq(FAR struct cc3000_config_s *state);
-static void wl_select(FAR struct cc3000_config_s *state, bool enable);
-static void wl_enable_power(FAR struct cc3000_config_s *state, bool enable);
-static bool wl_read_irq(FAR struct cc3000_config_s *state);
-#ifdef CONFIG_CC3000_PROBES
-static bool probe(FAR struct cc3000_config_s *state,int n, bool s);
-#endif
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-/* A reference to a structure of this type must be passed to the CC3000
- * driver. This structure provides information about the configuration
- * of the CC3000 and provides some board-specific hooks.
- *
- * Memory for this structure is provided by the caller. It is not copied
- * by the driver and is presumed to persist while the driver is active. The
- * memory must be writable because, under certain circumstances, the driver
- * may modify frequency or X plate resistance values.
- */
-
-static struct stm32_config_s g_cc3000_info =
-{
- .dev.spi_frequency = CONFIG_CC3000_SPI_FREQUENCY,
- .dev.spi_mode = CONFIG_CC3000_SPI_MODE,
- .dev.max_rx_size = 0,
- .dev.irq_attach = wl_attach_irq,
- .dev.irq_enable = wl_enable_irq,
- .dev.irq_clear = wl_clear_irq,
- .dev.power_enable = wl_enable_power,
- .dev.chip_chip_select = wl_select,
- .dev.irq_read = wl_read_irq,
-#ifdef CONFIG_CC3000_PROBES
- .dev.probe = probe, /* This is used for debugging */
-#endif
- .handler = NULL,
- .arg = NULL,
-};
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
-/* IRQ/GPIO access callbacks. These operations all hidden behind
- * callbacks to isolate the CC3000 driver from differences in GPIO
- * interrupt handling by varying boards and MCUs. If possible,
- * interrupts should be configured on both rising and falling edges
- * so that contact and loss-of-contact events can be detected.
- *
- * attach - Attach the CC3000 interrupt handler to the GPIO interrupt
- * enable - Enable or disable the GPIO interrupt
- * clear - Acknowledge/clear any pending GPIO interrupt
- * pendown - Return the state of the pen down GPIO input
- */
-
-static int wl_attach_irq(FAR struct cc3000_config_s *state, xcpt_t handler,
- FAR void *arg)
-{
- FAR struct stm32_config_s *priv = (FAR struct stm32_config_s *)state;
-
- /* Just save the handler for use when the interrupt is enabled */
-
- priv->handler = handler;
- priv->arg = arg;
- return OK;
-}
-
-static void wl_enable_irq(FAR struct cc3000_config_s *state, bool enable)
-{
- FAR struct stm32_config_s *priv = (FAR struct stm32_config_s *)state;
-
- /* The caller should not attempt to enable interrupts if the handler
- * has not yet been 'attached'
- */
-
- DEBUGASSERT(priv->handler || !enable);
-
- /* Attach and enable, or detach and disable */
-
- iinfo("enable:%d\n", enable);
- if (enable)
- {
- (void)stm32_gpiosetevent(GPIO_WIFI_INT, false, true, false,
- priv->handler, priv->arg);
- }
- else
- {
- (void)stm32_gpiosetevent(GPIO_WIFI_INT, false, false, false,
- NULL, NULL);
- }
-}
-
-static void wl_enable_power(FAR struct cc3000_config_s *state, bool enable)
-{
- iinfo("enable:%d\n", enable);
-
- /* Active high enable */
-
- stm32_gpiowrite(GPIO_WIFI_EN, enable);
-}
-
-static void wl_select(FAR struct cc3000_config_s *state, bool enable)
-{
- iinfo("enable:%d\n", enable);
-
- /* Active high enable */
-
- stm32_gpiowrite(GPIO_WIFI_CS, enable);
-}
-
-static void wl_clear_irq(FAR struct cc3000_config_s *state)
-{
- /* Does nothing */
-}
-
-static bool wl_read_irq(FAR struct cc3000_config_s *state)
-{
- /* Active low*/
-
- return stm32_gpioread(GPIO_WIFI_INT) ? false : true;
-}
-
-#ifdef CONFIG_CC3000_PROBES
-static bool probe(FAR struct cc3000_config_s *state,int n, bool s)
-{
- if (n == 0)
- {
- stm32_gpiowrite(GPIO_D14, s);
- }
-
- if (n == 1)
- {
- stm32_gpiowrite(GPIO_D15, s);
- }
-
- return true;
-}
-#endif
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: arch_wlinitialize
- *
- * Description:
- * Each board that supports a wireless device must provide this function.
- * This function is called by application-specific, setup logic to
- * configure the wireless device. This function will register the driver
- * as /dev/wirelessN where N is the minor device number.
- *
- * Returned Value:
- * Zero is returned on success. Otherwise, a negated errno value is
- * returned to indicate the nature of the failure.
- *
- ****************************************************************************/
-
-int wireless_archinitialize(size_t max_rx_size)
-{
- FAR struct spi_dev_s *spi;
-
- /* Init SPI bus */
-
- iinfo("minor %d\n", minor);
- DEBUGASSERT(CONFIG_CC3000_DEVMINOR == 0);
-
-#ifdef CONFIG_CC3000_PROBES
- stm32_configgpio(GPIO_D14);
- stm32_configgpio(GPIO_D15);
- stm32_gpiowrite(GPIO_D14, 1);
- stm32_gpiowrite(GPIO_D15, 1);
-#endif
-
- /* Get an instance of the SPI interface */
-
- spi = up_spiinitialize(CONFIG_CC3000_SPIDEV);
- if (!spi)
- {
- ierr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV);
- return -ENODEV;
- }
-
- /* Initialize and register the SPI CC3000 device */
-
- g_cc3000_info.dev.max_rx_size = max_rx_size ? max_rx_size : CONFIG_CC3000_RX_BUFFER_SIZE;
- int ret = cc3000_register(spi, &g_cc3000_info.dev, CONFIG_CC3000_DEVMINOR);
- if (ret < 0)
- {
- ierr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV);
- return -ENODEV;
- }
-
- return OK;
-}
-
-/****************************************************************************
- * Name: C3000_wlan_init
- *
- * Description:
- * Initialize wlan driver
- *
- * Warning: This function must be called before ANY other wlan driver
- * function
- *
- * Input Parameters:
- * sWlanCB Asynchronous events callback.
- * 0 no event call back.
- * - Call back parameters:
- * 1) event_type: HCI_EVNT_WLAN_UNSOL_CONNECT connect event,
- * HCI_EVNT_WLAN_UNSOL_DISCONNECT disconnect event,
- * HCI_EVNT_WLAN_ASYNC_SIMPLE_CONFIG_DONE config done,
- * HCI_EVNT_WLAN_UNSOL_DHCP dhcp report,
- * HCI_EVNT_WLAN_ASYNC_PING_REPORT ping report OR
- * HCI_EVNT_WLAN_KEEPALIVE keepalive.
- * 2) data: pointer to extra data that received by the event
- * (NULL no data).
- * 3) length: data length.
- * - Events with extra data:
- * HCI_EVNT_WLAN_UNSOL_DHCP: 4 bytes IP, 4 bytes Mask,
- * 4 bytes default gateway, 4 bytes DHCP server and 4 bytes
- * for DNS server.
- * HCI_EVNT_WLAN_ASYNC_PING_REPORT: 4 bytes Packets sent,
- * 4 bytes Packets received, 4 bytes Min round time,
- * 4 bytes Max round time and 4 bytes for Avg round time.
- *
- * sFWPatches 0 no patch or pointer to FW patches
- * sDriverPatches 0 no patch or pointer to driver patches
- * sBootLoaderPatches 0 no patch or pointer to bootloader patches
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-void cc3000_wlan_init(size_t max_tx_len,
- tWlanCB sWlanCB,
- tFWPatches sFWPatches, tDriverPatches
- sDriverPatches, tBootLoaderPatches sBootLoaderPatches)
-{
- wlan_init(max_tx_len, sWlanCB, sFWPatches, sDriverPatches, sBootLoaderPatches);
-}
-
-#endif /* CONFIG_WL_CC3000 */
diff --git a/configs/nucleo-l476rg/src/stm32_io.c b/configs/nucleo-l476rg/src/stm32_io.c
deleted file mode 100644
index 3ece19cf32..0000000000
--- a/configs/nucleo-l476rg/src/stm32_io.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/****************************************************************************
- * configs/nucleo-l476rg/src/stm32_io.c
- *
- * Copyright (C) 2014, 2017 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-
-#include
-#include
-
-#include
-#include "chip/stm32l4_tim.h"
-
-#include "nucleo-l476rg.h"
-
-#ifndef CONFIG_CC3000_PROBES
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: up_leds
- *
- * Description:
- *
- ****************************************************************************/
-
-void up_leds(int r, int g ,int b, int freqs)
-{
- long fosc = 72000000;
- long prescale = 2048;
- long p1s = fosc/prescale;
- long p0p5s = p1s/2;
- long p;
-
- static struct stm32_tim_dev_s *tim1 = 0;
-
- if (tim1 == 0)
- {
- tim1 = stm32_tim_init(1);
- STM32_TIM_SETMODE(tim1, STM32_TIM_MODE_UP);
- STM32_TIM_SETCLOCK(tim1, p1s-8);
- STM32_TIM_SETPERIOD(tim1, p1s);
- STM32_TIM_SETCOMPARE(tim1, 1, 0);
- STM32_TIM_SETCOMPARE(tim1, 2, 0);
- STM32_TIM_SETCOMPARE(tim1, 3, 0);
- STM32_TIM_SETCHANNEL(tim1, 1, STM32_TIM_CH_OUTPWM | STM32_TIM_CH_POLARITY_NEG);
- STM32_TIM_SETCHANNEL(tim1, 2, STM32_TIM_CH_OUTPWM | STM32_TIM_CH_POLARITY_NEG);
- STM32_TIM_SETCHANNEL(tim1, 3, STM32_TIM_CH_OUTPWM | STM32_TIM_CH_POLARITY_NEG);
- }
-
- p = freqs == 0 ? p1s : p1s / freqs;
- STM32_TIM_SETPERIOD(tim1, p);
-
- p = freqs == 0 ? p1s + 1 : p0p5s / freqs;
-
- STM32_TIM_SETCOMPARE(tim1, 2, (r * p) / 255);
- STM32_TIM_SETCOMPARE(tim1, 1, (b * p) / 255);
- STM32_TIM_SETCOMPARE(tim1, 3, (g * p) / 255);
-}
-
-/****************************************************************************
- * Name: up_ioinit
- *
- * Description:
- *
- ****************************************************************************/
-
-void up_ioinit(void)
-{
- /* Configure the GPIO pins as inputs. NOTE that EXTI interrupts are
- * configured for all pins.
- */
-
- up_leds(0,0,0,0);
- stm32_configgpio(GPIO_A0); /* Probes */
- stm32_configgpio(GPIO_A1); /* Probes */
- stm32_configgpio(GPIO_A2); /* Smart Config */
- stm32_configgpio(GPIO_A3); /* not used */
- stm32_configgpio(GPIO_BTN_USER); /* Sw 1 */
- stm32_configgpio(GPIO_D0); /* USART2 RX*/
- stm32_configgpio(GPIO_D1); /* uSART2 TX*/
- stm32_configgpio(GPIO_D2); /* Activate */
-}
-
-/****************************************************************************
- * Name: up_read_inputs
- *
- * N.B The return state in true logic, the button polarity is dealt here in
- *
- ****************************************************************************/
-
-uint8_t up_read_inputs(void)
-{
- uint8_t bits = 0;
- bits |= stm32_gpioread(GPIO_D14) == 0 ? 1 : 0;
- bits |= stm32_gpioread(GPIO_D15) == 0 ? 2 : 0;
- bits |= stm32_gpioread(GPIO_A2) == 0 ? 4 : 0;
- bits |= stm32_gpioread(GPIO_A3) == 0 ? 8 : 0;
- return bits;
-}
-
-/****************************************************************************
- * Name: up_write_outputs
- *
- * N.B The return state in true logic, the button polarity is dealt here in
- *
- ****************************************************************************/
-
-void up_write_outputs(int id, bool bits)
-{
- if (id == 2)
- {
- stm32_gpiowrite(GPIO_D2, bits);
- }
- else if (id == 0)
- {
- stm32_gpiowrite(GPIO_A0, bits);
- }
- else if (id == 1)
- {
- stm32_gpiowrite(GPIO_A1, bits);
- }
-}
-
-/****************************************************************************
- * Name: up_irqio
- *
- * Description:
- *
- ****************************************************************************/
-
-int up_irqio(int id, xcpt_t irqhandler, void *arg)
-{
- int ret = -EINVAL;
-
- /* The following should be atomic */
-
- if (id == 0)
- {
- ret = stm32_gpiosetevent(GPIO_D14, true, true, true, irqhandler, arg);
- }
- else if (id == 1)
- {
- ret = stm32_gpiosetevent(GPIO_D15, true, true, true, irqhandler, arg);
- }
-
- return ret;
-}
-#endif /* CONFIG_CC3000_PROBES */
diff --git a/configs/nucleo-l476rg/src/stm32_spi.c b/configs/nucleo-l476rg/src/stm32_spi.c
index d6d07d64f8..c0ab3d7b3b 100644
--- a/configs/nucleo-l476rg/src/stm32_spi.c
+++ b/configs/nucleo-l476rg/src/stm32_spi.c
@@ -92,10 +92,6 @@ void weak_function stm32l4_spiinitialize(void)
spierr("ERROR: FAILED to initialize SPI port 1\n");
}
-#ifdef CONFIG_WL_CC3000
- stm32l4_configgpio(GPIO_SPI_CS_WIFI);
-#endif
-
#ifdef HAVE_MMCSD
stm32l4_configgpio(GPIO_SPI_CS_SD_CARD);
#endif
@@ -106,14 +102,6 @@ void weak_function stm32l4_spiinitialize(void)
g_spi2 = stm32l4_spibus_initialize(2);
-#ifdef CONFIG_WL_CC3000
- /* Setup CS, EN & IRQ line IOs */
-
- stm32l4_configgpio(GPIO_WIFI_CS);
- stm32l4_configgpio(GPIO_WIFI_EN);
- stm32l4_configgpio(GPIO_WIFI_INT);
-#endif
-
#ifdef CONFIG_WL_CC1101
/* Setup CS, IRQ(gdo2) line IOs */
@@ -155,13 +143,6 @@ void stm32l4_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
-#ifdef CONFIG_WL_CC3000
- if (devid == SPIDEV_WIRELESS(0))
- {
- stm32l4_gpiowrite(GPIO_SPI_CS_WIFI, !selected);
- }
- else
-#endif
#ifdef HAVE_MMCSD
if (devid == SPIDEV_MMCSD(0))
{
@@ -181,13 +162,6 @@ void stm32l4_spi2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
-#ifdef CONFIG_WL_CC3000
- if (devid == SPIDEV_WIRELESS(0))
- {
- stm32l4_gpiowrite(GPIO_WIFI_CS, !selected);
- }
-#endif
-
#ifdef CONFIG_WL_CC1101
if (devid == SPIDEV_WIRELESS(5))
{
diff --git a/configs/sam4e-ek/README.txt b/configs/sam4e-ek/README.txt
index 58c4c4c785..e676d79465 100644
--- a/configs/sam4e-ek/README.txt
+++ b/configs/sam4e-ek/README.txt
@@ -581,8 +581,7 @@ USB Full-Speed Device
directories that can be used for reference.
2. Linux supports the CDC/ACM driver out of the box. Windows, on the other
- than requires that you first install a serial driver (a .inf file). There
- are example .inf files for NuttX in the nuttx/configs/spark directories.
+ than requires that you first install a serial driver (a .inf file).
3. There is hand-shaking to pace incoming serial data. As a result, you may
experience data loss due to RX overrun errors. The overrun errors occur
@@ -1380,8 +1379,7 @@ Configurations
5. By default, this configuration uses the CDC/ACM serial device to
provide the USB console. This works out-of-the-box for Linux.
Windows, on the other hand, will require a CDC/ACM device driver
- (.inf file). There is a sample .inf file in the nuttx/configs/spark
- directories.
+ (.inf file).
5. Using the Prolifics PL2303 Emulation
diff --git a/configs/spark/Kconfig b/configs/spark/Kconfig
deleted file mode 100644
index cb73361c18..0000000000
--- a/configs/spark/Kconfig
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# For a description of the syntax of this configuration file,
-# see the file kconfig-language.txt in the NuttX tools repository.
-#
-
-if ARCH_BOARD_SPARK
-
-config SPARK_FLASH
- bool "MTD driver for onboard 2M FLASH"
- default y
- select MTD
- select MTD_SST25
- select FS_FAT
- select STM32_SPI2
- select MTD_BYTE_WRITE
- ---help---
- Configures an MTD device for use with the onboard flash
-
-config SPARK_FLASH_SPI
- int "Flash SPI bus number"
- default 2
- depends on SPARK_FLASH
- ---help---
- Selects the SPI bus number identying that SPI interface that
- connects the Flash to the MCU.
-
-config SPARK_FLASH_MINOR
- int "Minor number for the FLASH /dev/fat entry"
- default 0
- depends on SPARK_FLASH
- ---help---
- Sets the minor number for the FLASH MTD /dev entry
-
-config SPARK_FLASH_PART
- bool "Enable partition support on FLASH"
- default n
- depends on SPARK_FLASH
- ---help---
- Enables creation of partitions on the FLASH
-
-config SPARK_FLASH_PART_LIST
- string "Flash partition size list"
- default "512,1536"
- depends on SPARK_FLASH_PART
- ---help---
- Comma separated list of partition sizes in KB
-
-endif
diff --git a/configs/spark/README.txt b/configs/spark/README.txt
deleted file mode 100644
index 2975270412..0000000000
--- a/configs/spark/README.txt
+++ /dev/null
@@ -1,364 +0,0 @@
-README
-======
-
-This README discusses issues unique to NuttX configurations for the Spark Core board from Spark Devices (http://www.spark.io). This board features the STM32103CBT6 MCU from STMicro.
-
-
- Microprocessor: 32-bit ARM Cortex M3 at 72MHz STM32F103CBT6
- Memory: 120 KB Flash and 20 KB SRAM, 2M serial Flash
- I/O Pins Out: 37, 17 On the Connector
- Network: TI CC3000 Wifi Module
- ADCs: 9 (at 12-bit resolution)
- Peripherals: 4 timers, 2 I2Cs, 2 SPI ports, 3 USARTs, 2 led's one Blue and one RGB.
- Other: Sleep, stop, and standby modes; serial wire debug and JTAG interfaces
-
- During the development of the SparkCore, the hardware was in limited supply
- As a work around David Sidrane created a SparkCore Big board
- (http://nscdg.com/spark/sparkBB.png) that will interface with a maple mini
- (http://leaflabs.com/docs/hardware/maple-mini.html), and a CC3000BOOST
- (https://estore.ti.com/CC3000BOOST-CC3000-BoosterPack-P4258.aspx)
-
- It breaks out the Tx, Rx to connect to a FTDI TTL-232RG-VREG3V3-WE for the console and
- wires in the spark LEDs and serial flash to the same I/O as the sparkcore. It has a Jlink
- compatible Jtag connector on it.
-
-Contents
-========
-
- - Hardware
- - Core Pin out
- - LEDs
- - Buttons
- - USARTS and Serial Consoles
- - DFU and JTAG
- - Spark -specific Configuration Options
- - Configurations
-
-DFU and JTAG
-============
-
- Enbling Support for the DFU Bootloader
- --------------------------------------
- The linker files in these projects can be configured to indicate that you
- will be loading code using STMicro built-in USB Device Firmware Upgrade (DFU)
- loader or via some JTAG emulator. You can specify the DFU bootloader by
- adding the following line:
-
- CONFIG_STM32_DFU=y
-
- to your .config file. Most of the configurations in this directory are set
- up to use the DFU loader.
-
- If CONFIG_STM32_DFU is defined, the code will not be positioned at the beginning
- of FLASH (0x08000000) but will be offset to 0x08005000. This offset is needed
- to make space for the DFU loader and 0x08005000 is where the DFU loader expects
- to find new applications at boot time. If you need to change that origin for some
- other bootloader, you will need to edit the file(s) ld.script.dfu for the
- configuration.
-
- For Linux or Mac:
- ----------------
-
- While on Linux or Mac, we can use dfu-util to upload nuttx binary.
-
- 1. Make sure we have installed dfu-util. (From yum, apt-get or build from source.)
- 2. Start the DFU loader (bootloader) on the Spark board. You do this by
- resetting the board while holding the "Key" button. Windows should
- recognize that the DFU loader has been installed.
- 3. Flash the nuttx.bin to the board use dfu-util. Here's an example:
-
- $ dfu-util -a1 -d 1eaf:0003 -D nuttx.bin -R
-
- For anything not clear, we can refer to LeafLabs official document:
-
- http://leaflabs.com/docs/unix-toolchain.html
-
- For Windows:
- -----------
-
- The DFU SE PC-based software is available from the STMicro website,
- http://www.st.com. General usage instructions:
-
- 1. Convert the NuttX Intel Hex file (nuttx.hex) into a special DFU
- file (nuttx.dfu)... see below for details.
- 2. Connect the M3 Wildfire board to your computer using a USB
- cable.
- 3. Start the DFU loader on the M3 Wildfire board. You do this by
- resetting the board while holding the "Key" button. Windows should
- recognize that the DFU loader has been installed.
- 3. Run the DFU SE program to load nuttx.dfu into FLASH.
-
- What if the DFU loader is not in FLASH? The loader code is available
- inside of the Demo dirctory of the USBLib ZIP file that can be downloaded
- from the STMicro Website. You can build it using RIDE (or other toolchains);
- you will need a JTAG emulator to burn it into FLASH the first time.
-
- In order to use STMicro's built-in DFU loader, you will have to get
- the NuttX binary into a special format with a .dfu extension. The
- DFU SE PC_based software installation includes a file "DFU File Manager"
- conversion program that a file in Intel Hex format to the special DFU
- format. When you successfully build NuttX, you will find a file called
- nutt.hex in the top-level directory. That is the file that you should
- provide to the DFU File Manager. You will end up with a file called
- nuttx.dfu that you can use with the STMicro DFU SE program.
-
- Enabling JTAG
- -------------
- If you are not using the DFU, then you will probably also need to enable
- JTAG support. By default, all JTAG support is disabled but there NuttX
- configuration options to enable JTAG in various different ways.
-
- These configurations effect the setting of the SWJ_CFG[2:0] bits in the AFIO
- MAPR register. These bits are used to configure the SWJ and trace alternate function I/Os.
- The SWJ (SerialWire JTAG) supports JTAG or SWD access to the Cortex debug port.
- The default state in this port is for all JTAG support to be disable.
-
- CONFIG_STM32_JTAG_FULL_ENABLE - sets SWJ_CFG[2:0] to 000 which enables full
- SWJ (JTAG-DP + SW-DP)
-
- CONFIG_STM32_JTAG_NOJNTRST_ENABLE - sets SWJ_CFG[2:0] to 001 which enable
- full SWJ (JTAG-DP + SW-DP) but without JNTRST.
-
- CONFIG_STM32_JTAG_SW_ENABLE - sets SWJ_CFG[2:0] to 010 which would set JTAG-DP
- disabled and SW-DP enabled
-
- The default setting (none of the above defined) is SWJ_CFG[2:0] set to 100
- which disable JTAG-DP and SW-DP.
-
-Hardware
-========
-
- The Spark comprises a STM32F103CB 72 Mhz, 128 Flash, 20K Ram, with 37 IO Pins, and
- a TI CC3000 Wifi Module. It has a 2MB serial flash, onboad regulation and 2 led's
- one Blue and one RGB.
-
- During the development of the SparkCore, the hardware was in limited supply
- As a work around david_s5 created a SparkCore Big board (http://nscdg.com/spark/sparkBB.png)
- that will interface with a maple mini (http://leaflabs.com/docs/hardware/maple-mini.html),
- and a CC3000BOOST (https://estore.ti.com/CC3000BOOST-CC3000-BoosterPack-P4258.aspx)
-
- It breaks out the Tx, Rx to connect to a FTDI TTL-232RG-VREG3V3-WE for the console and
- wires in the spark LEDs and serial flash to the same I/O as the sparkcore. It has a Jlink
- compatible Jtag connector on it.
-
-Core Pin out
-============
-
- There are 24 pis on the Spark Core module.
-
- Spark Spark Function STM32F103CBT6
- Name Pin # Pin #
- -------- ------ ------------------------------------------------ ---------------
- RAW JP1-1 Input Power N/A
- GND JP1-2 GND
- TX JP1-3 PA[02] USART2_TX/ADC12_IN2/TIM2_CH3 12
- RX JP1-4 PA[03] USART2_RX/ADC12_IN3/TIM2_CH4 13
- A7 JP1-5 PB[01] ADC12_IN9/TIM3_CH4 19
- A6 JP1-6 PB[00] ADC12_IN8/TIM3_CH3 18
- A5 JP1-7 PA[07] SPI1_MOSI/ADC12_IN7/TIM3_CH2 17
- A4 JP1-8 PA[06] SPI1_MISO/ADC12_IN6/TIM3_CH1 16
- A3 JP1-9 PA[05] SPI1_SCK/ADC12_IN5 15
- A2 JP1-10 PA[04] SPI1_NSS/USART2_CK/ADC12_IN4 14
- A1 JP1-11 PA[01] USART2_RTS/ADC12_IN1/TIM2_CH2 11
- A0 JP1-12 PA[00] WKUP/USART2_CTS/ADC12_IN0/TIM2_CH1_ETR 10
-
- +3V3 JP2-1 V3.3 Out of Core NA
- RST JP2-2 NRST 7
- VDDA JP2-3 ADC Voltage 9
- GND JP2-4 GND
- D7 JP2-5 PA[13] JTMS/SWDIO 34 Common with Blue LED LED_USR
- D6 JP2-6 PA[14] JTCK/SWCLK 37
- D5 JP2-7 PA[15] JTDI 38
- D4 JP2-8 PB[03] JTDO 39
- D3 JP2-9 PB[04] NJTRST 40
- D2 JP2-10 PB[05] I2C1_SMBA 41
- D1 JP2-11 PB[06] I2C1_SCL/TIM4_CH1 42
- D0 JP2-12 PB[07] I2C1_SDA/TIM4_CH2 43
-
-Core Internal IO
-================
-
- Spark Function STM32F103CBT6
- Name Pin #
- -------- ------------------------------------------------ ---------------
- BTN PB[02] BOOT1 20
- LED1,D7 PA[13] JTMS/SWDIO 34
- LED2 PA[08] USART1_CK/TIM1_CH1/MCO 29
- LED3 PA[09] USART1_TX/TIM1_CH2 30
- LED4 PA[10] USART1_RX/TIM1_CH3 31
- MEM_CS PB[09] TIM4_CH4 46 SST25VF016B Chip Select
- SPI_CLK PB[13] SPI2_SCK/USART3_CTS/TIM1_CH1N 26
- SPI_MISO PB[14] SPI2_MISO/USART3_RTS/TIM1_CH2N 27
- SPI_MOSI PB[15] SPI2_MOSI/TIM1_CH3N 28
- USB_DISC PB[10] I2C2_SCL/USART3_TX 21
- WIFI_CS PB[12] SPI2_NSS/I2C2_SMBA/USART3_CK/TIM1_BKIN 25 CC3000 Chip Select
- WIFI_EN PB[08] TIM4_CH3 45 CC3000 Module enable
- WIFI_INT PB[11] I2C2_SDA/USART3_RX 22 CC3000 Host interface SPI interrupt
-
-Buttons and LEDs
-================
-
- Buttons
- -------
- The Spark has two mechanical buttons. One button is the RESET button
- connected to the STM32F103CB's reset line via /RST and the other is a
- generic user configurable button labeled BTN and connected to GPIO
- PB2/BOOT1. Since on the Spark, BOOT0 is tied to GND it is a moot point
- that BTN signal is connected to the BOOT1 signal. When a button is
- pressed it will drive the I/O line to GND.
-
- LEDs
- ----
- There are 4 user-controllable LEDs in two packages on board the Spark board:
-
- Sigal Location Color GPIO Active
- ------- ------------ ----------- ----- -----------
- LED1 LED_USR Blue LED PA13 High Common With D7
- LED2 LED_RGB Red LED PA8 Low
- LED3 LED_RGB Blue LED PA9 Low
- LED4 LED_RGB Green LED PA10 Low
-
- LED1 is connected to ground and can be illuminated by driving the PA13
- output high, it shares the Sparks D7 output. The LED2,LED3 and LED4
- are pulled high and can be illuminated by driving the corresponding GPIO output
- to low.
-
- The RGB LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
- defined. In that case, the usage by the board port is defined in
- include/board.h and src/up_leds.c. The LEDs are used to encode OS-related
- events as follows:
-
- SYMBOL Meaning LED2 LED3 LED4
- red blue green Color
- ------------------- ----------------------- ------- ------- ------ ---------
- LED_STARTED NuttX has been started ON OFF OFF Red
- LED_HEAPALLOCATE Heap has been allocated OFF ON OFF Blue
- LED_IRQSENABLED Interrupts enabled ON OFF ON Orange
- LED_STACKCREATED Idle stack created OFF OFF ON Green
- LED_INIRQ In an interrupt** ON N/C N/C Orange Glow
- LED_SIGNAL In a signal handler*** N/C ON N/C Blue Glow
- LED_ASSERTION An assertion failed ON ON ON White
- LED_PANIC The system has crashed ON N/C N/C Red Flashing
- LED_IDLE STM32 is is sleep mode (Optional, not used)
-
- * If LED2, LED3, LED4 are statically on, then NuttX probably failed to boot
- and these LEDs will give you some indication of where the failure was
- ** The normal state is LED4 ON and LED2 faintly glowing. This faint glow
- is because of timer interrupts that result in the LED being illuminated
- on a small proportion of the time.
- *** LED3 may also flicker normally if signals are processed.
-
-Serial Consoles
-===============
-
- USART2
- -----
- If you have a 3.3 V TTL to RS-232 convertor then this is the most convenient
- serial console to use. UART2 is the default in all of these
- configurations.
-
- USART2 RX PA3 JP1 pin 4
- USART2 TX PA2 JP1 pin 3
- GND JP1 pin 2
- V3.3 JP2 pin 1
-
- Virtual COM Port
- ----------------
- Yet another option is to use UART0 and the USB virtual COM port. This
- option may be more convenient for long term development, but was
- painful to use during board bring-up.
-
-Spark -specific Configuration Options
-==============
- WIP
-
-Configurations
-==============
-
- Composite: The composite is a super set of all the functions in nsh,
- usbserial, usbmsc. (usbnsh has not been rung out).
-
- Build it with
-
- make distclean;cd tools;./configure.sh spark/composite;cd ..
-
- then run make menuconfig if you wish to customize things.
-
- N.B. Memory is tight, both Flash and RAM are taxed. If you enable
- debugging you will need to add -Os following the line -g in the line:
-
- ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
- ARCHOPTIMIZATION = -g
-
- in the top level Make.degs or the code will not fit.
-
- Stack space has been hand optimized using the stack coloring by enabling
- "Stack coloration" (CONFIG_STACK_COLORATION) in Build Setup-> Debug
- Options. I have selected values that have 8-16 bytes of headroom with
- network debugging on. If you enable more debugging and get a hard fault
- or any weirdness like commands hanging. Then the Idle, main or Interrupt
- stack my be too small. Stop the target and have a look a memory for a
- blown stack: No DEADBEEF at the lowest address of a given stack.
-
- Given the RAM memory constraints it is not possible to be running the
- network and USB CDC/ACM and MSC at the same time. But on the bright
- side, you can export the FLASH memory to the PC. Write files on the
- Flash. Reboot and mount the FAT FS and run network code that will have
- access the files.
-
- You can use the scripts/cdc-acm.inf file to install the windows
- composite device.
-
- SPI2 is enabled and support is included for the FAT file system on the
- 16Mbit (2M) SST25 device and control of the CC3000 on the spark core.
-
- When the system boots, you should have a dev/mtdblock0 that can be
- mounted using the command:
-
- mount -t vfat /dev/mtdblock0 /mnt/p0
-
- or /dev/mtdblock0 can be exported as MSC on the USB interface along with
- a Virtual serial port as a CDC/ACM interface.
-
- Use the command conn* and disconn to manage the USB interface.
-
- N.B. *If /dev/mtdblock0 is mounted then You must unmount it prior to
- exporting it via the conn command. Bad things will happen if not.
-
- Network control is facilitated by running the c3b (cc3000basic) application.
-
- Run c3b from the nsh prompt.
-
- +-------------------------------------------+
- | Nuttx CC3000 Demo Program |
- +-------------------------------------------+
-
- 01 - Initialize the CC3000
- 02 - Show RX & TX buffer sizes, & free RAM
- 03 - Start Smart Config
- 04 - Manually connect to AP
- 05 - Manually add connection profile
- 06 - List access points
- 07 - Show CC3000 information
- 08 - Telnet
-
- Type 01-07 to select above option:
-
- Select 01. Then use 03 and the TI Smart config application running on an
- IOS or Android device to configure join your network.
-
- Use 07 to see the IP address of the device.
-
- (On the next reboot running c3b 01 the CC3000 will automaticaly rejoin the
- network after the 01 give it a few seconds and enter 07 or 08)
-
- Use 08 to start Telnet. Then you can connect to the device using the
- address listed in command 07.
-
- qq will exit the c3b with the telnet deamon running (if started)
-
- Slow.... You will be thinking 300 bps. This is because of packet sizes and
- how the select thread runs in the telnet session. Telnet is not the best
- showcase for the CC3000, but simply a proof of network connectivity.
-
- http POST and GET should be more efficient.
diff --git a/configs/spark/composite/defconfig b/configs/spark/composite/defconfig
deleted file mode 100644
index 64e28d8db7..0000000000
--- a/configs/spark/composite/defconfig
+++ /dev/null
@@ -1,116 +0,0 @@
-# CONFIG_DISABLE_OS_API is not set
-# CONFIG_NSH_DISABLE_CMP is not set
-# CONFIG_NSH_DISABLE_DD is not set
-# CONFIG_NSH_DISABLE_EXEC is not set
-# CONFIG_NSH_DISABLE_EXIT is not set
-# CONFIG_NSH_DISABLE_GET is not set
-# CONFIG_NSH_DISABLE_HEXDUMP is not set
-# CONFIG_NSH_DISABLE_IFCONFIG is not set
-# CONFIG_NSH_DISABLE_LOSETUP is not set
-# CONFIG_NSH_DISABLE_MKRD is not set
-# CONFIG_NSH_DISABLE_PS is not set
-# CONFIG_NSH_DISABLE_PUT is not set
-# CONFIG_NSH_DISABLE_SEMICOLON is not set
-# CONFIG_NSH_DISABLE_WGET is not set
-# CONFIG_NSH_DISABLE_XD is not set
-# CONFIG_NSH_DISABLEBG is not set
-CONFIG_ANALOG=y
-CONFIG_ARCH_BOARD_SPARK=y
-CONFIG_ARCH_BOARD="spark"
-CONFIG_ARCH_BUTTONS=y
-CONFIG_ARCH_CHIP_STM32=y
-CONFIG_ARCH_CHIP_STM32F103CB=y
-CONFIG_ARCH_INTERRUPTSTACK=340
-CONFIG_ARCH_IRQBUTTONS=y
-CONFIG_ARCH_STACKDUMP=y
-CONFIG_ARCH="arm"
-CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y
-CONFIG_BOARD_INITIALIZE=y
-CONFIG_BOARD_LOOPSPERMSEC=5483
-CONFIG_BUILTIN_PROXY_STACKSIZE=768
-CONFIG_BUILTIN=y
-CONFIG_CC3000_SELECT_STACKSIZE=390
-CONFIG_CDCACM_COMPOSITE=y
-CONFIG_CDCACM_EPBULKIN_HSSIZE=64
-CONFIG_CDCACM_EPBULKOUT_HSSIZE=64
-CONFIG_CDCACM_NRDREQS=2
-CONFIG_CDCACM_NWRREQS=2
-CONFIG_CDCACM_RXBUFSIZE=96
-CONFIG_CDCACM_TXBUFSIZE=96
-CONFIG_CDCACM=y
-CONFIG_COMPOSITE_CONFIGSTR="system/composite"
-CONFIG_COMPOSITE_IAD=y
-CONFIG_COMPOSITE_PRODUCTID=0x2022
-CONFIG_COMPOSITE_PRODUCTSTR="Composite Device"
-CONFIG_COMPOSITE_SERIALSTR="12345"
-CONFIG_COMPOSITE_VENDORID=0x03eb
-CONFIG_DEFAULT_SMALL=y
-CONFIG_DISABLE_POLL=y
-CONFIG_DRIVERS_WIRELESS=y
-CONFIG_EXAMPLES_CC3000BASIC=y
-CONFIG_EXAMPLES_NSH=y
-CONFIG_FAT_LCNAMES=y
-CONFIG_FAT_LFN=y
-CONFIG_FAT_MAXFNAME=12
-CONFIG_FS_FATTIME=y
-CONFIG_FS_NAMED_SEMAPHORES=y
-CONFIG_IDLETHREAD_STACKSIZE=280
-CONFIG_INTELHEX_BINARY=y
-CONFIG_LIB_RAND_ORDER=2
-CONFIG_LIB_SENDFILE_BUFSIZE=0
-CONFIG_MAX_TASKS=16
-CONFIG_MAX_WDOGPARMS=2
-CONFIG_MM_SMALL=y
-CONFIG_MQ_MAXMSGSIZE=8
-CONFIG_MTD_PARTITION=y
-CONFIG_NAME_MAX=8
-CONFIG_NFILE_DESCRIPTORS=5
-CONFIG_NFILE_STREAMS=5
-CONFIG_NPTHREAD_KEYS=0
-CONFIG_NSH_ARCHINIT=y
-CONFIG_NSH_BUILTIN_APPS=y
-CONFIG_NSH_CODECS_BUFSIZE=0
-CONFIG_NSH_FILEIOSIZE=128
-CONFIG_NSH_LINELEN=80
-CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=768
-CONFIG_PREALLOC_MQ_MSGS=1
-CONFIG_PREALLOC_TIMERS=2
-CONFIG_PREALLOC_WDOGS=2
-CONFIG_PTHREAD_STACK_DEFAULT=340
-CONFIG_RAM_SIZE=20480
-CONFIG_RAM_START=0x20000000
-CONFIG_RAW_BINARY=y
-CONFIG_RR_INTERVAL=200
-CONFIG_SDCLONE_DISABLE=y
-CONFIG_SST25_SECTOR512=y
-CONFIG_SST25_SPIFREQUENCY=80000000
-CONFIG_START_DAY=30
-CONFIG_START_MONTH=11
-CONFIG_START_YEAR=2013
-CONFIG_STDIO_DISABLE_BUFFERING=y
-CONFIG_STM32_CRC=y
-CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y
-CONFIG_STM32_DMA1=y
-CONFIG_STM32_JTAG_FULL_ENABLE=y
-CONFIG_STM32_SPI_DMA=y
-CONFIG_STM32_USART2=y
-CONFIG_STM32_USB=y
-CONFIG_SYMTAB_ORDEREDBYNAME=y
-CONFIG_SYSTEM_COMPOSITE=y
-CONFIG_TASK_NAME_SIZE=7
-CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=768
-CONFIG_USART2_RXBUFSIZE=32
-CONFIG_USART2_SERIAL_CONSOLE=y
-CONFIG_USART2_TXBUFSIZE=32
-CONFIG_USBDEV_COMPOSITE=y
-CONFIG_USBDEV_TRACE_NRECORDS=32
-CONFIG_USBDEV_TRACE=y
-CONFIG_USBMSC_COMPOSITE=y
-CONFIG_USBMSC_NRDREQS=2
-CONFIG_USBMSC_NWRREQS=2
-CONFIG_USBMSC_SCSI_STACKSIZE=340
-CONFIG_USBMSC=y
-CONFIG_USER_ENTRYPOINT="nsh_main"
-CONFIG_USERMAIN_STACKSIZE=1024
-CONFIG_WDOG_INTRESERVE=0
-CONFIG_WL_CC3000=y
diff --git a/configs/spark/include/board.h b/configs/spark/include/board.h
deleted file mode 100644
index f88f3923fe..0000000000
--- a/configs/spark/include/board.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/************************************************************************************
- * configs/spark/include/board.h
- * include/arch/board/board.h
- *
- * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
- * Authors: Gregory Nutt
- * Librae
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ************************************************************************************/
-
-#ifndef __CONFIGS_SPARK_INCLUDE_BOARD_H
-#define __CONFIGS_SPARK_INCLUDE_BOARD_H
-
-/************************************************************************************
- * Included Files
- ************************************************************************************/
-
-#include
-
-#ifndef __ASSEMBLY__
-# include
-#endif
-
-#include
-
-#include "stm32_rcc.h"
-#include "stm32_sdio.h"
-#include "stm32.h"
-
-/************************************************************************************
- * Pre-processor Definitions
- ************************************************************************************/
-
-/* Clocking *************************************************************************/
-
-/* On-board crystal frequency is 8MHz (HSE) */
-
-#define STM32_BOARD_XTAL 8000000ul
-
-/* PLL source is HSE/1, PLL multipler is 9: PLL frequency is 8MHz (XTAL) x 9 = 72MHz */
-
-#define STM32_CFGR_PLLSRC RCC_CFGR_PLLSRC
-#define STM32_CFGR_PLLXTPRE 0
-#define STM32_CFGR_PLLMUL RCC_CFGR_PLLMUL_CLKx9
-#define STM32_PLL_FREQUENCY (9*STM32_BOARD_XTAL)
-
-/* Use the PLL and set the SYSCLK source to be the PLL */
-
-#define STM32_SYSCLK_SW RCC_CFGR_SW_PLL
-#define STM32_SYSCLK_SWS RCC_CFGR_SWS_PLL
-#define STM32_SYSCLK_FREQUENCY STM32_PLL_FREQUENCY
-
-/* AHB clock (HCLK) is SYSCLK (72MHz) */
-
-#define STM32_RCC_CFGR_HPRE RCC_CFGR_HPRE_SYSCLK
-#define STM32_HCLK_FREQUENCY STM32_PLL_FREQUENCY
-#define STM32_BOARD_HCLK STM32_HCLK_FREQUENCY /* same as above, to satisfy compiler */
-
-/* APB2 clock (PCLK2) is HCLK (72MHz) */
-
-#define STM32_RCC_CFGR_PPRE2 RCC_CFGR_PPRE2_HCLK
-#define STM32_PCLK2_FREQUENCY STM32_HCLK_FREQUENCY
-
-/* APB2 timers 1 and 8 will receive PCLK2. */
-
-#define STM32_APB2_TIM1_CLKIN (STM32_PCLK2_FREQUENCY)
-#define STM32_APB2_TIM8_CLKIN (STM32_PCLK2_FREQUENCY)
-
-/* APB1 clock (PCLK1) is HCLK/2 (36MHz) */
-
-#define STM32_RCC_CFGR_PPRE1 RCC_CFGR_PPRE1_HCLKd2
-#define STM32_PCLK1_FREQUENCY (STM32_HCLK_FREQUENCY/2)
-
-/* APB1 timers 2-7 will be twice PCLK1 */
-
-#define STM32_APB1_TIM2_CLKIN (2*STM32_PCLK1_FREQUENCY)
-#define STM32_APB1_TIM3_CLKIN (2*STM32_PCLK1_FREQUENCY)
-#define STM32_APB1_TIM4_CLKIN (2*STM32_PCLK1_FREQUENCY)
-#define STM32_APB1_TIM5_CLKIN (2*STM32_PCLK1_FREQUENCY)
-#define STM32_APB1_TIM6_CLKIN (2*STM32_PCLK1_FREQUENCY)
-#define STM32_APB1_TIM7_CLKIN (2*STM32_PCLK1_FREQUENCY)
-
-/* USB divider -- Divide PLL clock by 1.5 */
-
-#define STM32_CFGR_USBPRE 0
-
-/* Timer Frequencies, if APBx is set to 1, frequency is same to APBx
- * otherwise frequency is 2xAPBx.
- * Note: TIM1,8 are on APB2, others on APB1 */
-
-#define BOARD_TIM1_FREQUENCY STM32_HCLK_FREQUENCY
-#define BOARD_TIM2_FREQUENCY STM32_HCLK_FREQUENCY
-#define BOARD_TIM3_FREQUENCY STM32_HCLK_FREQUENCY
-#define BOARD_TIM4_FREQUENCY STM32_HCLK_FREQUENCY
-#define BOARD_TIM5_FREQUENCY STM32_HCLK_FREQUENCY
-#define BOARD_TIM6_FREQUENCY STM32_HCLK_FREQUENCY
-#define BOARD_TIM7_FREQUENCY STM32_HCLK_FREQUENCY
-#define BOARD_TIM8_FREQUENCY STM32_HCLK_FREQUENCY
-
-/* SDIO dividers. Note that slower clocking is required when DMA is disabled
- * in order to avoid RX overrun/TX underrun errors due to delayed responses
- * to service FIFOs in interrupt driven mode. These values have not been
- * tuned!!!
- *
- * HCLK=72MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(178+2)=400 KHz
- */
-
-#define SDIO_INIT_CLKDIV (178 << SDIO_CLKCR_CLKDIV_SHIFT)
-
-/* DMA ON: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(2+2)=18 MHz
- * DMA OFF: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(3+2)=14.4 MHz
- */
-
-#ifdef CONFIG_SDIO_DMA
-# define SDIO_MMCXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT)
-#else
-# define SDIO_MMCXFR_CLKDIV (3 << SDIO_CLKCR_CLKDIV_SHIFT)
-#endif
-
-/* DMA ON: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(1+2)=24 MHz
- * DMA OFF: HCLK=72 MHz, SDIOCLK=72MHz, SDIO_CK=HCLK/(3+2)=14.4 MHz
- */
-
-#ifdef CONFIG_SDIO_DMA
-# define SDIO_SDXFR_CLKDIV (1 << SDIO_CLKCR_CLKDIV_SHIFT)
-#else
-# define SDIO_SDXFR_CLKDIV (3 << SDIO_CLKCR_CLKDIV_SHIFT)
-#endif
-
-/* LED definitions ******************************************************************/
-/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any
- * way. The following definitions are used to access individual LEDs.
- */
-
-/* LED index values for use with board_userled() */
-
-#define BOARD_LED1 0 /* Tied to LED_USR */
-#define BOARD_LED2 1 /* Tied to LED_RGB RED */
-#define BOARD_LED3 2 /* Tied to LED_RGB BLUE */
-#define BOARD_LED4 3 /* Tied to LED_RGB GREEN */
-#define BOARD_NLEDS 4
-
-#define BOARD_USR_LED_BLUE BOARD_LED1
-#define BOARD_RGB_LED_RED BOARD_LED3
-#define BOARD_RGB_LED_GREEN BOARD_LED4
-#define BOARD_RGB_LED_BLUE BOARD_LED2
-
-/* LED bits for use with board_userled_all() */
-
-#define BOARD_USR_LED_BIT (1 << BOARD_USR_LED_BLUE)
-#define BOARD_RED_LED_BIT (1 << BOARD_RGB_LED_RED)
-#define BOARD_BLUE_LED_BIT (1 << BOARD_RGB_LED_BLUE)
-#define BOARD_GREEN_LED_BIT (1 << BOARD_RGB_LED_GREEN)
-
-#define LED_ACTIVE_LOW (BOARD_RED_LED_BIT|BOARD_BLUE_LED_BIT|BOARD_GREEN_LED_BIT)
-
-/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the 4 LEDs on board the
- * spark. The following definitions describe how NuttX controls the LEDs:
- */
-
- /* LED1 LED2 LED3 LED4 */
- /* blue red blue green Color */
-#define LED_STARTED 0 /* ------ ------ ------ ------ --------- */
-#define LED_HEAPALLOCATE 1 /* OFF ON OFF OFF Red */
-#define LED_IRQSENABLED 2 /* OFF OFF ON OFF Blue */
-#define LED_STACKCREATED 3 /* OFF ON OFF ON Orange */
-#define LED_INIRQ 4 /* N/C OFF OFF ON Green */
-#define LED_SIGNAL 5 /* N/C ON N/C N/C Red Glow */
-#define LED_ASSERTION 6 /* N/C N/C ON N/C Blue Glow */
-#define LED_PANIC 7 /* N/C ON ON ON White */
-#define LED_NUM_CODES 8
-
-/* Button definitions ***************************************************************/
-/* The Spark supports two buttons; only one button is controllable by software:
- *
- * BTN: user and wake-up button connected to the I/O PB2/BOOT1 of the STM32F103CB.
- * N.B. Since BOOT0 is tied to GND it is a moot point that BTN signal is connected
- * to the BOOT1 signal.
- * RESET: This pushbutton connected to NRST is used to RESET the STM32F103CB.
- */
-
-#define BUTTON_USER 0
-#define NUM_BUTTONS 1
-
-#define BUTTON_USER_BIT (1 << BUTTON_USER)
-#define BUTTON_ACTIVE_LOW (BUTTON_USER_BIT)
-
-#endif /* __CONFIGS_SPARK_INCLUDE_BOARD_H */
diff --git a/configs/spark/nsh/defconfig b/configs/spark/nsh/defconfig
deleted file mode 100644
index 28222b3f4d..0000000000
--- a/configs/spark/nsh/defconfig
+++ /dev/null
@@ -1,104 +0,0 @@
-# CONFIG_DISABLE_OS_API is not set
-# CONFIG_NSH_DISABLE_CMP is not set
-# CONFIG_NSH_DISABLE_DD is not set
-# CONFIG_NSH_DISABLE_EXEC is not set
-# CONFIG_NSH_DISABLE_EXIT is not set
-# CONFIG_NSH_DISABLE_GET is not set
-# CONFIG_NSH_DISABLE_HEXDUMP is not set
-# CONFIG_NSH_DISABLE_IFCONFIG is not set
-# CONFIG_NSH_DISABLE_LOSETUP is not set
-# CONFIG_NSH_DISABLE_MKRD is not set
-# CONFIG_NSH_DISABLE_PS is not set
-# CONFIG_NSH_DISABLE_PUT is not set
-# CONFIG_NSH_DISABLE_WGET is not set
-# CONFIG_NSH_DISABLE_XD is not set
-# CONFIG_NSH_DISABLEBG is not set
-# CONFIG_NSH_DISABLESCRIPT is not set
-CONFIG_ANALOG=y
-CONFIG_ARCH_BOARD_SPARK=y
-CONFIG_ARCH_BOARD="spark"
-CONFIG_ARCH_BUTTONS=y
-CONFIG_ARCH_CHIP_STM32=y
-CONFIG_ARCH_CHIP_STM32F103CB=y
-CONFIG_ARCH_INTERRUPTSTACK=156
-CONFIG_ARCH_IRQBUTTONS=y
-CONFIG_ARCH_STACKDUMP=y
-CONFIG_ARCH="arm"
-CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y
-CONFIG_BOARD_INITIALIZE=y
-CONFIG_BOARD_LOOPSPERMSEC=5483
-CONFIG_BUILTIN=y
-CONFIG_CDCACM_BULKIN_REQLEN=100
-CONFIG_CDCACM_COMPOSITE=y
-CONFIG_CDCACM_RXBUFSIZE=100
-CONFIG_CDCACM_TXBUFSIZE=80
-CONFIG_CDCACM=y
-CONFIG_COMPOSITE_IAD=y
-CONFIG_COMPOSITE_VENDORID=0x03eb
-CONFIG_DEFAULT_SMALL=y
-CONFIG_DISABLE_POLL=y
-CONFIG_DRIVERS_WIRELESS=y
-CONFIG_EXAMPLES_CC3000BASIC=y
-CONFIG_EXAMPLES_NSH=y
-CONFIG_FAT_LCNAMES=y
-CONFIG_FAT_LFN=y
-CONFIG_FAT_MAXFNAME=12
-CONFIG_FS_FATTIME=y
-CONFIG_FS_NAMED_SEMAPHORES=y
-CONFIG_IDLETHREAD_STACKSIZE=300
-CONFIG_INTELHEX_BINARY=y
-CONFIG_LIB_RAND_ORDER=2
-CONFIG_LIB_SENDFILE_BUFSIZE=0
-CONFIG_MAX_TASKS=16
-CONFIG_MAX_WDOGPARMS=2
-CONFIG_MM_SMALL=y
-CONFIG_MQ_MAXMSGSIZE=8
-CONFIG_MTD_PARTITION=y
-CONFIG_NAME_MAX=8
-CONFIG_NFILE_DESCRIPTORS=5
-CONFIG_NFILE_STREAMS=5
-CONFIG_NPTHREAD_KEYS=0
-CONFIG_NSH_ARCHINIT=y
-CONFIG_NSH_BUILTIN_APPS=y
-CONFIG_NSH_CODECS_BUFSIZE=0
-CONFIG_NSH_FILEIOSIZE=128
-CONFIG_NSH_LINELEN=40
-CONFIG_PREALLOC_MQ_MSGS=1
-CONFIG_PREALLOC_TIMERS=2
-CONFIG_PREALLOC_WDOGS=2
-CONFIG_PTHREAD_STACK_DEFAULT=464
-CONFIG_RAM_SIZE=20480
-CONFIG_RAM_START=0x20000000
-CONFIG_RAW_BINARY=y
-CONFIG_RR_INTERVAL=200
-CONFIG_SDCLONE_DISABLE=y
-CONFIG_SST25_SECTOR512=y
-CONFIG_SST25_SPIFREQUENCY=80000000
-CONFIG_START_DAY=30
-CONFIG_START_MONTH=11
-CONFIG_START_YEAR=2013
-CONFIG_STDIO_DISABLE_BUFFERING=y
-CONFIG_STM32_CRC=y
-CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y
-CONFIG_STM32_DMA1=y
-CONFIG_STM32_JTAG_FULL_ENABLE=y
-CONFIG_STM32_SPI_DMA=y
-CONFIG_STM32_USART2=y
-CONFIG_STM32_USB=y
-CONFIG_SYMTAB_ORDEREDBYNAME=y
-CONFIG_TASK_NAME_SIZE=7
-CONFIG_USART2_RXBUFSIZE=32
-CONFIG_USART2_SERIAL_CONSOLE=y
-CONFIG_USART2_TXBUFSIZE=32
-CONFIG_USBDEV_COMPOSITE=y
-CONFIG_USBDEV_TRACE_NRECORDS=32
-CONFIG_USBDEV_TRACE=y
-CONFIG_USBMSC_BULKINREQLEN=256
-CONFIG_USBMSC_BULKOUTREQLEN=256
-CONFIG_USBMSC_COMPOSITE=y
-CONFIG_USBMSC_SCSI_STACKSIZE=464
-CONFIG_USBMSC=y
-CONFIG_USER_ENTRYPOINT="nsh_main"
-CONFIG_USERMAIN_STACKSIZE=880
-CONFIG_WDOG_INTRESERVE=0
-CONFIG_WL_CC3000=y
diff --git a/configs/spark/scripts/Make.defs b/configs/spark/scripts/Make.defs
deleted file mode 100644
index d4c0a58120..0000000000
--- a/configs/spark/scripts/Make.defs
+++ /dev/null
@@ -1,117 +0,0 @@
-############################################################################
-# configs/spark/scripts/Make.defs
-#
-# Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
-# Author: Gregory Nutt
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-# 3. Neither the name NuttX nor the names of its contributors may be
-# used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-############################################################################
-
-include ${TOPDIR}/.config
-include ${TOPDIR}/tools/Config.mk
-include ${TOPDIR}/arch/arm/src/armv7-m/Toolchain.defs
-
-ifeq ($(CONFIG_STM32_DFU),y)
- LDSCRIPT = ld.script.dfu
-else
- LDSCRIPT = ld.script
-endif
-
-ifeq ($(WINTOOL),y)
- # Windows-native toolchains
- DIRLINK = $(TOPDIR)/tools/copydir.sh
- DIRUNLINK = $(TOPDIR)/tools/unlink.sh
- MKDEP = $(TOPDIR)/tools/mkwindeps.sh
- ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
- ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
- ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)}"
-else
- # Linux/Cygwin-native toolchain
- MKDEP = $(TOPDIR)/tools/mkdeps$(HOSTEXEEXT)
- ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
- ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
- ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/scripts/$(LDSCRIPT)
-endif
-
-CC = $(CROSSDEV)gcc
-CXX = $(CROSSDEV)g++
-CPP = $(CROSSDEV)gcc -E
-LD = $(CROSSDEV)ld
-STRIP = $(CROSSDEV)strip --strip-unneeded
-AR = $(CROSSDEV)ar rcs
-NM = $(CROSSDEV)nm
-OBJCOPY = $(CROSSDEV)objcopy
-OBJDUMP = $(CROSSDEV)objdump
-
-ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'}
-ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1}
-
-ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
- ARCHOPTIMIZATION = -g
-endif
-
-ifneq ($(CONFIG_DEBUG_NOOPT),y)
- ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
-endif
-
-ARCHCFLAGS = -fno-builtin
-ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti
-ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
-ARCHWARNINGSXX = -Wall -Wshadow -Wundef
-ARCHDEFINES =
-ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
-
-CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
-CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
-CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
-CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
-CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
-AFLAGS = $(CFLAGS) -D__ASSEMBLY__
-
-NXFLATLDFLAGS1 = -r -d -warn-common
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
-LDNXFLATFLAGS = -e main -s 2048
-
-ASMEXT = .S
-OBJEXT = .o
-LIBEXT = .a
-EXEEXT =
-
-ifneq ($(CROSSDEV),arm-nuttx-elf-)
- LDFLAGS += -nostartfiles -nodefaultlibs
-endif
-ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
- LDFLAGS += -g
-endif
-
-
-HOSTCC = gcc
-HOSTINCLUDES = -I.
-HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -Wundef -g -pipe
-HOSTLDFLAGS =
diff --git a/configs/spark/scripts/cdc-acm.inf b/configs/spark/scripts/cdc-acm.inf
deleted file mode 100644
index f348b810b5..0000000000
--- a/configs/spark/scripts/cdc-acm.inf
+++ /dev/null
@@ -1,108 +0,0 @@
-; Windows USB CDC ACM Setup File
-
-; Based on : https://www.kernel.org/doc/Documentation/usb/linux-cdc-acm.inf
-; Based on INF template which was:
-; Copyright (c) 2000 Microsoft Corporation
-; Copyright (c) 2007 Microchip Technology Inc.
-; likely to be covered by the MLPL as found at:
-; .
-; For use only on Windows operating systems.
-
-[Version]
-Signature="$Windows NT$"
-Class=Ports
-ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
-Provider=%Linux%
-DriverVer=11/15/2007,5.1.2600.0
-
-[Manufacturer]
-%Linux%=DeviceList, NTamd64
-
-[DestinationDirs]
-DefaultDestDir=12
-
-
-;------------------------------------------------------------------------------
-; Windows 2000/XP/Vista-32bit Sections
-;------------------------------------------------------------------------------
-
-[DriverInstall.nt]
-include=mdmcpq.inf
-CopyFiles=DriverCopyFiles.nt
-AddReg=DriverInstall.nt.AddReg
-
-[DriverCopyFiles.nt]
-usbser.sys,,,0x20
-
-[DriverInstall.nt.AddReg]
-HKR,,DevLoader,,*ntkern
-HKR,,NTMPDriver,,USBSER.sys
-HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
-
-[DriverInstall.nt.Services]
-AddService=usbser, 0x00000002, DriverService.nt
-
-[DriverService.nt]
-DisplayName=%SERVICE%
-ServiceType=1
-StartType=3
-ErrorControl=1
-ServiceBinary=%12%\USBSER.sys
-
-;------------------------------------------------------------------------------
-; Vista-64bit Sections
-;------------------------------------------------------------------------------
-
-[DriverInstall.NTamd64]
-include=mdmcpq.inf
-CopyFiles=DriverCopyFiles.NTamd64
-AddReg=DriverInstall.NTamd64.AddReg
-
-[DriverCopyFiles.NTamd64]
-USBSER.sys,,,0x20
-
-[DriverInstall.NTamd64.AddReg]
-HKR,,DevLoader,,*ntkern
-HKR,,NTMPDriver,,USBSER.sys
-HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
-
-[DriverInstall.NTamd64.Services]
-AddService=usbser, 0x00000002, DriverService.NTamd64
-
-[DriverService.NTamd64]
-DisplayName=%SERVICE%
-ServiceType=1
-StartType=3
-ErrorControl=1
-ServiceBinary=%12%\USBSER.sys
-
-
-;------------------------------------------------------------------------------
-; Vendor and Product ID Definitions
-;------------------------------------------------------------------------------
-; When developing your USB device, the VID and PID used in the PC side
-; application program and the firmware on the microcontroller must match.
-; Modify the below line to use your VID and PID. Use the format as shown
-; below.
-; Note: One INF file can be used for multiple devices with different
-; VID and PIDs. For each supported device, append
-; ",USB\VID_xxxx&PID_yyyy" to the end of the line.
-;------------------------------------------------------------------------------
-[SourceDisksFiles]
-[SourceDisksNames]
-[DeviceList]
-%DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7, USB\VID_03EB&PID_2022&MI_00
-
-[DeviceList.NTamd64]
-%DESCRIPTION%=DriverInstall, USB\VID_0525&PID_A4A7, USB\VID_03EB&PID_2022&MI_00
-
-
-;------------------------------------------------------------------------------
-; String Definitions
-;------------------------------------------------------------------------------
-;Modify these strings to customize your device
-;------------------------------------------------------------------------------
-[Strings]
-Linux = "Nutts Developer Community"
-DESCRIPTION = "Nuttx CDC/ACM"
-SERVICE = "Nuttx CDC/ACM Driver"
diff --git a/configs/spark/scripts/ld.script b/configs/spark/scripts/ld.script
deleted file mode 100644
index 1ae9912a2c..0000000000
--- a/configs/spark/scripts/ld.script
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
- * configs/spark/scripts/ld.script
- *
- * Copyright (C) 2013 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- * Librae
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F103xB has 128Kb of FLASH beginning at address 0x0800:0000 and
- * 20Kb of SRAM beginning at address 0x2000:0000. When booting from FLASH,
- * FLASH memory is aliased to address 0x0000:0000 where the code expects to
- * begin execution by jumping to the entry point in the 0x0800:0000 address
- * range.
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08000000, LENGTH = 128K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- .init_section : {
- _sinit = ABSOLUTE(.);
- *(.init_array .init_array.*)
- _einit = ABSOLUTE(.);
- } > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } > flash
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } > flash
- __exidx_end = ABSOLUTE(.);
-
- _eronly = ABSOLUTE(.);
-
- /* The STM32F103VCT6 has 48Kb of SRAM beginning at the following address */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/configs/spark/scripts/ld.script.dfu b/configs/spark/scripts/ld.script.dfu
deleted file mode 100644
index 48f7e7d291..0000000000
--- a/configs/spark/scripts/ld.script.dfu
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
- * configs/spark/scripts/ld.script.dfu
- *
- * Copyright (C) 2013 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- * Librae
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/* The STM32F103xB has 128Kb of FLASH beginning at address 0x0800:0000 and
- * 20Kb of SRAM beginning at address 0x2000:0000. Here we assume that the
- * spark's DFU bootloader is being used. In that case, the correct
- * load .text load address is 0x0800:5000 (leaving 108Kb).
- */
-
-MEMORY
-{
- flash (rx) : ORIGIN = 0x08005000, LENGTH = 108K
- sram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
-}
-
-OUTPUT_ARCH(arm)
-ENTRY(_stext)
-
-SECTIONS
-{
- .text : {
- _stext = ABSOLUTE(.);
- *(.vectors)
- *(.text .text.*)
- *(.fixup)
- *(.gnu.warning)
- *(.rodata .rodata.*)
- *(.gnu.linkonce.t.*)
- *(.glue_7)
- *(.glue_7t)
- *(.got)
- *(.gcc_except_table)
- *(.gnu.linkonce.r.*)
- _etext = ABSOLUTE(.);
- } > flash
-
- .init_section : {
- _sinit = ABSOLUTE(.);
- *(.init_array .init_array.*)
- _einit = ABSOLUTE(.);
- } > flash
-
- .ARM.extab : {
- *(.ARM.extab*)
- } > flash
-
- __exidx_start = ABSOLUTE(.);
- .ARM.exidx : {
- *(.ARM.exidx*)
- } > flash
- __exidx_end = ABSOLUTE(.);
-
- _eronly = ABSOLUTE(.);
-
- /* The STM32F103VCT6 has 48Kb of SRAM beginning at the following address */
-
- .data : {
- _sdata = ABSOLUTE(.);
- *(.data .data.*)
- *(.gnu.linkonce.d.*)
- CONSTRUCTORS
- _edata = ABSOLUTE(.);
- } > sram AT > flash
-
- .bss : {
- _sbss = ABSOLUTE(.);
- *(.bss .bss.*)
- *(.gnu.linkonce.b.*)
- *(COMMON)
- _ebss = ABSOLUTE(.);
- } > sram
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_info 0 : { *(.debug_info) }
- .debug_line 0 : { *(.debug_line) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- .debug_aranges 0 : { *(.debug_aranges) }
-}
diff --git a/configs/spark/src/Makefile b/configs/spark/src/Makefile
deleted file mode 100644
index 70a7879f15..0000000000
--- a/configs/spark/src/Makefile
+++ /dev/null
@@ -1,76 +0,0 @@
-############################################################################
-# configs/spark/src/Makefile
-#
-# Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
-# Author: Gregory Nutt
-# Librae
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-# 3. Neither the name NuttX nor the names of its contributors may be
-# used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-############################################################################
-
--include $(TOPDIR)/Make.defs
-
-ASRCS =
-CSRCS = stm32_boot.c stm32_spi.c
-
-ifeq ($(CONFIG_ARCH_LEDS),y)
-CSRCS += stm32_autoleds.c
-else
-CSRCS += stm32_userleds.c
-endif
-
-ifeq ($(CONFIG_ARCH_BUTTONS),y)
-CSRCS += stm32_buttons.c
-endif
-
-ifeq ($(CONFIG_LIB_BOARDCTL),y)
-CSRCS += stm32_appinit.c
-endif
-
-ifeq ($(CONFIG_USBDEV),y)
-CSRCS += stm32_usbdev.c
-endif
-
-ifeq ($(CONFIG_BOARDCTL_USBDEVCTRL),y)
-CSRCS += stm32_usbmsc.c
-endif
-
-ifeq ($(CONFIG_USBDEV_COMPOSITE),y)
-CSRCS += stm32_composite.c
-endif
-
-ifeq ($(CONFIG_WL_CC3000),y)
-CSRCS += stm32_cc3000.c
-endif
-
-ifeq ($(CONFIG_CC3000_PROBES),)
-CSRCS += stm32_io.c
-endif
-
-include $(TOPDIR)/configs/Board.mk
diff --git a/configs/spark/src/spark.h b/configs/spark/src/spark.h
deleted file mode 100644
index 0bfd4e3a05..0000000000
--- a/configs/spark/src/spark.h
+++ /dev/null
@@ -1,270 +0,0 @@
-/************************************************************************************
- * configs/spark/src/spark.h
- *
- * Copyright (C) 2013 Gregory Nutt. All rights reserved.
- * Author: Laurent Latil
- * Librae
- * David_s5
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ************************************************************************************/
-
-#ifndef __CONFIGS_SPARK_SRC_SPARK_H
-#define __CONFIGS_SPARK_SRC_SPARK_H
-
-/************************************************************************************
- * Included Files
- ************************************************************************************/
-
-#include
-#include
-#include
-#include
-
-/************************************************************************************
- * Pre-processor Definitions
- ************************************************************************************/
-/* During the development of the SparkCore, the hardware was in limited supply
- * As a work around david_s5 created a SparkCore Big board (http://nscdg.com/spark/sparkBB.png)
- * that will interface with a maple mini (http://leaflabs.com/docs/hardware/maple-mini.html),
- * and a CC3000BOOST (https://estore.ti.com/CC3000BOOST-CC3000-BoosterPack-P4258.aspx)
- *
- * It breaks out the Tx, Rx to connect to a FTDI TTL-232RG-VREG3V3-WE for the console and
- * wires in the spark LEDs and serial flash to the same I/O as the sparkcore. It has a Jlink
- * compatible Jtag connector on it.
- *
- *
- * Board GPIO Usage:
- *
- * GPIO Function MPU Core Core Maple Maple
- * Pin # Name Pin # Name Pin #
- * ----- -------------------------------- --------------------------------------------------------
- * PA[00] WKUP/USART2_CTS/ADC12_IN0/TIM2_CH1_ETR 10 A0 JP1-12 J1-8
- * PA[01] USART2_RTS/ADC12_IN1/TIM2_CH2 11 A1 JP1-11 J1-9
- * PA[02] USART2_TX/ADC12_IN2/TIM2_CH3 12 TX JP1-3 J1-10
- * PA[03] USART2_RX/ADC12_IN3/TIM2_CH4 13 RX JP1-4 J1-11
- * PA[04] SPI1_NSS/USART2_CK/ADC12_IN4 14 A2 JP1-10 J1-12
- * PA[05] SPI1_SCK/ADC12_IN5 15 A3 JP1-9 J1-13
- * PA[06] SPI1_MISO/ADC12_IN6/TIM3_CH1 16 A4 JP1-8 J1-14
- * PA[07] SPI1_MOSI/ADC12_IN7/TIM3_CH2 17 A5 JP1-7 J1-15
- * PA[08] USART1_CK/TIM1_CH1/MCO 29 LED2 J2-5
- * PA[09] USART1_TX/TIM1_CH2 30 LED3 J2-6
- * PA[10] USART1_RX/TIM1_CH3 31 LED4 J2-7
- * PA[11] USART1_CTS/CAN_RX/TIM1_CH4/USBDM 32 USBM USBDM J2-8
- * PA[12] USART1_RTS/CAN_TX/TIM1_ETR/USBDP 33 USBP USBDP J2-9
- * PA[13] JTMS/SWDIO 34 D7,LED1 JP2-5 J2-10
- * PA[14] JTCK/SWCLK 37 D6 JP2-6 J2-11
- * PA[15] JTDI 38 D5 JP2-7 J2-12
- *
- * PB[00] ADC12_IN8/TIM3_CH3 18 A6 JP1-6 J1-16
- * PB[01] ADC12_IN9/TIM3_CH4 19 A7 JP1-5 R1-LED
- * PB[02] BOOT1 20 BTN BTN J1-17
- * PB[03] JTDO 39 D4 JP2-8 J2-13
- * PB[04] NJTRST 40 D3 JP2-9 J2-14
- * PB[05] I2C1_SMBA 41 D2 JP2-10 J2-15
- * PB[06] I2C1_SCL/TIM4_CH1 42 D1 JP2-11 J2-16
- * PB[07] I2C1_SDA/TIM4_CH2 43 D0 JP2-12 J2-17
- * PB[08] TIM4_CH3 45 WIFI_EN BOOT0 J2-18
- * PB[09] TIM4_CH4 46 MEM_CS DISC
- * PB[10] I2C2_SCL/USART3_TX 21 USB_DISC J1-18
- * PB[11] I2C2_SDA/USART3_RX 22 WIFI_INT J1-19
- * PB[12] SPI2_NSS/I2C2_SMBA/USART3_CK/TIM1_BKIN 25 WIFI_CS J2-1
- * PB[13] SPI2_SCK/USART3_CTS/TIM1_CH1N 26 SPI_CLK J2-2
- * PB[14] SPI2_MISO/USART3_RTS/TIM1_CH2N 27 SPI_MISO J2-3
- * PB[15] SPI2_MOSI/TIM1_CH3N 28 SPI_MOSI J2-4
- *
- * PC[13] TAMPER-RTC 2 N.C. J1-4
- * PC[14] OSC32_IN 3 OSC32_IN Y1 N.C.
- * PC[15] OSC32_OUT 4 OSC32_OUT Y1 N.C.
- *
- * PD[00] OSC_IN 5 OSC_IN Y2 8MHZ OSC 8MHZ OSC
- * PD[01] OSC_OUT 6 OSC_OUT Y2 8MHZ OSC 8MHZ OSC
- *
- * Spark Core pin Mapping
- *
- * GPIO ADC Timer I2C UART SPI JTAG Other 5V? STM Pin# Core HW Core SW
- * PA0 CH0 2_CH1_ETR 2_CTS 10 A0 10
- * PA1 CH1 2_CH2 2_RTS 11 A1 11
- * PA2 CH2 2_CH3 2_TX 12 TX 19
- * PA3 CH3 2_CH4 2_RX 13 RX 18
- * PA4 CH4 2_CK 1_NSS 14 A2 12
- * PA5 CH5 1_SCK 15 A3 13
- * PA6 CH6 3_CH1 1_MISO 16 A4 14
- * PA7 CH7 3_CH2 1_MOSI 17 A5 15
- * PA8 1_CH1 1_CK MCO Yes 29 LED2
- * PA9 1_CH2 1_TX Yes 30 LED3
- * PA10 1_CH3 1_RX Yes 31 LED4
- * PA11 1_CH4 1_CTS USB- Yes 32 USBM
- * PA12 1_ETR 1_RTS USB+ Yes 33 USBP
- * PA13 JTMS Yes 34 D7 7
- * PA14 JTCK Yes 37 D6 6
- * PA15 JTDI Yes 38 D5 5
- *
- * PB0 CH8 3_CH3 18 A6 16
- * PB1 CH9 3_CH4 19 A7 17
- * PB2 BOOT1 Yes 20 BTN
- * PB3 JTDO Yes 39 D4 4
- * PB4 NJTRST Yes 40 D3 3
- * PB5 1_SMBA 41 D2 2
- * PB6 4_CH1 1_SCL Yes 42 D1 1
- * PB7 4_CH2 1_SDA Yes 43 D0 0
- * PB8 4_CH3 Yes 45 WIFI_EN
- * PB9 4_CH4 Yes 46 MEM_CS
- * PB10 2_SCL 3_TX Yes 21 USB_DISC
- * PB11 2_SDA 3_RX Yes 22 WIFI_INT
- * PB12 1_BKIN 2_SMBA 3_CK 2_NSS Yes 25 WIFI_CS
- * PB13 3_CTS 2_SCK Yes 26 SPI_SCK
- * PB14 3_RTS 2_MISO Yes 27 SPI_MISO
- * PB15 2_MOSI Yes 28 SPI_MOSI
- *
- * PC13 2
- * PC14 RTC Oscillator 3 OSC32IN
- * PC15 RTC Oscillator 4 OSC32OUT
- *
- * PD0 Oscillator <= 5 OSC
- * PD1 Oscillator => 6 OSC
- */
-
-/* How many SPI modules does this chip support? The LM3S6918 supports 2 SPI
- * modules (others may support more -- in such case, the following must be
- * expanded).
- */
-
-#if STM32_NSPI < 1
-# undef CONFIG_STM32_SPI1
-# undef CONFIG_STM32_SPI2
-#elif STM32_NSPI < 2
-# undef CONFIG_STM32_SPI2
-#endif
-
-/* LEDs *****************************************************************************/
-/*
- * GPIO Function MPU Core Core Maple Maple
- * Pin # Name Pin # Name Pin #
- * ----- -------------------------------- --------------------------------------------------------
- *
- * PA[08] USART1_CK/TIM1_CH1/MCO 29 LED2 J2-5
- * PA[09] USART1_TX/TIM1_CH2 30 LED3 J2-6
- * PA[10] USART1_RX/TIM1_CH3 31 LED4 J2-7
- * PA[13] JTMS/SWDIO 34 D7,LED1 JP2-5 J2-10
- */
-
-#define GPIO_LED1 (GPIO_PORTA | GPIO_PIN13 | GPIO_OUTPUT_CLEAR | GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz)
-#define GPIO_LED_USR GPIO_LED1
-#define GPIO_LED2 (GPIO_PORTA | GPIO_PIN8 | GPIO_OUTPUT_SET | GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz)
-#define GPIO_LED3 (GPIO_PORTA | GPIO_PIN9 | GPIO_OUTPUT_CLEAR | GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz)
-#define GPIO_LED4 (GPIO_PORTA | GPIO_PIN10 | GPIO_OUTPUT_SET | GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz)
-
-#define GPIO_USB_PULLUP (GPIO_PORTB | GPIO_PIN10 | GPIO_OUTPUT_SET | GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz)
-
-/* BUTTON ***************************************************************************/
-/*
- * GPIO Function MPU Core Core Maple Maple
- * Pin # Name Pin # Name Pin #
- * ----- -------------------------------- --------------------------------------------------------
- * PB[02] BOOT1 20 BTN BTN J1-17
- */
-#define IRQBUTTON BUTTON_USER
-
-#define GPIO_BTN (GPIO_PORTB | GPIO_PIN2 | GPIO_INPUT | GPIO_CNF_INPULLUP | GPIO_EXTI)
-
-
-/* MEMORYs **************************************************************************/
-/*
- * GPIO Function MPU Core Core Maple Maple
- * Pin # Name Pin # Name Pin #
- * ----- -------------------------------- --------------------------------------------------------
- * PB[09] TIM4_CH4 46 MEM_CS DISC
-*/
-
-#define GPIO_MEM_CS (GPIO_PORTB | GPIO_PIN9 | GPIO_OUTPUT_SET | GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz)
-
-/* CCS3000 **************************************************************************/
-/*
- * GPIO Function MPU Core Core Maple Maple
- * Pin # Name Pin # Name Pin #
- * ----- -------------------------------- --------------------------------------------------------
- * PB[08] TIM4_CH3 45 WIFI_EN BOOT0 J2-18
- * PB[11] I2C2_SDA/USART3_RX 22 WIFI_INT J1-19
- * PB[12] SPI2_NSS/I2C2_SMBA/USART3_CK/TIM1_BKIN 25 WIFI_CS J2-1
-*/
-
-#define GPIO_WIFI_EN (GPIO_PORTB | GPIO_PIN8 | GPIO_OUTPUT_CLEAR | GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz)
-#define GPIO_WIFI_CS (GPIO_PORTB | GPIO_PIN12 | GPIO_OUTPUT_SET | GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz)
-
-#define GPIO_WIFI_INT (GPIO_PORTB | GPIO_PIN11 | GPIO_INPUT | GPIO_CNF_INPULLUP | GPIO_EXTI)
-
-#if defined(CONFIG_CC3000_PROBES)
-#define GPIO_D0 (GPIO_PORTB | GPIO_PIN7 | GPIO_OUTPUT_CLEAR | GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz)
-#define GPIO_D1 (GPIO_PORTB | GPIO_PIN6 | GPIO_OUTPUT_CLEAR | GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz)
-#else
-#define GPIO_D0 (GPIO_PORTB | GPIO_PIN7 | GPIO_INPUT | GPIO_CNF_INPULLUP | GPIO_EXTI)
-#define GPIO_D1 (GPIO_PORTB | GPIO_PIN6 | GPIO_INPUT | GPIO_CNF_INPULLUP | GPIO_EXTI)
-#define GPIO_D2 (GPIO_PORTB | GPIO_PIN5 | GPIO_OUTPUT_CLEAR | GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz)
-#define GPIO_A0 (GPIO_PORTA | GPIO_PIN0 | GPIO_OUTPUT_SET | GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz)
-#define GPIO_A1 (GPIO_PORTA | GPIO_PIN1 | GPIO_OUTPUT_SET | GPIO_OUTPUT | GPIO_CNF_OUTPP | GPIO_MODE_50MHz)
-#define GPIO_A2 (GPIO_PORTA | GPIO_PIN4 | GPIO_INPUT | GPIO_CNF_INPULLUP )
-#define GPIO_A3 (GPIO_PORTA | GPIO_PIN5 | GPIO_INPUT | GPIO_CNF_INPULLUP )
-#endif
-/************************************************************************************
- * Public Types
- ************************************************************************************/
-
-/************************************************************************************
- * Public data
- ************************************************************************************/
-
-#ifndef __ASSEMBLY__
-
-/************************************************************************************
- * Public Functions
- ************************************************************************************/
-
-/************************************************************************************
- * Name: stm32_spidev_initialize
- *
- * Description:
- * Called to configure SPI chip select GPIO pins.
- *
- ************************************************************************************/
-
-void stm32_spidev_initialize(void);
-
-/************************************************************************************
- * Name: stm32_usbinitialize
- *
- * Description:
- * Called to setup USB-related GPIO pins.
- *
- ************************************************************************************/
-
-void stm32_usbinitialize(void);
-
-#endif /* __ASSEMBLY__ */
-#endif /* __CONFIGS_SPARK_SRC_SPARK_H */
diff --git a/configs/spark/src/stm32_appinit.c b/configs/spark/src/stm32_appinit.c
deleted file mode 100644
index a666eb089e..0000000000
--- a/configs/spark/src/stm32_appinit.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/****************************************************************************
- * config/spark/src/stm32_appinit.c
- *
- * Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- * David_s5
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-#ifdef CONFIG_MTD_SST25
-# include
-# include
-# include
-#endif
-
-#ifdef CONFIG_USBMONITOR
-# include
-#endif
-
-#ifdef CONFIG_USBDEV
-# include "stm32_usbdev.h"
-#endif
-
-#include "stm32.h"
-#include "spark.h"
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/* Configuration ************************************************************/
-
-/* Can't support the SST25 device if it SPI2 or SST25 support is not enabled */
-
-#define HAVE_SST25 1
-#if !defined(CONFIG_STM32_SPI2) || !defined(CONFIG_MTD_SST25)
-# undef HAVE_SST25
-#endif
-
-/* Can't support SST25 features if mountpoints are disabled */
-
-#if defined(CONFIG_DISABLE_MOUNTPOINT)
-# undef HAVE_SST25
-#endif
-
-#ifndef CONFIG_SPARK_FLASH_MOUNT_POINT
-# define CONFIG_SPARK_FLASH_MOUNT_POINT "/mnt/p%d"
-#endif
-
-/* Use minor device number 0 is not is provided */
-
-#ifndef CONFIG_SPARK_FLASH_MINOR
-# define CONFIG_SPARK_FLASH_MINOR 0
-#endif
-
-/* Can't support both FAT and NXFFS */
-
-#if defined(CONFIG_FS_FAT) && defined(CONFIG_FS_NXFFS)
-# warning "Can't support both FAT and NXFFS -- using FAT"
-#endif
-
-#define HAVE_USBDEV 1
-#define HAVE_USBMONITOR 1
-
-/* Can't support USB device is USB device is not enabled */
-
-#ifndef CONFIG_USBDEV
-# undef HAVE_USBDEV
-# undef HAVE_USBMONITOR
-#endif
-
-/* Check if we should enable the USB monitor before starting NSH */
-
-#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR)
-# undef HAVE_USBMONITOR
-#endif
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-static bool g_app_initialzed;
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: board_app_initialize
- *
- * Description:
- * Perform application specific initialization. This function is never
- * called directly from application code, but only indirectly via the
- * (non-standard) boardctl() interface using the command BOARDIOC_INIT.
- *
- * Input Parameters:
- * arg - The boardctl() argument is passed to the board_app_initialize()
- * implementation without modification. The argument has no
- * meaning to NuttX; the meaning of the argument is a contract
- * between the board-specific initalization logic and the
- * matching application logic. The value cold be such things as a
- * mode enumeration value, a set of DIP switch switch settings, a
- * pointer to configuration data read from a file or serial FLASH,
- * or whatever you would like to do with it. Every implementation
- * should accept zero/NULL as a default configuration.
- *
- * Returned Value:
- * Zero (OK) is returned on success; a negated errno value is returned on
- * any failure to indicate the nature of the failure.
- *
- ****************************************************************************/
-
-int board_app_initialize(uintptr_t arg)
-{
- /* Check if already initialized */
-
- if (g_app_initialzed)
- {
- return OK;
- }
-
-#ifdef HAVE_SST25
- {
- FAR struct spi_dev_s *spi;
- FAR struct mtd_dev_s *mtd;
- int ret;
-
- /* Configure SPI-based devices */
- /* Get the SPI port */
-
- syslog(LOG_INFO, "Initializing SPI port %d\n",
- CONFIG_SPARK_FLASH_SPI);
-
- spi = stm32_spibus_initialize(CONFIG_SPARK_FLASH_SPI);
- if (!spi)
- {
- syslog(LOG_ERR, "ERROR: Failed to initialize SPI port %d\n",
- CONFIG_SPARK_FLASH_SPI);
- return -ENODEV;
- }
-
- syslog(LOG_INFO, "Successfully initialized SPI port %d\n",
- CONFIG_SPARK_FLASH_SPI);
-
- /* Now bind the SPI interface to the SST25 SPI FLASH driver */
-
- syslog(LOG_INFO, "Bind SPI to the SPI flash driver\n");
-
- mtd = sst25_initialize(spi);
- if (!mtd)
- {
- syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to the SPI FLASH driver\n",
- CONFIG_SPARK_FLASH_SPI);
- }
- else
- {
- syslog(LOG_INFO, "Successfully bound SPI port %d to the SPI FLASH driver\n",
- CONFIG_SPARK_FLASH_SPI);
- }
-
-#ifndef CONFIG_SPARK_FLASH_PART
-
- /* Use the FTL layer to wrap the MTD driver as a block driver */
-
- ret = ftl_initialize(CONFIG_SPARK_FLASH_MINOR, mtd);
- if (ret < 0)
- {
- ferr("ERROR: Initialize the FTL layer\n");
- return ret;
- }
-
-#ifdef CONFIG_SPARK_MOUNT_FLASH
- {
- char partname[16];
- char mntpoint[16];
-
- /* mount -t vfat /dev/mtdblock0 /mnt/p0 */
-
- snprintf(partname, sizeof(partname), "/dev/mtdblock%d",
- CONFIG_SPARK_FLASH_MINOR);
- snprintf(mntpoint, sizeof(mntpoint)-1, CONFIG_SPARK_FLASH_MOUNT_POINT,
- CONFIG_SPARK_FLASH_MINOR);
-
- /* Mount the file system at /mnt/pn */
-
- ret = mount(partname, mntpoint, "vfat", 0, NULL);
- if (ret < 0)
- {
- ferr("ERROR: Failed to mount the FAT volume: %d\n", errno);
- return ret;
- }
- }
-#endif
-#else
- {
- int partno;
- int partsize;
- int partoffset;
- const char *partstring = CONFIG_SPARK_FLASH_PART_LIST;
- const char *ptr;
- FAR struct mtd_dev_s *mtd_part;
- char partname[16];
- char mntpoint[16];
-
- /* Now create a partition on the FLASH device */
-
- partno = CONFIG_SPARK_FLASH_MINOR;
- ptr = partstring;
- partoffset = 0;
- while (*ptr != '\0')
- {
- /* Get the partition size */
-
- partsize = atoi(ptr);
- mtd_part = mtd_partition(mtd, partoffset, (partsize >> 2) * 16);
- partoffset += (partsize >> 2) * 16;
-
- /* Use the FTL layer to wrap the MTD driver as a block driver */
-
- ret = ftl_initialize(partno, mtd_part);
- if (ret < 0)
- {
- ferr("ERROR: Initialize the FTL layer\n");
- return ret;
- }
-
- snprintf(partname,sizeof(partname), "/dev/mtdblock%d", partno);
- snprintf(mntpoint,sizeof(mntpoint)-1, CONFIG_SPARK_FLASH_MOUNT_POINT,
- partno);
-
- /* Mount the file system at /mnt/pn */
-
- ret = mount(partname, mntpoint, "vfat", 0, NULL);
- if (ret < 0)
- {
- ferr("ERROR: Failed to mount the FAT volume: %d\n", errno);
- return ret;
- }
-
- /* Update the pointer to point to the next size in the list */
-
- while ((*ptr >= '0') && (*ptr <= '9'))
- {
- ptr++;
- }
-
- if (*ptr == ',')
- {
- ptr++;
- }
-
- /* Increment the part number */
-
- partno++;
- }
- }
-#endif /* CONFIG_SPARK_FLASH_PART */
- }
-#endif /* HAVE_SST25 */
-
-#ifdef HAVE_USBMONITOR
- {
- int ret;
-
- /* Start the USB Monitor */
-
- ret = usbmonitor_start();
- if (ret != OK)
- {
- syslog(LOG_ERR, "ERROR: Failed to start USB monitor: %d\n", ret);
- }
- }
-#endif
-
- g_app_initialzed = true;
- return OK;
-}
diff --git a/configs/spark/src/stm32_autoleds.c b/configs/spark/src/stm32_autoleds.c
deleted file mode 100644
index 8d72a6678c..0000000000
--- a/configs/spark/src/stm32_autoleds.c
+++ /dev/null
@@ -1,287 +0,0 @@
-/****************************************************************************
- * configs/spark/src/stm32_autoleds.c
- *
- * Copyright (C) 2012-2013, 2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- * David Sidrane
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-
-#include
-#include
-#include
-
-#include
-#include
-
-#include "chip.h"
-#include "up_arch.h"
-#include "up_internal.h"
-#include "stm32.h"
-#include "spark.h"
-
-#ifdef CONFIG_ARCH_LEDS
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/* The following definitions map the encoded LED setting to bit sets used to
- * manipulate the LEDs. All terms are in true logic, the led polarity is dealt
- * with in the phy_xxx operations
- */
-
-#define ON_SETBITS_SHIFT (0)
-#define ON_CLRBITS_SHIFT (4)
-#define OFF_SETBITS_SHIFT (8)
-#define OFF_CLRBITS_SHIFT (12)
-
-#define ON_BITS(v) ((v) & 0xff)
-#define OFF_BITS(v) (((v) >> 8) & 0x0ff)
-#define SETBITS(b) ((b) & 0x0f)
-#define CLRBITS(b) (((b) >> 4) & 0x0f)
-
-#define ON_SETBITS(v) (SETBITS(ON_BITS(v))
-#define ON_CLRBITS(v) (CLRBITS(ON_BITS(v))
-#define OFF_SETBITS(v) (SETBITS(OFF_BITS(v))
-#define OFF_CLRBITS(v) (CLRBITS(OFF_BITS(v))
-
-#define LED_STARTED_ON_SETBITS ((BOARD_RED_LED_BIT) << ON_SETBITS_SHIFT)
-#define LED_STARTED_ON_CLRBITS ((BOARD_GREEN_LED_BIT|BOARD_BLUE_LED_BIT|BOARD_USR_LED_BIT) << ON_CLRBITS_SHIFT)
-#define LED_STARTED_OFF_SETBITS (0 << OFF_SETBITS_SHIFT)
-#define LED_STARTED_OFF_CLRBITS ((BOARD_RED_LED_BIT|BOARD_GREEN_LED_BIT|BOARD_BLUE_LED_BIT|BOARD_USR_LED_BIT) << OFF_CLRBITS_SHIFT)
-
-#define LED_HEAPALLOCATE_ON_SETBITS ((BOARD_BLUE_LED_BIT) << ON_SETBITS_SHIFT)
-#define LED_HEAPALLOCATE_ON_CLRBITS ((BOARD_RED_LED_BIT|BOARD_GREEN_LED_BIT|BOARD_USR_LED_BIT) << ON_CLRBITS_SHIFT)
-#define LED_HEAPALLOCATE_OFF_SETBITS ((BOARD_RED_LED_BIT) << OFF_SETBITS_SHIFT)
-#define LED_HEAPALLOCATE_OFF_CLRBITS ((BOARD_GREEN_LED_BIT|BOARD_BLUE_LED_BIT|BOARD_USR_LED_BIT) << OFF_CLRBITS_SHIFT)
-
-#define LED_IRQSENABLED_ON_SETBITS ((BOARD_RED_LED_BIT|BOARD_GREEN_LED_BIT) << ON_SETBITS_SHIFT)
-#define LED_IRQSENABLED_ON_CLRBITS ((BOARD_BLUE_LED_BIT|BOARD_USR_LED_BIT) << ON_CLRBITS_SHIFT)
-#define LED_IRQSENABLED_OFF_SETBITS ((BOARD_BLUE_LED_BIT) << OFF_SETBITS_SHIFT)
-#define LED_IRQSENABLED_OFF_CLRBITS ((BOARD_RED_LED_BIT|BOARD_GREEN_LED_BIT|BOARD_USR_LED_BIT) << OFF_CLRBITS_SHIFT)
-
-#define LED_STACKCREATED_ON_SETBITS ((BOARD_GREEN_LED_BIT) << ON_SETBITS_SHIFT)
-#define LED_STACKCREATED_ON_CLRBITS ((BOARD_RED_LED_BIT|BOARD_BLUE_LED_BIT|BOARD_USR_LED_BIT) << ON_CLRBITS_SHIFT)
-#define LED_STACKCREATED_OFF_SETBITS ((BOARD_RED_LED_BIT|BOARD_GREEN_LED_BIT) << OFF_SETBITS_SHIFT)
-#define LED_STACKCREATED_OFF_CLRBITS ((BOARD_BLUE_LED_BIT|BOARD_USR_LED_BIT) << OFF_CLRBITS_SHIFT)
-
-#define LED_INIRQ_ON_SETBITS ((BOARD_RED_LED_BIT) << ON_SETBITS_SHIFT)
-#define LED_INIRQ_ON_CLRBITS ((0) << ON_CLRBITS_SHIFT)
-#define LED_INIRQ_OFF_SETBITS ((0) << OFF_SETBITS_SHIFT)
-#define LED_INIRQ_OFF_CLRBITS ((BOARD_RED_LED_BIT) << OFF_CLRBITS_SHIFT)
-
-#define LED_SIGNAL_ON_SETBITS ((BOARD_BLUE_LED_BIT) << ON_SETBITS_SHIFT)
-#define LED_SIGNAL_ON_CLRBITS ((0) << ON_CLRBITS_SHIFT)
-#define LED_SIGNAL_OFF_SETBITS ((0) << OFF_SETBITS_SHIFT)
-#define LED_SIGNAL_OFF_CLRBITS ((BOARD_BLUE_LED_BIT) << OFF_CLRBITS_SHIFT)
-
-#define LED_ASSERTION_ON_SETBITS ((BOARD_RED_LED_BIT|BOARD_GREEN_LED_BIT|BOARD_BLUE_LED_BIT) << ON_SETBITS_SHIFT)
-#define LED_ASSERTION_ON_CLRBITS ((0) << ON_CLRBITS_SHIFT)
-#define LED_ASSERTION_OFF_SETBITS ((0) << OFF_SETBITS_SHIFT)
-#define LED_ASSERTION_OFF_CLRBITS ((BOARD_RED_LED_BIT|BOARD_GREEN_LED_BIT|BOARD_BLUE_LED_BIT) << OFF_CLRBITS_SHIFT)
-
-#define LED_PANIC_ON_SETBITS ((BOARD_RED_LED_BIT) << ON_SETBITS_SHIFT)
-#define LED_PANIC_ON_CLRBITS ((0) << ON_CLRBITS_SHIFT)
-#define LED_PANIC_OFF_SETBITS ((0) << OFF_SETBITS_SHIFT)
-#define LED_PANIC_OFF_CLRBITS ((BOARD_RED_LED_BIT) << OFF_CLRBITS_SHIFT)
-
-/**************************************************************************************
- * Private Function Prototypes
- **************************************************************************************/
-
-/* LED State Controls */
-
-static inline void phy_led_on(unsigned int on_bitset);
-static inline void phy_led_off(unsigned int off_bitset);
-static void led_setonoff(unsigned int bitset);
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-static const uint16_t g_ledbits[LED_NUM_CODES] =
-{
- (LED_STARTED_ON_SETBITS | LED_STARTED_ON_CLRBITS |
- LED_STARTED_OFF_SETBITS | LED_STARTED_OFF_CLRBITS),
-
- (LED_HEAPALLOCATE_ON_SETBITS | LED_HEAPALLOCATE_ON_CLRBITS |
- LED_HEAPALLOCATE_OFF_SETBITS | LED_HEAPALLOCATE_OFF_CLRBITS),
-
- (LED_IRQSENABLED_ON_SETBITS | LED_IRQSENABLED_ON_CLRBITS |
- LED_IRQSENABLED_OFF_SETBITS | LED_IRQSENABLED_OFF_CLRBITS),
-
- (LED_STACKCREATED_ON_SETBITS | LED_STACKCREATED_ON_CLRBITS |
- LED_STACKCREATED_OFF_SETBITS | LED_STACKCREATED_OFF_CLRBITS),
-
- (LED_INIRQ_ON_SETBITS | LED_INIRQ_ON_CLRBITS |
- LED_INIRQ_OFF_SETBITS | LED_INIRQ_OFF_CLRBITS),
-
- (LED_SIGNAL_ON_SETBITS | LED_SIGNAL_ON_CLRBITS |
- LED_SIGNAL_OFF_SETBITS | LED_SIGNAL_OFF_CLRBITS),
-
- (LED_ASSERTION_ON_SETBITS | LED_ASSERTION_ON_CLRBITS |
- LED_ASSERTION_OFF_SETBITS | LED_ASSERTION_OFF_CLRBITS),
-
- (LED_PANIC_ON_SETBITS | LED_PANIC_ON_CLRBITS |
- LED_PANIC_OFF_SETBITS | LED_PANIC_OFF_CLRBITS)
-};
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: phy_led_on
- *
- * Description:
- * Performs the physical IO to turn On LEDs to the bit encoded state
- *
- ****************************************************************************/
-
-static inline void phy_led_on(unsigned int on_bitset)
-{
- /* All RGB LEDs are pulled up and, hence, active low */
-
- if ((on_bitset & BOARD_RED_LED_BIT) != 0)
- {
- stm32_gpiowrite(GPIO_LED2, false);
- }
-
- if ((on_bitset & BOARD_GREEN_LED_BIT) != 0)
- {
- stm32_gpiowrite(GPIO_LED4, false);
- }
-
- if ((on_bitset & BOARD_BLUE_LED_BIT) != 0)
- {
- stm32_gpiowrite(GPIO_LED3, false);
- }
-
- /* USR LED is pulled down and, hence, active high */
-
- if ((on_bitset & BOARD_USR_LED_BIT) != 0)
- {
- stm32_gpiowrite(GPIO_LED1, true);
- }
-}
-
-/****************************************************************************
- * Name: phy_led_off
- *
- * Description:
- * Performs the physical IO to turn Off LEDs to the bit encoded state
- *
- ****************************************************************************/
-
-static inline void phy_led_off(unsigned int off_bitset)
-{
- /* All RGB LEDs are pulled up and, hence, active low */
-
- if ((off_bitset & BOARD_RED_LED_BIT) != 0)
- {
- stm32_gpiowrite(GPIO_LED2, true);
- }
-
- if ((off_bitset & BOARD_GREEN_LED_BIT) != 0)
- {
- stm32_gpiowrite(GPIO_LED4, true);
- }
-
- if ((off_bitset & BOARD_BLUE_LED_BIT) != 0)
- {
- stm32_gpiowrite(GPIO_LED3, true);
- }
-
- /* USR LED is pulled down and, hence, active high */
-
- if ((off_bitset & BOARD_USR_LED_BIT) != 0)
- {
- stm32_gpiowrite(GPIO_LED1, false);
- }
-}
-
-/****************************************************************************
- * Name: led_setonoff
- *
- * Description:
- * Set/clear all LEDs to the bit encoded state
- *
- ****************************************************************************/
-
-static void led_setonoff(unsigned int bits)
-{
- phy_led_off(CLRBITS(bits));
- phy_led_on(SETBITS(bits));
-}
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: board_autoled_initialize
- ****************************************************************************/
-
-void board_autoled_initialize(void)
-{
- /* Configure LED1-4 GPIOs for output */
-
- stm32_configgpio(GPIO_LED1);
- stm32_configgpio(GPIO_LED2);
- stm32_configgpio(GPIO_LED3);
- stm32_configgpio(GPIO_LED4);
-}
-
-/****************************************************************************
- * Name: board_autoled_on
- ****************************************************************************/
-
-void board_autoled_on(int led)
-{
- led_setonoff(ON_BITS(g_ledbits[led]));
-}
-
-/****************************************************************************
- * Name: board_autoled_off
- ****************************************************************************/
-
-void board_autoled_off(int led)
-{
- led_setonoff(OFF_BITS(g_ledbits[led]));
-}
-
-#endif /* CONFIG_ARCH_LEDS */
diff --git a/configs/spark/src/stm32_boot.c b/configs/spark/src/stm32_boot.c
deleted file mode 100644
index 6d278fb502..0000000000
--- a/configs/spark/src/stm32_boot.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/************************************************************************************
- * configs/spark/src/stm32_boot.c
- *
- * Copyright (C) 2013, 2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- * Librae
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ************************************************************************************/
-
-/************************************************************************************
- * Included Files
- ************************************************************************************/
-
-#include
-#include
-#include
-
-#include
-#include
-
-#include "up_arch.h"
-#include "spark.h"
-
-/************************************************************************************
- * Pre-processor Definitions
- ************************************************************************************/
-
-/************************************************************************************
- * Private Data
- ************************************************************************************/
-
-/************************************************************************************
- * Public Functions
- ************************************************************************************/
-
-/************************************************************************************
- * Name: stm32_boardinitialize
- *
- * Description:
- * All STM32 architectures must provide the following entry point. This entry point
- * is called early in the initialization -- after all memory has been configured
- * and mapped but before any devices have been initialized.
- *
- ************************************************************************************/
-
-void stm32_boardinitialize(void)
-{
- /* Configure on-board LEDs if LED support has been selected. */
-
-#ifdef CONFIG_ARCH_LEDS
- board_autoled_initialize();
-#endif
-
-#ifdef CONFIG_ARCH_BUTTONS
- board_button_initialize();
-#endif
-
- /* Configure SPI chip selects if 1) SP2 is not disabled, and 2) the weak function
- * stm32_spidev_initialize() has been brought into the link.
- */
-
-#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3)
- stm32_spidev_initialize();
-#endif
-
-
- /* Initialize USB is 1) USBDEV is selected, 2) the USB controller is not
- * disabled, and 3) the weak function stm32_usbinitialize() has been brought
- * into the build.
- */
-
-#if defined(CONFIG_USBDEV) && defined(CONFIG_STM32_USB)
- stm32_usbinitialize();
-#endif
-}
-
-/****************************************************************************
- * Name: board_initialize
- *
- * Description:
- * If CONFIG_BOARD_INITIALIZE is selected, then an additional
- * initialization call will be performed in the boot-up sequence to a
- * function called board_initialize(). board_initialize() will be
- * called immediately after up_intiialize() is called and just before the
- * initial application is started. This additional initialization phase
- * may be used, for example, to initialize board-specific device drivers.
- *
- ****************************************************************************/
-
-#ifdef CONFIG_BOARD_INITIALIZE
-void board_initialize(void)
-{
- /* Perform NSH initialization here instead of from the NSH. This
- * alternative NSH initialization is necessary when NSH is ran in user-space
- * but the initialization function must run in kernel space.
- */
-
-#if defined(CONFIG_NSH_LIBRARY) && !defined(CONFIG_LIB_BOARDCTL)
- board_app_initialize(0);
-#endif
-
- /* CC3000 wireless initialization
- * Avoid Double registration if CONFIG_EXAMPLES_CC3000BASIC is defined
- */
-
-#if defined(CONFIG_WL_CC3000) && !defined(CONFIG_EXAMPLES_CC3000BASIC)
- wireless_archinitialize(0);
-#endif
-}
-#endif
-
diff --git a/configs/spark/src/stm32_buttons.c b/configs/spark/src/stm32_buttons.c
deleted file mode 100644
index 3534eeeb6a..0000000000
--- a/configs/spark/src/stm32_buttons.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
- * configs/spark/src/stm32_buttons.c
- *
- * Copyright (C) 2011-2015, 2017 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-
-#include
-#include
-
-#include
-#include
-#include
-
-#include "spark.h"
-
-#ifdef CONFIG_ARCH_BUTTONS
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: board_button_initialize
- *
- * Description:
- * board_button_initialize() must be called to initialize button resources. After
- * that, board_buttons() may be called to collect the current state of all
- * buttons or board_button_irq() may be called to register button interrupt
- * handlers.
- *
- ****************************************************************************/
-
-void board_button_initialize(void)
-{
- /* Configure the GPIO pins as inputs. NOTE that EXTI interrupts are
- * configured for all pins.
- */
-
- stm32_configgpio(GPIO_BTN);
-}
-
-/****************************************************************************
- * Name: board_buttons
- *
- * N.B The return state in true logic, the button polarity is dealt here in
- ****************************************************************************/
-
-uint32_t board_buttons(void)
-{
- return stm32_gpioread(GPIO_BTN)==0 ? BUTTON_USER_BIT : 0;
-}
-
-/************************************************************************************
- * Button support.
- *
- * Description:
- * board_button_initialize() must be called to initialize button resources. After
- * that, board_buttons() may be called to collect the current state of all
- * buttons or board_button_irq() may be called to register button interrupt
- * handlers.
- *
- * After board_button_initialize() has been called, board_buttons() may be called to
- * collect the state of all buttons. board_buttons() returns an 32-bit bit set
- * with each bit associated with a button. See the BUTTON_*_BIT
- * definitions in board.h for the meaning of each bit.
- *
- * board_button_irq() may be called to register an interrupt handler that will
- * be called when a button is depressed or released. The ID value is a
- * button enumeration value that uniquely identifies a button resource. See the
- * BUTTON_* definitions in board.h for the meaning of enumeration
- * value.
- *
- ************************************************************************************/
-
-#ifdef CONFIG_ARCH_IRQBUTTONS
-int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg)
-{
- int ret = -EINVAL;
-
- /* The following should be atomic */
-
- if (id == BUTTON_USER)
- {
- ret = stm32_gpiosetevent(GPIO_BTN, true, true, true, irqhandler, arg);
- }
-
- return ret;
-}
-#endif
-#endif /* CONFIG_ARCH_BUTTONS */
diff --git a/configs/spark/src/stm32_cc3000.c b/configs/spark/src/stm32_cc3000.c
deleted file mode 100644
index 8cda9fb602..0000000000
--- a/configs/spark/src/stm32_cc3000.c
+++ /dev/null
@@ -1,368 +0,0 @@
-/************************************************************************************
- * configs/spark/src/stm32_cc3000.c
- *
- * Copyright (C) 2009, 2013 Gregory Nutt. All rights reserved.
- * Author: Laurent Latil
- * David Sidrane
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ************************************************************************************/
-
-/************************************************************************************
- * Included Files
- ************************************************************************************/
-
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include "stm32.h"
-#include "spark.h"
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-/* Configuration ************************************************************/
-
-#ifdef CONFIG_WL_CC3000
-#ifndef CONFIG_DRIVERS_WIRELESS
-# error "Wireless support requires CONFIG_DRIVERS_WIRELESS"
-#endif
-
-#ifndef CONFIG_STM32_SPI2
-# error "CC3000 Wireless support requires CONFIG_STM32_SPI2"
-#endif
-
-#ifndef CC3000_SPI_FREQUENCY
-# define CC3000_SPI_FREQUENCY 16000000
-#endif
-
-#ifndef CC3000_SPIDEV
-# define CC3000_SPIDEV 2
-#endif
-
-#if CC3000_SPIDEV != 2
-# error "CC3000_SPIDEV must be 2"
-#endif
-
-#ifndef CC3000_DEVMINOR
-# define CC3000_DEVMINOR 0
-#endif
-
-#ifndef CONFIG_CC3000_RX_BUFFER_SIZE
-#define CONFIG_CC3000_RX_BUFFER_SIZE 132
-#endif
-
-/****************************************************************************
- * Private Types
- ****************************************************************************/
-
-struct stm32_config_s
-{
- struct cc3000_config_s dev;
- xcpt_t handler;
- void *arg;
-};
-
-/****************************************************************************
- * Private Function Prototypes
- ****************************************************************************/
-
-/* IRQ/GPIO access callbacks. These operations all hidden behind callbacks
- * to isolate the CC3000 driver from differences in GPIO interrupt handling
- * by varying boards and MCUs. If possible, interrupts should be configured
- * on falling edges to detect the Ready Condition At T2: The normal master
- * SPI write sequence is SPI_CS low, followed by SPI_IRQ low CC3000 to host,
- * indicating that the CC3000 core module is ready to accept data. T2
- * duration is approximately 7 ms.
- *
- * irq_attach - Attach the CC3000 interrupt handler to the GPIO interrupt
- * irq_enable - Enable or disable the GPIO interrupt
- * clear_irq - Acknowledge/clear any pending GPIO interrupt
- * power_enable - Enable or disable Module enable.
- * chip_chip_select - The Chip Select
- * wl_read_irq - Return the state of the interrupt GPIO input
- */
-
-static int wl_attach_irq(FAR struct cc3000_config_s *state, xcpt_t handler,
- FAR void *arg);
-static void wl_enable_irq(FAR struct cc3000_config_s *state, bool enable);
-static void wl_clear_irq(FAR struct cc3000_config_s *state);
-static void wl_select(FAR struct cc3000_config_s *state, bool enable);
-static void wl_enable_power(FAR struct cc3000_config_s *state, bool enable);
-static bool wl_read_irq(FAR struct cc3000_config_s *state);
-#ifdef CONFIG_CC3000_PROBES
-static bool probe(FAR struct cc3000_config_s *state,int n, bool s);
-#endif
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-/* A reference to a structure of this type must be passed to the CC3000
- * driver. This structure provides information about the configuration
- * of the CC3000 and provides some board-specific hooks.
- *
- * Memory for this structure is provided by the caller. It is not copied
- * by the driver and is presumed to persist while the driver is active. The
- * memory must be writable because, under certain circumstances, the driver
- * may modify frequency or X plate resistance values.
- */
-
-static struct stm32_config_s g_cc3000_info =
-{
- .dev.spi_frequency = CONFIG_CC3000_SPI_FREQUENCY,
- .dev.spi_mode = CONFIG_CC3000_SPI_MODE,
- .dev.max_rx_size = 0,
- .dev.irq_attach = wl_attach_irq,
- .dev.irq_enable = wl_enable_irq,
- .dev.irq_clear = wl_clear_irq,
- .dev.power_enable = wl_enable_power,
- .dev.chip_chip_select = wl_select,
- .dev.irq_read = wl_read_irq,
-#ifdef CONFIG_CC3000_PROBES
- .dev.probe = probe, /* This is used for debugging */
-#endif
- .handler = NULL,
- .arg = NULL,
-};
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
-/* IRQ/GPIO access callbacks. These operations all hidden behind
- * callbacks to isolate the CC3000 driver from differences in GPIO
- * interrupt handling by varying boards and MCUs. If possible,
- * interrupts should be configured on both rising and falling edges
- * so that contact and loss-of-contact events can be detected.
- *
- * attach - Attach the CC3000 interrupt handler to the GPIO interrupt
- * enable - Enable or disable the GPIO interrupt
- * clear - Acknowledge/clear any pending GPIO interrupt
- * pendown - Return the state of the pen down GPIO input
- */
-
-static int wl_attach_irq(FAR struct cc3000_config_s *state, xcpt_t handler,
- FAR void *arg)
-{
- FAR struct stm32_config_s *priv = (FAR struct stm32_config_s *)state;
-
- /* Just save the handler for use when the interrupt is enabled */
-
- priv->handler = handler;
- priv->arg = arg;
- return OK;
-}
-
-static void wl_enable_irq(FAR struct cc3000_config_s *state, bool enable)
-{
- FAR struct stm32_config_s *priv = (FAR struct stm32_config_s *)state;
-
- /* The caller should not attempt to enable interrupts if the handler
- * has not yet been 'attached'
- */
-
- DEBUGASSERT(priv->handler || !enable);
-
- /* Attach and enable, or detach and disable */
-
- iinfo("enable:%d\n", enable);
- if (enable)
- {
- (void)stm32_gpiosetevent(GPIO_WIFI_INT, false, true, false,
- priv->handler, priv->arg);
- }
- else
- {
- (void)stm32_gpiosetevent(GPIO_WIFI_INT, false, false, false,
- NULL, NULL);
- }
-}
-
-static void wl_enable_power(FAR struct cc3000_config_s *state, bool enable)
-{
- iinfo("enable:%d\n", enable);
-
- /* Active high enable */
-
- stm32_gpiowrite(GPIO_WIFI_EN, enable);
-}
-
-static void wl_select(FAR struct cc3000_config_s *state, bool enable)
-{
- iinfo("enable:%d\n", enable);
-
- /* Active high enable */
-
- stm32_gpiowrite(GPIO_WIFI_CS, enable);
-}
-
-static void wl_clear_irq(FAR struct cc3000_config_s *state)
-{
- /* Does nothing */
-}
-
-static bool wl_read_irq(FAR struct cc3000_config_s *state)
-{
- /* Active low*/
-
- return stm32_gpioread(GPIO_WIFI_INT) ? false : true;
-}
-
-#ifdef CONFIG_CC3000_PROBES
-static bool probe(FAR struct cc3000_config_s *state,int n, bool s)
-{
- if (n == 0)
- {
- stm32_gpiowrite(GPIO_D0, s);
- }
-
- if (n == 1)
- {
- stm32_gpiowrite(GPIO_D1, s);
- }
-
- return true;
-}
-#endif
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: arch_wlinitialize
- *
- * Description:
- * Each board that supports a wireless device must provide this function.
- * This function is called by application-specific, setup logic to
- * configure the wireless device. This function will register the driver
- * as /dev/wirelessN where N is the minor device number.
- *
- *
- * Returned Value:
- * Zero is returned on success. Otherwise, a negated errno value is
- * returned to indicate the nature of the failure.
- *
- ****************************************************************************/
-
-int wireless_archinitialize(size_t max_rx_size)
-{
- FAR struct spi_dev_s *spi;
-
- /* Init SPI bus */
-
- iinfo("minor %d\n", minor);
- DEBUGASSERT(CONFIG_CC3000_DEVMINOR == 0);
-
-#ifdef CONFIG_CC3000_PROBES
- stm32_configgpio(GPIO_D0);
- stm32_configgpio(GPIO_D1);
- stm32_gpiowrite(GPIO_D0, 1);
- stm32_gpiowrite(GPIO_D1, 1);
-#endif
-
- /* Get an instance of the SPI interface */
-
- spi = stm32_spibus_initialize(CONFIG_CC3000_SPIDEV);
- if (!spi)
- {
- ierr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV);
- return -ENODEV;
- }
-
- /* Initialize and register the SPI CC3000 device */
- g_cc3000_info.dev.max_rx_size = max_rx_size ? max_rx_size : CONFIG_CC3000_RX_BUFFER_SIZE;
- int ret = cc3000_register(spi, &g_cc3000_info.dev, CONFIG_CC3000_DEVMINOR);
- if (ret < 0)
- {
- ierr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_CC3000_SPIDEV);
- return -ENODEV;
- }
-
- return OK;
-}
-
-/****************************************************************************
- * Name: C3000_wlan_init
- *
- * Description:
- * Initialize wlan driver
- *
- * Warning: This function must be called before ANY other wlan driver
- * function
- *
- * Input Parameters:
- * sWlanCB Asynchronous events callback.
- * 0 no event call back.
- * - Call back parameters:
- * 1) event_type: HCI_EVNT_WLAN_UNSOL_CONNECT connect event,
- * HCI_EVNT_WLAN_UNSOL_DISCONNECT disconnect event,
- * HCI_EVNT_WLAN_ASYNC_SIMPLE_CONFIG_DONE config done,
- * HCI_EVNT_WLAN_UNSOL_DHCP dhcp report,
- * HCI_EVNT_WLAN_ASYNC_PING_REPORT ping report OR
- * HCI_EVNT_WLAN_KEEPALIVE keepalive.
- * 2) data: pointer to extra data that received by the event
- * (NULL no data).
- * 3) length: data length.
- * - Events with extra data:
- * HCI_EVNT_WLAN_UNSOL_DHCP: 4 bytes IP, 4 bytes Mask,
- * 4 bytes default gateway, 4 bytes DHCP server and 4 bytes
- * for DNS server.
- * HCI_EVNT_WLAN_ASYNC_PING_REPORT: 4 bytes Packets sent,
- * 4 bytes Packets received, 4 bytes Min round time,
- * 4 bytes Max round time and 4 bytes for Avg round time.
- *
- * sFWPatches 0 no patch or pointer to FW patches
- * sDriverPatches 0 no patch or pointer to driver patches
- * sBootLoaderPatches 0 no patch or pointer to bootloader patches
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-void cc3000_wlan_init(size_t max_tx_len,
- tWlanCB sWlanCB,
- tFWPatches sFWPatches, tDriverPatches
- sDriverPatches, tBootLoaderPatches sBootLoaderPatches)
-{
- wlan_init(max_tx_len, sWlanCB, sFWPatches, sDriverPatches, sBootLoaderPatches);
-}
-
-#endif /* CONFIG_WL_CC3000 */
diff --git a/configs/spark/src/stm32_composite.c b/configs/spark/src/stm32_composite.c
deleted file mode 100644
index 9d8943c18e..0000000000
--- a/configs/spark/src/stm32_composite.c
+++ /dev/null
@@ -1,621 +0,0 @@
-/****************************************************************************
- * config/spark/src/stm32_composite.c
- *
- * Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- * David_s5
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-#ifdef CONFIG_MTD_SST25
-# include
-# include
-# include
-#endif
-
-#include
-#include
-#include
-#include
-
-#ifdef CONFIG_USBMONITOR
-# include
-#endif
-
-#ifdef CONFIG_USBDEV
-# include "stm32_usbdev.h"
-#endif
-
-#include "stm32.h"
-#include "spark.h"
-
-#if defined(CONFIG_BOARDCTL_USBDEVCTRL) && defined(CONFIG_USBDEV_COMPOSITE)
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/* Configuration ************************************************************/
-
-/* Can't support the SST25 device if it SPI2 or SST25 support is not enabled */
-
-#define HAVE_SST25 1
-#if !defined(CONFIG_STM32_SPI2) || !defined(CONFIG_MTD_SST25)
-# undef HAVE_SST25
-#endif
-
-/* Can't support SST25 features if mountpoints are disabled */
-
-#if defined(CONFIG_DISABLE_MOUNTPOINT)
-# undef HAVE_SST25
-#endif
-
-#ifndef CONFIG_SPARK_FLASH_MOUNT_POINT
-# define CONFIG_SPARK_FLASH_MOUNT_POINT "/mnt/p%d"
-#endif
-
-/* Use minor device number 0 is not is provided */
-
-#ifndef CONFIG_SPARK_FLASH_MINOR
-# define CONFIG_SPARK_FLASH_MINOR 0
-#endif
-
-/* Can't support both FAT and NXFFS */
-
-#if defined(CONFIG_FS_FAT) && defined(CONFIG_FS_NXFFS)
-# warning "Can't support both FAT and NXFFS -- using FAT"
-#endif
-
-#define HAVE_USBDEV 1
-#define HAVE_USBMONITOR 1
-
-/* Can't support USB device is USB device is not enabled */
-
-#ifndef CONFIG_USBDEV
-# undef HAVE_USBDEV
-# undef HAVE_USBMONITOR
-#endif
-
-/* Check if we should enable the USB monitor before starting NSH */
-
-#if !defined(CONFIG_USBDEV_TRACE) || !defined(CONFIG_USBMONITOR)
-# undef HAVE_USBMONITOR
-#endif
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-#ifdef CONFIG_USBMSC_COMPOSITE
-static FAR void *g_mschandle;
-#endif
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: stm32_composite_initialize
- *
- * Description:
- * Perform architecture specific initialization
- *
- ****************************************************************************/
-
-#ifndef CONFIG_NSH_BUILTIN_APPS
-static int stm32_composite_initialize(void)
-{
-#ifdef HAVE_SST25
- FAR struct spi_dev_s *spi;
- FAR struct mtd_dev_s *mtd;
- int ret;
-
- /* Configure SPI-based devices */
-
- /* Get the SPI port */
-
- finfo("Initializing SPI port %d\n", CONFIG_SPARK_FLASH_SPI);
-
- spi = stm32_spibus_initialize(CONFIG_SPARK_FLASH_SPI);
- if (!spi)
- {
- ferr("ERROR: Failed to initialize SPI port %d\n",
- CONFIG_SPARK_FLASH_SPI);
- return -ENODEV;
- }
-
- finfo("Successfully initialized SPI port %d\n", CONFIG_SPARK_FLASH_SPI);
-
- /* Now bind the SPI interface to the SST25 SPI FLASH driver */
-
- finfo("Bind SPI to the SPI flash driver\n");
- mtd = sst25_initialize(spi);
- if (!mtd)
- {
- ferr("ERROR: Failed to bind SPI port %d to the SPI FLASH driver\n",
- CONFIG_SPARK_FLASH_SPI);
- }
- else
- {
- finfo("Successfully bound SPI port %d to the SPI FLASH driver\n",
- CONFIG_SPARK_FLASH_SPI);
- }
-
-#ifndef CONFIG_SPARK_FLASH_PART
-
- /* Use the FTL layer to wrap the MTD driver as a block driver */
-
- ret = ftl_initialize(CONFIG_SPARK_FLASH_MINOR, mtd);
- if (ret < 0)
- {
- ferr("ERROR: Initialize the FTL layer\n");
- return ret;
- }
-
-#ifdef CONFIG_SPARK_MOUNT_FLASH
- char partname[16];
- char mntpoint[16];
-
- /* mount -t vfat /dev/mtdblock0 /mnt/p0 */
-
- snprintf(partname, sizeof(partname), "/dev/mtdblock%d",
- CONFIG_SPARK_FLASH_MINOR);
- snprintf(mntpoint, sizeof(mntpoint)-1, CONFIG_SPARK_FLASH_MOUNT_POINT,
- CONFIG_SPARK_FLASH_MINOR);
-
- /* Mount the file system at /mnt/pn */
-
- ret = mount(partname, mntpoint, "vfat", 0, NULL);
- if (ret < 0)
- {
- ferr("ERROR: Failed to mount the FAT volume: %d\n", errno);
- return ret;
- }
-
-#endif
-#else
- {
- int partno;
- int partsize;
- int partoffset;
- const char *partstring = CONFIG_SPARK_FLASH_PART_LIST;
- const char *ptr;
- FAR struct mtd_dev_s *mtd_part;
- char partname[16];
- char mntpoint[16];
-
- /* Now create a partition on the FLASH device */
-
- partno = CONFIG_SPARK_FLASH_MINOR;
- ptr = partstring;
- partoffset = 0;
- while (*ptr != '\0')
- {
- /* Get the partition size */
-
- partsize = atoi(ptr);
- mtd_part = mtd_partition(mtd, partoffset, (partsize >> 2) * 16);
- partoffset += (partsize >> 2) * 16;
-
- /* Use the FTL layer to wrap the MTD driver as a block driver */
-
- ret = ftl_initialize(partno, mtd_part);
- if (ret < 0)
- {
- ferr("ERROR: Initialize the FTL layer\n");
- return ret;
- }
-
- snprintf(partname,sizeof(partname), "/dev/mtdblock%d", partno);
- snprintf(mntpoint,sizeof(mntpoint)-1, CONFIG_SPARK_FLASH_MOUNT_POINT,
- partno);
-
- /* Mount the file system at /mnt/pn */
-
- ret = mount(partname, mntpoint, "vfat", 0, NULL);
- if (ret < 0)
- {
- ferr("ERROR: Failed to mount the FAT volume: %d\n", errno);
- return ret;
- }
-
- /* Update the pointer to point to the next size in the list */
-
- while ((*ptr >= '0') && (*ptr <= '9'))
- {
- ptr++;
- }
-
- if (*ptr == ',')
- {
- ptr++;
- }
-
- /* Increment the part number */
-
- partno++;
- }
- }
-#endif /* CONFIG_SPARK_FLASH_PART */
-
-#endif /* HAVE_SST25 */
-
-#ifdef HAVE_USBMONITOR
- /* Start the USB Monitor */
-
- ret = usbmonitor_start();
- if (ret != OK)
- {
- ferr("ERROR: Failed to start USB monitor: %d\n", ret);
- }
-#endif
-
- return OK;
-}
-#endif
-
-/****************************************************************************
- * Name: board_mscclassobject
- *
- * Description:
- * If the mass storage class driver is part of composite device, then
- * its instantiation and configuration is a multi-step, board-specific,
- * process (See comments for usbmsc_configure below). In this case,
- * board-specific logic must provide board_mscclassobject().
- *
- * board_mscclassobject() is called from the composite driver. It must
- * encapsulate the instantiation and configuration of the mass storage
- * class and the return the mass storage device's class driver instance
- * to the composite driver.
- *
- * Input Parameters:
- * classdev - The location to return the mass storage class' device
- * instance.
- *
- * Returned Value:
- * 0 on success; a negated errno on failure
- *
- ****************************************************************************/
-
-#ifdef CONFIG_USBMSC_COMPOSITE
-static int board_mscclassobject(int minor,
- FAR struct usbdev_devinfo_s *devinfo,
- FAR struct usbdevclass_driver_s **classdev)
-{
- int ret;
-
- DEBUGASSERT(g_mschandle == NULL);
-
- /* Configure the mass storage device */
-
- uinfo("Configuring with NLUNS=1\n");
- ret = usbmsc_configure(1, &g_mschandle);
- if (ret < 0)
- {
- uerr("ERROR: usbmsc_configure failed: %d\n", -ret);
- return ret;
- }
-
- uinfo("MSC handle=%p\n", g_mschandle);
-
- /* Bind the LUN(s) */
-
- uinfo("Bind LUN=0 to /dev/mtdblock0\n");
- ret = usbmsc_bindlun(g_mschandle, "/dev/mtdblock0", 0, 0, 0, false);
- if (ret < 0)
- {
- uerr("ERROR: usbmsc_bindlun failed for LUN 1 at /dev/mtdblock0: %d\n",
- ret);
- usbmsc_uninitialize(g_mschandle);
- g_mschandle = NULL;
- return ret;
- }
-
- /* Get the mass storage device's class object */
-
- ret = usbmsc_classobject(g_mschandle, devinfo, classdev);
- if (ret < 0)
- {
- uerr("ERROR: usbmsc_classobject failed: %d\n", -ret);
- usbmsc_uninitialize(g_mschandle);
- g_mschandle = NULL;
- }
-
- return ret;
-}
-#endif
-
- /****************************************************************************
- * Name: board_mscuninitialize
- *
- * Description:
- * Un-initialize the USB storage class driver. This is just an application-
- * specific wrapper aboutn usbmsc_unitialize() that is called form the
- * composite device logic.
- *
- * Input Parameters:
- * classdev - The class driver instrance previously give to the composite
- * driver by board_mscclassobject().
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-#ifdef CONFIG_USBMSC_COMPOSITE
-static void board_mscuninitialize(FAR struct usbdevclass_driver_s *classdev)
-{
- DEBUGASSERT(g_mschandle != NULL);
- usbmsc_uninitialize(g_mschandle);
- g_mschandle = NULL;
-}
-#endif
-
-/****************************************************************************
- * Name: board_composite0_connect
- *
- * Description:
- * Connect the USB composite device on the specified USB device port for
- * configuration 0.
- *
- * Input Parameters:
- * port - The USB device port.
- *
- * Returned Value:
- * A non-NULL handle value is returned on success. NULL is returned on
- * any failure.
- *
- ****************************************************************************/
-
-#ifdef CONFIG_USBMSC_COMPOSITE
-static FAR void *board_composite0_connect(int port)
-{
- /* Here we are composing the configuration of the usb composite device.
- *
- * The standard is to use one CDC/ACM and one USB mass storage device.
- */
-
- struct composite_devdesc_s dev[2];
- int ifnobase = 0;
- int strbase = COMPOSITE_NSTRIDS;
-
- /* Configure the CDC/ACM device */
-
- /* Ask the cdcacm driver to fill in the constants we didn't
- * know here.
- */
-
- cdcacm_get_composite_devdesc(&dev[0]);
-
- /* Overwrite and correct some values... */
- /* The callback functions for the CDC/ACM class */
-
- dev[0].classobject = cdcacm_classobject;
- dev[0].uninitialize = cdcacm_uninitialize;
-
- /* Interfaces */
-
- dev[0].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
- dev[0].minor = 0; /* The minor interface number */
-
- /* Strings */
-
- dev[0].devinfo.strbase = strbase; /* Offset to String Numbers */
-
- /* Endpoints */
-
- dev[0].devinfo.epno[CDCACM_EP_INTIN_IDX] = 1;
- dev[0].devinfo.epno[CDCACM_EP_BULKIN_IDX] = 2;
- dev[0].devinfo.epno[CDCACM_EP_BULKOUT_IDX] = 3;
-
- /* Count up the base numbers */
-
- ifnobase += dev[0].devinfo.ninterfaces;
- strbase += dev[0].devinfo.nstrings;
-
- /* Configure the mass storage device device */
- /* Ask the usbmsc driver to fill in the constants we didn't
- * know here.
- */
-
- usbmsc_get_composite_devdesc(&dev[1]);
-
- /* Overwrite and correct some values... */
- /* The callback functions for the USBMSC class */
-
- dev[1].classobject = board_mscclassobject;
- dev[1].uninitialize = board_mscuninitialize;
-
- /* Interfaces */
-
- dev[1].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
- dev[1].minor = 0; /* The minor interface number */
-
- /* Strings */
-
- dev[1].devinfo.strbase = strbase; /* Offset to String Numbers */
-
- /* Endpoints */
-
- dev[1].devinfo.epno[USBMSC_EP_BULKIN_IDX] = 5;
- dev[1].devinfo.epno[USBMSC_EP_BULKOUT_IDX] = 4;
-
- /* Count up the base numbers */
-
- ifnobase += dev[1].devinfo.ninterfaces;
- strbase += dev[1].devinfo.nstrings;
-
- return composite_initialize(2, dev);
-}
-#endif
-
-/****************************************************************************
- * Name: board_composite1_connect
- *
- * Description:
- * Connect the USB composite device on the specified USB device port for
- * configuration 1.
- *
- * Input Parameters:
- * port - The USB device port.
- *
- * Returned Value:
- * A non-NULL handle value is returned on success. NULL is returned on
- * any failure.
- *
- ****************************************************************************/
-
-static FAR void *board_composite1_connect(int port)
-{
- /* REVISIT: This configuration currently fails. stm32_epallocpma() fails
- * allocate a buffer for the 6th endpoint. Currenlty it supports 7x64 byte
- * buffers, two required for EP0, leaving only buffers for 5 additional
- * endpoints.
- */
-
-#if 0
- struct composite_devdesc_s dev[2];
- int strbase = COMPOSITE_NSTRIDS;
- int ifnobase = 0;
- int epno;
- int i;
-
- for (i = 0, epno = 1; i < 2; i++)
- {
- /* Ask the cdcacm driver to fill in the constants we didn't know here */
-
- cdcacm_get_composite_devdesc(&dev[i]);
-
- /* Overwrite and correct some values... */
- /* The callback functions for the CDC/ACM class */
-
- dev[i].classobject = cdcacm_classobject;
- dev[i].uninitialize = cdcacm_uninitialize;
-
- dev[i].minor = i; /* The minor interface number */
-
- /* Interfaces */
-
- dev[i].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
-
- /* Strings */
-
- dev[i].devinfo.strbase = strbase; /* Offset to String Numbers */
-
- /* Endpoints */
-
- dev[i].devinfo.epno[CDCACM_EP_INTIN_IDX] = epno++;
- dev[i].devinfo.epno[CDCACM_EP_BULKIN_IDX] = epno++;
- dev[i].devinfo.epno[CDCACM_EP_BULKOUT_IDX] = epno++;
-
- ifnobase += dev[i].devinfo.ninterfaces;
- strbase += dev[i].devinfo.nstrings;
- }
-
- return composite_initialize(2, dev);
-#else
- return NULL;
-#endif
-}
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: board_composite_initialize
- *
- * Description:
- * Perform architecture specific initialization of a composite USB device.
- *
- ****************************************************************************/
-
-int board_composite_initialize(int port)
-{
-#ifdef CONFIG_NSH_BUILTIN_APPS
- return OK;
-#else
- return stm32_composite_initialize();
-#endif
-}
-
-/****************************************************************************
- * Name: board_composite_connect
- *
- * Description:
- * Connect the USB composite device on the specified USB device port using
- * the specified configuration. The interpretation of the configid is
- * board specific.
- *
- * Input Parameters:
- * port - The USB device port.
- * configid - The USB composite configuration
- *
- * Returned Value:
- * A non-NULL handle value is returned on success. NULL is returned on
- * any failure.
- *
- ****************************************************************************/
-
-FAR void *board_composite_connect(int port, int configid)
-{
- if (configid == 0)
- {
-#ifdef CONFIG_USBMSC_COMPOSITE
- return board_composite0_connect(port);
-#else
- return NULL;
-#endif
- }
- else if (configid == 1)
- {
- return board_composite1_connect(port);
- }
- else
- {
- return NULL;
- }
-}
-
-#endif /* CONFIG_BOARDCTL_USBDEVCTRL && CONFIG_USBDEV_COMPOSITE */
diff --git a/configs/spark/src/stm32_io.c b/configs/spark/src/stm32_io.c
deleted file mode 100644
index b6601c1ac6..0000000000
--- a/configs/spark/src/stm32_io.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/****************************************************************************
- * configs/spark/src/stm32_io.c
- *
- * Copyright (C) 2011-2014, 2017 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-
-#include
-
-#include
-#include "chip/stm32_tim.h"
-
-#include "spark.h"
-
-#ifndef CONFIG_CC3000_PROBES
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: up_leds
- *
- * Description:
- *
- ****************************************************************************/
-
-void up_leds(int r, int g ,int b, int freqs)
-{
- long fosc = 72000000;
- long prescale = 2048;
- long p1s = fosc/prescale;
- long p0p5s = p1s/2;
- long p;
-
- static struct stm32_tim_dev_s *tim1 = 0;
-
- if (tim1 == 0)
- {
- tim1 = stm32_tim_init(1);
- STM32_TIM_SETMODE(tim1, STM32_TIM_MODE_UP);
- STM32_TIM_SETCLOCK(tim1, p1s-8);
- STM32_TIM_SETPERIOD(tim1, p1s);
- STM32_TIM_SETCOMPARE(tim1, 1, 0);
- STM32_TIM_SETCOMPARE(tim1, 2, 0);
- STM32_TIM_SETCOMPARE(tim1, 3, 0);
- STM32_TIM_SETCHANNEL(tim1, 1, STM32_TIM_CH_OUTPWM | STM32_TIM_CH_POLARITY_NEG);
- STM32_TIM_SETCHANNEL(tim1, 2, STM32_TIM_CH_OUTPWM | STM32_TIM_CH_POLARITY_NEG);
- STM32_TIM_SETCHANNEL(tim1, 3, STM32_TIM_CH_OUTPWM | STM32_TIM_CH_POLARITY_NEG);
- }
-
- p = freqs == 0 ? p1s : p1s / freqs;
- STM32_TIM_SETPERIOD(tim1, p);
-
- p = freqs == 0 ? p1s + 1 : p0p5s / freqs;
-
- STM32_TIM_SETCOMPARE(tim1, 2, (r * p) / 255);
- STM32_TIM_SETCOMPARE(tim1, 1, (b * p) / 255);
- STM32_TIM_SETCOMPARE(tim1, 3, (g * p) / 255);
-}
-
-/****************************************************************************
- * Name: up_ioinit
- *
- * Description:
- *
- ****************************************************************************/
-
-void up_ioinit(void)
-{
- /* Configure the GPIO pins as inputs. NOTE that EXTI interrupts are
- * configured for all pins.
- */
-
- up_leds(0,0,0,0);
- stm32_configgpio(GPIO_A0); /* Probes */
- stm32_configgpio(GPIO_A1); /* Probes */
- stm32_configgpio(GPIO_A2); /* Smart Config */
- stm32_configgpio(GPIO_A3); /* not used */
- stm32_configgpio(GPIO_D0); /* Sw 1 */
- stm32_configgpio(GPIO_D1); /* Sw 2 */
- stm32_configgpio(GPIO_D2); /* Activate */
-}
-
-/****************************************************************************
- * Name: up_read_inputs
- *
- * N.B The return state in true logic, the button polarity is dealt here in
- *
- ****************************************************************************/
-
-uint8_t up_read_inputs(void)
-{
- uint8_t bits = 0;
- bits |= stm32_gpioread(GPIO_D0) == 0 ? 1 : 0;
- bits |= stm32_gpioread(GPIO_D1) == 0 ? 2 : 0;
- bits |= stm32_gpioread(GPIO_A2) == 0 ? 4 : 0;
- bits |= stm32_gpioread(GPIO_A3) == 0 ? 8 : 0;
- return bits;
-}
-
-/****************************************************************************
- * Name: up_write_outputs
- *
- * N.B The return state in true logic, the button polarity is dealt here in
- *
- ****************************************************************************/
-
-void up_write_outputs(int id, bool bits)
-{
- if (id == 2)
- {
- stm32_gpiowrite(GPIO_D2, bits);
- }
- else if (id == 0)
- {
- stm32_gpiowrite(GPIO_A0, bits);
- }
- else if (id == 1)
- {
- stm32_gpiowrite(GPIO_A1, bits);
- }
-}
-
-/****************************************************************************
- * Name: up_irqio
- *
- * Description:
- *
- ****************************************************************************/
-
-int up_irqio(int id, xcpt_t irqhandler, void *arg)
-{
- int ret = -EINVAL;
-
- /* The following should be atomic */
-
- if (id == 0)
- {
- ret = stm32_gpiosetevent(GPIO_D0, true, true, true, irqhandler, arg);
- }
- else if (id == 1)
- {
- ret = stm32_gpiosetevent(GPIO_D1, true, true, true, irqhandler, arg);
- }
-
- return ret;
-}
-#endif /* CONFIG_CC3000_PROBES */
diff --git a/configs/spark/src/stm32_spi.c b/configs/spark/src/stm32_spi.c
deleted file mode 100644
index 8002196d86..0000000000
--- a/configs/spark/src/stm32_spi.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/************************************************************************************
- * configs/spark/src/stm32_spi.c
- *
- * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Modifications:
- *
- * - 10/8/2013: David Sidrane
- * - Modified to support SPI2 on the Spark Core.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ************************************************************************************/
-
-/************************************************************************************
- * Included Files
- ************************************************************************************/
-
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-#include "up_arch.h"
-#include "chip.h"
-#include "stm32.h"
-#include "spark.h"
-
-#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3)
-
-/************************************************************************************
- * Public Functions
- ************************************************************************************/
-
-/************************************************************************************
- * Name: stm32_spidev_initialize
- *
- * Description:
- * Called to configure SPI chip select GPIO pins for the Spark board.
- *
- ************************************************************************************/
-
-void weak_function stm32_spidev_initialize(void)
-{
-#ifdef CONFIG_STM32_SPI2
-
- /* Setup CS, EN & IRQ line IOs */
-
-#ifdef CONFIG_WL_CC3000
- stm32_configgpio(GPIO_WIFI_CS);
- stm32_configgpio(GPIO_WIFI_EN);
- stm32_configgpio(GPIO_WIFI_INT);
-#endif
-
-#ifdef CONFIG_MTD_SST25
- stm32_configgpio(GPIO_MEM_CS); /* FLASH chip select */
-#endif
-
-#endif
-}
-
-/****************************************************************************
- * Name: stm32_spi1/2/3select and stm32_spi1/2/3status
- *
- * Description:
- * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be
- * provided by board-specific logic. They are implementations of the select
- * and status methods of the SPI interface defined by struct spi_ops_s (see
- * include/nuttx/spi/spi.h). All other methods (including stm32_spibus_initialize())
- * are provided by common STM32 logic. To use this common SPI logic on your
- * board:
- *
- * 1. Provide logic in stm32_boardinitialize() to configure SPI chip select
- * pins.
- * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions in your
- * board-specific logic. These functions will perform chip selection and
- * status operations using GPIOs in the way your board is configured.
- * 3. Add a calls to stm32_spibus_initialize() in your low level application
- * initialization logic
- * 4. The handle returned by stm32_spibus_initialize() may then be used to bind the
- * SPI driver to higher level logic (e.g., calling
- * mmcsd_spislotinitialize(), for example, will bind the SPI driver to
- * the SPI MMC/SD driver).
- *
- ****************************************************************************/
-
-#ifdef CONFIG_STM32_SPI1
-void stm32_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
-{
- spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
-}
-
-uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
-{
- return 0;
-}
-#endif
-
-#ifdef CONFIG_STM32_SPI2
-void stm32_spi2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
-{
- spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
-
-#if defined(CONFIG_MTD_SST25)
-
- if (devid == SPIDEV_FLASH(0))
- {
- stm32_gpiowrite(GPIO_MEM_CS, !selected);
- }
-#if defined(CONFIG_WL_CC3000)
- else
-#endif
-#endif
-
-#if defined(CONFIG_WL_CC3000)
- if (devid == SPIDEV_WIRELESS(0))
- {
- stm32_gpiowrite(GPIO_WIFI_CS, !selected);
- }
-#endif
-}
-
-uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, uint32_t devid)
-{
- return 0;
-}
-#endif
-
-#ifdef CONFIG_STM32_SPI3
-void stm32_spi3select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
-
- spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
-
-}
-
-uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, uint32_t devid)
-{
- return 0;
-}
-#endif
-
-/****************************************************************************
- * Name: stm32_spi1cmddata
- *
- * Description:
- * Set or clear the SH1101A A0 or SD1306 D/C n bit to select data (true)
- * or command (false). This function must be provided by platform-specific
- * logic. This is an implementation of the cmddata method of the SPI
- * interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
- *
- * Input Parameters:
- *
- * spi - SPI device that controls the bus the device that requires the CMD/
- * DATA selection.
- * devid - If there are multiple devices on the bus, this selects which one
- * to select cmd or data. NOTE: This design restricts, for example,
- * one one SPI display per SPI bus.
- * cmd - true: select command; false: select data
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-#ifdef CONFIG_SPI_CMDDATA
-#ifdef CONFIG_STM32_SPI1
-int stm32_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
-{
- return -ENODEV;
-}
-#endif
-
-#ifdef CONFIG_STM32_SPI2
-int stm32_spi2cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
-{
- return OK;
-}
-#endif
-
-#ifdef CONFIG_STM32_SPI3
-int stm32_spi3cmddata(FAR struct spi_dev_s *dev, uint32_t devid, bool cmd)
-{
- return OK;
-}
-#endif
-#endif /* CONFIG_SPI_CMDDATA */
-
-#endif /* CONFIG_STM32_SPI1 || CONFIG_STM32_SPI2 */
diff --git a/configs/spark/src/stm32_usbdev.c b/configs/spark/src/stm32_usbdev.c
deleted file mode 100644
index ef59cef0c6..0000000000
--- a/configs/spark/src/stm32_usbdev.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/************************************************************************************
- * configs/spark/src/stm32_usbdev.c
- *
- * Copyright (C) 2009-2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- * Librae
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ************************************************************************************/
-
-/************************************************************************************
- * Included Files
- ************************************************************************************/
-
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-
-#include "up_arch.h"
-#include "stm32.h"
-#include "spark.h"
-
-/************************************************************************************
- * Pre-processor Definitions
- ************************************************************************************/
-
-/************************************************************************************
- * Private Functions
- ************************************************************************************/
-
-/************************************************************************************
- * Public Functions
- ************************************************************************************/
-
-/************************************************************************************
- * Name: stm32_usbinitialize
- *
- * Description:
- * Called to setup USB-related GPIO pins.
- *
- ************************************************************************************/
-
-void stm32_usbinitialize(void)
-{
- uinfo("called\n");
-
- /* USB Soft Connect Pullup */
-
- stm32_configgpio(GPIO_USB_PULLUP);
-}
-
-/************************************************************************************
- * Name: stm32_usbpullup
- *
- * Description:
- * If USB is supported and the board supports a pullup via GPIO (for USB software
- * connect and disconnect), then the board software must provide stm32_pullup.
- * See include/nuttx/usb/usbdev.h for additional description of this method.
- * Alternatively, if no pull-up GPIO the following EXTERN can be redefined to be
- * NULL.
- *
- ************************************************************************************/
-
-int stm32_usbpullup(FAR struct usbdev_s *dev, bool enable)
-{
- usbtrace(TRACE_DEVPULLUP, (uint16_t)enable);
- stm32_gpiowrite(GPIO_USB_PULLUP, !enable);
- return OK;
-}
-
-/************************************************************************************
- * Name: stm32_usbsuspend
- *
- * Description:
- * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is
- * used. This function is called whenever the USB enters or leaves suspend mode.
- * This is an opportunity for the board logic to shutdown clocks, power, etc.
- * while the USB is suspended.
- *
- ************************************************************************************/
-
-void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume)
-{
- uinfo("resume: %d\n", resume);
-}
diff --git a/configs/spark/src/stm32_usbmsc.c b/configs/spark/src/stm32_usbmsc.c
deleted file mode 100644
index 57e9e30d82..0000000000
--- a/configs/spark/src/stm32_usbmsc.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
- * configs/spark/src/stm32_usbmsc.c
- *
- * Copyright (C) 2016 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-
-#include
-
-#include "nuttx/board.h"
-
-#include "spark.h"
-
-#if defined(CONFIG_USBMSC) && defined(CONFIG_BOARDCTL_USBDEVCTRL)
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: board_usbmsc_initialize
- *
- * Description:
- * Perform architecture specific initialization as needed to establish
- * the mass storage device that will be exported by the USB MSC device.
- *
- ****************************************************************************/
-
-int board_usbmsc_initialize(int port)
-{
- return board_app_initialize(0);
-}
-
-#endif /* CONFIG_USBMSC && CONFIG_BOARDCTL_USBDEVCTRL */
diff --git a/configs/spark/src/stm32_userleds.c b/configs/spark/src/stm32_userleds.c
deleted file mode 100644
index 7acbf76b89..0000000000
--- a/configs/spark/src/stm32_userleds.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************************
- * configs/spark/src/stm32_userleds.c
- *
- * Copyright (C) 2011, 2013, 2015 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-
-#include
-#include
-#include
-
-#include
-#include
-
-#include "chip.h"
-#include "up_arch.h"
-#include "up_internal.h"
-#include "stm32.h"
-#include "spark.h"
-
-#ifndef CONFIG_ARCH_LEDS
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-/* This array maps an LED number to GPIO pin configuration */
-
-static uint32_t g_ledcfg[BOARD_NLEDS] =
-{
- GPIO_LED1, GPIO_LED2, GPIO_LED3, GPIO_LED4
-};
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: board_userled_initialize
- ****************************************************************************/
-
-void board_userled_initialize(void)
-{
- /* Configure LED1-4 GPIOs for output */
-
- stm32_configgpio(GPIO_LED1);
- stm32_configgpio(GPIO_LED2);
- stm32_configgpio(GPIO_LED3);
- stm32_configgpio(GPIO_LED4);
-}
-
-/****************************************************************************
- * Name: board_userled
- ****************************************************************************/
-
-void board_userled(int led, bool ledon)
-{
- if ((unsigned)led < BOARD_NLEDS)
- {
- bool active_low = (LED_ACTIVE_LOW & (1 << ledon)) != 0;
- stm32_gpiowrite(g_ledcfg[led], active_low ? !ledon : ledon);
- }
-}
-
-/****************************************************************************
- * Name: board_userled_all
- * Description:
- * This function will be called to set the state of the Leds on the board
- *
- * Input Parameters:
- * ledset: is a bit set of 1s for the LEDs to effect
- * led_states_set: a bit set of 1 for on 0 for off
- * N.B. The led_states_set terms are in true logic, the led polarity is
- * dealt herein
- *
- ****************************************************************************/
-
-void board_userled_all(uint8_t ledset, uint8_t led_states_set)
-{
- led_states_set ^= LED_ACTIVE_LOW;
- if ((ledset & BOARD_USR_LED_BIT) == 0)
- {
- stm32_gpiowrite(GPIO_LED1, (led_states_set & BOARD_USR_LED_BIT) == 0);
- }
-
- if ((ledset & BOARD_RED_LED_BIT) == 0)
- {
- stm32_gpiowrite(GPIO_LED2, (led_states_set & BOARD_RED_LED_BIT) == 0);
- }
-
- if ((ledset & BOARD_BLUE_LED_BIT) == 0)
- {
- stm32_gpiowrite(GPIO_LED3, (led_states_set & BOARD_BLUE_LED_BIT) == 0);
- }
-
- if ((ledset & BOARD_GREEN_LED_BIT) == 0)
- {
- stm32_gpiowrite(GPIO_LED4, (led_states_set & BOARD_GREEN_LED_BIT) == 0);
- }
-}
-
-#endif /* !CONFIG_ARCH_LEDS */
diff --git a/configs/spark/tools/dfu.sh b/configs/spark/tools/dfu.sh
deleted file mode 100755
index 4ca7e0eb1e..0000000000
--- a/configs/spark/tools/dfu.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-dfu-util -a1 -d 1eaf:0003 -D nuttx.bin -R
diff --git a/configs/spark/tools/env.sh b/configs/spark/tools/env.sh
deleted file mode 100755
index 1d90665286..0000000000
--- a/configs/spark/tools/env.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-cd tools
-./configure.sh spark/$1
-cd - > /dev/null
diff --git a/configs/spark/usbmsc/defconfig b/configs/spark/usbmsc/defconfig
deleted file mode 100644
index eed15c31c7..0000000000
--- a/configs/spark/usbmsc/defconfig
+++ /dev/null
@@ -1,101 +0,0 @@
-# CONFIG_DISABLE_OS_API is not set
-# CONFIG_NSH_DISABLE_CMP is not set
-# CONFIG_NSH_DISABLE_DD is not set
-# CONFIG_NSH_DISABLE_EXEC is not set
-# CONFIG_NSH_DISABLE_EXIT is not set
-# CONFIG_NSH_DISABLE_GET is not set
-# CONFIG_NSH_DISABLE_HEXDUMP is not set
-# CONFIG_NSH_DISABLE_IFCONFIG is not set
-# CONFIG_NSH_DISABLE_LOSETUP is not set
-# CONFIG_NSH_DISABLE_MKRD is not set
-# CONFIG_NSH_DISABLE_PS is not set
-# CONFIG_NSH_DISABLE_PUT is not set
-# CONFIG_NSH_DISABLE_WGET is not set
-# CONFIG_NSH_DISABLE_XD is not set
-# CONFIG_NSH_DISABLEBG is not set
-# CONFIG_NSH_DISABLESCRIPT is not set
-CONFIG_ANALOG=y
-CONFIG_ARCH_BOARD_SPARK=y
-CONFIG_ARCH_BOARD="spark"
-CONFIG_ARCH_BUTTONS=y
-CONFIG_ARCH_CHIP_STM32=y
-CONFIG_ARCH_CHIP_STM32F103CB=y
-CONFIG_ARCH_INTERRUPTSTACK=234
-CONFIG_ARCH_IRQBUTTONS=y
-CONFIG_ARCH_STACKDUMP=y
-CONFIG_ARCH="arm"
-CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y
-CONFIG_BOARD_INITIALIZE=y
-CONFIG_BOARD_LOOPSPERMSEC=5483
-CONFIG_BUILTIN_PROXY_STACKSIZE=768
-CONFIG_BUILTIN=y
-CONFIG_CC3000_SELECT_STACKSIZE=390
-CONFIG_DEFAULT_SMALL=y
-CONFIG_DISABLE_POLL=y
-CONFIG_DRIVERS_WIRELESS=y
-CONFIG_EXAMPLES_CC3000BASIC=y
-CONFIG_EXAMPLES_NSH=y
-CONFIG_FAT_LCNAMES=y
-CONFIG_FAT_LFN=y
-CONFIG_FAT_MAXFNAME=12
-CONFIG_FS_FATTIME=y
-CONFIG_FS_NAMED_SEMAPHORES=y
-CONFIG_IDLETHREAD_STACKSIZE=280
-CONFIG_INTELHEX_BINARY=y
-CONFIG_LIB_RAND_ORDER=2
-CONFIG_LIB_SENDFILE_BUFSIZE=0
-CONFIG_MAX_TASKS=16
-CONFIG_MAX_WDOGPARMS=2
-CONFIG_MM_SMALL=y
-CONFIG_MQ_MAXMSGSIZE=8
-CONFIG_MTD_PARTITION=y
-CONFIG_NAME_MAX=8
-CONFIG_NFILE_DESCRIPTORS=5
-CONFIG_NFILE_STREAMS=5
-CONFIG_NPTHREAD_KEYS=0
-CONFIG_NSH_ARCHINIT=y
-CONFIG_NSH_BUILTIN_APPS=y
-CONFIG_NSH_CODECS_BUFSIZE=0
-CONFIG_NSH_FILEIOSIZE=128
-CONFIG_NSH_LINELEN=80
-CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=768
-CONFIG_PREALLOC_MQ_MSGS=1
-CONFIG_PREALLOC_TIMERS=2
-CONFIG_PREALLOC_WDOGS=2
-CONFIG_PTHREAD_STACK_DEFAULT=340
-CONFIG_RAM_SIZE=20480
-CONFIG_RAM_START=0x20000000
-CONFIG_RAW_BINARY=y
-CONFIG_RR_INTERVAL=200
-CONFIG_SDCLONE_DISABLE=y
-CONFIG_SST25_SECTOR512=y
-CONFIG_SST25_SPIFREQUENCY=80000000
-CONFIG_START_DAY=30
-CONFIG_START_MONTH=11
-CONFIG_START_YEAR=2013
-CONFIG_STDIO_DISABLE_BUFFERING=y
-CONFIG_STM32_CRC=y
-CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y
-CONFIG_STM32_DMA1=y
-CONFIG_STM32_JTAG_FULL_ENABLE=y
-CONFIG_STM32_SPI_DMA=y
-CONFIG_STM32_USART2=y
-CONFIG_STM32_USB=y
-CONFIG_SYMTAB_ORDEREDBYNAME=y
-CONFIG_SYSTEM_USBMSC_DEVPATH1="/dev/mtdblock0"
-CONFIG_SYSTEM_USBMSC=y
-CONFIG_TASK_NAME_SIZE=7
-CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=768
-CONFIG_USART2_RXBUFSIZE=32
-CONFIG_USART2_SERIAL_CONSOLE=y
-CONFIG_USART2_TXBUFSIZE=32
-CONFIG_USBDEV_TRACE_NRECORDS=32
-CONFIG_USBDEV_TRACE=y
-CONFIG_USBMSC_NRDREQS=2
-CONFIG_USBMSC_NWRREQS=2
-CONFIG_USBMSC_SCSI_STACKSIZE=340
-CONFIG_USBMSC=y
-CONFIG_USER_ENTRYPOINT="nsh_main"
-CONFIG_USERMAIN_STACKSIZE=1024
-CONFIG_WDOG_INTRESERVE=0
-CONFIG_WL_CC3000=y
diff --git a/configs/spark/usbnsh/defconfig b/configs/spark/usbnsh/defconfig
deleted file mode 100644
index 29d4c54d08..0000000000
--- a/configs/spark/usbnsh/defconfig
+++ /dev/null
@@ -1,75 +0,0 @@
-# CONFIG_DEV_CONSOLE is not set
-# CONFIG_DISABLE_OS_API is not set
-# CONFIG_NSH_DISABLE_CMP is not set
-# CONFIG_NSH_DISABLE_DD is not set
-# CONFIG_NSH_DISABLE_EXEC is not set
-# CONFIG_NSH_DISABLE_EXIT is not set
-# CONFIG_NSH_DISABLE_GET is not set
-# CONFIG_NSH_DISABLE_HEXDUMP is not set
-# CONFIG_NSH_DISABLE_IFCONFIG is not set
-# CONFIG_NSH_DISABLE_LOSETUP is not set
-# CONFIG_NSH_DISABLE_MKFATFS is not set
-# CONFIG_NSH_DISABLE_MKRD is not set
-# CONFIG_NSH_DISABLE_PS is not set
-# CONFIG_NSH_DISABLE_PUT is not set
-# CONFIG_NSH_DISABLE_WGET is not set
-# CONFIG_NSH_DISABLE_XD is not set
-# CONFIG_NSH_DISABLEBG is not set
-# CONFIG_NSH_DISABLESCRIPT is not set
-CONFIG_ARCH_BOARD_SPARK=y
-CONFIG_ARCH_BOARD="spark"
-CONFIG_ARCH_CHIP_STM32=y
-CONFIG_ARCH_CHIP_STM32F103CB=y
-CONFIG_ARCH_INTERRUPTSTACK=512
-CONFIG_ARCH_STACKDUMP=y
-CONFIG_ARCH="arm"
-CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y
-CONFIG_BOARD_LOOPSPERMSEC=5483
-CONFIG_BUILTIN=y
-CONFIG_CDCACM_CONSOLE=y
-CONFIG_CDCACM_RXBUFSIZE=256
-CONFIG_CDCACM_TXBUFSIZE=256
-CONFIG_CDCACM=y
-CONFIG_DEFAULT_SMALL=y
-CONFIG_DISABLE_POLL=y
-CONFIG_EXAMPLES_NSH=y
-CONFIG_FS_AUTOMOUNTER=y
-CONFIG_INTELHEX_BINARY=y
-CONFIG_LIB_BOARDCTL=y
-CONFIG_LIB_RAND_ORDER=2
-CONFIG_MAX_TASKS=16
-CONFIG_MAX_WDOGPARMS=2
-CONFIG_MQ_MAXMSGSIZE=8
-CONFIG_NFILE_DESCRIPTORS=8
-CONFIG_NFILE_STREAMS=8
-CONFIG_NSH_BUILTIN_APPS=y
-CONFIG_NSH_FILEIOSIZE=1024
-CONFIG_NSH_LINELEN=80
-CONFIG_NSH_USBCONSOLE=y
-CONFIG_PREALLOC_MQ_MSGS=4
-CONFIG_PREALLOC_TIMERS=4
-CONFIG_PREALLOC_WDOGS=6
-CONFIG_PTHREAD_STACK_DEFAULT=1024
-CONFIG_RAM_SIZE=20480
-CONFIG_RAM_START=0x20000000
-CONFIG_RAW_BINARY=y
-CONFIG_RR_INTERVAL=200
-CONFIG_SCHED_HPWORK=y
-CONFIG_SCHED_HPWORKSTACKSIZE=800
-CONFIG_SDCLONE_DISABLE=y
-CONFIG_START_DAY=23
-CONFIG_START_MONTH=10
-CONFIG_START_YEAR=2013
-CONFIG_STM32_CRC=y
-CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y
-CONFIG_STM32_DMA1=y
-CONFIG_STM32_JTAG_FULL_ENABLE=y
-CONFIG_STM32_SPI_DMA=y
-CONFIG_STM32_USART2=y
-CONFIG_STM32_USB=y
-CONFIG_SYMTAB_ORDEREDBYNAME=y
-CONFIG_TASK_NAME_SIZE=0
-CONFIG_USBDEV_TRACE_NRECORDS=32
-CONFIG_USBDEV_TRACE=y
-CONFIG_USER_ENTRYPOINT="nsh_main"
-CONFIG_WDOG_INTRESERVE=0
diff --git a/configs/spark/usbserial/defconfig b/configs/spark/usbserial/defconfig
deleted file mode 100644
index 7b0d94af99..0000000000
--- a/configs/spark/usbserial/defconfig
+++ /dev/null
@@ -1,87 +0,0 @@
-# CONFIG_DISABLE_ENVIRON is not set
-# CONFIG_DISABLE_POSIX_TIMERS is not set
-CONFIG_ANALOG=y
-CONFIG_ARCH_BOARD_SPARK=y
-CONFIG_ARCH_BOARD="spark"
-CONFIG_ARCH_BUTTONS=y
-CONFIG_ARCH_CHIP_STM32=y
-CONFIG_ARCH_CHIP_STM32F103CB=y
-CONFIG_ARCH_INTERRUPTSTACK=512
-CONFIG_ARCH_IRQBUTTONS=y
-CONFIG_ARCH_STACKDUMP=y
-CONFIG_ARCH="arm"
-CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y
-CONFIG_BOARD_INITIALIZE=y
-CONFIG_BOARD_LOOPSPERMSEC=5483
-CONFIG_BUILTIN_PROXY_STACKSIZE=768
-CONFIG_BUILTIN=y
-CONFIG_CC3000_PROBES=y
-CONFIG_CC3000_SELECT_STACKSIZE=390
-CONFIG_CDCACM_EPBULKIN_HSSIZE=64
-CONFIG_CDCACM_EPBULKOUT_HSSIZE=64
-CONFIG_CDCACM_RXBUFSIZE=40
-CONFIG_CDCACM_TXBUFSIZE=40
-CONFIG_CDCACM=y
-CONFIG_DEFAULT_SMALL=y
-CONFIG_DISABLE_POLL=y
-CONFIG_DRIVERS_WIRELESS=y
-CONFIG_EXAMPLES_CC3000BASIC=y
-CONFIG_EXAMPLES_USBSERIAL_TRACECLASS=y
-CONFIG_EXAMPLES_USBSERIAL_TRACECONTROLLER=y
-CONFIG_EXAMPLES_USBSERIAL_TRACEINIT=y
-CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS=y
-CONFIG_EXAMPLES_USBSERIAL_TRACETRANSFERS=y
-CONFIG_EXAMPLES_USBSERIAL=y
-CONFIG_FAT_LCNAMES=y
-CONFIG_FAT_LFN=y
-CONFIG_FAT_MAXFNAME=12
-CONFIG_FS_FATTIME=y
-CONFIG_FS_NAMED_SEMAPHORES=y
-CONFIG_INTELHEX_BINARY=y
-CONFIG_LIB_BOARDCTL=y
-CONFIG_LIB_RAND_ORDER=2
-CONFIG_LIB_SENDFILE_BUFSIZE=0
-CONFIG_MAX_TASKS=16
-CONFIG_MAX_WDOGPARMS=2
-CONFIG_MM_SMALL=y
-CONFIG_MQ_MAXMSGSIZE=8
-CONFIG_MTD_PARTITION=y
-CONFIG_NAME_MAX=8
-CONFIG_NFILE_DESCRIPTORS=5
-CONFIG_NFILE_STREAMS=5
-CONFIG_NPTHREAD_KEYS=0
-CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=768
-CONFIG_PREALLOC_MQ_MSGS=1
-CONFIG_PREALLOC_TIMERS=2
-CONFIG_PREALLOC_WDOGS=2
-CONFIG_PTHREAD_STACK_DEFAULT=340
-CONFIG_RAM_SIZE=20480
-CONFIG_RAM_START=0x20000000
-CONFIG_RAW_BINARY=y
-CONFIG_RR_INTERVAL=200
-CONFIG_SDCLONE_DISABLE=y
-CONFIG_SST25_SECTOR512=y
-CONFIG_SST25_SPIFREQUENCY=80000000
-CONFIG_START_DAY=30
-CONFIG_START_MONTH=11
-CONFIG_START_YEAR=2013
-CONFIG_STDIO_DISABLE_BUFFERING=y
-CONFIG_STM32_CRC=y
-CONFIG_STM32_DISABLE_IDLE_SLEEP_DURING_DEBUG=y
-CONFIG_STM32_DMA1=y
-CONFIG_STM32_JTAG_FULL_ENABLE=y
-CONFIG_STM32_SPI_DMA=y
-CONFIG_STM32_USART2=y
-CONFIG_STM32_USB=y
-CONFIG_SYMTAB_ORDEREDBYNAME=y
-CONFIG_TASK_NAME_SIZE=7
-CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=768
-CONFIG_USART2_RXBUFSIZE=32
-CONFIG_USART2_SERIAL_CONSOLE=y
-CONFIG_USART2_TXBUFSIZE=32
-CONFIG_USBDEV_TRACE_NRECORDS=32
-CONFIG_USBDEV_TRACE=y
-CONFIG_USER_ENTRYPOINT="usbserial_main"
-CONFIG_USERMAIN_STACKSIZE=1024
-CONFIG_WDOG_INTRESERVE=0
-CONFIG_WL_CC3000=y
diff --git a/configs/stm32_tiny/src/Makefile b/configs/stm32_tiny/src/Makefile
index 02062684c6..0e9f1bff8e 100644
--- a/configs/stm32_tiny/src/Makefile
+++ b/configs/stm32_tiny/src/Makefile
@@ -44,7 +44,7 @@ CSRCS += stm32_pwm.c
endif
ifeq ($(CONFIG_WL_NRF24L01),y)
-CSRCS += stm32_cc3000.c
+CSRCS += stm32_nrf24l01.c
endif
ifeq ($(CONFIG_LIB_BOARDCTL),y)
diff --git a/configs/stm32_tiny/src/stm32_cc3000.c b/configs/stm32_tiny/src/stm32_nrf24l01.c
similarity index 99%
rename from configs/stm32_tiny/src/stm32_cc3000.c
rename to configs/stm32_tiny/src/stm32_nrf24l01.c
index 9a8a0d3619..e6d3513338 100644
--- a/configs/stm32_tiny/src/stm32_cc3000.c
+++ b/configs/stm32_tiny/src/stm32_nrf24l01.c
@@ -1,5 +1,5 @@
/************************************************************************************
- * configs/stm32_tiny/src/stm32_cc3000.c
+ * configs/stm32_tiny/src/stm32_nrf24l01.c
*
* Copyright (C) 2009, 2013, 2017 Gregory Nutt. All rights reserved.
* Author: Laurent Latil
diff --git a/configs/stm32l476vg-disco/src/stm32_spi.c b/configs/stm32l476vg-disco/src/stm32_spi.c
index 32e813b639..49c6bc8fa9 100644
--- a/configs/stm32l476vg-disco/src/stm32_spi.c
+++ b/configs/stm32l476vg-disco/src/stm32_spi.c
@@ -93,10 +93,6 @@ void weak_function stm32_spiinitialize(void)
spierr("ERROR: [boot] FAILED to initialize SPI port 1\n");
}
-#ifdef CONFIG_WL_CC3000
- stm32_configgpio(GPIO_SPI_CS_WIFI);
-#endif
-
#ifdef HAVE_MMCSD
stm32_configgpio(GPIO_SPI_CS_SD_CARD);
#endif
@@ -106,14 +102,10 @@ void weak_function stm32_spiinitialize(void)
/* Configure SPI-based devices */
g_spi2 = up_spiinitialize(2);
-
- /* Setup CS, EN & IRQ line IOs */
-
-#ifdef CONFIG_WL_CC3000
- stm32_configgpio(GPIO_WIFI_CS);
- stm32_configgpio(GPIO_WIFI_EN);
- stm32_configgpio(GPIO_WIFI_INT);
-#endif
+ if (!g_spi2)
+ {
+ spierr("ERROR: [boot] FAILED to initialize SPI port 2\n");
+ }
#endif
}
@@ -147,7 +139,6 @@ void stm32_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
-#ifdef CONFIG_WL_CC3000
if (devid == SPIDEV_WIRELESS(0))
{
stm32_gpiowrite(GPIO_SPI_CS_WIFI, !selected);
@@ -172,13 +163,6 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
void stm32_spi2select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected)
{
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
-
-#ifdef CONFIG_WL_CC3000
- if (devid == SPIDEV_WIRELESS(0))
- {
- stm32_gpiowrite(GPIO_WIFI_CS, !selected);
- }
-#endif
}
uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, uint32_t devid)
diff --git a/drivers/wireless/Kconfig b/drivers/wireless/Kconfig
index 70bc28eb3b..eb806d0052 100644
--- a/drivers/wireless/Kconfig
+++ b/drivers/wireless/Kconfig
@@ -23,12 +23,6 @@ config CC1101_SPIDEV
endif
-menuconfig WL_CC3000
- bool "CC3000 Wireless Module support"
- default n
- select SPI
-
-source drivers/wireless/cc3000/Kconfig
source drivers/wireless/spirit/Kconfig
menuconfig DRIVERS_IEEE802154
diff --git a/drivers/wireless/Make.defs b/drivers/wireless/Make.defs
index b0ae71fe56..e9a67ec2b6 100644
--- a/drivers/wireless/Make.defs
+++ b/drivers/wireless/Make.defs
@@ -60,10 +60,6 @@ CSRCS += cc1101.c ISM1_868MHzGFSK100kbps.c ISM2_905MHzGFSK250kbps.c
CSRCS += ISM2_433MHzMSK500kbps.c
endif
-ifeq ($(CONFIG_WL_CC3000),y)
-include wireless$(DELIM)cc3000$(DELIM)Make.defs
-endif
-
ifeq ($(CONFIG_WL_SPIRIT),y)
include wireless$(DELIM)spirit$(DELIM)Make.defs
endif
diff --git a/drivers/wireless/cc3000/Kconfig b/drivers/wireless/cc3000/Kconfig
deleted file mode 100644
index c1e65c4099..0000000000
--- a/drivers/wireless/cc3000/Kconfig
+++ /dev/null
@@ -1,77 +0,0 @@
-#
-# For a description of the syntax of this configuration file,
-# see the file kconfig-language.txt in the NuttX tools repository.
-#
-
-config WL_CC3000
- bool "CC3000 Wireless Module"
- default n
- select SPI
- select ARCH_HAVE_NET
- select CRYPTO
- select CRYPTO_SW_AES
- ---help---
- Enable support for the TI CC3000 Wifi Module
-
-if WL_CC3000
-
-config CC3000_MULTIPLE
- bool "Multiple CC3000 Devices"
- default n
- ---help---
- Can be defined to support multiple CC3000 devices on board.
-
-config CC3000_NPOLLWAITERS
- int "Number poll waiters"
- default 4
- depends on !DISABLE_POLL
- ---help---
- Maximum number of threads that can be waiting on poll()
-
-config CC3000_SPIDEV
- int "SPI bus number"
- default 2
- ---help---
- Selects the SPI bus number identying that SPI interface that
- connects the CC3000 to the MCU.
-
-config CC3000_DEVMINOR
- int "Input device minor number"
- default 0
- ---help---
- The CC3000 device will be registered as /dev/wirelessN where N is the
- value provided by this setting.
-
-config CC3000_SPI_MODE
- int "SPI mode"
- default 1
- range 0 3
- ---help---
- Controls the SPI mode. The device should work in mode 1, but
- sometimes you need to experiment.
-
-config CC3000_SPI_FREQUENCY
- int "SPI frequency"
- default 16000000
- ---help---
- Define to use a different SPI bus frequency.
-
-config CC3000_WORKER_STACKSIZE
- int "Worker thread stack size"
- default 240
-
-config CC3000_SELECT_STACKSIZE
- int "Select thread stack size"
- default 368
-
-config CC3000_UNSOLICED_STACKSIZE
- int "Unsolicited thread stack size"
- default 264
-
-config CC3000_PROBES
- bool "Thread probes"
- default n
- ---help---
- Select to use DO and D1 to indicate worker thread and ISR
-
-endif
diff --git a/drivers/wireless/cc3000/Make.defs b/drivers/wireless/cc3000/Make.defs
deleted file mode 100644
index 9571d750ab..0000000000
--- a/drivers/wireless/cc3000/Make.defs
+++ /dev/null
@@ -1,48 +0,0 @@
-############################################################################
-# drivers/wireless/Make.defs
-#
-# Copyright (C) 2013 Gregory Nutt. All rights reserved.
-# Author: Gregory Nutt
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-# 3. Neither the name NuttX nor the names of its contributors may be
-# used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-############################################################################
-
-ifeq ($(CONFIG_WL_CC3000),y)
-
-# Include cc3000 drivers
-
-CSRCS += cc3000.c cc3000_common.c cc3000drv.c evnt_handler.c hci.c netapp.c
-CSRCS += nvmem.c socket.c socket_imp.c wlan.c
-
-# Include wireless devices build support
-
-DEPPATH += --dep-path wireless$(DELIM)cc3000
-VPATH += :wireless$(DELIM)cc3000
-CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)wireless$(DELIM)cc3000}
-endif
diff --git a/drivers/wireless/cc3000/cc3000.c b/drivers/wireless/cc3000/cc3000.c
deleted file mode 100644
index 2055cdaec5..0000000000
--- a/drivers/wireless/cc3000/cc3000.c
+++ /dev/null
@@ -1,1855 +0,0 @@
-/****************************************************************************
- * drivers/wireless/cc3000.c
- *
- * Copyright (C) 2013-2016 Gregory Nutt. All rights reserved.
- * Authors: Gregory Nutt
- * David_s5
- *
- * References:
- * CC30000 from Texas Instruments http://processors.wiki.ti.com/index.php/CC3000
- *
- * See also:
- * http://processors.wiki.ti.com/index.php/CC3000_Host_Driver_Porting_Guide
- * http://processors.wiki.ti.com/index.php/CC3000_Host_Programming_Guide
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include "cc3000_socket.h"
-#include "cc3000.h"
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-#ifndef CCASSERT
-#define CCASSERT(predicate) _x_CCASSERT_LINE(predicate, __LINE__)
-#define _x_CCASSERT_LINE(predicate, line) typedef char constraint_violated_on_line_##line[2*((predicate)!=0)-1];
-#endif
-
-CCASSERT(sizeof(cc3000_buffer_desc) <= CONFIG_MQ_MAXMSGSIZE);
-
-#ifndef CONFIG_CC3000_WORKER_THREAD_PRIORITY
-# define CONFIG_CC3000_WORKER_THREAD_PRIORITY (SCHED_PRIORITY_MAX)
-#endif
-
-#ifndef CONFIG_CC3000_WORKER_STACKSIZE
-# define CONFIG_CC3000_WORKER_STACKSIZE 240
-#endif
-
-#ifndef CONFIG_CC3000_SELECT_THREAD_PRIORITY
-# define CONFIG_CC3000_SELECT_THREAD_PRIORITY (SCHED_PRIORITY_DEFAULT-1)
-#endif
-
-#ifndef CONFIG_CC3000_SELECT_STACKSIZE
-# define CONFIG_CC3000_SELECT_STACKSIZE 368
-#endif
-
-#ifndef ARRAY_SIZE
-# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-#endif
-#define NUMBER_OF_MSGS 1
-
-#define FREE_SLOT -1
-#define CLOSE_SLOT -2
-
-#if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_CC3000_PROBES)
-# define CC3000_GUARD (0xc35aa53c)
-# define INIT_GUARD(p) p->guard = CC3000_GUARD
-# define CHECK_GUARD(p) DEBUGASSERT(p->guard == CC3000_GUARD)
-# define PROBE(pin,state) priv->config->probe(priv->config,pin, state)
-#else
-# define INIT_GUARD(p)
-# define CHECK_GUARD(p)
-# define PROBE(pin,state)
-#endif
-
-#define waiterr(x,...) // _err
-#define waitinfo(x,...) // _info
-
-/****************************************************************************
- * Private Function Prototypes
- ****************************************************************************/
-
-/* Low-level SPI helpers */
-
-static void cc3000_lock_and_select(FAR struct spi_dev_s *spi);
-static void cc3000_deselect_and_unlock(FAR struct spi_dev_s *spi);
-
-/* Interrupts and data sampling */
-
-static void cc3000_notify(FAR struct cc3000_dev_s *priv);
-static void *cc3000_worker(FAR void *arg);
-static int cc3000_interrupt(int irq, FAR void *context, FAR void *arg);
-
-/* Character driver methods */
-
-static int cc3000_open(FAR struct file *filep);
-static int cc3000_close(FAR struct file *filep);
-static ssize_t cc3000_read(FAR struct file *filep, FAR char *buffer,
- size_t len);
-static ssize_t cc3000_write(FAR struct file *filep,
- FAR const char *buffer, size_t len);
-static int cc3000_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
-#ifndef CONFIG_DISABLE_POLL
-static int cc3000_poll(FAR struct file *filep, struct pollfd *fds,
- bool setup);
-#endif
-
-static int cc3000_wait_data(FAR struct cc3000_dev_s *priv, int sockfd);
-static int cc3000_accept_socket(FAR struct cc3000_dev_s *priv, int sd,
- FAR struct sockaddr *addr,
- socklen_t *addrlen);
-static int cc3000_add_socket(FAR struct cc3000_dev_s *priv, int sd);
-static int cc3000_remove_socket(FAR struct cc3000_dev_s *priv, int sd);
-static int cc3000_remote_closed_socket(FAR struct cc3000_dev_s *priv, int sd);
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
-/* This the vtable that supports the character driver interface */
-
-static const struct file_operations cc3000_fops =
-{
- cc3000_open, /* open */
- cc3000_close, /* close */
- cc3000_read, /* read */
- cc3000_write, /* write */
- 0, /* seek */
- cc3000_ioctl, /* ioctl */
-#ifndef CONFIG_DISABLE_POLL
- cc3000_poll /* poll */
-#endif
-};
-
-/* If only a single CC3000 device is supported, then the driver state
- * structure may as well be pre-allocated.
- */
-
-#ifndef CONFIG_CC3000_MULTIPLE
-static struct cc3000_dev_s g_cc3000;
-
-/* Otherwise, we will need to maintain allocated driver instances in a list */
-
-#else
-static struct cc3000_dev_s *g_cc3000list;
-#endif
-
-uint8_t spi_readCommand[] = READ_COMMAND;
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-/****************************************************************************
- * Name: cc3000_devtake() and cc3000_devgive()
- *
- * Description:
- * Used to get exclusive access to a CC3000 driver.
- *
- ****************************************************************************/
-
-static inline void cc3000_devtake(FAR struct cc3000_dev_s *priv)
-{
- int ret;
-
- do
- {
- /* Take the semaphore (perhaps waiting) */
-
- ret = nxsem_wait(&priv->devsem);
-
- /* The only case that an error should occur here is if the wait was
- * awakened by a signal.
- */
-
- DEBUGASSERT(ret == OK || ret == -EINTR);
- }
- while (ret == -EINTR);
-}
-
-static inline void cc3000_devgive(FAR struct cc3000_dev_s *priv)
-{
- (void)nxsem_post(&priv->devsem);
-}
-
-/****************************************************************************
- * Name: cc3000_configspi
- *
- * Description:
- * Configure the SPI for use with the CC3000. This function should be
- * called to configure the SPI
- * bus.
- *
- * Input Parameters:
- * spi - Reference to the SPI driver structure
- *
- * Returned Value:
- * None
- *
- * Assumptions:
- *
- ****************************************************************************/
-
-static inline void cc3000_configspi(FAR struct spi_dev_s *spi)
-{
- ninfo("Mode: %d Bits: 8 Frequency: %d\n",
- CONFIG_CC3000_SPI_MODE, CONFIG_CC3000_SPI_FREQUENCY);
-
- SPI_SETMODE(spi, CONFIG_CC3000_SPI_MODE);
- SPI_SETBITS(spi, 8);
- (void)SPI_HWFEATURES(spi, 0);
- (void)SPI_SETFREQUENCY(spi, CONFIG_CC3000_SPI_FREQUENCY);
-}
-
-/****************************************************************************
- * Name: cc3000_lock
- *
- * Description:
- * Lock the SPI bus and re-configure as necessary. This function must be
- * to assure: (1) exclusive access to the SPI bus, and (2) to assure that
- * the shared bus is properly configured for the cc3000 module.
- *
- * Input Parameters:
- * spi - Reference to the SPI driver structure
- *
- * Returned Value:
- * None
- *
- * Assumptions:
- *
- ****************************************************************************/
-
-static void cc3000_lock_and_select(FAR struct spi_dev_s *spi)
-{
- /* Lock the SPI bus so that we have exclusive access */
-
- (void)SPI_LOCK(spi, true);
-
- /* We have the lock. Now make sure that the SPI bus is configured for the
- * CC3000 (it might have gotten configured for a different device while
- * unlocked)
- */
-
- cc3000_configspi(spi);
- SPI_SELECT(spi, SPIDEV_WIRELESS(0), true);
-}
-
-/****************************************************************************
- * Name: cc3000_unlock
- *
- * Description:
- * Un-lock the SPI bus after each transfer, possibly losing the current
- * configuration if we are sharing the SPI bus with other devices.
- *
- * Input Parameters:
- * spi - Reference to the SPI driver structure
- *
- * Returned Value:
- * None
- *
- * Assumptions:
- *
- ****************************************************************************/
-
-static void cc3000_deselect_and_unlock(FAR struct spi_dev_s *spi)
-{
- /* De select */
-
- SPI_SELECT(spi, SPIDEV_WIRELESS(0), false);
-
- /* Relinquish the SPI bus. */
-
- (void)SPI_LOCK(spi, false);
-}
-
-/****************************************************************************
- * Name: cc3000_wait
- *
- * Description:
- * Helper function to wait on the semaphore signaled by the
- *
- * Input Parameters:
- * priv - Reference to the CC3000 driver structure
- * priv -
- *
- * Returned Value:
- * 0 - Semaphore signaled and devsem retaken
- * < 0 - Some Error occurred
- * Assumptions:
- * Own the devsem on entry
- *
- ****************************************************************************/
-
-static int cc3000_wait(FAR struct cc3000_dev_s *priv, sem_t *psem)
-{
- int ret;
-
- /* Give up */
-
- sched_lock();
- cc3000_devgive(priv);
-
- /* Wait on first psem to become signaled */
-
- ret = nxsem_wait(psem);
- if (ret < 0)
- {
- return ret;
- }
-
- /* Then retake the mutual exclusion semaphore */
-
- cc3000_devtake(priv);
- sched_unlock();
- return OK;
-}
-
-/****************************************************************************
- * Name: cc3000_wait_irq
- *
- * Description:
- * Helper function to wait on the irqsem signaled by the interrupt
- *
- * Input Parameters:
- * priv - Reference to the CC3000 driver structure
- *
- * Returned Value:
- * 0 - Semaphore signaled and devsem retaken
- * < 0 - Some Error occurred
- * Assumptions:
- * Own the devsem on entry
- *
- ****************************************************************************/
-
-static inline int cc3000_wait_irq(FAR struct cc3000_dev_s *priv)
-{
- return cc3000_wait(priv, &priv->irqsem);
-}
-
-/****************************************************************************
- * Name: cc3000_wait_ready
- *
- * Description:
- * Helper function to wait on the readysem signaled by the interrupt
- *
- * Input Parameters:
- * priv - Reference to the CC3000 driver structure
- *
- * Returned Value:
- * 0 - Semaphore signaled and devsem retaken
- * < 0 - Some Error occurred
- * Assumptions:
- * Own the devsem on entry
- *
- ****************************************************************************/
-
-static inline int cc3000_wait_ready(FAR struct cc3000_dev_s *priv)
-{
- return cc3000_wait(priv, &priv->readysem);
-}
-
-/****************************************************************************
- * Name: cc3000_pollnotify
- ****************************************************************************/
-
-#ifndef CONFIG_DISABLE_POLL
-static void cc3000_pollnotify(FAR struct cc3000_dev_s *priv, uint32_t type)
-{
- int i;
-
- for (i = 0; i < CONFIG_CC3000_NPOLLWAITERS; i++)
- {
- struct pollfd *fds = priv->fds[i];
- if (fds)
- {
- fds->revents |= type;
- ninfo("Report events: %02x\n", fds->revents);
- nxsem_post(fds->sem);
- }
- }
-}
-#endif
-
-/****************************************************************************
- * Name: cc3000_notify
- ****************************************************************************/
-
-static void cc3000_notify(FAR struct cc3000_dev_s *priv)
-{
- /* If there are threads waiting for read data, then signal one of them
- * that the read data is available.
- */
-
- if (priv->nwaiters > 0)
- {
- /* After posting this semaphore, we need to exit because the CC3000
- * is no longer available.
- */
-
- nxsem_post(&priv->waitsem);
- }
-
- /* If there are threads waiting on poll() for CC3000 data to become available,
- * then wake them up now. NOTE: we wake up all waiting threads because we
- * do not know that they are going to do. If they all try to read the data,
- * then some make end up blocking after all.
- */
-
-#ifndef CONFIG_DISABLE_POLL
- cc3000_pollnotify(priv, POLLIN);
-#endif
-}
-
-/****************************************************************************
- * Name: cc3000_worker
- ****************************************************************************/
-
-static void *select_thread_func(FAR void *arg)
-{
- FAR struct cc3000_dev_s *priv = (FAR struct cc3000_dev_s *)arg;
- struct timeval timeout;
- TICC3000fd_set readsds;
- TICC3000fd_set exceptsds;
- int ret = 0;
- int maxFD = 0;
- int s = 0;
-
- memset(&timeout, 0, sizeof(struct timeval));
- timeout.tv_sec = 0;
- timeout.tv_usec = (500000); /* 500 msecs */
-
- while (1)
- {
- nxsem_wait(&priv->selectsem);
-
- CHECK_GUARD(priv);
-
- /* Increase the count back by one to be decreased by the original caller */
-
- nxsem_post(&priv->selectsem);
-
- maxFD = -1;
- CC3000_FD_ZERO(&readsds);
- CC3000_FD_ZERO(&exceptsds);
-
- /* Ping correct socket descriptor param for select */
-
- for (s = 0; s < CONFIG_WL_MAX_SOCKETS; s++)
- {
- if (priv->sockets[s].sd != FREE_SLOT)
- {
- if (priv->sockets[s].sd == CLOSE_SLOT)
- {
- priv->sockets[s].sd = FREE_SLOT;
- waitinfo("Close\n");
- int count;
- do
- {
- nxsem_getvalue(&priv->sockets[s].semwait, &count);
- if (count < 0)
- {
- /* Release the waiting threads */
-
- waitinfo("Closed Signaled %d\n", count);
- nxsem_post(&priv->sockets[s].semwait);
- }
- }
- while (count < 0);
-
- continue;
- }
-
- CC3000_FD_SET(priv->sockets[s].sd, &readsds);
- CC3000_FD_SET(priv->sockets[s].sd, &exceptsds);
- if (maxFD <= priv->sockets[s].sd)
- {
- maxFD = priv->sockets[s].sd + 1;
- }
- }
- }
-
- if (maxFD < 0)
- {
- /* Handled only socket close. */
-
- continue;
- }
-
- /* Polling instead of blocking here to process "accept" below */
-
- ret = cc3000_select(maxFD, (fd_set *) &readsds, NULL,
- (fd_set *) &exceptsds, &timeout);
-
- if (priv->selecttid == -1)
- {
- /* driver close will terminate the thread and by that all sync
- * objects owned by it will be released
- */
-
- return OK;
- }
-
- for (s = 0; s < CONFIG_WL_MAX_SOCKETS; s++)
- {
- if ((priv->sockets[s].sd != FREE_SLOT ||
- priv->sockets[s].sd != CLOSE_SLOT) && /* Check that the socket is valid */
- priv->sockets[s].sd != priv->accepting_socket.acc.sd) /* Verify this is not an accept socket */
- {
- if (ret > 0 && CC3000_FD_ISSET(priv->sockets[s].sd, &readsds)) /* and has pending data */
- {
- waitinfo("Signaled %d\n", priv->sockets[s].sd);
- nxsem_post(&priv->sockets[s].semwait); /* release the waiting thread */
- }
- else if (ret > 0 && CC3000_FD_ISSET(priv->sockets[s].sd, &exceptsds)) /* or has pending exception */
- {
- waitinfo("Signaled %d (exception)\n", priv->sockets[s].sd);
- nxsem_post(&priv->sockets[s].semwait); /* release the waiting thread */
- }
- else if (priv->sockets[s].received_closed_event) /* or remote has closed connection and we have now read all of HW buffer. */
- {
- waitinfo("Signaled %d (closed & empty)\n", priv->sockets[s].sd);
- priv->sockets[s].emptied_and_remotely_closed = true;
- nxsem_post(&priv->sockets[s].semwait); /* release the waiting thread */
- }
- }
- }
-
- if (priv->accepting_socket.acc.sd != FREE_SLOT) /* If accept polling in needed */
- {
- if (priv->accepting_socket.acc.sd == CLOSE_SLOT)
- {
- ret = CC3000_SOC_ERROR;
- }
- else
- {
- ret = cc3000_do_accept(priv->accepting_socket.acc.sd, /* Send the select command on non blocking */
- &priv->accepting_socket.addr, /* Set up in ioctl */
- &priv->accepting_socket.addrlen);
- }
-
- if (ret != CC3000_SOC_IN_PROGRESS) /* Not waiting => error or accepted */
- {
- priv->accepting_socket.acc.sd = FREE_SLOT;
- priv->accepting_socket.acc.status = ret;
- nxsem_post(&priv->accepting_socket.acc.semwait); /* Release the waiting thread */
- }
- }
- }
-
- return OK;
-}
-
-/****************************************************************************
- * Name: cc3000_worker
- ****************************************************************************/
-
-static void *cc3000_worker(FAR void *arg)
-{
- FAR struct cc3000_dev_s *priv = (FAR struct cc3000_dev_s *)arg;
- int ret;
-
- ASSERT(priv != NULL && priv->config != NULL);
-
- /* We have started, release our creator */
-
- nxsem_post(&priv->readysem);
- while (1)
- {
- PROBE(0, 1);
- CHECK_GUARD(priv);
- cc3000_devtake(priv);
-
- /* Done ? */
-
- if ((cc3000_wait_irq(priv) != -EINTR) && (priv->workertid != -1))
- {
- PROBE(0, 0);
- ninfo("State%d\n", priv->state);
- switch (priv->state)
- {
- case eSPI_STATE_POWERUP:
- /* Signal the device has interrupted after power up */
-
- priv->state = eSPI_STATE_INITIALIZED;
- nxsem_post(&priv->readysem);
- break;
-
- case eSPI_STATE_WRITE_WAIT_IRQ:
- /* Signal the device has interrupted after Chip Select During a write operation */
-
- priv->state = eSPI_STATE_WRITE_PROCEED;
- nxsem_post(&priv->readysem);
- break;
-
- case eSPI_STATE_WRITE_DONE: /* IRQ post a write => Solicited */
- case eSPI_STATE_IDLE: /* IRQ when Idel => cc3000 has data for the hosts Unsolicited */
- {
- uint16_t data_to_recv;
- priv->state = eSPI_STATE_READ_IRQ;
-
- /* Issue the read command */
-
- cc3000_lock_and_select(priv->spi); /* Assert CS */
- priv->state = eSPI_STATE_READ_PROCEED;
- SPI_EXCHANGE(priv->spi, spi_readCommand, priv->rx_buffer.pbuffer,
- ARRAY_SIZE(spi_readCommand));
-
- /* Extract Length bytes from Rx Buffer. Here we need to convert
- * unaligned data in network order (big endian, MS byte first) to
- * host order. We cannot use ntohs here because the data is not
- * aligned.
- */
-
- data_to_recv = (uint16_t)priv->rx_buffer.pbuffer[READ_OFFSET_TO_LENGTH] << 8 |
- (uint16_t)priv->rx_buffer.pbuffer[READ_OFFSET_TO_LENGTH + 1];
-
- if (data_to_recv)
- {
- /* We will read ARRAY_SIZE(spi_readCommand) + data_to_recv. is it odd? */
-
- if ((data_to_recv + ARRAY_SIZE(spi_readCommand)) & 1)
- {
- /* Odd so make it even */
-
- data_to_recv++;
- }
-
- /* Read the whole payload in at the beginning of the buffer
- * Will it fit?
- */
-
- if (data_to_recv >= priv->rx_buffer_max_len)
- {
- ninfo("data_to_recv %d", data_to_recv);
- }
-
- DEBUGASSERT(data_to_recv < priv->rx_buffer_max_len);
- SPI_RECVBLOCK(priv->spi, priv->rx_buffer.pbuffer, data_to_recv);
- }
-
- cc3000_deselect_and_unlock(priv->spi); /* De assert CS */
-
- /* Disable more messages as the wl code will resume via CC3000IOC_COMPLETE */
-
- if (data_to_recv)
- {
- int count;
-
- priv->state = eSPI_STATE_READ_READY;
- priv->rx_buffer.len = data_to_recv;
-
- ret = nxmq_send(priv->queue,
- (FAR const char *)&priv->rx_buffer,
- sizeof(priv->rx_buffer), 1);
- DEBUGASSERT(ret >= 0);
- UNUSED(ret);
-
- /* Notify any waiters that new CC3000 data is available */
-
- cc3000_notify(priv);
-
- /* Give up driver */
-
- cc3000_devgive(priv);
-
- ninfo("Wait On Completion\n");
- nxsem_wait(priv->wrkwaitsem);
- ninfo("Completed S:%d irq :%d\n",
- priv->state, priv->config->irq_read(priv->config));
-
- nxsem_getvalue(&priv->irqsem, &count);
- if (priv->config->irq_read(priv->config) && count == 0)
- {
- nxsem_post(&priv->irqsem);
- }
-
- if (priv->state == eSPI_STATE_READ_READY)
- {
- priv->state = eSPI_STATE_IDLE;
- }
-
- continue;
- }
- }
- break;
-
- default:
- ninfo("default: State%d\n", priv->state);
- break;
- }
- }
-
- cc3000_devgive(priv);
- }
-
- return OK;
-}
-
-/****************************************************************************
- * Name: cc3000_interrupt
- ****************************************************************************/
-
-static int cc3000_interrupt(int irq, FAR void *context, FAR void *arg)
-{
- FAR struct cc3000_dev_s *priv = (FAR struct cc3000_dev_s *)arg;
-
- DEBUGASSERT(priv != NULL);
-
- /* Run the worker thread */
-
- PROBE(1, 0);
- nxsem_post(&priv->irqsem);
- PROBE(1, 1);
-
- /* Clear any pending interrupts and return success */
-
- priv->config->irq_clear(priv->config);
- return OK;
-}
-
-/****************************************************************************
- * Name: cc3000_open
- ****************************************************************************/
-
-static int cc3000_open(FAR struct file *filep)
-{
- FAR struct inode *inode;
- struct mq_attr attr;
- pthread_attr_t tattr;
- pthread_t threadid;
- struct sched_param param;
- char queuename[QUEUE_NAMELEN];
- FAR struct cc3000_dev_s *priv;
- uint8_t tmp;
- int ret;
-#ifdef CONFIG_CC3000_MT
- int s;
-#endif
-
- DEBUGASSERT(filep);
- inode = filep->f_inode;
-
- DEBUGASSERT(inode && inode->i_private);
- priv = (FAR struct cc3000_dev_s *)inode->i_private;
-
- CHECK_GUARD(priv);
-
- ninfo("crefs: %d\n", priv->crefs);
-
- /* Get exclusive access to the driver data structure */
-
- cc3000_devtake(priv);
-
- /* Increment the reference count */
-
- tmp = priv->crefs + 1;
- if (tmp == 0)
- {
- /* More than 255 opens; uint8_t overflows to zero */
-
- ret = -EMFILE;
- goto out_with_sem;
- }
-
- /* When the reference increments to 1, this is the first open event
- * on the driver.. and an opportunity to do any one-time initialization.
- */
-
- if (tmp == 1)
- {
- /* Initialize semaphores */
-
- nxsem_init(&priv->waitsem, 0, 0); /* Initialize event wait semaphore */
- nxsem_init(&priv->irqsem, 0, 0); /* Initialize IRQ Ready semaphore */
- nxsem_init(&priv->readysem, 0, 0); /* Initialize Device Ready semaphore */
-
- /* These semaphores are all used for signaling and, hence, should
- * not have priority inheritance enabled.
- */
-
- nxsem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
- nxsem_setprotocol(&priv->irqsem, SEM_PRIO_NONE);
- nxsem_setprotocol(&priv->readysem, SEM_PRIO_NONE);
-
-#ifdef CONFIG_CC3000_MT
- priv->accepting_socket.acc.sd = FREE_SLOT;
- nxsem_init(&priv->accepting_socket.acc.semwait, 0, 0);
- nxsem_setprotocol(&priv->accepting_socket.acc.semwait, SEM_PRIO_NONE);
-
- for (s = 0; s < CONFIG_WL_MAX_SOCKETS; s++)
- {
- priv->sockets[s].sd = FREE_SLOT;
- priv->sockets[s].received_closed_event = false;
- priv->sockets[s].emptied_and_remotely_closed = false;
-
- nxsem_init(&priv->sockets[s].semwait, 0, 0);
- nxsem_setprotocol(&priv->sockets[s].semwait, SEM_PRIO_NONE);
- }
-#endif
-
- /* Ensure the power is off so we get the falling edge of IRQ */
-
- priv->config->power_enable(priv->config, false);
-
- attr.mq_maxmsg = NUMBER_OF_MSGS;
- attr.mq_msgsize = sizeof(cc3000_buffer_desc);
- attr.mq_flags = 0;
-
- /* Set the flags for the open of the queue.
- * Make it a blocking open on the queue, meaning it will block if
- * this process tries to send to the queue and the queue is full.
- *
- * O_CREAT - the queue will get created if it does not already exist.
- * O_WRONLY - we are only planning to write to the queue.
- *
- * Open the queue, and create it if the receiving process hasn't
- * already created it.
- */
-
- snprintf(queuename, QUEUE_NAMELEN, QUEUE_FORMAT, priv->minor);
- priv->queue = mq_open(queuename, O_WRONLY | O_CREAT, 0666, &attr);
- if (priv->queue < 0)
- {
- ret = -errno;
- goto errout_sem_destroy;
- }
-
- pthread_attr_init(&tattr);
- tattr.stacksize = CONFIG_CC3000_WORKER_STACKSIZE;
- param.sched_priority = CONFIG_CC3000_WORKER_THREAD_PRIORITY;
- pthread_attr_setschedparam(&tattr, ¶m);
-
- ret = pthread_create(&priv->workertid, &tattr, cc3000_worker,
- (pthread_addr_t)priv);
- if (ret != 0)
- {
- ret = -ret; /* pthread_create does not modify errno. */
- goto errout_mq_close;
- }
-
- pthread_attr_init(&tattr);
- tattr.stacksize = CONFIG_CC3000_SELECT_STACKSIZE;
- param.sched_priority = CONFIG_CC3000_SELECT_THREAD_PRIORITY;
- pthread_attr_setschedparam(&tattr, ¶m);
-
- nxsem_init(&priv->selectsem, 0, 0);
- nxsem_setprotocol(&priv->selectsem, SEM_PRIO_NONE);
-
- ret = pthread_create(&priv->selecttid, &tattr, select_thread_func,
- (pthread_addr_t)priv);
- if (ret != 0)
- {
- ret = -ret; /* pthread_create does not modify errno. */
- goto errout_worker_cancel;
- }
-
- /* Do late allocation with hopes of realloc not fragmenting */
-
- priv->rx_buffer.pbuffer = kmm_malloc(priv->rx_buffer_max_len);
- DEBUGASSERT(priv->rx_buffer.pbuffer);
- if (!priv->rx_buffer.pbuffer)
- {
- ret = -errno;
- goto errout_select_cancel;
- }
-
- priv->state = eSPI_STATE_POWERUP;
- priv->config->irq_clear(priv->config);
-
- /* Bring the device Online A) on http://processors.wiki.ti.com/index.php/File:CC3000_Master_SPI_Write_Sequence_After_Power_Up.png */
-
- priv->config->irq_enable(priv->config, true);
-
- /* Wait on child thread */
-
- cc3000_wait_ready(priv);
- priv->config->power_enable(priv->config, true);
- }
-
- /* Save the new open count on success */
-
- priv->crefs = tmp;
- ret = OK;
-
- goto out_with_sem;
-
-errout_select_cancel:
- threadid = priv->selecttid;
- priv->selecttid = -1;
- pthread_cancel(threadid);
- pthread_join(threadid, NULL);
- nxsem_destroy(&priv->selectsem);
-
-errout_worker_cancel:
- threadid = priv->workertid;
- priv->workertid = -1;
- pthread_cancel(threadid);
- pthread_join(threadid, NULL);
-
-errout_mq_close:
- mq_close(priv->queue);
- priv->queue = 0;
-
-errout_sem_destroy:
-#ifdef CONFIG_CC3000_MT
- nxsem_destroy(&priv->accepting_socket.acc.semwait);
-
- for (s = 0; s < CONFIG_WL_MAX_SOCKETS; s++)
- {
- priv->sockets[s].sd = FREE_SLOT;
- nxsem_destroy(&priv->sockets[s].semwait);
- }
-#endif
-
- nxsem_destroy(&priv->waitsem);
- nxsem_destroy(&priv->irqsem);
- nxsem_destroy(&priv->readysem);
-
-out_with_sem:
- cc3000_devgive(priv);
- return ret;
-}
-
-/****************************************************************************
- * Name: cc3000_close
- ****************************************************************************/
-
-static int cc3000_close(FAR struct file *filep)
-{
- FAR struct inode *inode;
- FAR struct cc3000_dev_s *priv;
-#ifdef CONFIG_CC3000_MT
- int s;
-#endif
-
- DEBUGASSERT(filep);
- inode = filep->f_inode;
-
- DEBUGASSERT(inode && inode->i_private);
- priv = (FAR struct cc3000_dev_s *)inode->i_private;
-
- CHECK_GUARD(priv);
-
- ninfo("crefs: %d\n", priv->crefs);
-
- /* Get exclusive access to the driver data structure */
-
- cc3000_devtake(priv);
-
- /* Decrement the reference count unless it would decrement a negative
- * value. When the count decrements to zero, there are no further
- * open references to the driver.
- */
-
- int tmp = priv->crefs;
- if (priv->crefs >= 1)
- {
- priv->crefs--;
- }
-
- if (tmp == 1)
- {
- pthread_t id = priv->selecttid;
- priv->selecttid = -1;
- pthread_cancel(id);
- pthread_join(id, NULL);
- nxsem_destroy(&priv->selectsem);
-
- priv->config->irq_enable(priv->config, false);
- priv->config->irq_clear(priv->config);
- priv->config->power_enable(priv->config, false);
-
- id = priv->workertid;
- priv->workertid = -1;
- pthread_cancel(id);
- pthread_join(id, NULL);
-
- mq_close(priv->queue);
- priv->queue = 0;
-
- kmm_free(priv->rx_buffer.pbuffer);
- priv->rx_buffer.pbuffer = 0;
-
-#ifdef CONFIG_CC3000_MT
- nxsem_destroy(&priv->accepting_socket.acc.semwait);
-
- for (s = 0; s < CONFIG_WL_MAX_SOCKETS; s++)
- {
- priv->sockets[s].sd = FREE_SLOT;
- nxsem_destroy(&priv->sockets[s].semwait);
- }
-#endif
-
- nxsem_destroy(&priv->waitsem);
- nxsem_destroy(&priv->irqsem);
- nxsem_destroy(&priv->readysem);
- }
-
- cc3000_devgive(priv);
- return OK;
-}
-
-/****************************************************************************
- * Name: cc3000_read
- ****************************************************************************/
-
-static ssize_t cc3000_read(FAR struct file *filep, FAR char *buffer, size_t len)
-{
- FAR struct inode *inode;
- FAR struct cc3000_dev_s *priv;
- int ret;
- ssize_t nread;
-
- ninfo("buffer:%p len:%d\n", buffer, len);
- DEBUGASSERT(filep);
- inode = filep->f_inode;
-
- DEBUGASSERT(inode && inode->i_private);
- priv = (FAR struct cc3000_dev_s *)inode->i_private;
-
- CHECK_GUARD(priv);
-
- /* Get exclusive access to the driver data structure */
-
- cc3000_devtake(priv);
-
- /* Verify that the caller has provided a buffer large enough to receive
- * the maximum data.
- */
-
- if (len < priv->rx_buffer_max_len)
- {
- nerr("ERROR: Unsupported read size: %d\n", len);
- nread = -ENOSYS;
- goto errout_with_sem;
- }
-
-
- for (nread = priv->rx_buffer.len; nread == 0; nread = priv->rx_buffer.len)
- {
- if (nread > 0)
- {
- /* Yes.. break out to return what we have. */
-
- break;
- }
-
- /* data is not available now. We would have to wait to get
- * receive sample data. If the user has specified the O_NONBLOCK
- * option, then just return an error.
- */
-
- ninfo("CC3000 data is not available\n");
- if (filep->f_oflags & O_NONBLOCK)
- {
- nread = -EAGAIN;
- break;
- }
-
- /* Otherwise, wait for something to be written to the
- * buffer. Increment the number of waiters so that the notify
- * will know that it needs to post the semaphore to wake us up.
- */
-
- sched_lock();
- priv->nwaiters++;
- cc3000_devgive(priv);
-
- /* We may now be pre-empted! But that should be okay because we
- * have already incremented nwaiters. Pre-emptions is disabled
- * but will be re-enabled while we are waiting.
- */
-
- ninfo("Waiting..\n");
- ret = nxsem_wait(&priv->waitsem);
- priv->nwaiters--;
- sched_unlock();
-
- /* Did we successfully get the waitsem? */
-
- if (ret >= 0)
- {
- /* Yes... then retake the mutual exclusion semaphore */
-
- cc3000_devtake(priv);
- }
-
- /* Was the semaphore wait successful? Did we successful re-take the
- * mutual exclusion semaphore?
- */
-
- if (ret < 0)
- {
- /* No.. One of the two nxsem_wait's failed. */
-
- /* Were we awakened by a signal? Did we read anything before
- * we received the signal?
- */
-
- if (ret != -EINTR || nread >= 0)
- {
- /* Yes.. return the error. */
-
- nread = ret;
- }
-
- /* Break out to return what we have. Note, we can't exactly
- * "break" out because whichever error occurred, we do not hold
- * the exclusion semaphore.
- */
-
- goto errout_without_sem;
- }
- }
-
- if (nread > 0)
- {
- memcpy(buffer, priv->rx_buffer.pbuffer, priv->rx_buffer.len);
- priv->rx_buffer.len = 0;
- }
-
-errout_with_sem:
- cc3000_devgive(priv);
-
-errout_without_sem:
- ninfo("Returning: %d\n", nread);
-#ifndef CONFIG_DISABLE_POLL
- if (nread > 0)
- {
- cc3000_pollnotify(priv, POLLOUT);
- }
-#endif
-
- return nread;
-}
-
-/****************************************************************************
- * Name: cc3000_write
- *
- * Bit of non standard buffer management ahead
- * The buffer is memory allocated in the user space with space for the spi
- * header
- *
- ****************************************************************************/
-
-static ssize_t cc3000_write(FAR struct file *filep, FAR const char *usrbuffer, size_t len)
-{
- FAR struct inode *inode;
- FAR struct cc3000_dev_s *priv;
- FAR char *buffer = (FAR char *) usrbuffer;
- ssize_t nwritten = 0;
- int ret;
-
- /* Set the padding if count(buffer) is even ( as it will be come odd with header) */
-
- size_t tx_len = (len & 1) ? len : len +1;
-
- ninfo("buffer:%p len:%d tx_len:%d\n", buffer, len, tx_len);
-
- DEBUGASSERT(filep);
- inode = filep->f_inode;
-
- DEBUGASSERT(inode && inode->i_private);
- priv = (FAR struct cc3000_dev_s *)inode->i_private;
-
- CHECK_GUARD(priv);
-
- /* Get exclusive access to the driver data structure */
-
- cc3000_devtake(priv);
-
- /* Figure out the total length of the packet in order to figure out if there is padding or not */
-
- buffer[0] = WRITE;
- buffer[1] = HI(tx_len);
- buffer[2] = LO(tx_len);
- buffer[3] = 0;
- buffer[4] = 0;
- tx_len += SPI_HEADER_SIZE;
-
- /* The first write transaction to occur after release of the shutdown has
- * slightly different timing than the others. The normal Master SPI
- * write sequence is nCS low, followed by IRQ low (CC3000 host),
- * indicating that the CC3000 core device is ready to accept data.
- * However, after power up the sequence is slightly different, as shown
- * in the following Figure:
- *
- * http://processors.wiki.ti.com/index.php/File:CC3000_Master_SPI_Write_Sequence_After_Power_Up.png
- *
- * The following is a sequence of operations:
- * - The master detects the IRQ line low: in this case the detection of
- * IRQ low does not indicate the intention of the CC3000 device to
- * communicate with the master but rather CC3000 readiness after power
- * up.
- * - The master asserts nCS.
- * - The master introduces a delay of at least 50 μs before starting
- * actual transmission of data.
- * - The master transmits the first 4 bytes of the SPI header.
- * - The master introduces a delay of at least an additional 50 μs.
- * - The master transmits the rest of the packet.
- */
-
- if (priv->state == eSPI_STATE_POWERUP)
- {
- ret = cc3000_wait_ready(priv);
- if (ret < 0)
- {
- nwritten = ret;
- goto errout_without_sem;
- }
- }
-
- if (priv->state == eSPI_STATE_INITIALIZED)
- {
- cc3000_lock_and_select(priv->spi); /* Assert CS */
- nxsig_usleep(55);
- SPI_SNDBLOCK(priv->spi, buffer, 4);
- nxsig_usleep(55);
- SPI_SNDBLOCK(priv->spi, buffer+4, tx_len-4);
- }
- else
- {
- ninfo("Assert CS\n");
- priv->state = eSPI_STATE_WRITE_WAIT_IRQ;
- cc3000_lock_and_select(priv->spi); /* Assert CS */
- ninfo("Wait on IRQ Active\n");
- ret = cc3000_wait_ready(priv);
- ninfo("IRQ Signaled\n");
- if (ret < 0)
- {
- /* This should only happen if the wait was canceled by an signal */
-
- cc3000_deselect_and_unlock(priv->spi);
- ninfo("nxsem_wait: %d\n", ret);
- DEBUGASSERT(ret == -EINTR || ret == -ECANCELED);
- nwritten = ret;
- goto errout_without_sem;
- }
-
- SPI_SNDBLOCK(priv->spi, buffer, tx_len);
- }
-
- priv->state = eSPI_STATE_WRITE_DONE;
- ninfo("Deassert CS S:eSPI_STATE_WRITE_DONE\n");
- cc3000_deselect_and_unlock(priv->spi);
- nwritten = tx_len;
- cc3000_devgive(priv);
-
-errout_without_sem:
- ninfo("Returning: %d\n", ret);
- return nwritten;
-}
-
-/****************************************************************************
- * Name: cc3000_ioctl
- ****************************************************************************/
-
-static int cc3000_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
-{
- FAR struct inode *inode;
- FAR struct cc3000_dev_s *priv;
- int ret;
-
- ninfo("cmd: %d arg: %ld\n", cmd, arg);
- DEBUGASSERT(filep);
- inode = filep->f_inode;
-
- DEBUGASSERT(inode && inode->i_private);
- priv = (FAR struct cc3000_dev_s *)inode->i_private;
-
- CHECK_GUARD(priv);
-
- /* Get exclusive access to the driver data structure */
-
- cc3000_devtake(priv);
-
- /* Process the IOCTL by command */
-
- ret = OK;
- switch (cmd)
- {
- case CC3000IOC_GETQUESEMID:
- {
- FAR int *pminor = (FAR int *)(arg);
- DEBUGASSERT(pminor != NULL);
- *pminor = priv->minor;
- break;
- }
-
- case CC3000IOC_ADDSOCKET:
- {
- FAR int *pfd = (FAR int *)(arg);
- DEBUGASSERT(pfd != NULL);
- *pfd = cc3000_add_socket(priv, *pfd);
- break;
- }
-
- case CC3000IOC_REMOVESOCKET:
- {
- FAR int *pfd = (FAR int *)(arg);
- DEBUGASSERT(pfd != NULL);
- *pfd = cc3000_remove_socket(priv, *pfd);
- break;
- }
-
- case CC3000IOC_REMOTECLOSEDSOCKET:
- {
- FAR int *pfd = (FAR int *)(arg);
- DEBUGASSERT(pfd != NULL);
- *pfd = cc3000_remote_closed_socket(priv, *pfd);
- break;
- }
-
- case CC3000IOC_SELECTDATA:
- {
- FAR int *pfd = (FAR int *)(arg);
- DEBUGASSERT(pfd != NULL);
- *pfd = cc3000_wait_data(priv, *pfd);
- break;
- }
-
- case CC3000IOC_SELECTACCEPT:
- {
- FAR cc3000_acceptcfg *pcfg = (FAR cc3000_acceptcfg *)(arg);
- DEBUGASSERT(pcfg != NULL);
- pcfg->sockfd = cc3000_accept_socket(priv, pcfg->sockfd, pcfg->addr, pcfg->addrlen);
- break;
- }
-
- case CC3000IOC_SETRX_SIZE:
- {
- irqstate_t flags;
- FAR int *psize = (FAR int *)(arg);
- int rv;
-
- DEBUGASSERT(psize != NULL);
- rv = priv->rx_buffer_max_len;
- flags = enter_critical_section();
- priv->rx_buffer_max_len = *psize;
- priv->rx_buffer.pbuffer = kmm_realloc(priv->rx_buffer.pbuffer, *psize);
- leave_critical_section(flags);
- DEBUGASSERT(priv->rx_buffer.pbuffer);
- *psize = rv;
- break;
- }
-
- default:
- ret = -ENOTTY;
- break;
- }
-
- cc3000_devgive(priv);
- return ret;
-}
-
-/****************************************************************************
- * Name: cc3000_poll
- ****************************************************************************/
-
-#ifndef CONFIG_DISABLE_POLL
-static int cc3000_poll(FAR struct file *filep, FAR struct pollfd *fds,
- bool setup)
-{
- FAR struct inode *inode;
- FAR struct cc3000_dev_s *priv;
- int ret = OK;
- int i;
-
- ninfo("setup: %d\n", (int)setup);
- DEBUGASSERT(filep && fds);
- inode = filep->f_inode;
-
- DEBUGASSERT(inode && inode->i_private);
- priv = (FAR struct cc3000_dev_s *)inode->i_private;
-
- CHECK_GUARD(priv);
-
- /* Are we setting up the poll? Or tearing it down? */
-
- cc3000_devtake(priv);
-
- if (setup)
- {
- /* Ignore waits that do not include POLLIN */
-
- if ((fds->events & POLLIN) == 0)
- {
- ret = -EDEADLK;
- goto errout;
- }
-
- /* This is a request to set up the poll. Find an available
- * slot for the poll structure reference
- */
-
- for (i = 0; i < CONFIG_CC3000_NPOLLWAITERS; i++)
- {
- /* Find an available slot */
-
- if (!priv->fds[i])
- {
- /* Bind the poll structure and this slot */
-
- priv->fds[i] = fds;
- fds->priv = &priv->fds[i];
- break;
- }
- }
-
- if (i >= CONFIG_CC3000_NPOLLWAITERS)
- {
- fds->priv = NULL;
- ret = -EBUSY;
- goto errout;
- }
-
- /* Should we immediately notify on any of the requested events? */
-
- if (priv->rx_buffer.len)
- {
- cc3000_notify(priv);
- }
- }
- else if (fds->priv)
- {
- /* This is a request to tear down the poll. */
-
- struct pollfd **slot = (struct pollfd **)fds->priv;
- DEBUGASSERT(slot != NULL);
-
- /* Remove all memory of the poll setup */
-
- *slot = NULL;
- fds->priv = NULL;
- }
-
-errout:
- cc3000_devgive(priv);
- return ret;
-}
-#endif
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: cc3000_register
- *
- * Description:
- * Configure the CC3000 to use the provided SPI device instance. This
- * will register the driver as /dev/inputN where N is the minor device
- * number
- *
- * Input Parameters:
- * dev - An SPI driver instance
- * config - Persistent board configuration data
- * minor - The input device minor number
- *
- * Returned Value:
- * Zero is returned on success. Otherwise, a negated errno value is
- * returned to indicate the nature of the failure.
- *
- ****************************************************************************/
-
-int cc3000_register(FAR struct spi_dev_s *spi,
- FAR struct cc3000_config_s *config, int minor)
-{
- FAR struct cc3000_dev_s *priv;
- char drvname[DEV_NAMELEN];
- char semname[SEM_NAMELEN];
-#ifdef CONFIG_CC3000_MULTIPLE
- irqstate_t flags;
-#endif
- int ret;
-
- ninfo("spi: %p minor: %d\n", spi, minor);
-
- /* Debug-only sanity checks */
-
- DEBUGASSERT(spi != NULL && config != NULL && minor >= 0 && minor < 100);
-
- /* Create and initialize a CC3000 device driver instance */
-
-#ifndef CONFIG_CC3000_MULTIPLE
- priv = &g_cc3000;
-#else
- priv = (FAR struct cc3000_dev_s *)kmm_malloc(sizeof(struct cc3000_dev_s));
- if (!priv)
- {
- nerr("ERROR: kmm_malloc(%d) failed\n", sizeof(struct cc3000_dev_s));
- return -ENOMEM;
- }
-#endif
-
- /* Initialize the CC3000 device driver instance */
-
- memset(priv, 0, sizeof(struct cc3000_dev_s));
- INIT_GUARD(priv);
- priv->minor = minor; /* Save the minor number */
- priv->spi = spi; /* Save the SPI device handle */
- priv->config = config; /* Save the board configuration */
-
- priv->rx_buffer_max_len = config->max_rx_size;
-
- nxsem_init(&priv->devsem, 0, 1); /* Initialize device structure semaphore */
-
- (void)snprintf(semname, SEM_NAMELEN, SEM_FORMAT, minor);
- priv->wrkwaitsem = sem_open(semname, O_CREAT, 0, 0); /* Initialize Worker Wait semaphore */
-
-#ifdef CONFIG_CC3000_MT
- pthread_mutex_init(&g_cc3000_mut, NULL);
-#endif
-
- /* Make sure that interrupts are disabled */
-
- config->irq_clear(config);
- config->irq_enable(config, false);
-
- /* Attach the interrupt handler */
-
- ret = config->irq_attach(config, cc3000_interrupt, priv);
- if (ret < 0)
- {
- nerr("ERROR: Failed to attach interrupt\n");
- goto errout_with_priv;
- }
-
- /* Register the device as an input device */
-
- (void)snprintf(drvname, DEV_NAMELEN, DEV_FORMAT, minor);
- ninfo("Registering %s\n", drvname);
-
- ret = register_driver(drvname, &cc3000_fops, 0666, priv);
- if (ret < 0)
- {
- nerr("ERROR: register_driver() failed: %d\n", ret);
- goto errout_with_priv;
- }
-
- /* If multiple CC3000 devices are supported, then we will need to add
- * this new instance to a list of device instances so that it can be
- * found by the interrupt handler based on the recieved IRQ number.
- */
-
-#ifdef CONFIG_CC3000_MULTIPLE
- priv->flink = g_cc3000list;
- g_cc3000list = priv;
- leave_critical_section(flags);
-#endif
-
- /* And return success (?) */
-
- return OK;
-
-errout_with_priv:
- nxsem_destroy(&priv->devsem);
- sem_close(priv->wrkwaitsem);
- sem_unlink(semname);
-
-#ifdef CONFIG_CC3000_MT
- pthread_mutex_destroy(&g_cc3000_mut);
-#endif
-
-#ifdef CONFIG_CC3000_MULTIPLE
- kmm_free(priv);
-#endif
- return ret;
-}
-
-/****************************************************************************
- * Name: cc3000_wait_data
- *
- * Description:
- * Adds this socket for monitoring for the data available
- *
- * Input Parameters:
- * priv - The device cc3000_dev_s instance
- * sockfd cc3000 socket handle
- *
- * Returned Value:
- * Zero is returned on success. Otherwise, a -1 value is
- * returned to indicate socket not found or shut down occured.
- *
- ****************************************************************************/
-
-static int cc3000_wait_data(FAR struct cc3000_dev_s *priv, int sockfd)
-{
- int s;
-
- for (s = 0; s < CONFIG_WL_MAX_SOCKETS; s++)
- {
- if (priv->sockets[s].sd == sockfd)
- {
- sched_lock();
- cc3000_devgive(priv);
- nxsem_post(&priv->selectsem); /* Wake select thread if need be */
- nxsem_wait(&priv->sockets[s].semwait); /* Wait caller on select to finish */
- nxsem_wait(&priv->selectsem); /* Sleep select thread */
- cc3000_devtake(priv);
- sched_unlock();
-
- if (priv->sockets[s].sd != sockfd)
- {
- return -1;
- }
-
- if (priv->sockets[s].emptied_and_remotely_closed)
- {
- return -ECONNABORTED;
- }
-
- return OK;
- }
- }
-
- return (s >= CONFIG_WL_MAX_SOCKETS || priv->selecttid == -1) ? -1 : OK;
-}
-
-/****************************************************************************
- * Name: cc3000_accept_socket
- *
- * Description:
- * Adds this socket for monitoring for the accept operation
- *
- * Input Parameters:
- * priv - The device cc3000_dev_s instance
- * sockfd - cc3000 socket handle to monitor
- *
- * Returned Value:
- * Zero is returned on success. Otherwise, a negative value is
- * returned to indicate an error.
- *
- ****************************************************************************/
-
-static int cc3000_accept_socket(FAR struct cc3000_dev_s *priv, int sd, struct sockaddr *addr,
- socklen_t *addrlen)
-{
-
- priv->accepting_socket.acc.status = CC3000_SOC_ERROR;
- priv->accepting_socket.acc.sd = sd;
-
- sched_lock();
- cc3000_devgive(priv);
- nxsem_post(&priv->selectsem); /* Wake select thread if need be */
- nxsem_wait(&priv->accepting_socket.acc.semwait); /* Wait caller on select to finish */
- nxsem_wait(&priv->selectsem); /* Sleep the Thread */
- cc3000_devtake(priv);
- sched_unlock();
-
- if (priv->accepting_socket.acc.status != CC3000_SOC_ERROR)
- {
- *addr = priv->accepting_socket.addr;
- *addrlen = priv->accepting_socket.addrlen;
- cc3000_add_socket(priv, priv->accepting_socket.acc.status);
- }
-
- return priv->accepting_socket.acc.status;
-}
-
-/****************************************************************************
- * Name: cc3000_add_socket
- *
- * Description:
- * Adds a socket to the list for monitoring for long operation
- *
- * Input Parameters:
- * sd cc3000 socket handle
- * minor - The input device minor number
- *
- * Returned Value:
- * Zero is returned on success. Otherwise, a -1 value is
- * returned to indicate socket not found.
- *
- ****************************************************************************/
-
-static int cc3000_add_socket(FAR struct cc3000_dev_s *priv, int sd)
-{
- irqstate_t flags;
- int s;
-
- if (sd < 0)
- {
- return sd;
- }
-
- flags = enter_critical_section();
- for (s = 0; s < CONFIG_WL_MAX_SOCKETS; s++)
- {
- if (priv->sockets[s].sd == FREE_SLOT)
- {
- priv->sockets[s].received_closed_event = false;
- priv->sockets[s].emptied_and_remotely_closed = false;
- priv->sockets[s].sd = sd;
- break;
- }
- }
-
- leave_critical_section(flags);
- return s >= CONFIG_WL_MAX_SOCKETS ? -1 : OK;
-}
-
-/****************************************************************************
- * Name: cc3000_remove_socket
- *
- * Description:
- * Removes a socket from the list of monitoring for long operation
- *
- * Input Parameters:
- * sd cc3000 socket handle
- * minor - The input device minor number
- *
- * Returned Value:
- * Zero is returned on success. Otherwise, a -1 value is
- * returned to indicate socket not found.
- *
- ****************************************************************************/
-
-static int cc3000_remove_socket(FAR struct cc3000_dev_s *priv, int sd)
-{
- irqstate_t flags;
- int s;
- sem_t *ps = 0;
-
- if (sd < 0)
- {
- return sd;
- }
-
- flags = enter_critical_section();
- if (priv->accepting_socket.acc.sd == sd)
- {
- priv->accepting_socket.acc.sd = CLOSE_SLOT;
- ps = &priv->accepting_socket.acc.semwait;
- }
-
- for (s = 0; s < CONFIG_WL_MAX_SOCKETS; s++)
- {
- if (priv->sockets[s].sd == sd)
- {
- priv->sockets[s].received_closed_event = false;
- priv->sockets[s].emptied_and_remotely_closed = false;
- priv->sockets[s].sd = CLOSE_SLOT;
- ps = &priv->sockets[s].semwait;
- break;
- }
- }
-
- leave_critical_section(flags);
- if (ps)
- {
- sched_lock();
- cc3000_devgive(priv);
- nxsem_post(&priv->selectsem); /* Wake select thread if need be */
- nxsem_wait(ps);
- nxsem_wait(&priv->selectsem); /* Sleep the Thread */
- cc3000_devtake(priv);
- sched_unlock();
- }
-
- return s >= CONFIG_WL_MAX_SOCKETS ? -1 : OK;
-}
-
-/****************************************************************************
- * Name: cc3000_remote_closed_socket
- *
- * Description:
- * Mark socket as closed by remote host
- *
- * Input Parameters:
- * sd cc3000 socket handle
- *
- * Returned Value:
- * Zero is returned on success. Otherwise, a -1 value is
- * returned to indicate socket not found.
- *
- ****************************************************************************/
-
-static int cc3000_remote_closed_socket(FAR struct cc3000_dev_s *priv, int sd)
-{
- irqstate_t flags;
- int s;
-
- if (sd < 0)
- {
- return sd;
- }
-
- flags = enter_critical_section();
- for (s = 0; s < CONFIG_WL_MAX_SOCKETS; s++)
- {
- if (priv->sockets[s].sd == sd)
- {
- priv->sockets[s].received_closed_event = true;
- }
- }
-
- leave_critical_section(flags);
-
- return s >= CONFIG_WL_MAX_SOCKETS ? -1 : OK;
-}
diff --git a/drivers/wireless/cc3000/cc3000.h b/drivers/wireless/cc3000/cc3000.h
deleted file mode 100644
index d969a1e5f6..0000000000
--- a/drivers/wireless/cc3000/cc3000.h
+++ /dev/null
@@ -1,214 +0,0 @@
-/****************************************************************************
- * drivers//wireless/cc3000.h
- *
- * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
- * Authors: Gregory Nutt
- * David Sidrane
- *
- * References:
- * CC30000 from Texas Instruments http://processors.wiki.ti.com/index.php/CC3000
- *
- * See also:
- * http://processors.wiki.ti.com/index.php/CC3000_Host_Driver_Porting_Guide
- * http://processors.wiki.ti.com/index.php/CC3000_Host_Programming_Guide
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name NuttX nor the names of its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-#ifndef __DRIVERS_WIRELESS_WIRELESS_CC3000_H
-#define __DRIVERS_WIRELESS_WIRELESS_CC3000_H
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#define CONFIG_CC3000_MT /* Indicate multi threaded version */
-
-#ifdef CONFIG_CC3000_MT
-# define CONFIG_WL_MAX_SOCKETS 5
-#endif
-
-/* CC3000 Interfaces ********************************************************/
-
-/* Driver support ***********************************************************/
-/* This format is used to construct the /dev/input[n] device driver path. It
- * defined here so that it will be used consistently in all places.
- */
-
-#define READ 3
-#define READ_COMMAND {READ, 0 , 0 , 0 , 0}
-#define READ_OFFSET_TO_LENGTH 3 //cmd dmy dmy lh ll
-#define WRITE 1
-
-#define HI(value) (((value) & 0xFF00) >> 8)
-#define LO(value) ((value) & 0x00FF)
-
-#define SPI_HEADER_SIZE (5)
-
-/****************************************************************************
- * Public Types
- ****************************************************************************/
-
-#ifdef CONFIG_CC3000_MT
-/* lock to serialize access to driver (SPI protocol is window size 1) */
-
-extern pthread_mutex_t g_cc3000_mut;
-
-/* This structure describes the state of one CC3000 driver instance */
-
-typedef struct cc3000_socket_ent
-{
- volatile int sd;
- long status;
- bool received_closed_event:1;
- bool emptied_and_remotely_closed:1;
- sem_t semwait;
-} cc3000_socket_ent;
-
-typedef struct cc3000_accept_ent
-{
- cc3000_socket_ent acc;
- struct sockaddr addr;
- socklen_t addrlen;
-} cc3000_accept_ent;
-#endif
-
-typedef enum
-{
- eSPI_STATE_POWERUP = 0,
- eSPI_STATE_INITIALIZED,
- eSPI_STATE_IDLE,
- eSPI_STATE_WRITE_WAIT_IRQ,
- eSPI_STATE_WRITE_PROCEED,
- eSPI_STATE_WRITE_DONE,
- eSPI_STATE_READ_IRQ,
- eSPI_STATE_READ_PROCEED,
- eSPI_STATE_READ_READY,
-} eDeviceStates;
-
-struct cc3000_dev_s
-{
-#ifdef CONFIG_CC3000_MULTIPLE
- FAR struct cc3000_dev_s *flink; /* Supports a singly linked list of drivers */
-#endif
- pthread_t workertid; /* Handle for the worker thread */
- uint8_t crefs; /* Number of times the device has been opened */
- uint8_t nwaiters; /* Number of threads waiting for CC3000 data */
- uint8_t minor; /* minor */
- sem_t devsem; /* Manages exclusive access to this structure */
- sem_t *wrkwaitsem; /* Suspend and resume the delivery of messages */
- sem_t waitsem; /* Used to wait for the availability of data */
- sem_t irqsem; /* Used to signal irq from cc3000 */
- sem_t readysem; /* Used to wait for Ready Condition from the cc3000 */
-
- FAR struct cc3000_config_s *config; /* Board configuration data */
- FAR struct spi_dev_s *spi; /* Saved SPI driver instance */
- mqd_t queue; /* For unsolicited data delivery */
- eDeviceStates state; /* The device state */
- cc3000_buffer_desc rx_buffer;
- ssize_t rx_buffer_max_len;
-
- /* The following is a list if socket structures of threads waiting
- * long operations to finish;
- */
-#ifdef CONFIG_CC3000_MT
- pthread_t selecttid; /* Handle for the select thread */
- sem_t selectsem; /* Used to sleep the select thread */
- cc3000_socket_ent sockets[CONFIG_WL_MAX_SOCKETS];
- cc3000_accept_ent accepting_socket;
-#endif
-
- /* The following is a list if poll structures of threads waiting for
- * driver events. The 'struct pollfd' reference for each open is also
- * retained in the f_priv field of the 'struct file'.
- */
-
-#ifndef CONFIG_DISABLE_POLL
- struct pollfd *fds[CONFIG_CC3000_NPOLLWAITERS];
-#endif
-
-#if defined(CONFIG_DEBUG_FEATURES) && defined(CONFIG_CC3000_PROBES)
- long guard;
-#endif
-
-};
-
-/********************************************************************************************
- * Public Function Prototypes
- ********************************************************************************************/
-
-#ifdef __cplusplus
-#define EXTERN extern "C"
-extern "C" {
-#else
-#define EXTERN extern
-#endif
-
-static inline void cc3000_lib_lock(void)
-{
-#ifdef CONFIG_CC3000_MT
- int status = pthread_mutex_lock(&g_cc3000_mut);
- DEBUGASSERT(status == 0);
- UNUSED(status);
-#endif
-}
-
-static inline void cc3000_lib_unlock(void)
-{
-#ifdef CONFIG_CC3000_MT
- int status = pthread_mutex_unlock(&g_cc3000_mut);
- DEBUGASSERT(status == 0);
- UNUSED(status);
-#endif
-}
-
-int cc3000_do_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
-
-#undef EXTERN
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __DRIVERS_WIRELESS_WIRELESS_CC3000_H */
diff --git a/drivers/wireless/cc3000/cc3000_common.c b/drivers/wireless/cc3000/cc3000_common.c
deleted file mode 100644
index bf8a8da8cd..0000000000
--- a/drivers/wireless/cc3000/cc3000_common.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/****************************************************************************
- * drivers/wireless/cc3000/cc3000_common.c.c - CC3000 Host Driver Implementation.
- *
- * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-/****************************************************************************
- * Included files
- ****************************************************************************/
-
-#include
-#include
-
-/****************************************************************************
- * Name: __error__
- *
- * Description:
- * Stub function for ASSERT macro
- *
- * Input Parameters:
- * pcFilename - file name, where error occurred
- * ulLine - line number, where error occurred
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Name: UINT32_TO_STREAM_f
- *
- * Description:
- * This function is used for copying 32 bit to stream while converting to
- * little endian format.
- *
- * Input Parameters:
- * p pointer to the new stream
- * u32 pointer to the 32 bit
- *
- * Returned Value:
- * Pointer to the new stream
- *
- ****************************************************************************/
-
-uint8_t *UINT32_TO_STREAM_f(uint8_t *p, unsigned long u32)
-{
- *(p)++ = (uint8_t)(u32);
- *(p)++ = (uint8_t)((u32) >> 8);
- *(p)++ = (uint8_t)((u32) >> 16);
- *(p)++ = (uint8_t)((u32) >> 24);
- return p;
-}
-
-/****************************************************************************
- * Name: UINT16_TO_STREAM_f
- *
- * Description:
- * This function is used for copying 16 bit to stream while converting to
- * little endian format.
- *
- * Input Parameters:
- * p pointer to the new stream
- * u16 pointer to the 16 bit
- *
- * Returned Value:
- * Pointer to the new stream
- *
- ****************************************************************************/
-
-uint8_t *UINT16_TO_STREAM_f(uint8_t *p, uint16_t u16)
-{
- *(p)++ = (uint8_t)(u16);
- *(p)++ = (uint8_t)((u16) >> 8);
- return p;
-}
-
-/****************************************************************************
- * Name: STREAM_TO_UINT16_f
- *
- * Description:
- * This function is used for copying received stream to 16 bit in little
- * endian format.
- *
- * Input Parameters:
- * p pointer to the stream
- * offset offset in the stream
- *
- * Returned Value:
- * Pointer to the new 16 bit
- *
- ****************************************************************************/
-
-uint16_t STREAM_TO_UINT16_f(FAR char *p, uint16_t offset)
-{
- return (uint16_t)((uint16_t)((uint16_t)
- (*(p + offset + 1)) << 8) + (uint16_t)(*(p + offset)));
-}
-
-/****************************************************************************
- * Name: STREAM_TO_UINT32_f
- *
- * Description:
- * This function is used for copying received stream to 32 bit in little
- * endian format.
- *
- * Input Parameters:
- * p pointer to the stream
- * offset offset in the stream
- *
- * Returned Value:
- * Pointer to the new 32 bit
- *
- ****************************************************************************/
-
-unsigned long STREAM_TO_UINT32_f(FAR char *p, uint16_t offset)
-{
- return (unsigned long)((unsigned long)((unsigned long)
- (*(p + offset + 3)) << 24) + (unsigned long)((unsigned long)
- (*(p + offset + 2)) << 16) + (unsigned long)((unsigned long)
- (*(p + offset + 1)) << 8) + (unsigned long)(*(p + offset)));
-}
diff --git a/drivers/wireless/cc3000/cc3000_socket.h b/drivers/wireless/cc3000/cc3000_socket.h
deleted file mode 100644
index 0218221abc..0000000000
--- a/drivers/wireless/cc3000/cc3000_socket.h
+++ /dev/null
@@ -1,663 +0,0 @@
-/****************************************************************************
- * drivers/wireless/cc3000_socket.h - CC3000 Host Driver Implementation.
- * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-#ifndef __DRIVERS_WIRELESS_CC3000_SOCKET_H
-#define __DRIVERS_WIRELESS_CC3000_SOCKET_H
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-#include
-#include
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#define CC3000_HOSTNAME_MAX_LENGTH (230) /* 230 bytes + header shouldn't exceed 8
- * bit value */
-
-/*--------- Address Families --------*/
-
-#define CC3000_AF_INET 2
-#define CC3000_AF_INET6 23
-
-
-/*------------ Socket Types ------------*/
-
-#define CC3000_SOCK_STREAM 1
-#define CC3000_SOCK_DGRAM 2
-#define CC3000_SOCK_RAW 3 /* Raw sockets allow new IPv4
- * protocols to be implemented in
- * user space. A raw socket receives
- * or sends the raw datagram not
- * including link level headers */
-#define CC3000_SOCK_RDM 4
-#define CC3000_SOCK_SEQPACKET 5
-
-/*----------- Socket Protocol ----------*/
-
-#define CC3000_IPPROTO_IP 0 /* Dummy for IP */
-#define CC3000_IPPROTO_ICMP 1 /* Control message protocol */
-#define CC3000_IPPROTO_IPV4 CC3000_IPPROTO_IP /* IP inside IP */
-#define CC3000_IPPROTO_TCP 6 /* TCP */
-#define CC3000_IPPROTO_UDP 17 /* User datagram protocol */
-#define CC3000_IPPROTO_IPV6 41 /* IPv6 in IPv6 */
-#define CC3000_IPPROTO_NONE 59 /* No next header */
-#define CC3000_IPPROTO_TX_TEST_RAW 150 /* Raw 802.11 Tx Test packet */
-#define CC3000_IPPROTO_RAW 255 /* Raw IP packet */
-#define CC3000_IPPROTO_MAX 256
-
-/*----------- Socket retunr codes -----------*/
-
-#define CC3000_SOC_ERROR (-1) /* Error */
-#define CC3000_SOC_IN_PROGRESS (-2) /* Socket in progress */
-
-/*----------- Socket Options -----------*/
-#define CC3000_SOL_SOCKET 0xffff /* Socket level */
-#define CC3000_SOCKOPT_RECV_NONBLOCK 0 /* recv non block mode, set SOCK_ON or
- * SOCK_OFF (default block mode) */
-#define CC3000_SOCKOPT_RECV_TIMEOUT 1 /* optname to configure recv and recvfromtimeout */
-#define CC3000_SOCKOPT_ACCEPT_NONBLOCK 2 /* accept non block mode, set SOCK_ON or SOCK_OFF
- * (default block mode) */
-#define CC3000_SOCK_ON 0 /* socket non-blocking mode is enabled */
-#define CC3000_SOCK_OFF 1 /* socket blocking mode is enabled */
-
-#define CC3000_TCP_NODELAY 0x0001
-#define CC3000_TCP_BSDURGENT 0x7000
-
-#define CC3000_MAX_PACKET_SIZE 1500
-#define CC3000_MAX_LISTEN_QUEUE 4
-
-#define CC3000_IOCTL_SOCKET_EVENTMASK
-
-#define CC3000_FD_SETSIZE 32
-
-#define CC3000_ASIC_ADDR_LEN 8
-
-#define CC3000_NO_QUERY_RECIVED -3
-
-/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
-
-#define __NFDBITS (8 * sizeof (__fd_mask))
-#define __FDELT(d) ((d) / __NFDBITS)
-#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
-
-#define __FDS_BITS(set) ((set)->fds_bits)
-
-/* We don't use `memset' because this would require a prototype and
- * the array isn't too big.
- */
-
-#define __FD_ZERO(set) \
- do { \
- unsigned int __i; \
- TICC3000fd_set *__arr = (set); \
- for (__i = 0; __i < sizeof (TICC3000fd_set) / sizeof (__fd_mask); ++__i) \
- __FDS_BITS (__arr)[__i] = 0; \
- } while (0)
-#define __FD_SET(d, set) (__FDS_BITS (set)[__FDELT (d)] |= __FDMASK (d))
-#define __FD_CLR(d, set) (__FDS_BITS (set)[__FDELT (d)] &= ~__FDMASK (d))
-#define __FD_ISSET(d, set) (__FDS_BITS (set)[__FDELT (d)] & __FDMASK (d))
-
-/* Access macros for 'TICC3000fd_set' */
-
-#define CC3000_FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp)
-#define CC3000_FD_CLR(fd, fdsetp) __FD_CLR (fd, fdsetp)
-#define CC3000_FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp)
-#define CC3000_FD_ZERO(fdsetp) __FD_ZERO (fdsetp)
-
-
-/* mDNS port - 5353 mDNS multicast address - 224.0.0.251 */
-
-#define SET_mDNS_ADD(sockaddr) sockaddr.sa_data[0] = 0x14; \
- sockaddr.sa_data[1] = 0xe9; \
- sockaddr.sa_data[2] = 0xe0; \
- sockaddr.sa_data[3] = 0x0; \
- sockaddr.sa_data[4] = 0x0; \
- sockaddr.sa_data[5] = 0xfb;
-
-/****************************************************************************
- * Public Types
- ****************************************************************************/
-
-/* The fd_set member is required to be an array of longs. */
-
-typedef long int __fd_mask;
-
-/* fd_set for select and pselect. */
-
-typedef struct
-{
- __fd_mask fds_bits[CC3000_FD_SETSIZE / __NFDBITS];
-} TICC3000fd_set;
-
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/****************************************************************************
- * Public Function Prototypes
- ****************************************************************************/
-
-/****************************************************************************
- * Name: cc3000_socket_impl
- *
- * Decription:
- * create an endpoint for communication. The socket function creates a
- * socket that is bound to a specific transport service provider. This
- * function is called by the application layer to obtain a socket handle.
- *
- * Input Parameters:
- * domain selects the protocol family which will be used for
- * communication. On this version only AF_INET is supported
- * type specifies the communication semantics. On this version
- * only SOCK_STREAM, SOCK_DGRAM, SOCK_RAW are supported
- * protocol specifies a particular protocol to be used with the
- * socket IPPROTO_TCP, IPPROTO_UDP or IPPROTO_RAW are
- * supported.
- *
- * Returned Value:
- * On success, socket handle that is used for consequent socket
- * operations. On error, -1 is returned.
- *
- ****************************************************************************/
-
-int cc3000_socket_impl(long domain, long type, long protocol);
-
-/****************************************************************************
- * Name: cc3000_closesocket_impl
- *
- * Decription:
- * The socket function closes a created socket.
- *
- * Input Parameters:
- * sd socket handle.
- *
- * Returned Value:
- * On success, zero is returned. On error, -1 is returned.
- *
- ****************************************************************************/
-
-long cc3000_closesocket_impl(long sd);
-
-/****************************************************************************
- * Name: cc3000_accept_impl
- *
- * Decription:
- * accept a connection on a socket:
- * This function is used with connection-based socket types
- * (SOCK_STREAM). It extracts the first connection request on the
- * queue of pending connections, creates a new connected socket, and
- * returns a new file descriptor referring to that socket.
- * The newly created socket is not in the listening state.
- * The original socket sd is unaffected by this call.
- * The argument sd is a socket that has been created with socket(),
- * bound to a local address with bind(), and is listening for
- * connections after a listen(). The argument addr is a pointer
- * to a sockaddr structure. This structure is filled in with the
- * address of the peer socket, as known to the communications layer.
- * The exact format of the address returned addr is determined by the
- * socket's address family. The addrlen argument is a value-result
- * argument: it should initially contain the size of the structure
- * pointed to by addr, on return it will contain the actual
- * length (in bytes) of the address returned.
- *
- * Input Parameters:
- * sd socket descriptor (handle)
- * addr the argument addr is a pointer to a sockaddr structure
- * This structure is filled in with the address of the
- * peer socket, as known to the communications layer.
- * determined. The exact format of the address returned
- * addr is by the socket's address sockaddr.
- * On this version only AF_INET is supported.
- * This argument returns in network order.
- * addrlen The addrlen argument is a value-result argument:
- * it should initially contain the size of the structure
- * pointed to by addr.
- *
- * Returned Value:
- * For socket in blocking mode:
- * On success, socket handle. on failure negative
- * For socket in non-blocking mode:
- * - On connection establishment, socket handle
- * - On connection pending, SOC_IN_PROGRESS (-2)
- * - On failure, SOC_ERROR (-1)
- *
- ****************************************************************************/
-
-long cc3000_accept_impl(long sd, struct sockaddr *addr, socklen_t *addrlen);
-
-/****************************************************************************
- * Name: cc3000_bind_impl
- *
- * Decription:
- * assign a name to a socket
- * This function gives the socket the local address addr.
- * addr is addrlen bytes long. Traditionally, this is called when a
- * socket is created with socket, it exists in a name space (address
- * family) but has no name assigned.
- * It is necessary to assign a local address before a SOCK_STREAM
- * socket may receive connections.
- *
- * Input Parameters:
- * sd socket descriptor (handle)
- * addr specifies the destination address. On this version
- * only AF_INET is supported.
- * addrlen contains the size of the structure pointed to by addr.
- *
- * Returned Value:
- * On success, zero is returned. On error, -1 is returned.
- *
- ****************************************************************************/
-
-long cc3000_bind_impl(long sd, FAR const struct sockaddr *addr, socklen_t addrlen);
-
-/****************************************************************************
- * Name: cc3000_listen_impl
- *
- * Decription:
- * listen for connections on a socket
- * The willingness to accept incoming connections and a queue
- * limit for incoming connections are specified with listen(),
- * and then the connections are accepted with accept.
- * The listen() call applies only to sockets of type SOCK_STREAM
- * The backlog parameter defines the maximum length the queue of
- * pending connections may grow to.
- *
- * NOTE: On this version, backlog is not supported
- *
- * Input Parameters:
- * sd socket descriptor (handle)
- * backlog specifies the listen queue depth. On this version
- * backlog is not supported.
- *
- * Returned Value:
- * On success, zero is returned. On error, -1 is returned.
- *
- ****************************************************************************/
-
-long cc3000_listen_impl(long sd, long backlog);
-
-/****************************************************************************
- * Name: cc3000_connect_impl
- *
- * Decription:
- * initiate a connection on a socket
- * Function connects the socket referred to by the socket descriptor
- * sd, to the address specified by addr. The addrlen argument
- * specifies the size of addr. The format of the address in addr is
- * determined by the address space of the socket. If it is of type
- * SOCK_DGRAM, this call specifies the peer with which the socket is
- * to be associated; this address is that to which datagrams are to be
- * sent, and the only address from which datagrams are to be received.
- * If the socket is of type SOCK_STREAM, this call attempts to make a
- * connection to another socket. The other socket is specified by
- * address, which is an address in the communications space of the
- * socket. Note that the function implements only blocking behavior
- * thus the caller will be waiting either for the connection
- * establishment or for the connection establishment failure.
- *
- * Input Parameters:
- * sd socket descriptor (handle)
- * addr specifies the destination addr. On this version
- * only AF_INET is supported.
- * addrlen contains the size of the structure pointed to by addr
- *
- * Returned Value:
- * On success, zero is returned. On error, -1 is returned
- *
- ****************************************************************************/
-
-long cc3000_connect_impl(long sd, FAR const struct sockaddr *addr, socklen_t addrlen);
-
-/****************************************************************************
- * Name: cc3000_select_impl
- *
- * Decription:
- * Monitor socket activity
- * Select allow a program to monitor multiple file descriptors,
- * waiting until one or more of the file descriptors become
- * "ready" for some class of I/O operation
- *
- * NOTE: If the timeout value set to less than 5ms it will automatically set
- * to 5ms to prevent overload of the system
- *
- * Input Parameters:
- * nfds the highest-numbered file descriptor in any of the
- * three sets, plus 1.
- * readfds socket descriptors list for read monitoring
- * writefds socket descriptors list for write monitoring
- * exceptfds socket descriptors list for exception monitoring
- * timeout is an upper bound on the amount of time elapsed
- * before select() returns. Null means infinity
- * timeout. The minimum timeout is 5 milliseconds,
- * less than 5 milliseconds will be set
- * automatically to 5 milliseconds.
- *
- * Returned Value:
- * On success, select() returns the number of file descriptors
- * contained in the three returned descriptor sets (that is, the
- * total number of bits that are set in readfds, writefds,
- * exceptfds) which may be zero if the timeout expires before
- * anything interesting happens.
- * On error, -1 is returned.
- * *readfds - return the sockets on which Read request will
- * return without delay with valid data.
- * *writefds - return the sockets on which Write request
- * will return without delay.
- * *exceptfds - return the sockets which closed recently.
- *
- ****************************************************************************/
-
-struct timeval;
-
-int cc3000_select_impl(long nfds, TICC3000fd_set *readfds, TICC3000fd_set *writefds,TICC3000fd_set *exceptfds,
- struct timeval *timeout);
-
-int cc3000_select(int nfds, fd_set *readfds, fd_set *writefds,fd_set *exceptfds, struct timeval *timeout);
-
-
-#ifndef CC3000_TINY_DRIVER
-/****************************************************************************
- * Name: cc3000_setsockopt_impl
- *
- * Decription:
- * set socket options
- * This function manipulate the options associated with a socket.
- * Options may exist at multiple protocol levels; they are always
- * present at the uppermost socket level.
- * When manipulating socket options the level at which the option
- * resides and the name of the option must be specified.
- * To manipulate options at the socket level, level is specified as
- * SOL_SOCKET. To manipulate options at any other level the protocol
- * number of the appropriate protocol controlling the option is
- * supplied. For example, to indicate that an option is to be
- * interpreted by the TCP protocol, level should be set to the
- * protocol number of TCP;
- * The parameters optval and optlen are used to access optval -
- * use for setsockopt(). For getsockopt() they identify a buffer
- * in which the value for the requested option(s) are to
- * be returned. For getsockopt(), optlen is a value-result
- * parameter, initially containing the size of the buffer
- * pointed to by option_value, and modified on return to
- * indicate the actual size of the value returned. If no option
- * value is to be supplied or returned, option_value may be NULL.
- *
- * NOTE: On this version the following two socket options are enabled:
- * The only protocol level supported in this version
- * is SOL_SOCKET (level).
- * 1. SOCKOPT_RECV_TIMEOUT (optname)
- * SOCKOPT_RECV_TIMEOUT configures recv and recvfrom timeout
- * in milliseconds.
- * In that case optval should be pointer to unsigned long.
- * 2. SOCKOPT_NONBLOCK (optname). sets the socket non-blocking mode on
- * or off.
- * In that case optval should be SOCK_ON or SOCK_OFF (optval).
- *
- * Input Parameters:
- * sd socket handle
- * level defines the protocol level for this option
- * optname defines the option name to Interrogate
- * optval specifies a value for the option
- * optlen specifies the length of the option value
- *
- * Returned Value:
- * On success, zero is returned. On error, -1 is returned
- *
- ****************************************************************************/
-
-int cc3000_setsockopt_impl(long sd, long level, long optname, const void *optval, socklen_t optlen);
-#endif
-
-/****************************************************************************
- * Name: cc3000_getsockopt_impl
- *
- * Decription:
- * set socket options
- * This function manipulate the options associated with a socket.
- * Options may exist at multiple protocol levels; they are always
- * present at the uppermost socket level.
- * When manipulating socket options the level at which the option
- * resides and the name of the option must be specified.
- * To manipulate options at the socket level, level is specified as
- * SOL_SOCKET. To manipulate options at any other level the protocol
- * number of the appropriate protocol controlling the option is
- * supplied. For example, to indicate that an option is to be
- * interpreted by the TCP protocol, level should be set to the
- * protocol number of TCP;
- * The parameters optval and optlen are used to access optval -
- * use for setsockopt(). For getsockopt() they identify a buffer
- * in which the value for the requested option(s) are to
- * be returned. For getsockopt(), optlen is a value-result
- * parameter, initially containing the size of the buffer
- * pointed to by option_value, and modified on return to
- * indicate the actual size of the value returned. If no option
- * value is to be supplied or returned, option_value may be NULL.
- *
- * NOTE: On this version the following two socket options are enabled:
- * The only protocol level supported in this version
- * is SOL_SOCKET (level).
- * 1. SOCKOPT_RECV_TIMEOUT (optname)
- * SOCKOPT_RECV_TIMEOUT configures recv and recvfrom timeout
- * in milliseconds.
- * In that case optval should be pointer to unsigned long.
- * 2. SOCKOPT_NONBLOCK (optname). sets the socket non-blocking mode on
- * or off.
- * In that case optval should be SOCK_ON or SOCK_OFF (optval).
- *
- * Input Parameters:
- * sd socket handle
- * level defines the protocol level for this option
- * optname defines the option name to Interrogate
- * optval specifies a value for the option
- * optlen specifies the length of the option value
- *
- * Returned Value:
- * On success, zero is returned. On error, -1 is returned
- *
- ****************************************************************************/
-
-int cc3000_getsockopt_impl(long sd, long level, long optname, void *optval, socklen_t *optlen);
-
-
-/****************************************************************************
- * Name: cc3000_recv_impl
- *
- * Decription:
- * function receives a message from a connection-mode socket
- *
- * NOTE: On this version, only blocking mode is supported.
- *
- * Input Parameters:
- * sd socket handle
- * buf Points to the buffer where the message should be stored
- * len Specifies the length in bytes of the buffer pointed to
- * by the buffer argument.
- * flags Specifies the type of message reception.
- * On this version, this parameter is not supported.
- *
- * Returned Value:
- * Return the number of bytes received, or -1 if an error
- * occurred
- *
- ****************************************************************************/
-
-int cc3000_recv_impl(long sd, void *buf, long len, long flags);
-
-/****************************************************************************
- * Name: cc3000_recvfrom_impl
- *
- * Decription:
- * read data from socket
- * function receives a message from a connection-mode or
- * connectionless-mode socket. Note that raw sockets are not
- * supported.
- *
- * NOTE: On this version, only blocking mode is supported.
- *
- * Input Parameters:
- * sd socket handle
- * buf Points to the buffer where the message should be stored
- * len Specifies the length in bytes of the buffer pointed to
- * by the buffer argument.
- * flags Specifies the type of message reception.
- * On this version, this parameter is not supported.
- * from pointer to an address structure indicating the source
- * address: sockaddr. On this version only AF_INET is
- * supported.
- * fromlen source address tructure size
- *
- * Returned Value:
- * Return the number of bytes received, or -1 if an error
- * occurred
- *
- ****************************************************************************/
-
-int cc3000_recvfrom_impl(long sd, void *buf, long len, long flags,
- struct sockaddr *from, socklen_t *fromlen);
-
-/****************************************************************************
- * Name: cc3000_send_impl
- *
- * Decription:
- * Write data to TCP socket
- * This function is used to transmit a message to another
- * socket.
- *
- * NOTE: On this version, only blocking mode is supported.
- *
- * Input Parameters:
- * sd socket handle
- * buf Points to a buffer containing the message to be sent
- * len message size in bytes
- * flags On this version, this parameter is not supported
- *
- * Returned Value:
- * Return the number of bytes transmitted, or -1 if an
- * error occurred
- *
- ****************************************************************************/
-
-int cc3000_send_impl(long sd, const void *buf, long len, long flags);
-
-/****************************************************************************
- * Name: cc3000_sendto_impl
- *
- * Decription:
- * Write data to TCP socket
- * This function is used to transmit a message to another
- * socket.
- *
- * NOTE: On this version, only blocking mode is supported.
- *
- * Input Parameters:
- * sd socket handle
- * buf Points to a buffer containing the message to be sent
- * len message size in bytes
- * flags On this version, this parameter is not supported
- * to pointer to an address structure indicating the destination
- * address: sockaddr. On this version only AF_INET is
- * supported.
- * tolen destination address structure size
- *
- * Returned Value:
- * Return the number of bytes transmitted, or -1 if an
- * error occurred
- *
- ****************************************************************************/
-
-int cc3000_sendto_impl(long sd, FAR const void *buf, long len, long flags,
- FAR const struct sockaddr *to, socklen_t tolen);
-
-#ifndef CC3000_TINY_DRIVER
-/****************************************************************************
- * Name: cc3000_gethostbyname_impl
- *
- * Decription:
- * Get host IP by name. Obtain the IP Address of machine on network,
- * by its name.
- *
- * NOTE: On this version, only blocking mode is supported. Also note that
- * the function requires DNS server to be configured prior to its
- * usage.
- *
- * Input Parameters:
- * hostname host name
- * usNameLen name length
- * out_ip_addr This parameter is filled in with host IP address.
- * In case that host name is not resolved,
- * out_ip_addr is zero.
- *
- * Returned Value:
- * On success, positive is returned. On error, negative is returned
- *
- ****************************************************************************/
-
-//struct hostent *gethostbyname(const char *name);
-int cc3000_gethostbyname_impl(char * hostname, uint16_t usNameLen, unsigned long* out_ip_addr);
-#endif
-
-/****************************************************************************
- * Name: cc3000_mdnsAdvertiser_impl
- *
- * Decription:
- * Set CC3000 in mDNS advertiser mode in order to advertise itself.
- *
- * Input Parameters:
- * mdnsEnabled flag to enable/disable the mDNS feature
- * deviceServiceName Service name as part of the published
- * canonical domain name
- * deviceServiceNameLength Length of the service name
- *
- * Returned Value:
- * On success, zero is returned, return SOC_ERROR if socket was not
- * opened successfully, or if an error occurred.
- *
- ****************************************************************************/
-
-int cc3000_mdnsadvertiser_impl(uint16_t mdnsEnabled, char * deviceServiceName,
- uint16_t deviceServiceNameLength);
-
-#ifdef __cplusplus
-}
-#endif // __cplusplus
-
-#endif // __DRIVERS_WIRELESS_CC3000_SOCKET_H
diff --git a/drivers/wireless/cc3000/cc3000drv.c b/drivers/wireless/cc3000/cc3000drv.c
deleted file mode 100644
index acd9ae8528..0000000000
--- a/drivers/wireless/cc3000/cc3000drv.c
+++ /dev/null
@@ -1,438 +0,0 @@
-/****************************************************************************
- * drivers/wireless/cc3000/cc3000drv.c
- * Driver wrapper functions to conntect nuttx to the TI CC3000
- *
- * Port to nuttx:
- * David Sidrane
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "cc3000drv.h"
-
-#include
-#include
-#include
-#include
-
-/****************************************************************************
- * Private Types
- ****************************************************************************/
-
-static struct
-{
- int cc3000fd;
- gcSpiHandleRx pfRxHandler;
- pthread_t unsoliced_thread;
- bool run;
- cc3000_buffer_desc rx_buffer;
- mqd_t queue;
- sem_t *done;
- sem_t unsoliced_thread_wakesem;
-} spiconf =
-{
- -1,
-};
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: cc3000_resume
- *
- * Description:
- * Will re enable the to deliver messages
- *
- * Input Parameters:
- * None
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-void cc3000_resume(void)
-{
- DEBUGASSERT(spiconf.cc3000fd >= 0 && spiconf.done);
- nxsem_post(spiconf.done);
- ninfo("Done\n");
-}
-
-/****************************************************************************
- * Name: cc3000_write
- *
- * Description:
- * This function enter point for write flow
- *
- * Input Parameters:
- * pUserBuffer
- * usLength
- *
- * Returned Value:
- *
- ****************************************************************************/
-
-long cc3000_write(uint8_t *pUserBuffer, uint16_t usLength)
-{
- ssize_t ret;
-
- DEBUGASSERT(spiconf.cc3000fd >= 0);
-
- ret = nx_write(spiconf.cc3000fd, pUserBuffer, usLength);
- return ret >= 0 ? 0 : ret;
-}
-
-/****************************************************************************
- * Name: cc3000_read
- *
- * Description:
- * This function enter point for read flow. This function will block the
- * caller until there is data available
- *
- * Input Parameters:
- * pUserBuffer
- * usLength
- *
- * Returned Value:
- *
- ****************************************************************************/
-
-long cc3000_read(uint8_t *pUserBuffer, uint16_t usLength)
-{
- DEBUGASSERT(spiconf.cc3000fd >= 0);
- return nx_read(spiconf.cc3000fd, pUserBuffer, usLength);
-}
-
-/****************************************************************************
- * Name: cc3000_wait
- *
- * Description:
- * Waits on a message from the driver.
- *
- * Input Parameters:
- * None
- *
- * Returned Value:
- *
- ****************************************************************************/
-
-uint8_t *cc3000_wait(void)
-{
- DEBUGASSERT(spiconf.cc3000fd >= 0);
-
- (void)nxmq_receive(spiconf.queue, (FAR char *)&spiconf.rx_buffer,
- sizeof(spiconf.rx_buffer), 0);
- return spiconf.rx_buffer.pbuffer;
-}
-
-/****************************************************************************
- * Name: unsoliced_thread_func
- *
- * Description:
- * This is the thread for unsolicited events. This function will block the
- * caller until there is data available
- *
- * Input Parameters:
- * parameter
- *
- * Returned Value:
- *
- ****************************************************************************/
-
-static void *unsoliced_thread_func(void *parameter)
-{
- char buff[QUEUE_NAMELEN];
- int status = 0;
- int nbytes = 0;
- int minor = 0;
-
- ioctl(spiconf.cc3000fd, CC3000IOC_GETQUESEMID, (unsigned long)&minor);
- snprintf(buff, QUEUE_NAMELEN, QUEUE_FORMAT, minor);
- spiconf.queue = mq_open(buff, O_RDONLY);
- DEBUGASSERT(spiconf.queue != (mqd_t) -1);
- DEBUGASSERT(SEM_NAMELEN == QUEUE_NAMELEN);
- snprintf(buff, SEM_NAMELEN, SEM_FORMAT, minor);
- spiconf.done = sem_open(buff, O_RDONLY);
- DEBUGASSERT(spiconf.done != SEM_FAILED);
-
- nxsem_post(&spiconf.unsoliced_thread_wakesem);
-
- while (spiconf.run)
- {
- memset(&spiconf.rx_buffer, 0, sizeof(spiconf.rx_buffer));
- nbytes = nxmq_receive(spiconf.queue, (FAR char *)&spiconf.rx_buffer,
- sizeof(spiconf.rx_buffer), 0);
- if (nbytes > 0)
- {
- ninfo("%d Processed\n", nbytes);
- spiconf.pfRxHandler(spiconf.rx_buffer.pbuffer);
- }
- }
-
- mq_close(spiconf.queue);
- sem_close(spiconf.done);
- pthread_exit((pthread_addr_t)status);
- return (pthread_addr_t)status;
-}
-
-/****************************************************************************
- * Name: cc3000_open
- *
- * Description:
- * Open the cc3000 driver
- *
- * Input Parameters:
- * pfRxHandler the Rx handler for messages
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-void cc3000_open(gcSpiHandleRx pfRxHandler)
-{
- int status;
- int ret;
- int fd;
-
- DEBUGASSERT(spiconf.cc3000fd == -1);
-
- fd = open("/dev/wireless0", O_RDWR | O_BINARY);
- if (fd >= 0)
- {
- spiconf.pfRxHandler = pfRxHandler;
- spiconf.cc3000fd = fd;
- spiconf.run = true;
-
- nxsem_init(&spiconf.unsoliced_thread_wakesem, 0, 0);
-
- pthread_attr_t attr;
- struct sched_param param;
- pthread_attr_init(&attr);
- attr.stacksize = CONFIG_CC3000_UNSOLICED_STACKSIZE;
- param.sched_priority = SCHED_PRIORITY_DEFAULT-10;
- pthread_attr_setschedparam(&attr, ¶m);
- status = pthread_create(&spiconf.unsoliced_thread, &attr,
- unsoliced_thread_func, NULL);
- DEBUGASSERT(status == 0);
- UNUSED(status);
-
- /* Wait unsoliced_thread to wake-up. */
-
- do
- {
- ret = nxsem_wait(&spiconf.unsoliced_thread_wakesem);
-
- /* The only case that an error should occur here is if the wait
- * was awakened by a signal.
- */
-
- DEBUGASSERT(ret == OK || ret == -EINTR);
- }
- while (ret == -EINTR);
- }
-
- DEBUGASSERT(spiconf.cc3000fd >= 0);
-}
-
-/****************************************************************************
- * Name: cc3000_close
- *
- * Description:
- * Close the cc3000 driver
- *
- * Input Parameters:
- * None
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-void cc3000_close(void)
-{
- if (spiconf.cc3000fd >= 0)
- {
- int status;
- spiconf.run = false;
-
- pthread_cancel(spiconf.unsoliced_thread);
- pthread_join(spiconf.unsoliced_thread, (FAR pthread_addr_t *)&status);
-
- close(spiconf.cc3000fd);
-
- memset(&spiconf, 0, sizeof(spiconf));
- spiconf.cc3000fd = -1;
- }
-}
-
-/****************************************************************************
- * Name: cc3000_wait_data
- *
- * Description:
- * Adds this socket for monitoring for the data operation
- *
- * Input Parameters:
- * sd cc3000 socket handle or -1 tp remove it
- *
- * Returned Value:
- * Zero is returned on success. Otherwise, a -1 value is
- * returned to indicate socket not found.
- *
- ****************************************************************************/
-
-int cc3000_wait_data(int sockfd)
-{
- int rv = sockfd;
-
- DEBUGASSERT(spiconf.cc3000fd >= 0);
- ioctl(spiconf.cc3000fd, CC3000IOC_SELECTDATA, (unsigned long)&rv);
- return rv;
-}
-
-/****************************************************************************
- * Name: cc3000_accept_socket
- *
- * Description:
- * Adds this socket for monitoring for the accept operation
- *
- * Input Parameters:
- * sd cc3000 socket handle or -1 tp remove it
- * minor - The input device minor number
- *
- * Returned Value:
- * Zero is returned on success. Otherwise, a -1 value is
- * returned to indicate socket not found.
- *
- ****************************************************************************/
-
-int cc3000_accept_socket(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
-{
- DEBUGASSERT(spiconf.cc3000fd >= 0);
-
- cc3000_acceptcfg cfg;
- cfg.sockfd = sockfd;
- cfg.addr = addr;
- cfg.addrlen = addrlen;
- ioctl(spiconf.cc3000fd, CC3000IOC_SELECTACCEPT, (unsigned long)&cfg);
- return cfg.sockfd;
-}
-
-/****************************************************************************
- * Name: cc3000_add_socket
- *
- * Description:
- * Adds a socket to the list for monitoring for long operation
- *
- * Input Parameters:
- * sd cc3000 socket handle
- * minor - The input device minor number
- *
- * Returned Value:
- * Zero is returned on success. Otherwise, a -1 value is
- * returned to indicate socket not found.
- *
- ****************************************************************************/
-
-int cc3000_add_socket(int sockfd)
-{
- int rv = sockfd;
-
- DEBUGASSERT(spiconf.cc3000fd >= 0);
- ioctl(spiconf.cc3000fd, CC3000IOC_ADDSOCKET, (unsigned long)&rv);
- return rv;
-}
-
-/****************************************************************************
- * Name: cc3000_remove_socket
- *
- * Description:
- * Removes a socket from the list of monitoring for long operation
- *
- * Input Parameters:
- * sd cc3000 socket handle
- * minor - The input device minor number
- *
- * Returned Value:
- * Zero is returned on success. Otherwise, a -1 value is
- * returned to indicate socket not found.
- *
- ****************************************************************************/
-
-int cc3000_remove_socket(int sockfd)
-{
- int rv = sockfd;
-
- DEBUGASSERT(spiconf.cc3000fd >= 0);
- ioctl(spiconf.cc3000fd, CC3000IOC_REMOVESOCKET, (unsigned long)&rv);
- return rv;
-}
-
-/****************************************************************************
- * Name: cc3000_remote_closed_socket
- *
- * Description:
- * Mark socket as closed by remote host
- *
- * Input Parameters:
- * sd cc3000 socket handle
- *
- * Returned Value:
- * Zero is returned on success. Otherwise, a -1 value is
- * returned to indicate socket not found.
- *
- ****************************************************************************/
-
-int cc3000_remote_closed_socket(int sockfd)
-{
- int rv = sockfd;
-
- DEBUGASSERT(spiconf.cc3000fd >= 0);
- ioctl(spiconf.cc3000fd, CC3000IOC_REMOTECLOSEDSOCKET, (unsigned long)&rv);
- return rv;
-}
diff --git a/drivers/wireless/cc3000/cc3000drv.h b/drivers/wireless/cc3000/cc3000drv.h
deleted file mode 100644
index 4c67fa2fe4..0000000000
--- a/drivers/wireless/cc3000/cc3000drv.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
- * drivers/wireless/cc3000/cc3000drv.h - Driver wrapper functions to
- * connect nuttx to the TI CC3000
- *
- * Port to nuttx:
- * David Sidrane
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-#ifndef __DRIVERS_WIRELESS_CC3000_CC3000DRV_H
-#define __DRIVERS_WIRELESS_CC3000_CC3000DRV_H
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-#include
-
-/****************************************************************************
- * Public Types
- ****************************************************************************/
-
-typedef void (*gcSpiHandleRx)(void *p);
-
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-/****************************************************************************
- * Public Function Prototypes
- ****************************************************************************/
-
-#ifdef __cplusplus
-#define EXTERN extern "C"
-extern "C"
-{
-#else
-#define EXTERN extern
-#endif
-
-void cc3000_open(gcSpiHandleRx pfRxHandler);
-void cc3000_close(void);
-long cc3000_write(uint8_t *pUserBuffer, uint16_t usLength);
-uint8_t *cc3000_wait(void);
-long cc3000_read(uint8_t *pUserBuffer, uint16_t usLength);
-void cc3000_resume(void);
-
-int cc3000_wait_data(int sockfd);
-int cc3000_accept_socket(int sockfd, struct sockaddr *addr,
- socklen_t *addrlen);
-int cc3000_add_socket(int sockfd);
-int cc3000_remove_socket(int sockfd);
-int cc3000_remote_closed_socket(int sockfd);
-
-#undef EXTERN
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __DRIVERS_WIRELESS_CC3000_CC3000DRV_H */
diff --git a/drivers/wireless/cc3000/evnt_handler.c b/drivers/wireless/cc3000/evnt_handler.c
deleted file mode 100644
index b2ec2b016a..0000000000
--- a/drivers/wireless/cc3000/evnt_handler.c
+++ /dev/null
@@ -1,1021 +0,0 @@
-/****************************************************************************
- * drivers/wireless/cc3000/evnt_handler.c - CC3000 Host Driver Implementation.
- *
- * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include "cc3000_socket.h"
-#include "cc3000drv.h"
-#include
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#define FLOW_CONTROL_EVENT_HANDLE_OFFSET (0)
-#define FLOW_CONTROL_EVENT_BLOCK_MODE_OFFSET (1)
-#define FLOW_CONTROL_EVENT_FREE_BUFFS_OFFSET (2)
-#define FLOW_CONTROL_EVENT_SIZE (4)
-
-#define BSD_RSP_PARAMS_SOCKET_OFFSET (0)
-#define BSD_RSP_PARAMS_STATUS_OFFSET (4)
-
-#define GET_HOST_BY_NAME_RETVAL_OFFSET (0)
-#define GET_HOST_BY_NAME_ADDR_OFFSET (4)
-
-#define ACCEPT_SD_OFFSET (0)
-#define ACCEPT_RETURN_STATUS_OFFSET (4)
-#define ACCEPT_ADDRESS__OFFSET (8)
-
-#define SL_RECEIVE_SD_OFFSET (0)
-#define SL_RECEIVE_NUM_BYTES_OFFSET (4)
-#define SL_RECEIVE__FLAGS__OFFSET (8)
-
-#define SELECT_STATUS_OFFSET (0)
-#define SELECT_READFD_OFFSET (4)
-#define SELECT_WRITEFD_OFFSET (8)
-#define SELECT_EXFD_OFFSET (12)
-
-#define NETAPP_IPCONFIG_IP_OFFSET (0)
-#define NETAPP_IPCONFIG_SUBNET_OFFSET (4)
-#define NETAPP_IPCONFIG_GW_OFFSET (8)
-#define NETAPP_IPCONFIG_DHCP_OFFSET (12)
-#define NETAPP_IPCONFIG_DNS_OFFSET (16)
-#define NETAPP_IPCONFIG_MAC_OFFSET (20)
-#define NETAPP_IPCONFIG_SSID_OFFSET (26)
-
-#define NETAPP_IPCONFIG_IP_LENGTH (4)
-#define NETAPP_IPCONFIG_MAC_LENGTH (6)
-#define NETAPP_IPCONFIG_SSID_LENGTH (32)
-
-#define NETAPP_PING_PACKETS_SENT_OFFSET (0)
-#define NETAPP_PING_PACKETS_RCVD_OFFSET (4)
-#define NETAPP_PING_MIN_RTT_OFFSET (8)
-#define NETAPP_PING_MAX_RTT_OFFSET (12)
-#define NETAPP_PING_AVG_RTT_OFFSET (16)
-
-#define GET_SCAN_RESULTS_TABlE_COUNT_OFFSET (0)
-#define GET_SCAN_RESULTS_SCANRESULT_STATUS_OFFSET (4)
-#define GET_SCAN_RESULTS_ISVALID_TO_SSIDLEN_OFFSET (8)
-#define GET_SCAN_RESULTS_FRAME_TIME_OFFSET (10)
-#define GET_SCAN_RESULTS_SSID_MAC_LENGTH (38)
-
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-unsigned long socket_active_status = SOCKET_STATUS_INIT_VAL;
-
-/****************************************************************************
- * Private Function Prototypes
- ****************************************************************************/
-
-static long hci_event_unsol_flowcontrol_handler(char *pEvent);
-static void update_socket_active_status(char *resp_params);
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-/****************************************************************************
- * Name: hci_unsol_handle_patch_request
- *
- * Description:
- * Handle unsolicited event from type patch request
- *
- * Input Parameters:
- * event_hdr event header
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-void hci_unsol_handle_patch_request(char *event_hdr)
-{
- char *params = (char *)(event_hdr) + HCI_EVENT_HEADER_SIZE;
- unsigned long ucLength = 0;
- char *patch;
-
- switch (*params)
- {
- case HCI_EVENT_PATCHES_DRV_REQ:
-
- if (tSLInformation.sDriverPatches)
- {
- patch = tSLInformation.sDriverPatches(&ucLength);
-
- if (patch)
- {
- hci_patch_send(HCI_EVENT_PATCHES_DRV_REQ,
- tSLInformation.pucTxCommandBuffer,
- patch, ucLength);
- return;
- }
- }
-
- /* Send 0 length Patches response event */
-
- hci_patch_send(HCI_EVENT_PATCHES_DRV_REQ,
- tSLInformation.pucTxCommandBuffer, 0, 0);
- break;
-
- case HCI_EVENT_PATCHES_FW_REQ:
-
- if (tSLInformation.sFWPatches)
- {
- patch = tSLInformation.sFWPatches(&ucLength);
-
- /* Build and send a patch */
-
- if (patch)
- {
- hci_patch_send(HCI_EVENT_PATCHES_FW_REQ,
- tSLInformation.pucTxCommandBuffer,
- patch, ucLength);
- return;
- }
- }
-
- /* Send 0 length Patches response event */
-
- hci_patch_send(HCI_EVENT_PATCHES_FW_REQ,
- tSLInformation.pucTxCommandBuffer, 0, 0);
- break;
-
- case HCI_EVENT_PATCHES_BOOTLOAD_REQ:
-
- if (tSLInformation.sBootLoaderPatches)
- {
- patch = tSLInformation.sBootLoaderPatches(&ucLength);
-
- if (patch)
- {
- hci_patch_send(HCI_EVENT_PATCHES_BOOTLOAD_REQ,
- tSLInformation.pucTxCommandBuffer,
- patch, ucLength);
- return;
- }
- }
-
- /* Send 0 length Patches response event */
-
- hci_patch_send(HCI_EVENT_PATCHES_BOOTLOAD_REQ,
- tSLInformation.pucTxCommandBuffer, 0, 0);
- break;
- }
-}
-
-/****************************************************************************
- * Name: hci_event_handler
- *
- * Description:
- * Parse the incoming events packets and issues corresponding event handler
- * from global array of handlers pointers
- *
- * Input Parameters:
- * pRetParams incoming data buffer
- * from from information (in case of data received)
- * fromlen from information length (in case of data received)
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-uint8_t *hci_event_handler(void *pRetParams, uint8_t *from, uint8_t *fromlen)
-{
- uint8_t *pucReceivedData, ucArgsize;
- uint16_t usLength;
- uint8_t *pucReceivedParams;
- uint16_t usReceivedEventOpcode = 0;
- unsigned long retValue32;
- uint8_t * RecvParams;
- uint8_t *RetParams;
-
- while (1)
- {
- if (tSLInformation.usEventOrDataReceived != 0)
- {
- pucReceivedData = (tSLInformation.pucReceivedData);
-
- if (*pucReceivedData == HCI_TYPE_EVNT)
- {
- /* Event Received */
-
- STREAM_TO_UINT16((char *)pucReceivedData,
- HCI_EVENT_OPCODE_OFFSET,
- usReceivedEventOpcode);
-
- pucReceivedParams = pucReceivedData + HCI_EVENT_HEADER_SIZE;
- RecvParams = pucReceivedParams;
- RetParams = (uint8_t *)pRetParams;
-
- /* In case unsolicited event received - here the handling finished */
-
- if (hci_unsol_event_handler((char *)pucReceivedData) == 0)
- {
- STREAM_TO_UINT8(pucReceivedData, HCI_DATA_LENGTH_OFFSET, usLength);
-
- switch (usReceivedEventOpcode)
- {
- case HCI_CMND_READ_BUFFER_SIZE:
- {
- STREAM_TO_UINT8((char *)pucReceivedParams, 0,
- tSLInformation.usNumberOfFreeBuffers);
- STREAM_TO_UINT16((char *)pucReceivedParams, 1,
- tSLInformation.usSlBufferLength);
- }
- break;
-
- case HCI_CMND_WLAN_CONFIGURE_PATCH:
- case HCI_NETAPP_DHCP:
- case HCI_NETAPP_PING_SEND:
- case HCI_NETAPP_PING_STOP:
- case HCI_NETAPP_ARP_FLUSH:
- case HCI_NETAPP_SET_DEBUG_LEVEL:
- case HCI_NETAPP_SET_TIMERS:
- case HCI_EVNT_NVMEM_READ:
- case HCI_EVNT_NVMEM_CREATE_ENTRY:
- case HCI_CMND_NVMEM_WRITE_PATCH:
- case HCI_NETAPP_PING_REPORT:
- case HCI_EVNT_MDNS_ADVERTISE:
-
- STREAM_TO_UINT8(pucReceivedData, HCI_EVENT_STATUS_OFFSET,
- *(uint8_t *)pRetParams);
- break;
-
- case HCI_CMND_SETSOCKOPT:
- case HCI_CMND_WLAN_CONNECT:
- case HCI_CMND_WLAN_IOCTL_STATUSGET:
- case HCI_EVNT_WLAN_IOCTL_ADD_PROFILE:
- case HCI_CMND_WLAN_IOCTL_DEL_PROFILE:
- case HCI_CMND_WLAN_IOCTL_SET_CONNECTION_POLICY:
- case HCI_CMND_WLAN_IOCTL_SET_SCANPARAM:
- case HCI_CMND_WLAN_IOCTL_SIMPLE_CONFIG_START:
- case HCI_CMND_WLAN_IOCTL_SIMPLE_CONFIG_STOP:
- case HCI_CMND_WLAN_IOCTL_SIMPLE_CONFIG_SET_PREFIX:
- case HCI_CMND_EVENT_MASK:
- case HCI_EVNT_WLAN_DISCONNECT:
- case HCI_EVNT_SOCKET:
- case HCI_EVNT_BIND:
- case HCI_CMND_LISTEN:
- case HCI_EVNT_CLOSE_SOCKET:
- case HCI_EVNT_CONNECT:
- case HCI_EVNT_NVMEM_WRITE:
-
- STREAM_TO_UINT32((char *)pucReceivedParams, 0,
- *(unsigned long *)pRetParams);
- break;
-
- case HCI_EVNT_READ_SP_VERSION:
-
- STREAM_TO_UINT8(pucReceivedData, HCI_EVENT_STATUS_OFFSET,
- *(uint8_t *)pRetParams);
- pRetParams = ((char *)pRetParams) + 1;
- STREAM_TO_UINT32((char *)pucReceivedParams, 0, retValue32);
- UINT32_TO_STREAM((uint8_t *)pRetParams, retValue32);
- break;
-
- case HCI_EVNT_BSD_GETHOSTBYNAME:
-
- STREAM_TO_UINT32((char *)pucReceivedParams,
- GET_HOST_BY_NAME_RETVAL_OFFSET,
- *(unsigned long *)pRetParams);
- pRetParams = ((char *)pRetParams) + 4;
- STREAM_TO_UINT32((char *)pucReceivedParams,
- GET_HOST_BY_NAME_ADDR_OFFSET,
- *(unsigned long *)pRetParams);
- break;
-
- case HCI_EVNT_ACCEPT:
- {
- STREAM_TO_UINT32((char *)pucReceivedParams,
- ACCEPT_SD_OFFSET,
- *(unsigned long *)pRetParams);
- pRetParams = ((char *)pRetParams) + 4;
- STREAM_TO_UINT32((char *)pucReceivedParams,
- ACCEPT_RETURN_STATUS_OFFSET,
- *(unsigned long *)pRetParams);
- pRetParams = ((char *)pRetParams) + 4;
-
- /* This argument returns in network order */
-
- memcpy((uint8_t *)pRetParams,
- pucReceivedParams + ACCEPT_ADDRESS__OFFSET,
- sizeof(struct sockaddr));
- }
- break;
-
- case HCI_EVNT_RECV:
- case HCI_EVNT_RECVFROM:
- {
- STREAM_TO_UINT32((char *)pucReceivedParams,
- SL_RECEIVE_SD_OFFSET,
- *(unsigned long *)pRetParams);
- pRetParams = ((char *)pRetParams) + 4;
- STREAM_TO_UINT32((char *)pucReceivedParams,
- SL_RECEIVE_NUM_BYTES_OFFSET,
- *(unsigned long *)pRetParams);
- pRetParams = ((char *)pRetParams) + 4;
- STREAM_TO_UINT32((char *)pucReceivedParams,
- SL_RECEIVE__FLAGS__OFFSET,
- *(unsigned long *)pRetParams);
-
- if (((tBsdReadReturnParams *)pRetParams)->iNumberOfBytes ==
- ERROR_SOCKET_INACTIVE)
- {
- set_socket_active_status
- (((tBsdReadReturnParams *)pRetParams)->iSocketDescriptor,
- SOCKET_STATUS_INACTIVE);
- }
- }
- break;
-
- case HCI_EVNT_SEND:
- case HCI_EVNT_SENDTO:
- {
- STREAM_TO_UINT32((char *)pucReceivedParams,
- SL_RECEIVE_SD_OFFSET,
- *(unsigned long *)pRetParams);
- pRetParams = ((char *)pRetParams) + 4;
- STREAM_TO_UINT32((char *)pucReceivedParams,
- SL_RECEIVE_NUM_BYTES_OFFSET,
- *(unsigned long *)pRetParams);
- pRetParams = ((char *)pRetParams) + 4;
- }
- break;
-
- case HCI_EVNT_SELECT:
- {
- STREAM_TO_UINT32((char *)pucReceivedParams,
- SELECT_STATUS_OFFSET,
- *(unsigned long *)pRetParams);
- pRetParams = ((char *)pRetParams) + 4;
- STREAM_TO_UINT32((char *)pucReceivedParams,
- SELECT_READFD_OFFSET,
- *(unsigned long *)pRetParams);
- pRetParams = ((char *)pRetParams) + 4;
- STREAM_TO_UINT32((char *)pucReceivedParams,
- SELECT_WRITEFD_OFFSET,
- *(unsigned long *)pRetParams);
- pRetParams = ((char *)pRetParams) + 4;
- STREAM_TO_UINT32((char *)pucReceivedParams,
- SELECT_EXFD_OFFSET,
- *(unsigned long *)pRetParams);
- }
- break;
-
- case HCI_CMND_GETSOCKOPT:
-
- STREAM_TO_UINT8(pucReceivedData, HCI_EVENT_STATUS_OFFSET,
- ((tBsdGetSockOptReturnParams *)pRetParams)->iStatus);
-
- /* This argument returns in network order */
-
- memcpy((uint8_t *)pRetParams, pucReceivedParams, 4);
- break;
-
- case HCI_CMND_WLAN_IOCTL_GET_SCAN_RESULTS:
-
- STREAM_TO_UINT32((char *)pucReceivedParams,
- GET_SCAN_RESULTS_TABlE_COUNT_OFFSET,
- *(unsigned long *)pRetParams);
- pRetParams = ((char *)pRetParams) + 4;
- STREAM_TO_UINT32((char *)pucReceivedParams,
- GET_SCAN_RESULTS_SCANRESULT_STATUS_OFFSET,
- *(unsigned long *)pRetParams);
- pRetParams = ((char *)pRetParams) + 4;
-
- STREAM_TO_UINT16((char *)pucReceivedParams,
- GET_SCAN_RESULTS_ISVALID_TO_SSIDLEN_OFFSET,
- *(unsigned long *)pRetParams);
- pRetParams = ((char *)pRetParams) + 2;
- STREAM_TO_UINT16((char *)pucReceivedParams,
- GET_SCAN_RESULTS_FRAME_TIME_OFFSET,
- *(unsigned long *)pRetParams);
- pRetParams = ((char *)pRetParams) + 2;
- memcpy((uint8_t *)pRetParams,
- (char *)(pucReceivedParams +
- GET_SCAN_RESULTS_FRAME_TIME_OFFSET + 2),
- GET_SCAN_RESULTS_SSID_MAC_LENGTH);
- break;
-
- case HCI_CMND_SIMPLE_LINK_START:
- break;
-
- case HCI_NETAPP_IPCONFIG:
-
- /* Read IP address */
-
- STREAM_TO_STREAM(RecvParams, RetParams, NETAPP_IPCONFIG_IP_LENGTH);
- RecvParams += 4;
-
- /* Read subnet */
-
- STREAM_TO_STREAM(RecvParams, RetParams, NETAPP_IPCONFIG_IP_LENGTH);
- RecvParams += 4;
-
- /* Read default GW */
-
- STREAM_TO_STREAM(RecvParams, RetParams, NETAPP_IPCONFIG_IP_LENGTH);
- RecvParams += 4;
-
- /* Read DHCP server */
-
- STREAM_TO_STREAM(RecvParams, RetParams, NETAPP_IPCONFIG_IP_LENGTH);
- RecvParams += 4;
-
- /* Read DNS server */
-
- STREAM_TO_STREAM(RecvParams, RetParams, NETAPP_IPCONFIG_IP_LENGTH);
- RecvParams += 4;
-
- /* Read Mac address */
-
- STREAM_TO_STREAM(RecvParams, RetParams, NETAPP_IPCONFIG_MAC_LENGTH);
- RecvParams += 6;
-
- /* Read SSID */
-
- STREAM_TO_STREAM(RecvParams, RetParams, NETAPP_IPCONFIG_SSID_LENGTH);
- break;
-
- default:
- PANIC();
- break;
- }
- }
-
- if (usReceivedEventOpcode == tSLInformation.usRxEventOpcode)
- {
- tSLInformation.usRxEventOpcode = 0;
- }
- }
- else
- {
- pucReceivedParams = pucReceivedData;
- STREAM_TO_UINT8((char *)pucReceivedData,
- HCI_PACKET_ARGSIZE_OFFSET, ucArgsize);
-
- STREAM_TO_UINT16((char *)pucReceivedData,
- HCI_PACKET_LENGTH_OFFSET, usLength);
-
- /* Data received: note that the only case where from and from length
- * are not null is in recv from, so fill the args accordingly
- */
-
- if (from)
- {
- STREAM_TO_UINT32((char *)(pucReceivedData + HCI_DATA_HEADER_SIZE),
- BSD_RECV_FROM_FROMLEN_OFFSET,
- *(unsigned long *)fromlen);
- memcpy(from,
- (pucReceivedData + HCI_DATA_HEADER_SIZE + BSD_RECV_FROM_FROM_OFFSET),
- *fromlen);
- }
-
- memcpy(pRetParams, pucReceivedParams + HCI_DATA_HEADER_SIZE + ucArgsize,
- usLength - ucArgsize);
-
- if (fromlen)
- {
- *fromlen = usLength - ucArgsize;
- }
-
- tSLInformation.usRxDataPending = 0;
- }
-
- tSLInformation.usEventOrDataReceived = 0;
-
- cc3000_resume();
-
- /* Since we are going to TX - we need to handle this event after the
- * ResumeSPi since we need interrupts
- */
-
- if ((*pucReceivedData == HCI_TYPE_EVNT) &&
- (usReceivedEventOpcode == HCI_EVNT_PATCHES_REQ))
- {
- hci_unsol_handle_patch_request((char *)pucReceivedData);
- }
-
- if ((tSLInformation.usRxEventOpcode == 0) &&
- (tSLInformation.usRxDataPending == 0))
- {
- break;
- }
- }
- }
-
- return NULL;
-}
-
-/****************************************************************************
- * Name: hci_unsol_event_handler
- *
- * Description:
- * Handle unsolicited events
- *
- * Input Parameters:
- * event_hdr event header
- *
- * Returned Value:
- * 1 if event supported and handled
- * 0 if event is not supported
- *
- ****************************************************************************/
-
-long hci_unsol_event_handler(char *event_hdr)
-{
- char * data = NULL;
- long event_type;
- unsigned long NumberOfReleasedPackets;
- unsigned long NumberOfSentPackets;
-
- STREAM_TO_UINT16(event_hdr, HCI_EVENT_OPCODE_OFFSET, event_type);
-
- if (event_type == HCI_EVNT_PATCHES_REQ)
- {
- hci_unsol_handle_patch_request(event_hdr);
- }
-
- if (event_type & HCI_EVNT_UNSOL_BASE)
- {
- switch (event_type)
- {
- case HCI_EVNT_DATA_UNSOL_FREE_BUFF:
- {
- hci_event_unsol_flowcontrol_handler(event_hdr);
-
- NumberOfReleasedPackets = tSLInformation.NumberOfReleasedPackets;
- NumberOfSentPackets = tSLInformation.NumberOfSentPackets;
-
- if (NumberOfReleasedPackets == NumberOfSentPackets)
- {
- if (tSLInformation.InformHostOnTxComplete)
- {
- tSLInformation.sWlanCB(HCI_EVENT_CC3000_CAN_SHUT_DOWN, NULL, 0);
- }
- }
-
- return 1;
- }
- }
- }
-
- if (event_type & HCI_EVNT_WLAN_UNSOL_BASE)
- {
- switch (event_type)
- {
- case HCI_EVNT_WLAN_KEEPALIVE:
- case HCI_EVNT_WLAN_UNSOL_CONNECT:
- case HCI_EVNT_WLAN_UNSOL_DISCONNECT:
- case HCI_EVNT_WLAN_UNSOL_INIT:
- case HCI_EVNT_WLAN_ASYNC_SIMPLE_CONFIG_DONE:
-
- if (tSLInformation.sWlanCB)
- {
- tSLInformation.sWlanCB(event_type, 0, 0);
- }
- break;
-
- case HCI_EVNT_WLAN_UNSOL_DHCP:
- {
- uint8_t params[NETAPP_IPCONFIG_MAC_OFFSET + 1]; /* Extra byte is for the status */
- uint8_t *recParams = params;
-
- data = (FAR char *)(event_hdr) + HCI_EVENT_HEADER_SIZE;
-
- /* Read IP address */
-
- STREAM_TO_STREAM(data, recParams, NETAPP_IPCONFIG_IP_LENGTH);
- data += 4;
-
- /* Read subnet */
-
- STREAM_TO_STREAM(data, recParams, NETAPP_IPCONFIG_IP_LENGTH);
- data += 4;
-
- /* Read default GW */
-
- STREAM_TO_STREAM(data, recParams, NETAPP_IPCONFIG_IP_LENGTH);
- data += 4;
-
- /* Read DHCP server */
-
- STREAM_TO_STREAM(data, recParams, NETAPP_IPCONFIG_IP_LENGTH);
- data += 4;
-
- /* Read DNS server */
-
- STREAM_TO_STREAM(data, recParams, NETAPP_IPCONFIG_IP_LENGTH);
-
- /* Read the status */
-
- STREAM_TO_UINT8(event_hdr, HCI_EVENT_STATUS_OFFSET, *recParams);
-
- if (tSLInformation.sWlanCB)
- {
- tSLInformation.sWlanCB(event_type, (char *)params, sizeof(params));
- }
- }
- break;
-
- case HCI_EVNT_WLAN_ASYNC_PING_REPORT:
- {
- netapp_pingreport_args_t params;
- data = (FAR char *)(event_hdr) + HCI_EVENT_HEADER_SIZE;
- STREAM_TO_UINT32(data, NETAPP_PING_PACKETS_SENT_OFFSET, params.packets_sent);
- STREAM_TO_UINT32(data, NETAPP_PING_PACKETS_RCVD_OFFSET, params.packets_received);
- STREAM_TO_UINT32(data, NETAPP_PING_MIN_RTT_OFFSET, params.min_round_time);
- STREAM_TO_UINT32(data, NETAPP_PING_MAX_RTT_OFFSET, params.max_round_time);
- STREAM_TO_UINT32(data, NETAPP_PING_AVG_RTT_OFFSET, params.avg_round_time);
-
- if (tSLInformation.sWlanCB)
- {
- tSLInformation.sWlanCB(event_type, (char *)¶ms, sizeof(params));
- }
- }
- break;
-
- case HCI_EVNT_BSD_TCP_CLOSE_WAIT:
- {
- int sockfd;
-
- data = (FAR char *)(event_hdr) + HCI_EVENT_HEADER_SIZE;
- STREAM_TO_UINT32(data, NETAPP_PING_PACKETS_SENT_OFFSET, sockfd);
- data += 4;
-
- (void)cc3000_remote_closed_socket(sockfd);
-
- if (tSLInformation.sWlanCB)
- {
- tSLInformation.sWlanCB(event_type, NULL, 0);
- }
- }
- break;
-
- /* 'default' case which means "event not supported" */
-
- default:
- return 0;
- }
-
- return 1;
- }
-
- if ((event_type == HCI_EVNT_SEND) || (event_type == HCI_EVNT_SENDTO) ||
- (event_type == HCI_EVNT_WRITE))
- {
- char *pArg;
- long status;
-
- pArg = M_BSD_RESP_PARAMS_OFFSET(event_hdr);
- STREAM_TO_UINT32(pArg, BSD_RSP_PARAMS_STATUS_OFFSET, status);
-
- if (ERROR_SOCKET_INACTIVE == status)
- {
- /* The only synchronous event that can come from SL device in form of
- * command complete is "Command Complete" on data sent, in case SL device
- * was unable to transmit
- */
-
- STREAM_TO_UINT8(event_hdr, HCI_EVENT_STATUS_OFFSET,
- tSLInformation.slTransmitDataError);
- update_socket_active_status(M_BSD_RESP_PARAMS_OFFSET(event_hdr));
-
- return 1;
- }
- else
- {
- return 0;
- }
- }
-
- return 0;
-}
-
-/****************************************************************************
- * Name: hci_unsolicited_event_handler
- *
- * Description:
- * Parse the incoming unsolicited event packets and issues corresponding
- * event handler.
- *
- * Input Parameters:
- * None
- *
- * Returned Value:
- * ESUCCESS if successful, EFAIL if an error occurred
- *
- ****************************************************************************/
-
-long hci_unsolicited_event_handler(void)
-{
- unsigned long res = 0;
- uint8_t *pucReceivedData;
-
- if (tSLInformation.usEventOrDataReceived != 0)
- {
- pucReceivedData = (tSLInformation.pucReceivedData);
-
- if (*pucReceivedData == HCI_TYPE_EVNT)
- {
- /* In case unsolicited event received - here the handling finished */
-
- if (hci_unsol_event_handler((char *)pucReceivedData) == 1)
- {
- /* There was an unsolicited event received - we can release the buffer
- * and clean the event received
- */
-
- tSLInformation.usEventOrDataReceived = 0;
-
- res = 1;
- cc3000_resume();
- }
- }
- }
-
- return res;
-}
-
-/****************************************************************************
- * Name: set_socket_active_status
- *
- * Description:
- * Check if the socket ID and status are valid and set accordingly the
- * global socket status
- *
- * Input Parameters:
- * Sd
- * Status
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-void set_socket_active_status(long Sd, long Status)
-{
- if (M_IS_VALID_SD(Sd) && M_IS_VALID_STATUS(Status))
- {
- socket_active_status &= ~(1 << Sd); /* Clean socket's mask */
- socket_active_status |= (Status << Sd); /* Set new socket's mask */
- }
-}
-
-/****************************************************************************
- * Name: hci_event_unsol_flowcontrol_handler
- *
- * Description:
- * Called in case unsolicited event from type HCI_EVNT_DATA_UNSOL_FREE_BUFF
- * has received. Keep track on the number of packets transmitted and update
- * the number of free buffer in the SL device.
- *
- * Input Parameters:
- * pEvent pointer to the string contains parameters for IPERF
- *
- * Returned Value:
- * ESUCCESS if successful, EFAIL if an error occurred
- *
- ****************************************************************************/
-
-long hci_event_unsol_flowcontrol_handler(char *pEvent)
-{
- long temp, value;
- uint16_t i;
- uint16_t pusNumberOfHandles = 0;
- char *pReadPayload;
-
- STREAM_TO_UINT16((char *)pEvent, HCI_EVENT_HEADER_SIZE, pusNumberOfHandles);
- pReadPayload = ((char *)pEvent +
- HCI_EVENT_HEADER_SIZE + sizeof(pusNumberOfHandles));
- temp = 0;
-
- for (i = 0; i < pusNumberOfHandles ; i++)
- {
- STREAM_TO_UINT16(pReadPayload, FLOW_CONTROL_EVENT_FREE_BUFFS_OFFSET, value);
- temp += value;
- pReadPayload += FLOW_CONTROL_EVENT_SIZE;
- }
-
- tSLInformation.usNumberOfFreeBuffers += temp;
- tSLInformation.NumberOfReleasedPackets += temp;
-
- return(ESUCCESS);
-}
-
-/****************************************************************************
- * Name: get_socket_active_status
- *
- * Description:
- * Retrieve socket status
- *
- * Input Parameters:
- * Sd Socket IS
- *
- * Returned Value:
- * Current status of the socket.
- *
- ****************************************************************************/
-
-long get_socket_active_status(long Sd)
-{
- if (M_IS_VALID_SD(Sd))
- {
- return (socket_active_status & (1 << Sd)) ?
- SOCKET_STATUS_INACTIVE : SOCKET_STATUS_ACTIVE;
- }
-
- return SOCKET_STATUS_INACTIVE;
-}
-
-/****************************************************************************
- * Name: update_socket_active_status
- *
- * Description:
- * Retrieve socket status
- *
- * Input Parameters:
- * resp_params Socket IS
- *
- * Returned Value:
- * Current status of the socket.
- *
- ****************************************************************************/
-
-void update_socket_active_status(char *resp_params)
-{
- long status, sd;
-
- STREAM_TO_UINT32(resp_params, BSD_RSP_PARAMS_SOCKET_OFFSET, sd);
- STREAM_TO_UINT32(resp_params, BSD_RSP_PARAMS_STATUS_OFFSET, status);
-
- if (ERROR_SOCKET_INACTIVE == status)
- {
- set_socket_active_status(sd, SOCKET_STATUS_INACTIVE);
- }
-}
-
-/****************************************************************************
- * Name: SimpleLinkWaitEvent
- *
- * Description:
- * Wait for event, pass it to the hci_event_handler and update the event
- * opcode in a global variable.
- *
- * Input Parameters:
- * opcode command operation code
- * pRetParams command return parameters
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-void SimpleLinkWaitEvent(uint16_t opcode, void *pRetParams)
-{
- /* In the blocking implementation the control to caller will be returned only
- * after the end of current transaction
- */
-
- tSLInformation.usRxEventOpcode = opcode;
- ninfo("Looking for opcode 0x%x\n", opcode);
- uint16_t event_type;
-
- do
- {
- ninfo("cc3000_wait\n");
- tSLInformation.pucReceivedData = cc3000_wait();
- tSLInformation.usEventOrDataReceived = 1;
- STREAM_TO_UINT16((FAR char *)tSLInformation.pucReceivedData,
- HCI_EVENT_OPCODE_OFFSET, event_type);
-
- if (*tSLInformation.pucReceivedData == HCI_TYPE_EVNT)
- {
- ninfo("Evtn:0x%x\n", event_type);
- }
-
- if (event_type != opcode)
- {
- if (hci_unsolicited_event_handler() == 1)
- {
- ninfo("Processed Event 0x%x want 0x%x\n", event_type, opcode);
- }
- }
- else
- {
- ninfo("Processing opcode 0x%x\n", opcode);
- hci_event_handler(pRetParams, 0, 0);
- }
- }
- while (tSLInformation.usRxEventOpcode != 0);
-
- ninfo("Done for opcode 0x%x\n", opcode);
-}
-
-/****************************************************************************
- * Name: SimpleLinkWaitData
- *
- * Description:
- * Wait for data, pass it to the hci_event_handler and update in a global
- * variable that there is data to read.
- *
- * Input Parameters:
- * pBuf data buffer
- * from from information
- * fromlen from information length
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-void SimpleLinkWaitData(uint8_t *pBuf, uint8_t *from, uint8_t *fromlen)
-{
- /* In the blocking implementation the control to caller will be returned only
- * after the end of current transaction, i.e. only after data will be received
- */
-
- ninfo("Looking for Data\n");
- uint16_t event_type;
- uint16_t opcode = tSLInformation.usRxEventOpcode;
-
- do
- {
- tSLInformation.pucReceivedData = cc3000_wait();
- tSLInformation.usEventOrDataReceived = 1;
-
- if (*tSLInformation.pucReceivedData == HCI_TYPE_DATA)
- {
- tSLInformation.usRxDataPending = 1;
- hci_event_handler(pBuf, from, fromlen);
- break;
- }
- else
- {
- STREAM_TO_UINT16((char *)tSLInformation.pucReceivedData, HCI_EVENT_OPCODE_OFFSET, event_type);
- ninfo("Evtn:0x%x\n", event_type);
-
- if (hci_unsolicited_event_handler() == 1)
- {
- ninfo("Processed Event 0x%x want Data! Opcode 0x%x\n", event_type, opcode);
- }
- else
- {
- ninfo("!!!!!opcode 0x%x\n", opcode);
- }
-
- UNUSED(event_type);
- }
- }
- while (*tSLInformation.pucReceivedData == HCI_TYPE_EVNT);
-
- ninfo("Done for Data 0x%x\n", opcode);
- UNUSED(opcode);
-}
diff --git a/drivers/wireless/cc3000/hci.c b/drivers/wireless/cc3000/hci.c
deleted file mode 100644
index 9d07450943..0000000000
--- a/drivers/wireless/cc3000/hci.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/****************************************************************************
- * drivers/wireless/cc3000/hci.c - CC3000 Host Driver Implementation.
- *
- * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include
-
-#include
-#include
-
-#include
-#include
-#include "cc3000drv.h"
-#include
-#include
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#define SL_PATCH_PORTION_SIZE (1000)
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-/****************************************************************************
- * Name: hci_command_send
- *
- * Description:
- * Initiate an HCI command.
- *
- * Input Parameters:
- * usOpcode command operation code
- * pucBuff pointer to the command's arguments buffer
- * ucArgsLength length of the arguments
- *
- * Returned Value:
- * Zero
- *
- ****************************************************************************/
-
-uint16_t hci_command_send(uint16_t usOpcode, uint8_t *pucBuff,
- uint8_t ucArgsLength)
-{
- uint8_t *stream;
-
- stream = (pucBuff + SPI_HEADER_SIZE);
-
- ninfo("Send 0x%x\n", usOpcode);
- UINT8_TO_STREAM(stream, HCI_TYPE_CMND);
- stream = UINT16_TO_STREAM(stream, usOpcode);
- UINT8_TO_STREAM(stream, ucArgsLength);
-
- /* Update the opcode of the event we will be waiting for */
-
- cc3000_write(pucBuff, ucArgsLength + SIMPLE_LINK_HCI_CMND_HEADER_SIZE);
- ninfo("Send of 0x%x Completed\n", usOpcode);
-
- return 0;
-}
-
-/****************************************************************************
- * Name: hci_data_send
- *
- * Description:
- *
- *
- * Input Parameters:
- * usOpcode command operation code
- * ucArgs pointer to the command's arguments buffer
- * usArgsLength length of the arguments
- * ucTail pointer to the data buffer
- * usTailLength buffer length
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-long hci_data_send(uint8_t ucOpcode, uint8_t *ucArgs, uint16_t usArgsLength,
- uint16_t usDataLength, const uint8_t *ucTail,
- uint16_t usTailLength)
-{
- uint8_t *stream;
-
- stream = ((ucArgs) + SPI_HEADER_SIZE);
-
- UINT8_TO_STREAM(stream, HCI_TYPE_DATA);
- UINT8_TO_STREAM(stream, ucOpcode);
- UINT8_TO_STREAM(stream, usArgsLength);
- stream = UINT16_TO_STREAM(stream, usArgsLength + usDataLength + usTailLength);
-
- /* Send the packet over the SPI */
-
- cc3000_write(ucArgs,
- SIMPLE_LINK_HCI_DATA_HEADER_SIZE + usArgsLength +
- usDataLength + usTailLength);
-
- return ESUCCESS;
-}
-
-/****************************************************************************
- * Name: hci_data_command_send
- *
- * Description:
- * Prepeare HCI header and initiate an HCI data write operation
- *
- * Input Parameters:
- * usOpcode command operation code
- * pucBuff pointer to the data buffer
- * ucArgsLength arguments length
- * ucDataLength data length
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-void hci_data_command_send(uint16_t usOpcode, uint8_t *pucBuff,
- uint8_t ucArgsLength, uint16_t ucDataLength)
-{
- uint8_t *stream = (pucBuff + SPI_HEADER_SIZE);
-
- UINT8_TO_STREAM(stream, HCI_TYPE_DATA);
- UINT8_TO_STREAM(stream, usOpcode);
- UINT8_TO_STREAM(stream, ucArgsLength);
- stream = UINT16_TO_STREAM(stream, ucArgsLength + ucDataLength);
-
- /* Send the command over SPI on data channel */
-
- cc3000_write(pucBuff,
- ucArgsLength + ucDataLength +
- SIMPLE_LINK_HCI_DATA_CMND_HEADER_SIZE);
-}
-
-/****************************************************************************
- * Name: hci_patch_send
- *
- * Description:
- * Prepeare HCI header and initiate an HCI patch write operation
- *
- * Input Parameters:
- * usOpcode command operation code
- * pucBuff pointer to the command's arguments buffer
- * patch pointer to patch content buffer
- * usDataLength data length
- *
- * Returned Value:
- * None
- *
- ****************************************************************************/
-
-void hci_patch_send(uint8_t ucOpcode, uint8_t *pucBuff, char *patch,
- uint16_t usDataLength)
-{
- uint8_t *data_ptr = (pucBuff + SPI_HEADER_SIZE);
- uint16_t usTransLength;
- uint8_t *stream = (pucBuff + SPI_HEADER_SIZE);
-
- UINT8_TO_STREAM(stream, HCI_TYPE_PATCH);
- UINT8_TO_STREAM(stream, ucOpcode);
- stream = UINT16_TO_STREAM(stream,
- usDataLength + SIMPLE_LINK_HCI_PATCH_HEADER_SIZE);
-
- if (usDataLength <= SL_PATCH_PORTION_SIZE)
- {
- UINT16_TO_STREAM(stream, usDataLength);
- stream = UINT16_TO_STREAM(stream, usDataLength);
- memcpy((pucBuff + SPI_HEADER_SIZE) + HCI_PATCH_HEADER_SIZE, patch,
- usDataLength);
-
- /* Update the opcode of the event we will be waiting for */
-
- cc3000_write(pucBuff, usDataLength + HCI_PATCH_HEADER_SIZE);
- }
- else
- {
- usTransLength = (usDataLength/SL_PATCH_PORTION_SIZE);
- UINT16_TO_STREAM(stream,
- usDataLength + SIMPLE_LINK_HCI_PATCH_HEADER_SIZE +
- usTransLength*SIMPLE_LINK_HCI_PATCH_HEADER_SIZE);
- stream = UINT16_TO_STREAM(stream, SL_PATCH_PORTION_SIZE);
- memcpy(pucBuff + SPI_HEADER_SIZE + HCI_PATCH_HEADER_SIZE, patch,
- SL_PATCH_PORTION_SIZE);
- usDataLength -= SL_PATCH_PORTION_SIZE;
- patch += SL_PATCH_PORTION_SIZE;
-
- /* Update the opcode of the event we will be waiting for */
-
- cc3000_write(pucBuff, SL_PATCH_PORTION_SIZE + HCI_PATCH_HEADER_SIZE);
-
- while (usDataLength)
- {
- if (usDataLength <= SL_PATCH_PORTION_SIZE)
- {
- usTransLength = usDataLength;
- usDataLength = 0;
- }
- else
- {
- usTransLength = SL_PATCH_PORTION_SIZE;
- usDataLength -= usTransLength;
- }
-
- *(uint16_t *)data_ptr = usTransLength;
- memcpy(data_ptr + SIMPLE_LINK_HCI_PATCH_HEADER_SIZE, patch,
- usTransLength);
- patch += usTransLength;
-
- /* Update the opcode of the event we will be waiting for */
-
- cc3000_write((uint8_t *)data_ptr, usTransLength + sizeof(usTransLength));
- }
- }
-}
diff --git a/drivers/wireless/cc3000/host_driver_version.h b/drivers/wireless/cc3000/host_driver_version.h
deleted file mode 100644
index e191ba1ae0..0000000000
--- a/drivers/wireless/cc3000/host_driver_version.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/****************************************************************************
-*
-* host_driver_version.h - CC3000 Host Driver Implementation.
-* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions
-* are met:
-*
-* Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-*
-* Redistributions in binary form must reproduce the above copyright
-* notice, this list of conditions and the following disclaimer in the
-* documentation and/or other materials provided with the
-* distribution.
-*
-* Neither the name of Texas Instruments Incorporated nor the names of
-* its contributors may be used to endorse or promote products derived
-* from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*
-*****************************************************************************/
-
-#ifndef __DRIVERS_WIRELESS_CC3000_HOST_DRIVER_VERSION_H
-#define __DRIVERS_WIRELESS_CC3000_HOST_DRIVER_VERSION_H
-
-#define DRIVER_VERSION_NUMBER 13
-
-#endif /* __DRIVERS_WIRELESS_CC3000_HOST_DRIVER_VERSION_H */
diff --git a/drivers/wireless/cc3000/netapp.c b/drivers/wireless/cc3000/netapp.c
deleted file mode 100644
index 648ecb1b89..0000000000
--- a/drivers/wireless/cc3000/netapp.c
+++ /dev/null
@@ -1,541 +0,0 @@
-/****************************************************************************
- * drivers/wireless/cc3000/netapp.c - CC3000 Host Driver Implementation.
- *
- * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include |