Driver for CC3000 Wi-Fi module

Dependencies:   NVIC_set_all_priorities

Dependents:   CC3000_Simple_Socket Wi-Go_IOT_Demo

Embed: (wiki syntax)

« Back to documentation index

Cc3000_spi_hci

Cc3000_spi_hci

Functions

long SpiFirstWrite (unsigned char *ucBuf, unsigned short usLength)
 First SPI write after powerup (delay needed between SPI header and body)
void SpiWriteDataSynchronous (unsigned char *data, unsigned short size)
 Low level SPI write.
void SpiReadDataSynchronous (unsigned char *data, unsigned short size)
 Low level SPI read.
long SpiReadDataCont (void)
 Process the received SPI Header and in accordance with it - continue reading the packet.
void SpiOpen (gcSpiHandleRx pfRxHandler)
 Open the SPI interface.
void SpiClose (void)
 Close the SPI interface.
long SpiWrite (unsigned char *pUserBuffer, unsigned short usLength)
 SPI Write function.
void WLAN_IRQHandler (void)
 SPI interrupt Handler.
unsigned short hci_command_send (unsigned short usOpcode, unsigned char *ucArgs, unsigned char ucArgsLength)
 Send a HCI command.
long hci_data_send (unsigned char ucOpcode, unsigned char *ucArgs, unsigned short usArgsLength, unsigned short usDataLength, const unsigned char *ucTail, unsigned short usTailLength)
 Send HCI data.
void hci_data_command_send (unsigned short usOpcode, unsigned char *pucBuff, unsigned char ucArgsLength, unsigned short ucDataLength)
 Prepare HCI header and send HCI data.
void hci_patch_send (unsigned char ucOpcode, unsigned char *pucBuff, char *patch, unsigned short usDataLength)
 Prepare HCI header and send HCI patch.

Function Documentation

unsigned short hci_command_send ( unsigned short  usOpcode,
unsigned char *  ucArgs,
unsigned char  ucArgsLength 
)

Send a HCI command.

Parameters:
usOpcodecommand operation code
pucBuffpointer to the command's arguments buffer
ucArgsLengthlength of the arguments
Returns:
none

Definition at line 275 of file cc3000_spi_hci.cpp.

void hci_data_command_send ( unsigned short  usOpcode,
unsigned char *  pucBuff,
unsigned char  ucArgsLength,
unsigned short  ucDataLength 
)

Prepare HCI header and send HCI data.

Parameters:
usOpcodecommand operation code
pucBuffpointer to the data buffer
ucArgsLengtharguments length
ucDataLengthdata length
Returns:
none

Definition at line 313 of file cc3000_spi_hci.cpp.

long hci_data_send ( unsigned char  ucOpcode,
unsigned char *  ucArgs,
unsigned short  usArgsLength,
unsigned short  usDataLength,
const unsigned char *  ucTail,
unsigned short  usTailLength 
)

Send HCI data.

Parameters:
usOpcodecommand operation code
ucArgspointer to the command's arguments buffer
usArgsLengthlength of the arguments
ucTailpointer to the data buffer
usTailLengthbuffer length
Returns:
none

Definition at line 290 of file cc3000_spi_hci.cpp.

void hci_patch_send ( unsigned char  ucOpcode,
unsigned char *  pucBuff,
char *  patch,
unsigned short  usDataLength 
)

Prepare HCI header and send HCI patch.

Parameters:
usOpcodecommand operation code
pucBuffpointer to the command's arguments buffer
patchpointer to patch content buffer
usDataLengthdata length
Returns:
none

Definition at line 332 of file cc3000_spi_hci.cpp.

void SpiClose ( void   )

Close the SPI interface.

Parameters:
none
Returns:
none

Definition at line 56 of file cc3000_spi_hci.cpp.

long SpiFirstWrite ( unsigned char *  ucBuf,
unsigned short  usLength 
)

First SPI write after powerup (delay needed between SPI header and body)

Parameters:
pointerto write buffer
bufferlength
Returns:
none

Definition at line 80 of file cc3000_spi_hci.cpp.

void SpiOpen ( gcSpiHandleRx  pfRxHandler )

Open the SPI interface.

Parameters:
pointerto RX handle
Returns:
none

Definition at line 66 of file cc3000_spi_hci.cpp.

long SpiReadDataCont ( void   )

Process the received SPI Header and in accordance with it - continue reading the packet.

Parameters:
None
Returns:
0

Definition at line 178 of file cc3000_spi_hci.cpp.

void SpiReadDataSynchronous ( unsigned char *  data,
unsigned short  size 
)

Low level SPI read.

Parameters:
pointerto data buffer
numberof bytes
Returns:
none

Definition at line 168 of file cc3000_spi_hci.cpp.

long SpiWrite ( unsigned char *  pUserBuffer,
unsigned short  usLength 
)

SPI Write function.

Parameters:
pointerto write buffer
bufferlength
Returns:
0

Definition at line 100 of file cc3000_spi_hci.cpp.

void SpiWriteDataSynchronous ( unsigned char *  data,
unsigned short  size 
)

Low level SPI write.

Parameters:
pointerto data buffer
numberof bytes
Returns:
none

Definition at line 158 of file cc3000_spi_hci.cpp.

void WLAN_IRQHandler ( void   )

SPI interrupt Handler.

The external WLAN device asserts the IRQ line when data is ready.
The host CPU needs to acknowledges the IRQ by asserting CS.

Parameters:
none
Returns:
none

Definition at line 229 of file cc3000_spi_hci.cpp.