RTEMS  5.1
mpc83xx_i2cdrv.h
1 /*===============================================================*\
2 | Project: RTEMS support for MPC83xx |
3 +-----------------------------------------------------------------+
4 | Copyright (c) 2007 |
5 | Embedded Brains GmbH |
6 | Obere Lagerstr. 30 |
7 | D-82178 Puchheim |
8 | Germany |
9 | rtems@embedded-brains.de |
10 +-----------------------------------------------------------------+
11 | The license and distribution terms for this file may be |
12 | found in the file LICENSE in this distribution or at |
13 | |
14 | http://www.rtems.org/license/LICENSE. |
15 | |
16 +-----------------------------------------------------------------+
17 | this file contains the MPC83xx I2C driver declarations |
18 \*===============================================================*/
19 #ifndef _MPC83XX_I2CDRV_H
20 #define _MPC83XX_I2CDRV_H
21 
22 #include <rtems/libi2c.h>
23 #include <rtems/irq.h>
24 
25 #include <bsp.h>
26 
27 #ifdef LIBBSP_POWERPC_GEN83XX_BSP_H
28  #include <mpc83xx/mpc83xx.h>
29 #endif
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #ifdef LIBBSP_POWERPC_MPC55XXEVB_BSP_H
36  typedef struct {
37  volatile uint8_t i2cadr;
38  volatile uint8_t i2cfdr;
39  volatile uint8_t i2ccr;
40  volatile uint8_t i2csr;
41  volatile uint8_t i2cdr;
42  volatile uint8_t i2cdfsrr;
44 #endif
45 
46 typedef struct mpc83xx_i2c_softc {
47  m83xxI2CRegisters_t *reg_ptr; /* ptr to HW registers */
48  int initialized; /* TRUE: module is initialized */
49  rtems_irq_number irq_number; /* IRQ number used for this module */
50  uint32_t base_frq; /* input frq for baud rate divider */
51  rtems_id irq_sema_id; /* SEMA used for IRQ signalling */
52  void (*probe)(struct mpc83xx_i2c_softc *self);
54 
55 typedef struct {
56  rtems_libi2c_bus_t bus_desc;
57  struct mpc83xx_i2c_softc softc;
59 
60 
61 extern rtems_libi2c_bus_ops_t mpc83xx_i2c_ops;
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 
68 #endif /* _MPC83XX_I2CDRV_H */
Definition: libi2c.h:162
Definition: mpc83xx_i2cdrv.h:46
Definition: mpc83xx_i2cdrv.h:55
Definition: mpc83xx.h:274
Definition: libi2c.h:175
Objects_Id rtems_id
Used to manage and manipulate RTEMS object identifiers.
Definition: types.h:83
Legacy I2C Library.