RTEMS
7.0-rc1
Loading...
Searching...
No Matches
bsps
arm
raspberrypi
include
bsp
i2c.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0+-with-RTEMS-exception */
2
11
/*
12
* Copyright (c) 2014-2015 Andre Marques <andre.lousa.marques at gmail.com>
13
*
14
* The license and distribution terms for this file may be
15
* found in the file LICENSE in this distribution or at
16
* http://www.rtems.org/license/LICENSE.
17
*/
18
19
#ifndef LIBBSP_ARM_RASPBERRYPI_I2C_H
20
#define LIBBSP_ARM_RASPBERRYPI_I2C_H
21
22
#include <
dev/i2c/i2c.h
>
23
24
#ifdef __cplusplus
25
extern
"C"
{
26
#endif
/* __cplusplus */
27
39
#define BSC_CORE_CLK_HZ 150000000
40
46
#define DEFAULT_BUS_CLOCK 100000
47
59
extern
void
rpi_i2c_init
(
void
);
60
72
extern
int
rpi_i2c_register_bus
(
73
const
char
*bus_path,
74
uint32_t bus_clock
75
);
76
84
static
inline
int
rpi_setup_i2c_bus(
void
)
85
{
86
rpi_i2c_init
();
87
88
return
rpi_i2c_register_bus
(
"/dev/i2c"
,
DEFAULT_BUS_CLOCK
);
89
}
90
93
#ifdef __cplusplus
94
}
95
#endif
/* __cplusplus */
96
97
#endif
/* LIBBSP_ARM_RASPBERRYPI_I2C_H */
DEFAULT_BUS_CLOCK
#define DEFAULT_BUS_CLOCK
Default bus clock.
Definition:
i2c.h:46
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:366
rpi_i2c_init
void rpi_i2c_init(void)
Setups the Raspberry Pi GPIO header to activate the BSC I2C bus.
Definition:
i2c.c:418
i2c.h
Inter-Integrated Circuit (I2C) Driver API.
Generated by
1.9.6