#include <SPI.h>
|
| SPI () |
|
virtual uint8_t | prescale (uint32_t frequency) |
|
virtual void | acquire (uint8_t mode, uint8_t bitorder, uint8_t prescale) |
|
virtual uint8_t | transfer (uint8_t value) |
|
virtual void | transfer (void *dest, const void *src, size_t count) |
|
virtual void | read (void *buf, size_t count) |
|
virtual void | write (const void *buf, size_t count) |
|
| SPI () |
|
virtual void | acquire (uint8_t mode, uint8_t bitorder, uint8_t scale) |
|
virtual uint8_t | transfer (uint8_t value) |
|
virtual void | transfer (void *dest, const void *src, size_t count) |
|
virtual void | read (void *buf, size_t count) |
|
virtual void | write (const void *buf, size_t count) |
|
virtual void | release () |
|
SPI & | operator>> (uint8_t &value) |
|
SPI & | operator<< (uint8_t value) |
|
|
static const uint32_t | MAX_FREQ = F_CPU / 2 |
|
Definition at line 31 of file SPI.h.
Serial Perpheral Interface (SPI) constructor.
Definition at line 36 of file SPI.h.
Serial Perpheral Interface (SPI) constructor.
Definition at line 35 of file SPI.h.
virtual void Hardware::SPI::acquire |
( |
uint8_t |
mode, |
|
|
uint8_t |
bitorder, |
|
|
uint8_t |
scale |
|
) |
| |
|
inlinevirtual |
Acquire bus access. Yield until bus is released.
- Parameters
-
[in] | mode | of access. |
[in] | bitorder | of serial data. |
[in] | scale | clock frequency. |
Reimplemented from SPI.
Definition at line 44 of file SPI.h.
virtual void Hardware::SPI::acquire |
( |
uint8_t |
mode, |
|
|
uint8_t |
bitorder, |
|
|
uint8_t |
prescale |
|
) |
| |
|
inlinevirtual |
Acquire bus access. Yield until bus is released.
- Parameters
-
[in] | mode | of access. |
[in] | bitorder | of serial data. |
[in] | prescale | clock prescale. |
Reimplemented from SPI.
Definition at line 70 of file SPI.h.
Lock bus manager.
Definition at line 252 of file SPI.h.
SPI& SPI::operator<< |
( |
uint8_t |
value | ) |
|
|
inlineinherited |
Write value to device. Shorthand for write().
- Parameters
-
[in] | value | to write to device. |
Definition at line 95 of file SPI.h.
SPI& SPI::operator>> |
( |
uint8_t & |
value | ) |
|
|
inlineinherited |
Read value from device.
- Parameters
-
[out] | value | read from device. |
Definition at line 84 of file SPI.h.
virtual uint8_t Hardware::SPI::prescale |
( |
uint32_t |
frequency | ) |
|
|
inlinevirtual |
Calculate bus prescale from device frequency.
- Parameters
-
[in] | frequency | device access. |
- Returns
- prescale
Reimplemented from SPI.
Definition at line 51 of file SPI.h.
virtual void Hardware::SPI::read |
( |
void * |
buf, |
|
|
size_t |
count |
|
) |
| |
|
inlinevirtual |
Read given number of bytes from device and store in buffer.
- Parameters
-
[in] | buf | buffer pointer. |
[in] | count | number of bytes. |
Reimplemented from SPI.
Definition at line 83 of file SPI.h.
virtual void Hardware::SPI::read |
( |
void * |
buf, |
|
|
size_t |
count |
|
) |
| |
|
inlinevirtual |
Read given number of bytes from device and store in buffer.
- Parameters
-
[in] | buf | buffer pointer. |
[in] | count | number of bytes. |
Reimplemented from SPI.
Definition at line 132 of file SPI.h.
virtual void SPI::release |
( |
| ) |
|
|
inlinevirtualinherited |
virtual uint8_t Hardware::SPI::transfer |
( |
uint8_t |
value | ) |
|
|
inlinevirtual |
Send given byte to device. Returns byte received from device.
- Parameters
-
[in] | value | to send to device. |
- Returns
- received value.
Implements SPI.
Definition at line 57 of file SPI.h.
virtual void Hardware::SPI::transfer |
( |
void * |
dest, |
|
|
const void * |
src, |
|
|
size_t |
count |
|
) |
| |
|
inlinevirtual |
Transfer given number of bytes from source buffer to device. Store received bytes in destination buffer.
- Parameters
-
[in] | dest | destination buffer. |
[in] | src | source buffer. |
[in] | count | number of bytes to transfer. |
Reimplemented from SPI.
Definition at line 72 of file SPI.h.
virtual uint8_t Hardware::SPI::transfer |
( |
uint8_t |
value | ) |
|
|
inlinevirtual |
Send given byte to device. Returns byte received from device.
- Parameters
-
[in] | value | to send to device. |
- Returns
- received value.
Implements SPI.
Definition at line 90 of file SPI.h.
virtual void Hardware::SPI::transfer |
( |
void * |
dest, |
|
|
const void * |
src, |
|
|
size_t |
count |
|
) |
| |
|
inlinevirtual |
Transfer given number of bytes from source buffer to device. Store received bytes in destination buffer.
- Parameters
-
[in] | dest | destination buffer. |
[in] | src | source buffer. |
[in] | count | number of bytes to transfer. |
Reimplemented from SPI.
Definition at line 107 of file SPI.h.
Unlock bus manager.
Definition at line 262 of file SPI.h.
virtual void Hardware::SPI::write |
( |
const void * |
buf, |
|
|
size_t |
count |
|
) |
| |
|
inlinevirtual |
Write given number of bytes from buffer to device.
- Parameters
-
[in] | buf | buffer pointer. |
[in] | count | number of bytes. |
Reimplemented from SPI.
Definition at line 94 of file SPI.h.
virtual void Hardware::SPI::write |
( |
const void * |
buf, |
|
|
size_t |
count |
|
) |
| |
|
inlinevirtual |
Write given number of bytes from buffer to device.
- Parameters
-
[in] | buf | buffer pointer. |
[in] | count | number of bytes. |
Reimplemented from SPI.
Definition at line 154 of file SPI.h.
volatile bool SPI::m_busy |
|
protectedinherited |
Bus manager semaphore.
Definition at line 247 of file SPI.h.
GPIO<BOARD::MISO> Hardware::SPI::m_miso |
|
protected |
Master Input Slave Output pin.
Definition at line 181 of file SPI.h.
GPIO<BOARD::MOSI> Hardware::SPI::m_mosi |
|
protected |
Master Output Slave Input pin.
Definition at line 178 of file SPI.h.
GPIO<BOARD::SCK> Hardware::SPI::m_sck |
|
protected |
Clock pin.
Definition at line 175 of file SPI.h.
GPIO<BOARD::SS> Hardware::SPI::m_ss |
|
protected |
Slave select pin.
Definition at line 172 of file SPI.h.
const uint32_t SPI::MAX_FREQ = F_CPU / 2 |
|
staticinherited |
Maximum clock frequency.
Definition at line 30 of file SPI.h.
The documentation for this class was generated from the following file: