Skip to contentSkip to conversation

cs_change for SPI transfers

DISCUSSION Manuel Stahl 2 participants 2 messages Jan 10, 2011 – Jan 11, 2011 IIO

lore
Share & tools
lore
#0 lore raw

Hi,

I think there's an error in most IIO devices that use SPI transfers.

Quoted 9 lines · Haavard Skinnemoen

The normal behaviour is:
* After all transfers except the last: CS stays active
* After the last transfer: CS goes inactive

The cs_change flag is used to invert this behaviour. So for the last transfer, cs_change indicates that CS should stay active after the transfer (though the driver may not actually be able to do so, e.g. if the message is followed by a message to a different device.)

The drivers in IIO set cs_change for all transfers (including the last in a message), which is not what we want. I can prepare a patch to correct this.

Regards,

Signature · 12 lines
Manuel Stahl
Fraunhofer-Institut IIS
Leistungsoptimierte Systeme

Nordostpark 93
D90411 Nürnberg
Telefon  +49 (0)911/58061-6419
Fax      +49 (0)911/58061-6398
E-Mail   [email protected]

http://www.iis.fraunhofer.de
http://www.smart-power.fraunhofer.de

begin:vcard
fn:Manuel Stahl
n:Stahl;Manuel
email;internet:[email protected]
tel;work:+49 911 58061-6419
x-mozilla-html:FALSE
version:2.1
end:vcard

#1 lore raw
Quoted 15 lines · Manuel Stahl

Hi,

I think there's an error in most IIO devices that use SPI transfers.

Quoted 9 lines · Haavard Skinnemoen

The normal behaviour is:
* After all transfers except the last: CS stays active
* After the last transfer: CS goes inactive

The cs_change flag is used to invert this behaviour. So for the last transfer, cs_change indicates that CS should stay active after the transfer (though the driver may not actually be able to do so, e.g. if the message is followed by a message to a different device.)

Quoted 3 lines

The drivers in IIO set cs_change for all transfers (including the last in a message), which is not what we want. I can prepare a patch to correct this.

Yikes.

They win for completely counter intuitive interface... I guess I can see why they did it like that (to make 0 the default behaviour).
Clearer naming would have been nice. cs_change_non_default or something...

Please do submit a patch set for this.

Jonathan