spi_setup()


Configuring SPI

Description

void spi_setup(int $spi_id[, int $div = 256[, int $mode = 3]])

Parameters

Example

<?php
include "/lib/sd_340.php";
spi_setup(0);           // Configuring SPI0 with divider 256 and mode 3
spi_setup(0, 128);      // Configuring SPI0 with divider 128 and mode 3
spi_setup(0, 128, 0);   // Configuring SPI0 with divider 128 and mode 0
?>

See also