![]() |
RTEMS 6.1
|
Support for the I2C bus on the Raspberry Pi GPIO P1 header (model A/B) and GPIO J8 header on model B+. More...
#include <bsp.h>#include <bsp/raspberrypi.h>#include <bsp/gpio.h>#include <bsp/rpi-gpio.h>#include <bsp/irq.h>#include <bsp/i2c.h>#include <assert.h>Data Structures | |
| struct | rpi_i2c_bus |
| Object containing relevant information about an I2C bus. More... | |
Macros | |
| #define | TRANSFER_COUNT(buffer_size) (buffer_size + 0xFFFE) / 0xFFFF |
| #define | ADJUST_TRANSFER_SIZE(transfer_count, remaining_bytes) transfer_count > 1 ? 0xFFFF : (remaining_bytes & 0xFFFF) |
| #define | I2C_POLLING(condition) |
Functions | |
| int | rpi_i2c_register_bus (const char *bus_path, uint32_t bus_clock) |
| Registers the Raspberry Pi BSC I2C bus with the Linux I2C User-Space API. | |
| void | rpi_i2c_init (void) |
| Setups the Raspberry Pi GPIO header to activate the BSC I2C bus. | |
Support for the I2C bus on the Raspberry Pi GPIO P1 header (model A/B) and GPIO J8 header on model B+.
| #define I2C_POLLING | ( | condition | ) |
| int rpi_i2c_register_bus | ( | const char * | bus_path, |
| uint32_t | bus_clock | ||
| ) |
Registers the Raspberry Pi BSC I2C bus with the Linux I2C User-Space API.
| [in] | bus_path | Path to the bus device file. |
| [in] | bus_clock | Bus clock in Hz. |
| 0 | Bus registered successfully. |
| <0 | Could not register the bus. The return value is a negative errno code. |