Added mutex for multiple SPI devices on the same SPI bus
Fork of cc3000_hostdriver_mbedsocket by
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, Mutex &mutex, 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 1072 of file cc3000.h.
Constructor & Destructor Documentation
| cc3000_spi | ( | PinName | cc3000_irq, |
| PinName | cc3000_en, | ||
| PinName | cc3000_cs, | ||
| SPI | cc3000_spi, | ||
| Mutex & | mutex, | ||
| cc3000_event & | event, | ||
| cc3000_simple_link & | simple_link | ||
| ) |
Ctor.
- Parameters:
-
irq IRQ pin cc3000_en Enable pin cc3000_cs Chip select pin cc3000_spi SPI object irq_port Port for IRQ pin (needed for enable/disable interrupts) event Reference to the event object. simple_link Reference to the simple link object.
- Returns:
- none
Definition at line 46 of file cc3000_spi.cpp.
| ~cc3000_spi | ( | ) |
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:
-
buffer pointer to write buffer length buffer length
- Returns:
- 0
Definition at line 92 of file cc3000_spi.cpp.
| void open | ( | ) |
| 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 174 of file cc3000_spi.cpp.
| void read_synchronous | ( | uint8_t * | data, |
| uint16_t | size | ||
| ) |
Low level SPI read.
- Parameters:
-
data pointer to data buffer size number of bytes
- Returns:
- none
Definition at line 168 of file cc3000_spi.cpp.
| void set_wlan_en | ( | uint8_t | value ) |
Enable/Disable the WLAN module.
- Parameters:
-
value 1 : Enable 0 : Disable
- Returns:
- None
Definition at line 214 of file cc3000_spi.cpp.
| void wlan_irq_disable | ( | ) |
| void wlan_irq_enable | ( | ) |
| 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 222 of file cc3000_spi.cpp.
| uint32_t write | ( | uint8_t * | buffer, |
| uint16_t | length | ||
| ) |
SPI Write function.
- Parameters:
-
buffer pointer to write buffer length buffer length
- Returns:
- 0
Definition at line 109 of file cc3000_spi.cpp.
| void write_synchronous | ( | uint8_t * | data, |
| uint16_t | size | ||
| ) |
Low level SPI write.
- Parameters:
-
data pointer to data buffer size number of bytes
- Returns:
- none
Definition at line 161 of file cc3000_spi.cpp.
Generated on Thu Jul 14 2022 05:00:36 by
1.7.2
