Arduino-SPI
Serial Peripheral Interface (SPI) library for Arduino
|
#include <SPI.h>
Public Member Functions | |
SPI () | |
virtual void | acquire (uint8_t mode, uint8_t bitorder, uint8_t scale) |
virtual void | release () |
virtual uint8_t | transfer (uint8_t value) |
virtual uint8_t | prescale (uint32_t frequency) |
virtual void | transfer (void *dest, const void *src, size_t count) |
SPI & | operator>> (uint8_t &value) |
SPI & | operator<< (uint8_t value) |
virtual void | read (void *buf, size_t count) |
virtual void | write (const void *buf, size_t count) |
Static Public Attributes | |
static const uint32_t | MAX_FREQ = F_CPU / 2 |
Protected Member Functions | |
void | lock () |
void | unlock () |
Protected Attributes | |
GPIO< SCK_PIN > | m_sck |
GPIO< MOSI_PIN > | m_mosi |
GPIO< MISO_PIN > | m_miso |
bool | m_cpha |
uint8_t | m_bitorder |
volatile bool | m_busy |
|
inline |
|
inlinevirtual |
|
inlineinherited |
|
inlineinherited |
|
inlinevirtualinherited |
Calculate clock prescale from device frequency.
[in] | frequency | device access. |
Reimplemented in Hardware::SPI.
|
inlinevirtualinherited |
Read given number of bytes from device and store in buffer.
[in] | buf | buffer pointer. |
[in] | count | number of bytes. |
Reimplemented in Hardware::SPI, and Hardware::SPI.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtualinherited |
Transfer given number of bytes from source buffer to device. Store received bytes in destination buffer.
[in] | dest | destination buffer. |
[in] | src | source buffer. |
[in] | count | number of bytes to transfer. |
Reimplemented in Hardware::SPI, and Hardware::SPI.
|
inlineprotectedinherited |
|
inlinevirtualinherited |
Write given number of bytes from buffer to device.
[in] | buf | buffer pointer. |
[in] | count | number of bytes. |
Reimplemented in Hardware::SPI, and Hardware::SPI.
|
protected |
|
protectedinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticinherited |