Sets the SPI clock divider relative to the selected clock reference. The available dividers are 2, 4, 8, 16, 32, 64, 128 or 256. The default setting is SPI_CLOCK_DIV4, which sets the SPI clock to one-quarter the frequency of the system clock.
// SYNTAX SPI.setClockDivider(divider);
Where the parameter,
divider can be:
The clock reference varies depending on the device.
- On Gen 3 devices (Argon, Boron, B Series SoM, Tracker SOM), the clock reference is 64 MHz.
- On Gen 2 devices (Photon, P1, Electron, E Series), the clock reference is 120 MHz.
Note that you must use the same
SPI object as used with
SPI.begin() so if you used
SPI1.begin() also use