Reads and writes to the files spi0 and spi1 transfer data over the SPI bus. Accesses to spi0 cause the transfers to take place with the CE0\_0 line asserted low. Similarly, transfers to spi1 are carried out with CE1\_0 asserted low.
The spictl file is used to set various control parameters. It accepts the following commands:
clock " freq" Set the frequency of the SPI clock. The clock from which the SPI clock is derived runs at 250MHz, and the divisor must be a multiple of 2. (The Broadcom documentation incorrectly says "power of 2".) The driver sets the divisor to the highest multiple of 2 that results in a clock rate that is less than or equal to the freq parameter in MHz.
mode " n" Treats n as a two-bit number specifying the settings for the clock phase and clock polarity. The default value of 0 matches the polarity and phase requirements of most peripheral devices.
lossi Enable a bidirectional mode where the MOSI line is used for both reads and writes.