RTEMS  5.0.0
i2c.h File Reference

Raspberry Pi specific I2C definitions. More...

#include <dev/i2c/i2c.h>

Go to the source code of this file.

Macros

I2C constants.
#define BSC_CORE_CLK_HZ   150000000
 BSC controller core clock rate in Hz. More...
 
#define DEFAULT_BUS_CLOCK   100000
 Default bus clock. More...
 

Functions

I2C directives.
void rpi_i2c_init (void)
 Setups the Raspberry Pi GPIO header to activate the BSC I2C bus.
 
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. More...
 

Detailed Description

Raspberry Pi specific I2C definitions.

Macro Definition Documentation

◆ BSC_CORE_CLK_HZ

#define BSC_CORE_CLK_HZ   150000000

BSC controller core clock rate in Hz.

This is set to 150 MHz as per the BCM2835 datasheet.

◆ DEFAULT_BUS_CLOCK

#define DEFAULT_BUS_CLOCK   100000

Default bus clock.

This sets the bus with a 100 kHz clock speed.

Function Documentation

◆ rpi_i2c_register_bus()

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.

Parameters
[in]bus_pathPath to the bus device file.
[in]bus_clockBus clock in Hz.
Return values
0Bus registered successfully.
<0Could not register the bus. The return value is a negative errno code.