wirish/HardwareSPI.cpp
static void enable_device(spi_dev *dev,
                          bool as_master,
                          SPIFrequency freq,
                          spi_cfg_flag endianness,
                          spi_mode mode) {
    spi_baud_rate baud = determine_baud_rate(dev, freq);
    uint32 cfg_flags = (endianness | SPI_DFF_8_BIT | SPI_SW_SLAVE |
                        (as_master ? SPI_SOFT_SS : 0));

    spi_init(dev);
    configure_gpios(dev, as_master);
    if (as_master) {
        spi_master_enable(dev, baud, mode, cfg_flags);
    } else {
        spi_slave_enable(dev, mode, cfg_flags);
    }
}
/* Enables the device in master or slave full duplex mode.  If you
 * change this code, you must ensure that appropriate changes are made
 * to HardwareSPI::end(). */
Enables the device in master or slave full duplex mode.  If you
change this code, you must ensure that appropriate changes are made
to HardwareSPI::end().
Enables the device in master or slave full duplex mode . If you change this code you must ensure that appropriate changes are made to HardwareSPI :: end () .
static void enable_device(spi_dev *dev,
                          bool as_master,
                          SPIFrequency freq,
                          spi_cfg_flag endianness,
                          spi_mode mode) {
    spi_baud_rate baud = determine_baud_rate(dev, freq);
    uint32 cfg_flags = (endianness | SPI_DFF_8_BIT | SPI_SW_SLAVE |
                        (as_master ? SPI_SOFT_SS : 0));
    spi_init(dev);
    configure_gpios(dev, as_master);
    if (as_master) {
        spi_master_enable(dev, baud, mode, cfg_flags);
    } else {
        spi_slave_enable(dev, mode, cfg_flags);
    }
}
static void enable_device ( spi_dev * dev , bool as_master , SPIFrequency freq , spi_cfg_flag endianness , spi_mode mode ) { spi_baud_rate baud = determine_baud_rate ( dev , freq ) ; uint32 cfg_flags = ( endianness | SPI_DFF_8_BIT | SPI_SW_SLAVE | ( as_master ? SPI_SOFT_SS : 0 ) ) ; spi_init ( dev ) ; configure_gpios ( dev , as_master ) ; if ( as_master ) { spi_master_enable ( dev , baud , mode , cfg_flags ) ; } else { spi_slave_enable ( dev , mode , cfg_flags ) ; } }
Enables the device in master or slave full duplex mode.
Enables the device in master or slave full duplex mode .