int bcm2835_spi_begin (void)
void bcm2835_spi_end (void)
void bcm2835_spi_setBitOrder (uint8_t order)
void bcm2835_spi_setClockDivider (uint16_t divider)
void bcm2835_spi_set_speed_hz (uint32_t speed_hz)
void bcm2835_spi_setDataMode (uint8_t mode)
void bcm2835_spi_chipSelect (uint8_t cs)
void bcm2835_spi_setChipSelectPolarity (uint8_t cs, uint8_t active)
uint8_t bcm2835_spi_transfer (uint8_t value)
void bcm2835_spi_transfernb (char *tbuf, char *rbuf, uint32_t len)
void bcm2835_spi_transfern (char *buf, uint32_t len)
void bcm2835_spi_writenb (const char *buf, uint32_t len)
void bcm2835_spi_write (uint16_t data)
int bcm2835_aux_spi_begin (void)
void bcm2835_aux_spi_end (void)
void bcm2835_aux_spi_setClockDivider (uint16_t divider)
uint16_t bcm2835_aux_spi_CalcClockDivider (uint32_t speed_hz)
void bcm2835_aux_spi_write (uint16_t data)
void bcm2835_aux_spi_writenb (const char *buf, uint32_t len)
void bcm2835_aux_spi_transfern (char *buf, uint32_t len)
void bcm2835_aux_spi_transfernb (const char *tbuf, char *rbuf, uint32_t
len)
uint8_t bcm2835_aux_spi_transfer (uint8_t value)
These functions let you use SPI0 (Serial Peripheral Interface) to interface with an external SPI device.
Start AUX SPI operations. Forces RPi AUX SPI pins P1-38 (MOSI), P1-38 (MISO), P1-40 (CLK) and P1-36 (CE2) to alternate function ALT4, which enables those pins for SPI interface.
Returns
Calculates the input for
See also
Parameters
See also
BCM2835_AUX_SPI_CLOCK_MAX
Returns
See also
End AUX SPI operations. SPI1 pins P1-38 (MOSI), P1-38 (MISO), P1-40 (CLK) and P1-36 (CE2) are returned to their default INPUT behaviour.
Sets the AUX SPI clock divider and therefore the AUX SPI clock speed.
Parameters
Transfers one byte to and from the AUX SPI slave. Clocks the 8 bit value out on MOSI, and simultaneously clocks in data from MISO. Returns the read data byte from the slave.
Parameters
Returns
See also
Transfers any number of bytes to and from the AUX SPI slave using bcm2835_aux_spi_transfernb. The returned data from the slave replaces the transmitted data in the buffer.
Parameters
See also
Transfers any number of bytes to and from the AUX SPI slave. Asserts the CE2 pin during the transfer. Clocks the len 8 bit bytes out on MOSI, and simultaneously clocks in data from MISO. The data read read from the slave is placed into rbuf. rbuf must be at least len bytes long
Parameters
Transfers half-word to the AUX SPI slave. Asserts the currently selected CS pins during the transfer.
Parameters
Returns
See also
Transfers any number of bytes to the AUX SPI slave. Asserts the CE2 pin during the transfer.
Parameters
Start SPI operations. Forces RPi SPI0 pins P1-19 (MOSI), P1-21 (MISO), P1-23 (CLK), P1-24 (CE0) and P1-26 (CE1) to alternate function ALT0, which enables those pins for SPI interface. You should call bcm2835_spi_end() when all SPI funcitons are complete to return the pins to their default functions.
See also
Returns
Sets the chip select pin(s) When an bcm2835_spi_transfer() is made, the selected pin(s) will be asserted during the transfer.
Parameters
End SPI operations. SPI0 pins P1-19 (MOSI), P1-21 (MISO), P1-23 (CLK), P1-24 (CE0) and P1-26 (CE1) are returned to their default INPUT behaviour.
Sets the SPI clock divider by converting the speed parameter to the equivalent SPI clock divider. ( see
See also
Parameters
Sets the SPI bit order Set the bit order to be used for transmit and receive. The bcm2835 SPI0 only supports BCM2835_SPI_BIT_ORDER_MSB, so if you select BCM2835_SPI_BIT_ORDER_LSB, the bytes will be reversed in software. The library defaults to BCM2835_SPI_BIT_ORDER_MSB.
Parameters
Sets the chip select pin polarity for a given pin When an bcm2835_spi_transfer() occurs, the currently selected chip select pin(s) will be asserted to the value given by active. When transfers are not happening, the chip select pin(s) return to the complement (inactive) value.
Parameters
Sets the SPI clock divider and therefore the SPI clock speed.
Parameters
Sets the SPI data mode Sets the clock polariy and phase
Parameters
Transfers one byte to and from the currently selected SPI slave. Asserts the currently selected CS pins (as previously set by bcm2835_spi_chipSelect) during the transfer. Clocks the 8 bit value out on MOSI, and simultaneously clocks in data from MISO. Returns the read data byte from the slave. Uses polled transfer as per section 10.6.1 of the BCM 2835 ARM Peripherls manual
Parameters
Returns
See also
Transfers any number of bytes to and from the currently selected SPI slave using bcm2835_spi_transfernb. The returned data from the slave replaces the transmitted data in the buffer.
Parameters
See also
Transfers any number of bytes to and from the currently selected SPI slave. Asserts the currently selected CS pins (as previously set by bcm2835_spi_chipSelect) during the transfer. Clocks the len 8 bit bytes out on MOSI, and simultaneously clocks in data from MISO. The data read read from the slave is placed into rbuf. rbuf must be at least len bytes long Uses polled transfer as per section 10.6.1 of the BCM 2835 ARM Peripherls manual
Parameters
See also
Transfers half-word to the currently selected SPI slave. Asserts the currently selected CS pins (as previously set by bcm2835_spi_chipSelect) during the transfer. Clocks the 8 bit value out on MOSI, and simultaneously clocks in data from MISO. Uses polled transfer as per section 10.6.1 of the BCM 2835 ARM Peripherls manual
Parameters
See also
Transfers any number of bytes to the currently selected SPI slave. Asserts the currently selected CS pins (as previously set by bcm2835_spi_chipSelect) during the transfer.
Parameters
Generated automatically by Doxygen for bcm2835 from the source code.