[riot-notifications] [RIOT] drivers/spi: updated SPI driver interface (#3216)
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:
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:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications