The prescaler ladder
You will learn
How the prescaler ladder turns one clock into a family of SCK rates, and which steps are valid.
One clock becomes a family of rates through the prescaler ladder: PRESCALER_2 is 0, PRESCALER_4 is 1, and the ladder climbs while the clock holds. spi_prescaler_16_default checks the default, spi_set_prescaler_valid and spi_set_prescaler_invalid check the bounds, spi_sck_freq_at_50 checks the arithmetic. The recording is a native run: the SPI testbench spec through the real t27c, 7 tests pass.