source: rtems/c/src/lib/libbsp/arm/xilinx-zynq/include/i2c.h @ 45a63ee

4.115
Last change on this file since 45a63ee was 45a63ee, checked in by Sebastian Huber <sebastian.huber@…>, on Nov 10, 2014 at 12:46:32 PM

bsp/xilinx-zynq: Add Cadence I2C bus driver

  • Property mode set to 100644
File size: 964 bytes
Line 
1/*
2 * Copyright (c) 2014 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <info@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#ifndef LIBBSP_ARM_XILINX_ZYNQ_I2C_H
16#define LIBBSP_ARM_XILINX_ZYNQ_I2C_H
17
18#include <bsp/cadence-i2c.h>
19#include <bsp/irq.h>
20#include <bsp.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif /* __cplusplus */
25
26static inline int zynq_register_i2c_0(void)
27{
28  return i2c_bus_register_cadence(
29    "/dev/i2c-0",
30    0xe0004000,
31    zynq_clock_cpu_1x(),
32    ZYNQ_IRQ_I2C_0
33  );
34}
35
36static inline int zynq_register_i2c_1(void)
37{
38  return i2c_bus_register_cadence(
39    "/dev/i2c-1",
40    0xe0005000,
41    zynq_clock_cpu_1x(),
42    ZYNQ_IRQ_I2C_1
43  );
44}
45
46#ifdef __cplusplus
47}
48#endif /* __cplusplus */
49
50#endif /* LIBBSP_ARM_XILINX_ZYNQ_I2C_H */
Note: See TracBrowser for help on using the repository browser.