int bcm2835_i2c_begin (void)
void bcm2835_i2c_end (void)
void bcm2835_i2c_setSlaveAddress (uint8_t addr)
void bcm2835_i2c_setClockDivider (uint16_t divider)
void bcm2835_i2c_set_baudrate (uint32_t baudrate)
uint8_t bcm2835_i2c_write (const char *buf, uint32_t len)
uint8_t bcm2835_i2c_read (char *buf, uint32_t len)
uint8_t bcm2835_i2c_read_register_rs (char *regaddr, char *buf,
uint32_t len)
uint8_t bcm2835_i2c_write_read_rs (char *cmds, uint32_t cmds_len, char
*buf, uint32_t buf_len)
These functions let you use I2C (The Broadcom Serial Control bus with the Philips I2C bus/interface version 2.1 January 2000.) to interface with an external I2C device.
Start I2C operations. Forces RPi I2C pins P1-03 (SDA) and P1-05 (SCL) to alternate function ALT0, which enables those pins for I2C interface. You should call bcm2835_i2c_end() when all I2C functions are complete to return the pins to their default functions
Returns
See also
End I2C operations. I2C pins P1-03 (SDA) and P1-05 (SCL) are returned to their default INPUT behaviour.
Transfers any number of bytes from the currently selected I2C slave. (as previously set by
See also
Parameters
Returns
Allows reading from I2C slaves that require a repeated start (without any prior stop) to read after the required slave register has been set. For example, the popular MPL3115A2 pressure and temperature sensor. Note that your device must support or require this mode. If your device does not require this mode then the standard combined:
See also
bcm2835_i2c_read are a better choice. Will read from the slave previously set by
bcm2835_i2c_setSlaveAddress
Parameters
Returns
Sets the I2C clock divider by converting the baudrate parameter to the equivalent I2C clock divider. ( see
See also
Sets the I2C clock divider and therefore the I2C clock speed.
Parameters
Sets the I2C slave address.
Parameters
Transfers any number of bytes to the currently selected I2C slave. (as previously set by
See also
Parameters
Returns
Allows sending an arbitrary number of bytes to I2C slaves before issuing a repeated start (with no prior stop) and reading a response. Necessary for devices that require such behavior, such as the MLX90620. Will write to and read from the slave previously set by
See also
Parameters
Returns
Generated automatically by Doxygen for bcm2835 from the source code.