jung6717 / arduino

Automatically exported from code.google.com/p/arduino
0 stars 0 forks source link

SPI library. #240

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What change would like to see?

An SPI library.

Why?

To provide a standard API for users and library writers.

Would this cause any incompatibilities with previous versions?  If so, how
can these be mitigated?

No.

Original issue reported on code.google.com by dmel...@gmail.com on 6 May 2010 at 6:08

GoogleCodeExporter commented 8 years ago
Just for reference, here's a link to an SPI library on the playground: 
http://www.arduino.cc/playground/Code/Spi

FWIW, for my own purposes I implemented a slightly different public interface 
and then subclassed it for my 
actual device:

class SpiDevice {
  public:
    SpiDevice();

    void begin(); // Uses default (pin 10)
    void begin(byte selectPin);

    // May make these private (or protected) in the final library?
    void deselect();
    void select();

    byte transfer(volatile byte data);
    void transfer_bulk(const uint8_t* srcptr, unsigned long int length);
};

Original comment by follower@gmail.com on 7 May 2010 at 2:26

GoogleCodeExporter commented 8 years ago
Added as part of a rewrite of the Ethernet library by Christian Maglie (r1023).

Original comment by dmel...@gmail.com on 2 Aug 2010 at 7:01