I am considering using an SD card and another SPI slave device (an atmega328p as SPI slave) on SPI bus. I have some concerns with setting the bus speed divider. Some code for using one arduino as SPI master starts with SPI.begin() and some has setClockDivider() (was default value 4MHz?):
I know that one can effectively set bus clock divider with:
The code is complicated within the begin method but I think they map SPI_FULL_SPEED to 8MHz and SPI_HALF_SPEED to 4MHz, right?
Then the SdFat library will not change the speed in later calls such read and write, right? So if I first begin the sd object as above, then I can just enable the other SPI slave with SS, and then write to it, cause the bus is already initialized by the sd.begin, and the speed stays at whatever I gave for sd.begin(), no need to set it again for the other slave, correct? Thanks.