1 /******************************************************************************
2 ** File Name: I2C_phy.h *
5 ** Copyright: 2010 Spreatrum, Incoporated. All Rights Reserved. *
6 ** Description: This file define the basic hw interfaces of I2C device. *
7 ******************************************************************************
9 ******************************************************************************
11 ** ------------------------------------------------------------------------- *
12 ** DATE NAME DESCRIPTION *
13 ** 06/28/2010 liuhao Create. *
14 ******************************************************************************/
18 /*----------------------------------------------------------------------------*
20 **------------------------------------------------------------------------- */
22 #include "sci_types.h"
24 /**---------------------------------------------------------------------------*
26 **--------------------------------------------------------------------------*/
31 /**---------------------------------------------------------------------------*
33 **---------------------------------------------------------------------------*/
34 typedef uint32 (*_init) (uint32 phy_id, uint32 freq, uint32 port);
35 typedef uint32 (*_start) (uint32 phy_id, uint8 addr, BOOLEAN rw, BOOLEAN ack_en);
36 typedef uint32 (*_write) (uint32 phy_id, uint8 *pCmd, uint32 len, BOOLEAN ack_en, BOOLEAN no_stop);
37 typedef uint32 (*_read) (uint32 phy_id, uint8 *pCmd, uint32 len, BOOLEAN ack_en);
38 typedef uint32 (*_stop) (uint32 phy_id);
39 typedef uint32 (*_sendack) (uint32 phy_id);
40 typedef uint32 (*_getack) (uint32 phy_id);
53 //I2C error code define
56 ERR_I2C_NONE = 0, // Success,no error
57 ERR_I2C_ACK_TIMEOUT, // I2C wait ACK timeout
58 ERR_I2C_INT_TIMEOUT, // I2C wait INT timeout
59 ERR_I2C_BUSY_TIMEOUT, // I2C wait BUSY timeout
60 ERR_I2C_DEVICE_NOT_FOUND, // I2C device not found
61 ERR_I2C_NO_MUTEX // No mutex created
64 /**----------------------------------------------------------------------------*
65 ** Local Function Prototype **
66 **----------------------------------------------------------------------------*/
69 /**----------------------------------------------------------------------------*
70 ** Function Prototype **
71 **----------------------------------------------------------------------------*/
73 /**----------------------------------------------------------------------------*
75 **----------------------------------------------------------------------------*/
79 /**---------------------------------------------------------------------------*/