I have written a custom library that uses the Arduino SPI library. It works just fine with the Uno but not with the Due because of the Due's different SPI functions.
I would like to make my library compatible with the Due and its extended SPI usage. However, I am not quit sure how to best accomplish this. I can't figure out how to conditionally use the extended SPI functions when the user compiles for a Due.
The only idea I've come up with so far, which I don't like since this library will be released with a product, is to create a duplicate library for use with the Due, which includes the special functions like SPI.begin(x) and SPI.transfer(x,x, SPI_CONTINUE) rather than the standard SPI library equivalents.
Is there a way to make a library that calls the SPI functions work with both Uno and Due? Maybe by using some other conditional compiling directive like #ifdef's in my library? Or is the standard approach to just not include SPI functions in a library?
Any guidance is appreciated!