RTEMS
5.0.0
Main Page
Related Pages
Modules
+
Data Structures
Data Structures
Data Structure Index
+
Data Fields
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Variables
_
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
v
w
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
o
p
q
r
s
t
u
v
w
x
+
Enumerations
a
b
c
e
h
i
l
m
o
p
q
r
s
t
w
+
Enumerator
a
c
d
i
l
m
p
r
s
t
w
+
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
bsps
arm
raspberrypi
include
bsp
i2c.h
Go to the documentation of this file.
1
9
/*
10
* Copyright (c) 2014-2015 Andre Marques <andre.lousa.marques at gmail.com>
11
*
12
* The license and distribution terms for this file may be
13
* found in the file LICENSE in this distribution or at
14
* http://www.rtems.org/license/LICENSE.
15
*/
16
17
#ifndef LIBBSP_ARM_RASPBERRYPI_I2C_H
18
#define LIBBSP_ARM_RASPBERRYPI_I2C_H
19
20
#include <
dev/i2c/i2c.h
>
21
22
#ifdef __cplusplus
23
extern
"C"
{
24
#endif
/* __cplusplus */
25
37
#define BSC_CORE_CLK_HZ 150000000
38
44
#define DEFAULT_BUS_CLOCK 100000
45
57
extern
void
rpi_i2c_init
(
void
);
58
70
extern
int
rpi_i2c_register_bus
(
71
const
char
*bus_path,
72
uint32_t bus_clock
73
);
74
82
static
inline
int
rpi_setup_i2c_bus(
void
)
83
{
84
rpi_i2c_init
();
85
86
return
rpi_i2c_register_bus
(
"/dev/i2c"
,
DEFAULT_BUS_CLOCK
);
87
}
88
91
#ifdef __cplusplus
92
}
93
#endif
/* __cplusplus */
94
95
#endif
/* LIBBSP_ARM_RASPBERRYPI_I2C_H */
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.
Definition:
i2c.c:364
rpi_i2c_init
void rpi_i2c_init(void)
Setups the Raspberry Pi GPIO header to activate the BSC I2C bus.
Definition:
i2c.c:416
i2c.h
Inter-Integrated Circuit (I2C) Driver API.
DEFAULT_BUS_CLOCK
#define DEFAULT_BUS_CLOCK
Default bus clock.
Definition:
i2c.h:44
Generated by
1.8.13