RTEMS 7.0-rc1
Loading...
Searching...
No Matches
raspberrypi-i2c.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * Copyright (C) 2025 Shaunak Datar
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
36#ifndef LIBBSP_AARCH64_RASPBERRYPI_I2C_H
37#define LIBBSP_AARCH64_RASPBERRYPI_I2C_H
38
39#include <bsp/raspberrypi.h>
40#include <bsp/rpi-gpio.h>
41#include <bsp/utility.h>
42#include <dev/i2c/i2c.h>
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
51typedef enum {
56
61
66
71
76
82
93 uint32_t bus_clock
94);
95
96#ifdef __cplusplus
97}
98#endif /* __cplusplus */
99
100#endif /* LIBBSP_AARCH64_RASPBERRYPI_I2C_H */
void rpi_i2c_init(void)
Setups the Raspberry Pi GPIO header to activate the BSC I2C bus.
Definition: i2c.c:418
Inter-Integrated Circuit (I2C) Driver API.
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85
This header file provides utility macros for BSPs.
raspberrypi_bsc_masters
I2C controller instances on Raspberry Pi 4.
Definition: raspberrypi-i2c.h:51
@ raspberrypi_bscm1
BSC Master 1 (GPIO 2/3)
Definition: raspberrypi-i2c.h:60
@ raspberrypi_bscm6
BSC Master 6 (GPIO 22/23)
Definition: raspberrypi-i2c.h:80
@ raspberrypi_bscm3
BSC Master 3 (GPIO 4/5)
Definition: raspberrypi-i2c.h:65
@ raspberrypi_bscm0
BSC Master 0 (GPIO 0/1)
Definition: raspberrypi-i2c.h:55
@ raspberrypi_bscm5
BSC Master 5 (GPIO 10/11)
Definition: raspberrypi-i2c.h:75
@ raspberrypi_bscm4
BSC Master 4 (GPIO 6/7)
Definition: raspberrypi-i2c.h:70