RTEMS 6.1-rc5
Loading...
Searching...
No Matches
mpc83xx_i2cdrv.h
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/*
4 * RTEMS support for MPC83xx
5 *
6 * This file contains the MPC83xx I2C driver declarations.
7 */
8
9/*
10 * Copyright (c) 2007 embedded brains GmbH & Co. KG
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 */
33
34#ifndef _MPC83XX_I2CDRV_H
35#define _MPC83XX_I2CDRV_H
36
37#include <rtems/libi2c.h>
38#include <rtems/irq.h>
39
40#include <bsp.h>
41
42#ifdef LIBBSP_POWERPC_GEN83XX_BSP_H
43 #include <mpc83xx/mpc83xx.h>
44#endif
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50#ifdef LIBBSP_POWERPC_MPC55XXEVB_BSP_H
51 typedef struct {
52 volatile uint8_t i2cadr;
53 volatile uint8_t i2cfdr;
54 volatile uint8_t i2ccr;
55 volatile uint8_t i2csr;
56 volatile uint8_t i2cdr;
57 volatile uint8_t i2cdfsrr;
59#endif
60
61typedef struct mpc83xx_i2c_softc {
62 m83xxI2CRegisters_t *reg_ptr; /* ptr to HW registers */
63 int initialized; /* TRUE: module is initialized */
64 rtems_irq_number irq_number; /* IRQ number used for this module */
65 uint32_t base_frq; /* input frq for baud rate divider */
66 rtems_id irq_sema_id; /* SEMA used for IRQ signalling */
67 void (*probe)(struct mpc83xx_i2c_softc *self);
69
70typedef struct {
71 rtems_libi2c_bus_t bus_desc;
72 struct mpc83xx_i2c_softc softc;
74
75
76extern rtems_libi2c_bus_ops_t mpc83xx_i2c_ops;
77
78#ifdef __cplusplus
79}
80#endif
81
82
83#endif /* _MPC83XX_I2CDRV_H */
Objects_Id rtems_id
This type represents RTEMS object identifiers.
Definition: types.h:94
Legacy I2C Library.
Definition: mpc83xx.h:274
Definition: mpc83xx_i2cdrv.h:70
Definition: mpc83xx_i2cdrv.h:61
Definition: libi2c.h:176
Definition: libi2c.h:163