source: svn/newcon3bcm2_21bu/dst/dhl/src/devices/dtqs22ddp101b/MxL601_OEM_Drv.c

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 3.6 KB
Line 
1/*****************************************************************************************
2 *
3 * FILE NAME          : MxL601_OEM_Drv.c
4 *
5 * AUTHOR             : Dong Liu
6 *
7 * DATE CREATED       : 01/23/2011 
8 *
9 * DESCRIPTION        : This file contains I2C driver and Sleep functins that
10 *                      OEM should implement for MxL601 APIs
11 *                             
12 *****************************************************************************************
13 *                Copyright (c) 2010, MaxLinear, Inc.
14 ****************************************************************************************/
15
16#include "UserDefinedIIC2.h"
17#include "MxL601_OEM_Drv.h"
18
19/*----------------------------------------------------------------------------------------
20--| FUNCTION NAME : Ctrl_WriteRegister
21--|
22--| AUTHOR        : Brenndon Lee
23--|
24--| DATE CREATED  : 7/30/2009
25--|
26--| DESCRIPTION   : This function does I2C write operation.
27--|
28--| RETURN VALUE  : True or False
29--|
30--|-------------------------------------------------------------------------------------*/
31
32MXL_STATUS Ctrl_WriteRegister(UINT8 I2cSlaveAddr, UINT8 RegAddr, UINT8 RegData)
33{
34  MXL_STATUS status = MXL_TRUE;
35
36  // OEM should implement I2C write protocol that complies with MxL601 I2C
37  // format.
38
39  // 8 bit Register Write Protocol:
40  // +------+-+-----+-+-+----------+-+----------+-+-+
41  // |MASTER|S|SADDR|W| |RegAddr   | |RegData(L)| |P|
42  // +------+-+-----+-+-+----------+-+----------+-+-+
43  // |SLAVE |         |A|          |A|          |A| |
44  // +------+---------+-+----------+-+----------+-+-+
45  // Legends: SADDR (I2c slave address), S (Start condition), A (Ack), N(NACK),
46  // P(Stop condition)
47
48  status = MxL601_I2cWrite((I2cSlaveAddr<<1),RegAddr, RegData);
49 
50  return status;
51}
52
53/*------------------------------------------------------------------------------
54--| FUNCTION NAME : Ctrl_ReadRegister
55--|
56--| AUTHOR        : Brenndon Lee
57--|
58--| DATE CREATED  : 7/30/2009
59--|
60--| DESCRIPTION   : This function does I2C read operation.
61--|
62--| RETURN VALUE  : True or False
63--|
64--|---------------------------------------------------------------------------*/
65
66MXL_STATUS Ctrl_ReadRegister(UINT8 I2cSlaveAddr, UINT8 RegAddr, UINT8 *DataPtr)
67{
68  MXL_STATUS status = MXL_TRUE;
69 
70  // OEM should implement I2C read protocol that complies with MxL601 I2C
71  // format.
72
73  // 8 bit Register Read Protocol:
74  // +------+-+-----+-+-+----+-+----------+-+-+
75  // |MASTER|S|SADDR|W| |0xFB| |RegAddr   | |P|
76  // +------+-+-----+-+-+----+-+----------+-+-+
77  // |SLAVE |         |A|    |A|          |A| |
78  // +------+-+-----+-+-+----+-+----------+-+-+
79  // +------+-+-----+-+-+-----+--+-+
80  // |MASTER|S|SADDR|R| |     |MN|P|
81  // +------+-+-----+-+-+-----+--+-+
82  // |SLAVE |         |A|Data |  | |
83  // +------+---------+-+-----+--+-+
84  // Legends: SADDR(I2c slave address), S(Start condition), MA(Master Ack), MN(Master NACK),
85  // P(Stop condition)
86
87  status = MxL601_I2cRead((I2cSlaveAddr<<1),RegAddr,DataPtr);
88
89  return status;
90}
91
92/*------------------------------------------------------------------------------
93--| FUNCTION NAME : MXL_Sleep
94--|
95--| AUTHOR        : Dong Liu
96--|
97--| DATE CREATED  : 01/10/2010
98--|
99--| DESCRIPTION   : This function complete sleep operation. WaitTime is in ms unit
100--|
101--| RETURN VALUE  : None
102--|
103--|-------------------------------------------------------------------------------------*/
104
105void MxL_Sleep(UINT16 DelayTimeInMs)
106{
107  // OEM should implement sleep operation
108  SemcoSleep(0,DelayTimeInMs);
109}
Note: See TracBrowser for help on using the repository browser.