SimpleLink API Reference Manual  1.11.1
 All Data Structures Files Functions Variables Typedefs Macros Groups
cc3000_common.h File Reference
#include <stdlib.h>
#include <errno.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  timeval
 
struct  sSimplLinkInformation
 

Macros

#define ESUCCESS   0
 
#define EFAIL   -1
 
#define EERROR   EFAIL
 
#define ERROR_SOCKET_INACTIVE   -57
 
#define WLAN_ENABLE   (1)
 
#define WLAN_DISABLE   (0)
 
#define MAC_ADDR_LEN   (6)
 
#define SP_PORTION_SIZE   (32)
 
#define CC3000_MINIMAL_RX_SIZE   (130 + 1)
 
#define CC3000_MAXIMAL_RX_SIZE   (1519 + 1)
 
#define CC3000_MINIMAL_TX_SIZE   (130 + 1)
 
#define CC3000_MAXIMAL_TX_SIZE   (1519 + 1)
 
#define CC3000_RX_BUFFER_SIZE   (CC3000_MINIMAL_RX_SIZE)
 
#define CC3000_TX_BUFFER_SIZE   (CC3000_MINIMAL_TX_SIZE)
 
#define UINT8_TO_STREAM(_p, _val)   {*(_p)++ = (_val);}
 
#define UINT16_TO_STREAM(_p, _u16)   (UINT16_TO_STREAM_f(_p, _u16))
 
#define UINT32_TO_STREAM(_p, _u32)   (UINT32_TO_STREAM_f(_p, _u32))
 
#define ARRAY_TO_STREAM(p, a, l)   {register short _i; for (_i = 0; _i < l; _i++) *(p)++ = ((unsigned char *) a)[_i];}
 
#define STREAM_TO_UINT8(_p, _offset, _u8)   {_u8 = (unsigned char)(*(_p + _offset));}
 
#define STREAM_TO_UINT16(_p, _offset, _u16)   {_u16 = STREAM_TO_UINT16_f(_p, _offset);}
 
#define STREAM_TO_UINT32(_p, _offset, _u32)   {_u32 = STREAM_TO_UINT32_f(_p, _offset);}
 
#define STREAM_TO_STREAM(p, a, l)   {register short _i; for (_i = 0; _i < l; _i++) *(a)++= ((unsigned char *) p)[_i];}
 

Typedefs

typedef long time_t
 
typedef unsigned long clock_t
 
typedef long suseconds_t
 
typedef struct timeval timeval
 
typedef char *(* tFWPatches )(unsigned long *usLength)
 
typedef char *(* tDriverPatches )(unsigned long *usLength)
 
typedef char *(* tBootLoaderPatches )(unsigned long *usLength)
 
typedef void(* tWlanCB )(long event_type, char *data, unsigned char length)
 
typedef long(* tWlanReadInteruptPin )(void)
 
typedef void(* tWlanInterruptEnable )(void)
 
typedef void(* tWlanInterruptDisable )(void)
 
typedef void(* tWriteWlanPin )(unsigned char val)
 

Functions

void SimpleLinkWaitEvent (unsigned short usOpcode, void *pRetParams)
 Wait for event, pass it to the hci_event_handler and update the event opcode in a global variable.
 
void SimpleLinkWaitData (unsigned char *pBuf, unsigned char *from, unsigned char *fromlen)
 Wait for data, pass it to the hci_event_handler and update in a global variable that there is data to read.
 
unsigned char * UINT32_TO_STREAM_f (unsigned char *p, unsigned long u32)
 This function is used for copying 32 bit to stream while converting to little endian format.
 
unsigned char * UINT16_TO_STREAM_f (unsigned char *p, unsigned short u16)
 This function is used for copying 16 bit to stream while converting to little endian format.
 
unsigned short STREAM_TO_UINT16_f (char *p, unsigned short offset)
 This function is used for copying received stream to 16 bit in little endian format.
 
unsigned long STREAM_TO_UINT32_f (char *p, unsigned short offset)
 This function is used for copying received stream to 32 bit in little endian format.
 

Variables

volatile sSimplLinkInformation tSLInformation
 

Macro Definition Documentation

#define ESUCCESS   0

Definition at line 58 of file cc3000_common.h.

#define EFAIL   -1

Definition at line 59 of file cc3000_common.h.

#define EERROR   EFAIL

Definition at line 60 of file cc3000_common.h.

#define ERROR_SOCKET_INACTIVE   -57

Definition at line 65 of file cc3000_common.h.

#define WLAN_ENABLE   (1)

Definition at line 67 of file cc3000_common.h.

#define WLAN_DISABLE   (0)

Definition at line 68 of file cc3000_common.h.

#define MAC_ADDR_LEN   (6)

Definition at line 70 of file cc3000_common.h.

#define SP_PORTION_SIZE   (32)

Definition at line 72 of file cc3000_common.h.

#define CC3000_MINIMAL_RX_SIZE   (130 + 1)

Definition at line 105 of file cc3000_common.h.

#define CC3000_MAXIMAL_RX_SIZE   (1519 + 1)

Definition at line 106 of file cc3000_common.h.

#define CC3000_MINIMAL_TX_SIZE   (130 + 1)

Definition at line 127 of file cc3000_common.h.

#define CC3000_MAXIMAL_TX_SIZE   (1519 + 1)

Definition at line 128 of file cc3000_common.h.

#define CC3000_RX_BUFFER_SIZE   (CC3000_MINIMAL_RX_SIZE)

Definition at line 147 of file cc3000_common.h.

#define CC3000_TX_BUFFER_SIZE   (CC3000_MINIMAL_TX_SIZE)

Definition at line 148 of file cc3000_common.h.

#define UINT8_TO_STREAM (   _p,
  _val 
)    {*(_p)++ = (_val);}

Definition at line 330 of file cc3000_common.h.

#define UINT16_TO_STREAM (   _p,
  _u16 
)    (UINT16_TO_STREAM_f(_p, _u16))

Definition at line 332 of file cc3000_common.h.

#define UINT32_TO_STREAM (   _p,
  _u32 
)    (UINT32_TO_STREAM_f(_p, _u32))

Definition at line 334 of file cc3000_common.h.

#define ARRAY_TO_STREAM (   p,
  a,
 
)    {register short _i; for (_i = 0; _i < l; _i++) *(p)++ = ((unsigned char *) a)[_i];}

Definition at line 336 of file cc3000_common.h.

#define STREAM_TO_UINT8 (   _p,
  _offset,
  _u8 
)    {_u8 = (unsigned char)(*(_p + _offset));}

Definition at line 338 of file cc3000_common.h.

#define STREAM_TO_UINT16 (   _p,
  _offset,
  _u16 
)    {_u16 = STREAM_TO_UINT16_f(_p, _offset);}

Definition at line 340 of file cc3000_common.h.

#define STREAM_TO_UINT32 (   _p,
  _offset,
  _u32 
)    {_u32 = STREAM_TO_UINT32_f(_p, _offset);}

Definition at line 342 of file cc3000_common.h.

#define STREAM_TO_STREAM (   p,
  a,
 
)    {register short _i; for (_i = 0; _i < l; _i++) *(a)++= ((unsigned char *) p)[_i];}

Definition at line 343 of file cc3000_common.h.

Typedef Documentation

typedef long time_t

Definition at line 160 of file cc3000_common.h.

typedef unsigned long clock_t

Definition at line 161 of file cc3000_common.h.

typedef long suseconds_t

Definition at line 162 of file cc3000_common.h.

typedef struct timeval timeval

Definition at line 164 of file cc3000_common.h.

typedef char*(* tFWPatches)(unsigned long *usLength)

Definition at line 172 of file cc3000_common.h.

typedef char*(* tDriverPatches)(unsigned long *usLength)

Definition at line 174 of file cc3000_common.h.

typedef char*(* tBootLoaderPatches)(unsigned long *usLength)

Definition at line 176 of file cc3000_common.h.

typedef void(* tWlanCB)(long event_type, char *data, unsigned char length)

Definition at line 178 of file cc3000_common.h.

typedef long(* tWlanReadInteruptPin)(void)

Definition at line 180 of file cc3000_common.h.

typedef void(* tWlanInterruptEnable)(void)

Definition at line 182 of file cc3000_common.h.

typedef void(* tWlanInterruptDisable)(void)

Definition at line 184 of file cc3000_common.h.

typedef void(* tWriteWlanPin)(unsigned char val)

Definition at line 186 of file cc3000_common.h.

Function Documentation

void SimpleLinkWaitEvent ( unsigned short  usOpcode,
void *  pRetParams 
)

Wait for event, pass it to the hci_event_handler and update the event opcode in a global variable.

SimpleLinkWaitEvent

Parameters
usOpcodecommand operation code
pRetParamscommand return parameters
Returns
none
void SimpleLinkWaitData ( unsigned char *  pBuf,
unsigned char *  from,
unsigned char *  fromlen 
)

Wait for data, pass it to the hci_event_handler and update in a global variable that there is data to read.

SimpleLinkWaitData

Parameters
pBufdata buffer
fromfrom information
fromlenfrom information length
Returns
none
unsigned char* UINT32_TO_STREAM_f ( unsigned char *  p,
unsigned long  u32 
)

This function is used for copying 32 bit to stream while converting to little endian format.

UINT32_TO_STREAM_f

Parameters
ppointer to the new stream
u32pointer to the 32 bit
Returns
pointer to the new stream
unsigned char* UINT16_TO_STREAM_f ( unsigned char *  p,
unsigned short  u16 
)

This function is used for copying 16 bit to stream while converting to little endian format.

UINT16_TO_STREAM_f

Parameters
ppointer to the new stream
u32pointer to the 16 bit
Returns
pointer to the new stream
unsigned short STREAM_TO_UINT16_f ( char *  p,
unsigned short  offset 
)

This function is used for copying received stream to 16 bit in little endian format.

STREAM_TO_UINT16_f

Parameters
ppointer to the stream
offsetoffset in the stream
Returns
pointer to the new 16 bit
unsigned long STREAM_TO_UINT32_f ( char *  p,
unsigned short  offset 
)

This function is used for copying received stream to 32 bit in little endian format.

STREAM_TO_UINT32_f

Parameters
ppointer to the stream
offsetoffset in the stream
Returns
pointer to the new 32 bit

Variable Documentation

volatile sSimplLinkInformation tSLInformation