blob: 6abe505a5e253fc84f6d00c96de7a9fe3ca39bda (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
/******************************************************************************
** File Name: sc8810_i2c_cfg.h *
** Author: liuhao *
** DATE: 06/28/2010 *
** Copyright: 2010 Spreatrum, Incoporated. All Rights Reserved. *
** Description: This file define the basic hw interfaces of I2C device. *
******************************************************************************
******************************************************************************
** Edit History *
** ------------------------------------------------------------------------- *
** DATE NAME DESCRIPTION *
** 06/28/2010 liuhao Create. *
******************************************************************************/
#ifndef _SC8810_I2C_CFG_H_
#define _SC8810_I2C_CFG_H_
/*----------------------------------------------------------------------------*
** Dependencies *
**------------------------------------------------------------------------- */
#include "asm/arch/sci_types.h"
#include "i2c_phy.h"
/**---------------------------------------------------------------------------*
** Compiler Flag *
**--------------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C"
{
#endif
/**---------------------------------------------------------------------------*
** Debugging Flag *
**---------------------------------------------------------------------------*/
//#define DEBUG_IIC
//#ifdef DEBUG_IIC
//#define IIC_PRINT SCI_TRACE_LOW
//#else
#define IIC_PRINT
//#endif
/**---------------------------------------------------------------------------*
** Micro Define **
**---------------------------------------------------------------------------*/
#ifndef I2C_DEV_MAX
#define I2C_DEV_MAX 8
#endif
#define I2C_BUS_MAX 6
#define I2C_ID_MAX 6
#define I2C_PORT_NUM 0
typedef struct
{
uint32 phy_id;
uint32 base_addr;
} I2C_BASE_INFO;
typedef struct
{
uint32 phy_id;
uint32 sda_pin;
uint32 scl_pin;
} I2C_GPIO_INFO;
typedef struct
{
uint32 logic_id;
uint32 phy_id;
uint32 port_id;
I2C_PHY_FUN *phy_fun;
} I2C_PHY_CFG;
/**----------------------------------------------------------------------------*
** Local Function Prototype **
**----------------------------------------------------------------------------*/
/**----------------------------------------------------------------------------*
** Function Prototype **
**----------------------------------------------------------------------------*/
/**----------------------------------------------------------------------------*
** Compiler Flag **
**----------------------------------------------------------------------------*/
#ifdef __cplusplus
}
#endif
/**---------------------------------------------------------------------------*/
#endif
// End
|