cc3000 hostdriver with the mbed socket interface

Dependents:   cc3000_hello_world_demo cc3000_simple_socket_demo cc3000_ntp_demo cc3000_ping_demo ... more

Embed: (wiki syntax)

« Back to documentation index

cc3000_spi Class Reference

cc3000_spi Class Reference

SPI communication layer. More...

#include <cc3000.h>

Public Member Functions

 cc3000_spi (PinName cc3000_irq, PinName cc3000_en, PinName cc3000_cs, SPI cc3000_spi, cc3000_event &event, cc3000_simple_link &simple_link)
 Ctor.
 ~cc3000_spi ()
 Dtor.
void close ()
 Close SPI - disables IRQ and set received buffer to 0.
void open ()
 Open the SPI interface.
uint32_t first_write (uint8_t *buffer, uint16_t length)
 First SPI write after powerup (delay needed between SPI header and body)
uint32_t write (uint8_t *buffer, uint16_t length)
 SPI Write function.
void write_synchronous (uint8_t *data, uint16_t size)
 Low level SPI write.
void read_synchronous (uint8_t *data, uint16_t size)
 Low level SPI read.
uint32_t read_data_cont ()
 Process the received SPI Header and in accordance with it - continue reading the packet.
void wlan_irq_enable ()
 Enable WLAN interrutp.
void wlan_irq_disable ()
 Disable WLAN interrutp.
uint32_t wlan_irq_read ()
 Get WLAN interrupt status.
void WLAN_IRQHandler ()
 SPI interrupt Handler.
void set_wlan_en (uint8_t value)
 Enable/Disable the WLAN module.

Detailed Description

SPI communication layer.

Definition at line 1071 of file cc3000.h.


Constructor & Destructor Documentation

cc3000_spi ( PinName  cc3000_irq,
PinName  cc3000_en,
PinName  cc3000_cs,
SPI  cc3000_spi,
cc3000_event event,
cc3000_simple_link simple_link 
)

Ctor.

Parameters:
irqIRQ pin
cc3000_enEnable pin
cc3000_csChip select pin
cc3000_spiSPI object
irq_portPort for IRQ pin (needed for enable/disable interrupts)
eventReference to the event object.
simple_linkReference to the simple link object.
Returns:
none

Definition at line 46 of file cc3000_spi.cpp.

~cc3000_spi (  )

Dtor.

Parameters:
none
Returns:
none

Definition at line 58 of file cc3000_spi.cpp.


Member Function Documentation

void close (  )

Close SPI - disables IRQ and set received buffer to 0.

Parameters:
none
Returns:
none

Definition at line 81 of file cc3000_spi.cpp.

uint32_t first_write ( uint8_t *  buffer,
uint16_t  length 
)

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

Parameters:
bufferpointer to write buffer
lengthbuffer length
Returns:
0

Definition at line 92 of file cc3000_spi.cpp.

void open (  )

Open the SPI interface.

Parameters:
none
Returns:
none

Definition at line 85 of file cc3000_spi.cpp.

uint32_t read_data_cont (  )

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

Parameters:
None
Returns:
0

Definition at line 171 of file cc3000_spi.cpp.

void read_synchronous ( uint8_t *  data,
uint16_t  size 
)

Low level SPI read.

Parameters:
datapointer to data buffer
sizenumber of bytes
Returns:
none

Definition at line 165 of file cc3000_spi.cpp.

void set_wlan_en ( uint8_t  value )

Enable/Disable the WLAN module.

Parameters:
value1 : Enable 0 : Disable
Returns:
None

Definition at line 211 of file cc3000_spi.cpp.

void wlan_irq_disable (  )

Disable WLAN interrutp.

Parameters:
None
Returns:
None

Definition at line 72 of file cc3000_spi.cpp.

void wlan_irq_enable (  )

Enable WLAN interrutp.

Parameters:
None
Returns:
None

Definition at line 62 of file cc3000_spi.cpp.

uint32_t wlan_irq_read (  )

Get WLAN interrupt status.

Parameters:
None
Returns:
0 : No interrupt occured 1 : Interrupt occured

Definition at line 77 of file cc3000_spi.cpp.

void WLAN_IRQHandler (  )

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 219 of file cc3000_spi.cpp.

uint32_t write ( uint8_t *  buffer,
uint16_t  length 
)

SPI Write function.

Parameters:
bufferpointer to write buffer
lengthbuffer length
Returns:
0

Definition at line 107 of file cc3000_spi.cpp.

void write_synchronous ( uint8_t *  data,
uint16_t  size 
)

Low level SPI write.

Parameters:
datapointer to data buffer
sizenumber of bytes
Returns:
none

Definition at line 158 of file cc3000_spi.cpp.