TI-RTOS for TivaC  2.14.04.31
WiFi.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
109 #ifndef ti_drivers_WiFi__include
110 #define ti_drivers_WiFi__include
111 
112 #ifdef __cplusplus
113 extern "C" {
114 #endif
115 
116 #include <stdint.h>
117 
129 #define WiFi_CMD_RESERVED 32
130 
143 #define WiFi_STATUS_RESERVED -32
144 
151 #define WiFi_STATUS_SUCCESS 0
152 
159 #define WiFi_STATUS_ERROR -1
160 
168 #define WiFi_STATUS_UNDEFINEDCMD -2
169 
184 typedef void (*WiFi_evntCallback) (long eventType, char *data, unsigned char length);
185 
189 typedef struct WiFi_Config *WiFi_Handle;
190 
199 typedef struct WiFi_Params {
200  uint32_t bitRate;
201  void *custom;
203 } WiFi_Params;
204 
209 typedef void (*WiFi_InitFxn) (WiFi_Handle handle);
210 
215 typedef WiFi_Handle (*WiFi_OpenFxn) (WiFi_Handle handle, unsigned int spiIndex,
216  WiFi_evntCallback evntCallback,
217  WiFi_Params *params);
218 
223 typedef void (*WiFi_CloseFxn) (WiFi_Handle handle);
224 
229 typedef int (*WiFi_ControlFxn) (WiFi_Handle handle,
230  unsigned int cmd,
231  void *arg);
232 
237 typedef struct WiFi_FxnTable {
240 
243 
246 
249 } WiFi_FxnTable;
250 
262 typedef struct WiFi_Config {
265 
267  void *object;
268 
270  void const *hwAttrs;
271 } WiFi_Config;
272 
282 extern void WiFi_close(WiFi_Handle handle);
283 
303 extern int WiFi_control(WiFi_Handle handle, unsigned int cmd, void *arg);
304 
313 extern void WiFi_init(void);
314 
346 extern WiFi_Handle WiFi_open(unsigned int wifiIndex, unsigned int spiIndex,
347  WiFi_evntCallback evntCallback,
348  WiFi_Params *params);
349 
359 extern void WiFi_Params_init(WiFi_Params *params);
360 
361 #ifdef __cplusplus
362 }
363 #endif
364 
365 #endif /* ti_drivers_WiFi__include */
WiFi_InitFxn initFxn
Definition: WiFi.h:245
WiFi_CloseFxn closeFxn
Definition: WiFi.h:239
void(* WiFi_InitFxn)(WiFi_Handle handle)
A function pointer to a driver specific implementation of WiFi_init().
Definition: WiFi.h:209
struct WiFi_Config WiFi_Config
WiFi Global configuration.
The definition of a WiFi function table that contains the required set of functions to control a spec...
Definition: WiFi.h:237
WiFi Global configuration.
Definition: WiFi.h:262
int WiFi_control(WiFi_Handle handle, unsigned int cmd, void *arg)
Function performs implementation specific features on a given WiFi_Handle.
WiFi_ControlFxn controlFxn
Definition: WiFi.h:242
struct WiFi_Config * WiFi_Handle
A handle that is returned from a WiFi_open() call.
Definition: WiFi.h:189
void WiFi_Params_init(WiFi_Params *params)
Function to initialize the WiFi_Params structure to its defaults.
void WiFi_init(void)
Function to initialize the WiFi module.
void * object
Definition: WiFi.h:267
struct WiFi_Params WiFi_Params
WiFi Parameters.
uint32_t bitRate
Definition: WiFi.h:200
struct WiFi_FxnTable WiFi_FxnTable
The definition of a WiFi function table that contains the required set of functions to control a spec...
void(* WiFi_CloseFxn)(WiFi_Handle handle)
A function pointer to a driver specific implementation of WiFi_close().
Definition: WiFi.h:223
void WiFi_close(WiFi_Handle handle)
Function to close a WiFi peripheral specified by the WiFi handle.
WiFi_OpenFxn openFxn
Definition: WiFi.h:248
void * custom
Definition: WiFi.h:201
WiFi_Handle WiFi_open(unsigned int wifiIndex, unsigned int spiIndex, WiFi_evntCallback evntCallback, WiFi_Params *params)
Function to initialize a given WiFi peripheral.
void const * hwAttrs
Definition: WiFi.h:270
WiFi_FxnTable const * fxnTablePtr
Definition: WiFi.h:264
WiFi_Handle(* WiFi_OpenFxn)(WiFi_Handle handle, unsigned int spiIndex, WiFi_evntCallback evntCallback, WiFi_Params *params)
A function pointer to a driver specific implementation of WiFi_open().
Definition: WiFi.h:215
WiFi Parameters.
Definition: WiFi.h:199
void(* WiFi_evntCallback)(long eventType, char *data, unsigned char length)
A typedef to a an unsolicited event callback function.
Definition: WiFi.h:184
int(* WiFi_ControlFxn)(WiFi_Handle handle, unsigned int cmd, void *arg)
A function pointer to a driver specific implementation of WiFi_control().
Definition: WiFi.h:229
Copyright 2015, Texas Instruments Incorporated