[riot-notifications] [RIOT] drivers/spi: updated SPI driver interface (#3216)

Hauke Petersen notifications at github.com
Wed Jun 24 22:29:07 CEST 2015


Hm, wait: I might have an idea: We could introduce another parameter for the transfer functions:
```c
void spi_transfer_bytes(spi_t dev, gpio_t cs, ...);
```
Now the spi driver can deicide itself, if it just ignores the given parameter (and uses internal HW CS lines instead). Even both is possible, as you could implement your CPUs spi driver in a way, that it will use some HW CS pin in case the parameter 'GPIO_UNDEF' is given, and use SW CS.

Using an additional parameter has the advantage, that the SPI driver does not need to keep state. Because keeping say an instance struct for each device that is run on a SPI bus, it would lead to redundant data that can be saved this way. What do you say?

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/3216#issuecomment-115001392
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20150624/fb936d3d/attachment.html>


More information about the notifications mailing list