TI-RTOS Drivers  tidrivers_tivac_2_16_00_08
Data Structures | Typedefs | Variables
WiFiCC3100.h File Reference

Detailed Description

WiFi driver implementation for the SimpleLink Wi-Fi CC3100 device.

===========================================================================

The WiFi header file should be included in the application as follows:

Refer to WiFi.h for a complete description of APIs & example of use.

This WiFi driver implementation is designed for the SimpleLink Wi-Fi CC3100 device on a host processor. One of the host device's SPI (SSI) peripherals will be utilized by the driver as well as its corresponding DMA channels. This means that in addition to a WiFi_config array, a SPI_config array with a host device-specific SPI entry must be provided. See SPI.h for more details.

The SPI transport layer used by the CC3100 uses an IRQ line to signal the host processor to perform an action. The pin, port, and interrupt number for the IRQ pin are configured in the WiFiCC3100_HWAttrs structure. Note that no other pins on this GPIO port will be able to use GPIO interrupts while the WiFi driver is in use.

This WiFi driver implementation provides the SPI transport layer required by the SimpleLink Host Driver. In the case of unsolicited events that require the application to make decisions (such as an unsolicited disconnect from an AP), the SimpleLink Host Driver specifies callbacks which must be modified to fit application requirements. Contrary to other WiFi driver implementations, callback function pointers are not provided to WiFi_open() as arguments. An example of how to modify the SimpleLink Host Driver callbacks is shown below:

void SimpleLinkWlanEventHandler(SlWlanEvent_t *pArgs)
{
switch(pArgs->Event){
case SL_WLAN_CONNECT_EVENT:
// CC3100 connected to an AP
deviceConnected = true;
break;
case SL_WLAN_DISCONNECT_EVENT:
// CC3100 disconnected from an AP
deviceConnected = false;
break;
case SL_WLAN_SMART_CONFIG_START_EVENT:
break;
case SL_WLAN_SMART_CONFIG_STOP_EVENT:
break;
}
}
void function0()
{
WiFi_Handle handle;
WiFi_Params params;
WiFi_Params_init(&params);
handle = WiFi_open(WiFi_configIndex, SPI_configIndex, NULL, &params);
if (!handle) {
System_abort("WiFi did not open");
}
// Wi-Fi device's host driver APIs (such as socket()) may now be used
}

For a list of all events and details on what data they may provide, see the Porting - Event Handlers section of the SimpleLink Host Driver API reference guide on SimpleLink Wi-Fi CC3100 Wiki.

The SimpleLink Host Driver APIs sl_Start() must be called by the user application to start the network processor. Additionally, sl_Start() and *sl_Stop() can be called by the application to restart the CC3100 without having to close and reopen the WiFi Driver instance.

The SimpleLink Host Driver for the CC3100 device is provided by TI-RTOS in the following directory in the TI-RTOS installation:

For more on the SimpleLink Host Driver APIs, the CC3100 SDK and to download Doxygen APIs see SimpleLink Wi-Fi CC3100 Wiki.


#include <ti/sysbios/family/arm/m3/Hwi.h>
#include <ti/drivers/SPI.h>
#include <ti/drivers/WiFi.h>
Include dependency graph for WiFiCC3100.h:

Go to the source code of this file.

Data Structures

struct  WiFiCC3100_HWAttrs
 WiFiCC3100 Hardware attributes. More...
 
struct  WiFiCC3100_Object
 WiFiCC3100 Object. More...
 

Typedefs

typedef struct WiFiCC3100_HWAttrs WiFiCC3100_HWAttrs
 WiFiCC3100 Hardware attributes. More...
 
typedef struct WiFiCC3100_Object WiFiCC3100_Object
 WiFiCC3100 Object. More...
 

Variables

const WiFi_FxnTable WiFiCC3100_fxnTable
 WiFi function table for CC3100 devices. More...
 

Typedef Documentation

WiFiCC3100 Hardware attributes.

These fields are used by driverlib APIs and therefore must be populated by driverlib macro definitions. These definitions are found in: For TivaWare:

  • inc/hw_memap.h
  • inc/hw_ints.h
  • driverlib/gpio.h

For MSP430Ware:

  • gpio.h

A sample structure is shown below:

1 const WiFiCC3100_HWAttrs wiFiCC3100HWAttrs[] = {
2  // TivaWare example
3  {
4  .irqPort = GPIO_PORTM_BASE,
5  .irqPin = GPIO_PIN_3,
6  .irqIntNum = INT_GPIOM,
7 
8  .csPort = GPIO_PORTH_BASE,
9  .csPin = GPIO_PIN_2,
10 
11  .enPort = GPIO_PORTC_BASE,
12  .enPin = GPIO_PIN_6
13  }
14  // MSP430Ware example
15  {
16  .irqPort = GPIO_PORT_P1,
17  .irqPin = GPIO_PIN2,
18  .irqIntNum = 39,
19 
20  .csPort = GPIO_PORT_P3,
21  .csPin = GPIO_PIN0,
22 
23  .enPort = GPIO_PORT_P4,
24  .enPin = GPIO_PIN3
25  }
26 };

WiFiCC3100 Object.

The application must not access any member variables of this structure!

Variable Documentation

const WiFi_FxnTable WiFiCC3100_fxnTable

WiFi function table for CC3100 devices.

Copyright 2016, Texas Instruments Incorporated