RTEMS 7.0-rc1
Loading...
Searching...
No Matches
i2c.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * Copyright (c) 2012 Claas Ziemke. All rights reserved.
13 *
14 * Claas Ziemke
15 * Kernerstrasse 11
16 * 70182 Stuttgart
17 * Germany
18 * <claas.ziemke@gmx.net>
19 *
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions
22 * are met:
23 * 1. Redistributions of source code must retain the above copyright
24 * notice, this list of conditions and the following disclaimer.
25 * 2. Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in the
27 * documentation and/or other materials provided with the distribution.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
30 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
33 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
34 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
36 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
37 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 * POSSIBILITY OF SUCH DAMAGE.
40 */
41
42#ifndef LIBBSP_ARM_BEAGLE_I2C_H
43#define LIBBSP_ARM_BEAGLE_I2C_H
44
45#include <rtems.h>
46#include <bsp.h>
47#include <dev/i2c/i2c.h>
48#include <ofw/ofw.h>
49
50#ifdef __cplusplus
51extern "C" {
52#endif /* __cplusplus */
53
54#define BBB_I2C_SYSCLK 48000000
55#define BBB_I2C_INTERNAL_CLK 12000000
56
57#define BBB_I2C_0_BUS_PATH "/dev/i2c-0"
58#define BBB_I2C_1_BUS_PATH "/dev/i2c-1"
59#define BBB_I2C_2_BUS_PATH "/dev/i2c-2"
60
61typedef enum {
62 I2C0,
63 I2C1,
64 I2C2,
65 I2C_COUNT
66} bbb_i2c_id_t;
67
68typedef struct i2c_regs {
69 uint32_t BBB_I2C_REVNB_LO;
70 uint32_t BBB_I2C_REVNB_HI;
71 uint32_t dummy1[ 2 ];
72 uint32_t BBB_I2C_SYSC;
73 uint32_t dummy2[ 4 ];
74 uint32_t BBB_I2C_IRQSTATUS_RAW;
75 uint32_t BBB_I2C_IRQSTATUS;
76 uint32_t BBB_I2C_IRQENABLE_SET;
77 uint32_t BBB_I2C_IRQENABLE_CLR;
78 uint32_t BBB_I2C_WE;
79 uint32_t BBB_I2C_DMARXENABLE_SET;
80 uint32_t BBB_I2C_DMATXENABLE_SET;
81 uint32_t BBB_I2C_DMARXENABLE_CLR;
82 uint32_t BBB_I2C_DMATXENABLE_CLR;
83 uint32_t BBB_I2C_DMARXWAKE_EN;
84 uint32_t BBB_I2C_DMATXWAKE_EN;
85 uint32_t dummy3[ 16 ];
86 uint32_t BBB_I2C_SYSS;
87 uint32_t BBB_I2C_BUF;
88 uint32_t BBB_I2C_CNT;
89 uint32_t BBB_I2C_DATA;
90 uint32_t dummy4;
91 uint32_t BBB_I2C_CON;
92 uint32_t BBB_I2C_OA;
93 uint32_t BBB_I2C_SA;
94 uint32_t BBB_I2C_PSC;
95 uint32_t BBB_I2C_SCLL;
96 uint32_t BBB_I2C_SCLH;
97 uint32_t BBB_I2C_SYSTEST;
98 uint32_t BBB_I2C_BUFSTAT;
99 uint32_t BBB_I2C_OA1;
100 uint32_t BBB_I2C_OA2;
101 uint32_t BBB_I2C_OA3;
102 uint32_t BBB_I2C_ACTOA;
103 uint32_t BBB_I2C_SBLOCK;
105
106void beagle_i2c_init( phandle_t node );
107
108#ifdef __cplusplus
109}
110#endif /* __cplusplus */
111
112#endif /* LIBBSP_ARM_BEAGLE_I2C_H */
Inter-Integrated Circuit (I2C) Driver API.
uint32_t phandle_t
Definition: ofw.h:56
This header file defines the RTEMS Classic API.
Definition: i2c.h:68