BSP430  20141115
Board Support Package for MSP430 microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Macros | Functions | Variables
cc3000.h File Reference

CC3000 Host Driver Interface for BSP430. More...

#include <bsp430/platform.h>
#include <cc3000/cc3000_common.h>

Go to the source code of this file.

Macros

#define BSP430_CC3000_ENABLE_SMART   0
 
#define BSP430_CC3000SPI_RX_BUFFER_SIZE   400
 
#define BSP430_CC3000SPI_TX_BUFFER_SIZE   400
 
#define configBSP430_RF_CC3000BOOST   0
 
#define BSP430_RF_CC3000_SPI_PERIPH_CPPID   include <bsp430/platform.h>
 
#define BSP430_RF_CC3000_SPI_PERIPH_HANDLE   include <bsp430/platform.h>
 
#define BSP430_RF_CC3000_CSn_PORT_PERIPH_HANDLE   include <bsp430/platform.h>
 
#define BSP430_RF_CC3000_IRQn_PORT_PERIPH_HANDLE   include <bsp430/platform.h>
 
#define BSP430_RF_CC3000_PWR_EN_PORT_PERIPH_HANDLE   include <bsp430/platform.h>
 
#define BSP430_RF_CC3000_CSn_PORT_PERIPH_CPPID   include <bsp430/platform.h>
 
#define BSP430_RF_CC3000_CSn_PORT_BIT   include <bsp430/platform.h>
 
#define BSP430_RF_CC3000_IRQn_PORT_PERIPH_CPPID   include <bsp430/platform.h>
 
#define BSP430_RF_CC3000_IRQn_TIMER_PERIPH_CPPID   include <bsp430/platform.h>
 
#define BSP430_RF_CC3000_IRQn_PORT_BIT   include <bsp430/platform.h>
 
#define BSP430_RF_CC3000_IRQn_TIMER_PERIPH_HANDLE   include <bsp430/platform.h>
 
#define BSP430_RF_CC3000_IRQn_TIMER_CCIDX   include <bsp430/platform.h>
 
#define BSP430_RF_CC3000_IRQn_TIMER_CCIS   include <bsp430/platform.h>
 
#define BSP430_RF_CC3000_PWR_EN_PORT_PERIPH_CPPID   include <bsp430/platform.h>
 
#define BSP430_RF_CC3000_PWR_EN_PORT_BIT   include <bsp430/platform.h>
 

Functions

int iBSP430cc3000spiInitialize (tWlanCB wlan_cb, tFWPatches firmware_patch_fn, tDriverPatches driver_patch_fn, tBootLoaderPatches boot_loader_patch_fn)
 

Variables

int iBSP430cc3000IRQrv
 

Detailed Description

CC3000 Host Driver Interface for BSP430.

This file supports a Host Driver SPI interface for the Texas Instruments SimpleLink(TM) CC3000 Wi-Fi SOC.

This file provides only the host driver interface. The host driver itself is a separate library provided by Texas Instruments. A git repository that repackages that driver in a format suitable for linking with user applications is available at http://github.com/pabigot/cc3000.

Homepage
http://github.com/pabigot/bsp430

Macro Definition Documentation

#define BSP430_CC3000_ENABLE_SMART   0

Define externally to a true value when you want the CC3000 Smart Config process to work.

This feature requires that the RX buffer size be a full 1500 octets; setting this flag changes the default value for BSP430_CC3000SPI_RX_BUFFER_SIZE to satisfy that requirement.

Defaulted:
The value here is superseded by previously encountered definitions.
Affects:
BSP430_CC3000SPI_RX_BUFFER_SIZE
#define BSP430_CC3000SPI_RX_BUFFER_SIZE   400

Size of the cc3000spi receive buffer, in octets.

The value is an integer between #CC3000_MINIMAL_RX_SIZE=119 and #CC3000_MAXIMAL_RX_SIZE=1520, unless #CC3000_TINY_DRIVER is defined in which case #CC3000_MAXIMAL_RX_SIZE is 44.

<cc3000/cc3000_common.h> unconditionally defines a CC3000_RX_BUFFER_SIZE constant, but it is not referenced by the driver and is not relevant to this implementation.

Note
The current (SP 1.10.1 and later) CC3000 Smart Config process works by encoding data in the length of UDP packets transmitted to/from port 15000 of the gateway. It is necessary to have at least the RX buffer of the CC3000 at full size in order to receive this information. (Documentation says use 1500; I have observed packets that are 1498 octets, so this is probably accurate.)
Defaulted:
The value here is superseded by previously encountered definitions.
Dependency:
BSP430_CC3000SPI_RX_BUFFER_SIZE
Examples:
rf/cc3000/cli/main.c.
#define BSP430_CC3000SPI_TX_BUFFER_SIZE   400

Size of the cc3000spi transmit buffer, in octets.

The value is an integer between #CC3000_MINIMAL_TX_SIZE=119 and #CC3000_MAXIMAL_TX_SIZE=1520, unless #CC3000_TINY_DRIVER is defined in which case #CC3000_MAXIMAL_TX_SIZE is 59.

<cc3000/cc3000_common.h> unconditionally defines a CC3000_TX_BUFFER_SIZE constant, but it is not referenced by the driver and is not relevant to this implementation.

Defaulted:
The value here is superseded by previously encountered definitions.
Examples:
rf/cc3000/cli/main.c.
#define BSP430_RF_CC3000_CSn_PORT_BIT   include <bsp430/platform.h>

Port bit on BSP430_RF_CC3000_CSn_PORT_PERIPH_HANDLE for CSn.

This is the bit mask, not a bit position.

Examples:
rf/cc3000/cli/main.c.
#define BSP430_RF_CC3000_CSn_PORT_PERIPH_CPPID   include <bsp430/platform.h>

Preprocessor-compatible identifier corresponding to BSP430_RF_CC3000_CSn_PORT_PERIPH_HANDLE.

See also
BSP430_PERIPH_CPPID_NONE
#define BSP430_RF_CC3000_CSn_PORT_PERIPH_HANDLE   include <bsp430/platform.h>

BSP430 peripheral handle for port on which CSn is placed.

The CSn signal is ***FILL IN HERE***

Examples:
rf/cc3000/cli/main.c.
#define BSP430_RF_CC3000_IRQn_PORT_BIT   include <bsp430/platform.h>

Port bit on BSP430_RF_CC3000_IRQn_PORT_PERIPH_HANDLE for IRQn.

This is the bit mask, not a bit position.

Examples:
rf/cc3000/cli/main.c.
#define BSP430_RF_CC3000_IRQn_PORT_PERIPH_CPPID   include <bsp430/platform.h>

Preprocessor-compatible identifier corresponding to BSP430_RF_CC3000_IRQn_PORT_PERIPH_HANDLE.

See also
BSP430_PERIPH_CPPID_NONE
#define BSP430_RF_CC3000_IRQn_PORT_PERIPH_HANDLE   include <bsp430/platform.h>

BSP430 peripheral handle for port on which IRQn is placed.

The IRQn signal is ***FILL IN HERE***

Examples:
rf/cc3000/cli/main.c.
#define BSP430_RF_CC3000_IRQn_TIMER_CCIDX   include <bsp430/platform.h>

The capture/compare index on BSP430_RF_CC3000_IRQn_TIMER_PERIPH_HANDLE corresponding to IRQn.

This macro is defined only if IRQn is connected to a port that supports capture of a timer counter based on signal changes.

See also
BSP430_RF_CC3000_IRQn_TIMER_CCIS
#define BSP430_RF_CC3000_IRQn_TIMER_CCIS   include <bsp430/platform.h>

The capture/compare input selector necessary to capture any signal changes associated with CC3000 IRQn.

This macro is defined only if IRQn is connected to a port that supports capture of a timer counter based on signal changes.

See also
BSP430_RF_CC3000_IRQn_TIMER_CCIDX
#define BSP430_RF_CC3000_IRQn_TIMER_PERIPH_CPPID   include <bsp430/platform.h>

Preprocessor-compatible identifier corresponding to BSP430_RF_CC3000_IRQn_TIMER_PERIPH_HANDLE.

This macro is defined only if IRQn is connected to a port that supports capture of a timer counter based on signal changes.

See also
BSP430_PERIPH_CPPID_NONE
#define BSP430_RF_CC3000_IRQn_TIMER_PERIPH_HANDLE   include <bsp430/platform.h>

BSP430 peripheral handle for timer connected to IRQn.

This macro is defined only if IRQn is connected to a port that supports capture of a timer counter based on signal changes.

#define BSP430_RF_CC3000_PWR_EN_PORT_BIT   include <bsp430/platform.h>

Port bit on BSP430_RF_CC3000_PWR_EN_PORT_PERIPH_HANDLE for PWR_EN.

This is the bit mask, not a bit position.

Examples:
rf/cc3000/cli/main.c.
#define BSP430_RF_CC3000_PWR_EN_PORT_PERIPH_CPPID   include <bsp430/platform.h>

Preprocessor-compatible identifier corresponding to BSP430_RF_CC3000_PWR_EN_PORT_PERIPH_HANDLE.

See also
BSP430_PERIPH_CPPID_NONE
#define BSP430_RF_CC3000_PWR_EN_PORT_PERIPH_HANDLE   include <bsp430/platform.h>

BSP430 peripheral handle for port on which PWR_EN is placed.

The PWR_EN signal is ***FILL IN HERE***

Examples:
rf/cc3000/cli/main.c.
#define BSP430_RF_CC3000_SPI_PERIPH_CPPID   include <bsp430/platform.h>

The CPPID associated with the serial device serving as the SPI interface to the CC3000 radio.

#define BSP430_RF_CC3000_SPI_PERIPH_HANDLE   include <bsp430/platform.h>

The serial peripheral serving as the SPI interface to the CC3000 radio.

Examples:
rf/cc3000/cli/main.c.
#define configBSP430_RF_CC3000BOOST   0

Define to a true value to indicate intent to use a CC3000BOOST boosterpack.

This selects the boosterpack pin mapping in preference to the default RFEM pin mapping.

C Preprocessor Only:
This macro may have a value that restricts its use to C preprocessor conditional directives.
Defaulted:
The value here is superseded by previously encountered definitions.

Function Documentation

int iBSP430cc3000spiInitialize ( tWlanCB  wlan_cb,
tFWPatches  firmware_patch_fn,
tDriverPatches  driver_patch_fn,
tBootLoaderPatches  boot_loader_patch_fn 
)

BSP430 wrapper around CC3000 wlan_init().

This interface provides access to user-level callbacks, and adds the driver-level callbacks internally.

Note
While this function may be called with interrupts disabled, it does nothing but store some configuration information. All other CC3000 operations including wlan_start() should be called with interrupts enabled.
Parameters
wlan_cbsee wlan_init() documentation.
firmware_patch_fnsee wlan_init() documentation. Passing NULL is generally appropriate.
driver_patch_fnsee wlan_init() documentation. Passing NULL is generally appropriate.
boot_loader_patch_fnsee wlan_init() documentation. Passing NULL is generally appropriate.
Returns
0 if all goes well; -1 if one of the underlying BSP430 resources could not be obtained.
Examples:
rf/cc3000/cli/main.c.

Variable Documentation

int iBSP430cc3000IRQrv

A global variable used to communicate the IRQ return value back to the TI driver code, since there is no other way to do that.

Implementations of #tWlanCB passed to iBSP430cc3000spiInitialize() should assign a value consistent with Interrupt Callback Return Values to control wakeup behavior when unsolicited CC3000 events might require the application to wake. The value is cleared to zero prior to invoking the application callback, so if no interrupt chain/wakeup operations are required the variable need not be updated.