COSA
An Object-Oriented Platform for Arduino Programming
|
#include <SPI.hh>
Public Member Functions | |
Driver (Board::DigitalPin cs, Pulse pulse=DEFAULT_PULSE, Clock clock=DEFAULT_CLOCK, uint8_t mode=0, Order order=MSB_ORDER, Interrupt::Handler *irq=NULL) | |
void | set_clock (Clock rate) |
void | set_clock (uint32_t freq) |
Static Public Member Functions | |
static Clock | clock (uint32_t freq) |
static Clock | cycle (uint16_t ns) |
Protected Attributes | |
Driver * | m_next |
List of drivers. More... | |
Interrupt::Handler * | m_irq |
Interrupt handler. More... | |
OutputPin | m_cs |
Device chip select pin. More... | |
Pulse | m_pulse |
Chip select pulse mode. More... | |
uint8_t | m_mode |
Mode for phase and transition. More... | |
Order | m_order |
Data direction; bit order. More... | |
uint8_t | m_data |
Data to transfer. More... | |
Friends | |
class | SPI |
SPI device driver abstract class. Holds SPI state to allow handling of several SPI devices with different clock, mode and/or bit order.
Soft::SPI::Driver::Driver | ( | Board::DigitalPin | cs, |
Pulse | pulse = DEFAULT_PULSE , |
||
Clock | clock = DEFAULT_CLOCK , |
||
uint8_t | mode = 0 , |
||
Order | order = MSB_ORDER , |
||
Interrupt::Handler * | irq = NULL |
||
) |
Construct SPI Device driver with given chip select pin, pulse, clock, mode, and bit order.
|
inlinestatic |
|
inlinestatic |
void Soft::SPI::Driver::set_clock | ( | Clock | rate | ) |
Set SPI master clock rate.
[in] | clock | rate. |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |