TI-RTOS Drivers  tidrivers_full_2_20_00_08
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  */
106 #ifndef ti_drivers_WiFi__include
107 #define ti_drivers_WiFi__include
108 
109 #ifdef __cplusplus
110 extern "C" {
111 #endif
112 
113 #include <stdint.h>
114 
132 #define WiFi_CMD_RESERVED 32
133 
146 #define WiFi_STATUS_RESERVED -32
147 
161 #define WiFi_STATUS_SUCCESS 0
162 
169 #define WiFi_STATUS_ERROR -1
170 
178 #define WiFi_STATUS_UNDEFINEDCMD -2
179 
189 /* Add WiFi_CMD_<commands> here */
190 
209 typedef void (*WiFi_evntCallback) (long eventType, char *data, unsigned char length);
210 
214 typedef struct WiFi_Config *WiFi_Handle;
215 
224 typedef struct WiFi_Params {
225  uint32_t bitRate;
226  uint32_t spawnTaskPri;
227  uintptr_t custom;
229 } WiFi_Params;
230 
235 typedef void (*WiFi_InitFxn) (WiFi_Handle handle);
236 
241 typedef WiFi_Handle (*WiFi_OpenFxn) (WiFi_Handle handle, unsigned int spiIndex,
242  WiFi_evntCallback evntCallback,
243  WiFi_Params *params);
244 
249 typedef void (*WiFi_CloseFxn) (WiFi_Handle handle);
250 
255 typedef int (*WiFi_ControlFxn) (WiFi_Handle handle,
256  unsigned int cmd,
257  void *arg);
258 
263 typedef struct WiFi_FxnTable {
266 
269 
272 
275 } WiFi_FxnTable;
276 
288 typedef struct WiFi_Config {
291 
293  void *object;
294 
296  void const *hwAttrs;
297 } WiFi_Config;
298 
308 extern void WiFi_close(WiFi_Handle handle);
309 
347 extern int WiFi_control(WiFi_Handle handle, unsigned int cmd, void *arg);
348 
357 extern void WiFi_init(void);
358 
390 extern WiFi_Handle WiFi_open(unsigned int wifiIndex, unsigned int spiIndex,
391  WiFi_evntCallback evntCallback,
392  WiFi_Params *params);
393 
403 extern void WiFi_Params_init(WiFi_Params *params);
404 
405 #ifdef __cplusplus
406 }
407 #endif
408 
409 #endif /* ti_drivers_WiFi__include */
uintptr_t custom
Definition: WiFi.h:227
WiFi_InitFxn initFxn
Definition: WiFi.h:271
WiFi_CloseFxn closeFxn
Definition: WiFi.h:265
void(* WiFi_InitFxn)(WiFi_Handle handle)
A function pointer to a driver specific implementation of WiFi_init().
Definition: WiFi.h:235
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:263
WiFi Global configuration.
Definition: WiFi.h:288
int WiFi_control(WiFi_Handle handle, unsigned int cmd, void *arg)
Function performs implementation specific features on a given WiFi_Handle.
uint32_t spawnTaskPri
Definition: WiFi.h:226
WiFi_ControlFxn controlFxn
Definition: WiFi.h:268
struct WiFi_Config * WiFi_Handle
A handle that is returned from a WiFi_open() call.
Definition: WiFi.h:214
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:293
struct WiFi_Params WiFi_Params
WiFi Parameters.
uint32_t bitRate
Definition: WiFi.h:225
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:249
void WiFi_close(WiFi_Handle handle)
Function to close a WiFi peripheral specified by the WiFi handle.
WiFi_OpenFxn openFxn
Definition: WiFi.h:274
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:296
WiFi_FxnTable const * fxnTablePtr
Definition: WiFi.h:290
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:241
WiFi Parameters.
Definition: WiFi.h:224
void(* WiFi_evntCallback)(long eventType, char *data, unsigned char length)
A typedef to a an unsolicited event callback function.
Definition: WiFi.h:209
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:255
Copyright 2016, Texas Instruments Incorporated