Pages: [1]   Go Down
Author Topic: SPI library issues  (Read 844 times)
0 Members and 1 Guest are viewing this topic.
Boston, MA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 83
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Can I somehow help get SPI library issues addressed?  There is this bug which basically stops the SPI library from working with mode 3 (and probably other modes).  http://code.google.com/p/arduino/issues/detail?id=888

Another small bug is that if you just call begin() the library relies on the values of the SPSR and SPCR to be the default since it ORs bits without initializing the registers.

Also, a great feature would be the ability to switch between different SPI slaves in a standard way (similar to how "begin" is standard).  I would propose the addition of 2 member functions for APIs that use SPI ".pause()" (generally a no-op, but might turn off interrupt handlers for example) and ".resume()".

This is needed because (in my experience) all the config bits in SPCR and SPSR regs are not actually readable -- I just get 0x80 when I read SPCR for example.  This means that generic code to push and pop SPI register state like this does not work:
class SpiSaver
{
public:
byte spcr,spsr;
SpiSaver() { spcr = SPCR; spsr = SPSR; }
~SpiSaver() { SPCR = spcr; SPSR = spsr; }
};

Cheers!
Andrew
Logged

http://www.toastedcircuits.com Lightuino LED driver: 16 sources, 70 sinks, remote controlled.  Also high powered LED drivers.

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12739
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Please reports your comments and suggestions on the Developer's List...
http://arduino.cc/mailman/listinfo/developers_arduino.cc
Logged

Pages: [1]   Go Up
Jump to: