source: svn/trunk/newcon3bcm2_21bu/magnum/portinginterface/i2c/7552/bi2c_priv.h

Last change on this file was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 31.3 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2012, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile: bi2c_priv.h $
11 * $brcm_Revision: Hydra_Software_Devel/25 $
12 * $brcm_Date: 2/1/12 12:17a $
13 *
14 * Module Description:
15 *
16 * Revision History:
17 *
18 * $brcm_Log: /magnum/portinginterface/i2c/7346/bi2c_priv.h $
19 *
20 * Hydra_Software_Devel/25   2/1/12 12:17a agin
21 * SW7346-657:  Subaddress not handled properly for
22 * BI2C_P_WriteBy4BytesCmd.
23 *
24 * Hydra_Software_Devel/24   1/9/12 10:43a agin
25 * SWNOOS-507:  Eliminate redundant functions.
26 *
27 * Hydra_Software_Devel/23   1/7/12 1:42p agin
28 * SWNOOS-507:  Don't require a buffer for BI2C_P_WriteBy4BytesCmd.
29 *
30 * Hydra_Software_Devel/22   4/14/11 3:17p agin
31 * SW7344-44:  Add mutex protection for i2c accesses, handle EDDC
32 * different.
33 *
34 * Hydra_Software_Devel/21   3/21/11 4:11p agin
35 * SW7346-96:  Add prototypes for BI2C_P_WriteSwA24, BI2C_P_ReadSwA24 and
36 * BI2C_P_WriteSwA16.
37 *
38 * Hydra_Software_Devel/20   3/24/10 11:47a vle
39 * SW7601-171: Add BI2C_P_SetupHdmiHwAccess to set up I2C for HDMI HDCP
40 * auto Ri/Pj link integrity check feature
41 *
42 * Hydra_Software_Devel/SW7601-171/1   3/9/10 3:22p vle
43 * SW7601-171: Add BI2C_P_SetupHdmiHwAccess to set up I2C for HDMI HDCP
44 * auto Ri/Pj link integrity check feature
45 *
46 * Hydra_Software_Devel/19   10/26/09 1:52p agin
47 * SW7115-841: Add support for BERR_Code BI2C_P_ReadSwNoAck and
48 * BI2C_P_ReadSwNoAddrNoAck.
49 *
50 * Hydra_Software_Devel/18   12/13/08 3:45p agin
51 * PR42305: Support i2c via gpio for read EDDC.
52 *
53 * Hydra_Software_Devel/17   11/21/08 10:57a agin
54 * PR49585: Add sw i2c support for 7601.
55 *
56 * Hydra_Software_Devel/16   10/14/08 5:07p agin
57 * PR42305: Add BI2C_P_ReadSwNoAddr and BI2C_P_ReadSwEDDC.
58 *
59 * Hydra_Software_Devel/15   5/4/08 1:36a agin
60 * PR42305: Support i2c via gpio.
61 *
62 * Hydra_Software_Devel/14   4/21/08 1:17p farshidf
63 * PR41729: add BI2C_P_ReadNoAddrNoAck function
64 *
65 * Hydra_Software_Devel/13   5/24/07 11:53a jkim
66 * PR29251: Add 4byte transfer support for 7405
67 *
68 * Hydra_Software_Devel/12   4/24/07 5:25p jkim
69 * PR29538: Add burst mode support
70 *
71 * Hydra_Software_Devel/11   4/18/05 10:46a agin
72 * PR14828: add read and write no ack functions.
73 *
74 * Hydra_Software_Devel/10   3/14/05 5:51p agin
75 * PR14351: Fassl's changes
76 *
77 * Hydra_Software_Devel/9   3/2/05 5:49p agin
78 * PR14318:  Added support for I2C write for NVRAM devices.
79 *
80 * Hydra_Software_Devel/8   7/8/04 2:23p brianlee
81 * PR11845: Add I2C API for 3-byte sub address.
82 *
83 * Hydra_Software_Devel/7   1/13/04 5:02p brianlee
84 * PR9268: Make write structures constant.
85 *
86 * Hydra_Software_Devel/6   10/15/03 2:33p brianlee
87 * Moved #defne MAX_I2C_CHANNELS to bi2c.h so application code can use it.
88 *
89 * Hydra_Software_Devel/5   9/18/03 10:16a brianlee
90 * Make SetClk and GetClk functions public so the caller can change the
91 * clock rate after the channel is opened.
92 *
93 * Hydra_Software_Devel/4   9/12/03 5:02p brianlee
94 * Add chip address to EDDC read/write functions instead of using the
95 * fixed value of A0.
96 *
97 * Hydra_Software_Devel/3   9/11/03 11:42a brianlee
98 * Modified function definitions to match the ones in register interface.
99 *
100 * Hydra_Software_Devel/2   8/21/03 4:03p brianlee
101 * Added EDDCRead and EDDCWrite functions.  Added enums for I2C commands.
102 *
103 * Hydra_Software_Devel/1   7/31/03 9:44a brianlee
104 * Private I2C functions.
105 *
106 ***************************************************************************/
107#ifndef BI2C_PRIVATE_H__
108#define BI2C_PRIVATE_H__
109
110#include "bi2c.h"
111
112#ifdef __cplusplus
113extern "C" {
114#endif
115
116/* Data Transfer Format */
117typedef enum
118{
119        BI2C_P_eWriteOnly = 0,
120        BI2C_P_eReadOnly  = 1,
121        BI2C_P_eReadWrite = 2,
122        BI2C_P_eWriteRead = 3
123} BI2C_P_XferType;
124
125/***************************************************************************
126Summary:
127        This function performs a read operation with 8-bit target sub address.
128
129Description:
130        This function is used to read from a target with 8-bit sub address.
131               
132Returns:
133        TODO:
134
135See Also:
136        BI2C_P_ReadNoAck(), BI2C_P_ReadA16(), BI2C_P_ReadNoAddr(), BI2C_EDDCRead().
137
138****************************************************************************/
139BERR_Code BI2C_P_Read(
140        void *context,                          /* Device channel handle */
141        uint16_t chipAddr,                                      /* chip address */
142        uint8_t subAddr,                                        /* 8-bit sub address */
143        uint8_t *pData,                         /* pointer to memory location to store read data  */
144        size_t length                                           /* number of bytes to read */
145        );
146
147/***************************************************************************
148Summary:
149        This function performs a read operation with 8-bit target sub address.
150
151Description:
152        This function is used to read from a target with 8-bit sub address.
153               
154Returns:
155        TODO:
156
157See Also:
158        BI2C_P_ReadNoAck(), BI2C_P_ReadA16(), BI2C_P_ReadNoAddr(), BI2C_EDDCRead().
159
160****************************************************************************/
161BERR_Code BI2C_P_ReadSw(
162        void *context,                          /* Device channel handle */
163        uint16_t chipAddr,                                      /* chip address */
164        uint8_t subAddr,                                        /* 8-bit sub address */
165        uint8_t *pData,                         /* pointer to memory location to store read data  */
166        size_t length                                           /* number of bytes to read */
167        );
168
169/***************************************************************************
170Summary:
171        This function performs a read operation with 8-bit target sub address
172        and no ack.
173
174Description:
175        This function is used to read from a target with 8-bit sub address.
176               
177Returns:
178        TODO:
179
180See Also:
181        BI2C_P_Read(), BI2C_P_ReadA16(), BI2C_P_ReadNoAddr(), BI2C_EDDCRead().
182
183****************************************************************************/
184BERR_Code BI2C_P_ReadNoAck(
185        void *context,                          /* Device channel handle */
186        uint16_t chipAddr,                                      /* chip address */
187        uint8_t subAddr,                                        /* 8-bit sub address */
188        uint8_t *pData,                         /* pointer to memory location to store read data  */
189        size_t length                                           /* number of bytes to read */
190        );
191
192/***************************************************************************
193Summary:
194        This function performs a read operation with 8-bit target sub address
195        and no ack.
196
197Description:
198        This function is used to read from a target with 8-bit sub address.
199               
200Returns:
201        TODO:
202
203See Also:
204        BI2C_P_Read(), BI2C_P_ReadA16(), BI2C_P_ReadNoAddr(), BI2C_EDDCRead().
205
206****************************************************************************/
207BERR_Code BI2C_P_ReadSwNoAck(
208        void *context,                          /* Device channel handle */
209        uint16_t chipAddr,                                      /* chip address */
210        uint8_t subAddr,                                        /* 8-bit sub address */
211        uint8_t *pData,                         /* pointer to memory location to store read data  */
212        size_t length                                           /* number of bytes to read */
213        );
214
215/***************************************************************************
216Summary:
217        This function performs a read operation with 16-bit target sub address.
218
219Description:
220        This function is used to read from a target with 16-bit sub address.
221               
222Returns:
223        TODO:
224
225See Also:
226        BI2C_P_Read(), BI2C_P_ReadNoAck(), BI2C_P_ReadNoAddr(), BI2C_EDDCRead().
227
228****************************************************************************/
229BERR_Code BI2C_P_ReadA16(
230        void *context,                          /* Device channel handle */
231        uint16_t chipAddr,                                      /* chip address */
232        uint16_t subAddr,                                       /* 16-bit sub address */
233        uint8_t *pData,                         /* pointer to memory location to store read data  */
234        size_t length                                           /* number of bytes to read */
235        );
236
237/***************************************************************************
238Summary:
239        This function performs a read operation with 16-bit target sub address.
240
241Description:
242        This function is used to read from a target with 16-bit sub address.
243               
244Returns:
245        TODO:
246
247See Also:
248        BI2C_P_Read(), BI2C_P_ReadNoAck(), BI2C_P_ReadNoAddr(), BI2C_EDDCRead().
249
250****************************************************************************/
251BERR_Code BI2C_P_ReadSwA16(
252        void *context,                          /* Device channel handle */
253        uint16_t chipAddr,                                      /* chip address */
254        uint16_t subAddr,                                       /* 16-bit sub address */
255        uint8_t *pData,                         /* pointer to memory location to store read data  */
256        size_t length                                           /* number of bytes to read */
257        );
258
259/***************************************************************************
260Summary:
261        This function performs a read operation with 24-bit target sub address.
262
263Description:
264        This function is used to read from a target with 24-bit sub address.
265               
266Returns:
267        TODO:
268
269See Also:
270        BI2C_P_Read(), BI2C_P_ReadNoAck(), BI2C_P_ReadNoAddr(), BI2C_EDDCRead().
271
272****************************************************************************/
273BERR_Code BI2C_P_ReadA24(
274        void *context,                          /* Device channel handle */
275        uint16_t chipAddr,                                      /* chip address */
276        uint32_t subAddr,                                       /* 24-bit sub address */
277        uint8_t *pData,                         /* pointer to memory location to store read data  */
278        size_t length                                           /* number of bytes to read */
279        );
280
281/***************************************************************************
282Summary:
283        This function performs a read operation with 24-bit target sub address.
284
285Description:
286        This function is used to read from a target with 24-bit sub address.
287               
288Returns:
289        TODO:
290
291See Also:
292        BI2C_P_Read(), BI2C_P_ReadNoAck(), BI2C_P_ReadNoAddr(), BI2C_EDDCRead().
293
294****************************************************************************/
295BERR_Code BI2C_P_ReadSwA24(
296        void *context,                          /* Device channel handle */
297        uint16_t chipAddr,                                      /* chip address */
298        uint32_t subAddr,                                       /* 24-bit sub address */
299        uint8_t *pData,                         /* pointer to memory location to store read data  */
300        size_t length                                           /* number of bytes to read */
301        );
302
303/***************************************************************************
304Summary:
305        This function performs a read operation with no target sub address.
306
307Description:
308        This function is used to read from a target without specifying sub
309        address.  This is normally used when the user wants to continue reading
310        from where the last read command left off.
311               
312Returns:
313        TODO:
314
315See Also:
316        BI2C_P_Read(), BI2C_P_ReadNoAck(), BI2C_P_ReadA16(), BI2C_EDDCRead().
317
318****************************************************************************/
319BERR_Code BI2C_P_ReadNoAddr(
320        void *context,                          /* Device channel handle */
321        uint16_t chipAddr,                                      /* chip address */
322        uint8_t *pData,                         /* pointer to memory location to store read data  */
323        size_t length                                           /* number of bytes to read */
324        );
325
326/***************************************************************************
327Summary:
328        This function performs a read operation with no target sub address.
329
330Description:
331        This function is used to read from a target without specifying sub
332        address.  This is normally used when the user wants to continue reading
333        from where the last read command left off.
334               
335Returns:
336        TODO:
337
338See Also:
339        BI2C_P_Read(), BI2C_P_ReadNoAck(), BI2C_P_ReadA16(), BI2C_EDDCRead().
340
341****************************************************************************/
342BERR_Code BI2C_P_ReadSwNoAddr(
343        void *context,                          /* Device channel handle */
344        uint16_t chipAddr,                                      /* chip address */
345        uint8_t *pData,                         /* pointer to memory location to store read data  */
346        size_t length                                           /* number of bytes to read */
347        );
348
349/***************************************************************************
350Summary:
351        This function performs a read operation with no target sub address.
352
353Description:
354        This function is used to read from a target without specifying sub
355        address and without waiting for an ack.  This is normally used when the
356        user wants to continue reading from where the last read command left off.
357               
358Returns:
359        TODO:
360
361See Also:
362        BI2C_P_Read(), BI2C_P_ReadNoAck(), BI2C_P_ReadA16(), BI2C_EDDCRead().
363
364****************************************************************************/
365BERR_Code BI2C_P_ReadNoAddrNoAck(
366        void *context,                          /* Device channel handle */
367        uint16_t chipAddr,                                      /* chip address */
368        uint8_t *pData,                         /* pointer to memory location to store read data  */
369        size_t length                                           /* number of bytes to read */
370        );
371
372/***************************************************************************
373Summary:
374        This function performs a read operation with no target sub address.
375
376Description:
377        This function is used to read from a target without specifying sub
378        address and without waiting for an ack.  This is normally used when the
379        user wants to continue reading from where the last read command left off.
380               
381Returns:
382        TODO:
383
384See Also:
385        BI2C_P_Read(), BI2C_P_ReadNoAck(), BI2C_P_ReadA16(), BI2C_EDDCRead().
386
387****************************************************************************/
388BERR_Code BI2C_P_ReadSwNoAddrNoAck(
389        void *context,                          /* Device channel handle */
390        uint16_t chipAddr,                                      /* chip address */
391        uint8_t *pData,                         /* pointer to memory location to store read data  */
392        size_t length                                           /* number of bytes to read */
393        );
394
395/***************************************************************************
396Summary:
397        This function performs a write operation with 8-bit target sub address.
398
399Description:
400        This function is used to write data to a target with 8-bit sub address.
401               
402Returns:
403        TODO:
404
405See Also:
406        BI2C_P_WriteA16(), BI2C_P_WriteNoAck(), BI2C_P_WriteNoAddr(), BI2C_EDDCwrite().
407
408****************************************************************************/
409BERR_Code BI2C_P_Write(
410        void *context,                          /* Device channel handle */
411        uint16_t chipAddr,                                      /* chip address */
412        uint8_t subAddr,                                        /* 8-bit sub address */
413        const uint8_t *pData,                           /* pointer to data to write */
414        size_t length                                           /* number of bytes to write */
415        );
416
417/***************************************************************************
418Summary:
419        This function performs a write operation with 8-bit target sub address.
420
421Description:
422        This function is used to write data to a target with 8-bit sub address.
423               
424Returns:
425        TODO:
426
427See Also:
428        BI2C_P_WriteA16(), BI2C_P_WriteNoAck(), BI2C_P_WriteNoAddr(), BI2C_EDDCwrite().
429
430****************************************************************************/
431BERR_Code BI2C_P_WriteSw(
432        void *context,                          /* Device channel handle */
433        uint16_t chipAddr,                                      /* chip address */
434        uint8_t subAddr,                                        /* 8-bit sub address */
435        const uint8_t *pData,                           /* pointer to data to write */
436        size_t length                                           /* number of bytes to write */
437        );
438
439/***************************************************************************
440Summary:
441        This function performs a write operation with 8-bit target sub address
442        and no ack.
443
444Description:
445        This function is used to write data to a target with 8-bit sub address.
446               
447Returns:
448        TODO:
449
450See Also:
451        BI2C_P_WriteA16(), BI2C_P_WriteA16(), BI2C_P_WriteNoAddr(), BI2C_EDDCwrite().
452
453****************************************************************************/
454BERR_Code BI2C_P_WriteNoAck(
455        void *context,                          /* Device channel handle */
456        uint16_t chipAddr,                                      /* chip address */
457        uint8_t subAddr,                                        /* 8-bit sub address */
458        const uint8_t *pData,                           /* pointer to data to write */
459        size_t length                                           /* number of bytes to write */
460        );
461
462/***************************************************************************
463Summary:
464        This function performs a write operation with 16-bit target sub address.
465
466Description:
467        This function is used to write data to a target with 16-bit sub address.
468               
469Returns:
470        TODO:
471
472See Also:
473        BI2C_P_Write(), BI2C_P_WriteNoAck(), BI2C_P_WriteNoAddr(), BI2C_EDDCwrite().
474
475****************************************************************************/
476BERR_Code BI2C_P_WriteA16(
477        void *context,                          /* Device channel handle */
478        uint16_t chipAddr,                                      /* chip address */
479        uint16_t subAddr,                                       /* 16-bit sub address */
480        const uint8_t *pData,                           /* pointer to data to write */
481        size_t length                                           /* number of bytes to write */
482        );
483
484/***************************************************************************
485Summary:
486        This function performs a write operation with 16-bit target sub address.
487
488Description:
489        This function is used to write data to a target with 16-bit sub address.
490               
491Returns:
492        TODO:
493
494See Also:
495        BI2C_P_Write(), BI2C_P_WriteNoAck(), BI2C_P_WriteNoAddr(), BI2C_EDDCwrite().
496
497****************************************************************************/
498BERR_Code BI2C_P_WriteSwA16(
499        void *context,                          /* Device channel handle */
500        uint16_t chipAddr,                                      /* chip address */
501        uint16_t subAddr,                                       /* 16-bit sub address */
502        const uint8_t *pData,                           /* pointer to data to write */
503        size_t length                                           /* number of bytes to write */
504        );
505
506/***************************************************************************
507Summary:
508        This function performs a write operation with 24-bit target sub address.
509
510Description:
511        This function is used to write data to a target with 16-bit sub address.
512               
513Returns:
514        TODO:
515
516See Also:
517        BI2C_P_Write(), BI2C_P_WriteNoAck(), BI2C_P_WriteNoAddr(), BI2C_EDDCwrite().
518
519****************************************************************************/
520BERR_Code BI2C_P_WriteA24(
521        void *context,                          /* Device channel handle */
522        uint16_t chipAddr,                                      /* chip address */
523        uint32_t subAddr,                                       /* 24-bit sub address */
524        const uint8_t *pData,                           /* pointer to data to write */
525        size_t length                                           /* number of bytes to write */
526        );
527
528/***************************************************************************
529Summary:
530        This function performs a write operation with 24-bit target sub address.
531
532Description:
533        This function is used to write data to a target with 16-bit sub address.
534               
535Returns:
536        TODO:
537
538See Also:
539        BI2C_P_Write(), BI2C_P_WriteNoAck(), BI2C_P_WriteNoAddr(), BI2C_EDDCwrite().
540
541****************************************************************************/
542BERR_Code BI2C_P_WriteSwA24(
543        void *context,                          /* Device channel handle */
544        uint16_t chipAddr,                                      /* chip address */
545        uint32_t subAddr,                                       /* 24-bit sub address */
546        const uint8_t *pData,                           /* pointer to data to write */
547        size_t length                                           /* number of bytes to write */
548        );
549
550/***************************************************************************
551Summary:
552        This function performs a write operation with no target sub address.
553
554Description:
555        This function is used to write from a target without specifying sub
556        address.  This is normally used when the user wants to continue writing
557        from where the last write command left off.
558               
559Returns:
560        TODO:
561
562See Also:
563        BI2C_P_Write(), BI2C_P_WriteNoAck(), BI2C_P_WriteA16(), BI2C_EDDCwrite().
564
565****************************************************************************/
566BERR_Code BI2C_P_WriteNoAddr(
567        void *context,                          /* Device channel handle */
568        uint16_t chipAddr,                                      /* chip address */
569        const uint8_t *pData,                           /* pointer to data to write */
570        size_t length                                           /* number of bytes to write */
571        );
572
573/***************************************************************************
574Summary:
575        This function performs a write operation with no target sub address
576        and no ack.
577
578Description:
579        This function is used to write from a target without specifying sub
580        address and without waiting for an ack.  This is normally used when
581        the user wants to continue writing from where the last write command
582        left off.
583               
584Returns:
585        TODO:
586
587See Also:
588        BI2C_P_Write(), BI2C_P_WriteNoAck(), BI2C_P_WriteA16(), BI2C_EDDCwrite().
589
590****************************************************************************/
591BERR_Code BI2C_P_WriteNoAddrNoAck(
592        void *context,                          /* Device channel handle */
593        uint16_t chipAddr,                                      /* chip address */
594        const uint8_t *pData,                           /* pointer to data to write */
595        size_t length                                           /* number of bytes to write */
596        );
597
598/***************************************************************************
599Summary:
600        This function performs a write operation to an nvram device.
601
602Description:
603        This function is used to write an nvram device.
604               
605Returns:
606        TODO:
607
608See Also:
609        BI2C_P_Write(), BI2C_P_WriteNoAck(), BI2C_P_WriteA16(), BI2C_EDDCwrite().
610
611****************************************************************************/
612BERR_Code BI2C_P_WriteNvram(
613        void *context,                                          /* Device channel handle */
614        uint16_t chipAddr,                                      /* chip address */
615        uint8_t subAddr,                                        /* 8-bit sub address */
616        const uint8_t *pData,                           /* pointer to data to write */
617        size_t length                                           /* number of bytes to write */
618        );
619
620/***************************************************************************
621Summary:
622        This function performs a EDDC read operation.
623
624Description:
625        This function is used to perform an Enhanced Display Data Channel read
626        protocol.
627               
628Returns:
629        TODO:
630
631See Also:
632
633****************************************************************************/
634BERR_Code BI2C_P_ReadEDDC(
635        void *context,                          /* Device channel handle */
636        uint8_t chipAddr,                       /* chip address */
637        uint8_t segment,                        /* EDDC segment pointer */
638        uint8_t subAddr,                        /* 8-bit sub address */
639        uint8_t *pData,                         /* pointer to memory location to store read data  */
640        size_t length                           /* number of bytes to read */
641        );
642
643/***************************************************************************
644Summary:
645        This function performs a EDDC read operation.
646
647Description:
648        This function is used to perform an Enhanced Display Data Channel read
649        protocol.
650               
651Returns:
652        TODO:
653
654See Also:
655
656****************************************************************************/
657BERR_Code BI2C_P_ReadSwEDDC(
658        void *context,                          /* Device channel handle */
659        uint8_t chipAddr,                       /* chip address */
660        uint8_t segment,                        /* EDDC segment pointer */
661        uint8_t subAddr,                        /* 8-bit sub address */
662        uint8_t *pData,                         /* pointer to memory location to store read data  */
663        size_t length                           /* number of bytes to read */
664        );
665
666/***************************************************************************
667Summary:
668        This function performs a EDDC write operation.
669
670Description:
671        This function is used to perform an Enhanced Display Data Channel write
672        protocol.
673               
674Returns:
675        TODO:
676
677See Also:
678
679****************************************************************************/
680BERR_Code BI2C_P_WriteEDDC(
681        void *context,                          /* Device channel handle */
682        uint8_t chipAddr,                       /* chip address */
683        uint8_t segment,                        /* EDDC segment pointer */
684        uint8_t subAddr,                        /* 8-bit sub address */
685        const uint8_t *pData,           /* pointer to data to write */
686        size_t length                           /* number of bytes to write */
687        );
688
689/***************************************************************************
690Summary:
691        This function is the main read function
692
693Description:
694        This function is called by public read functions
695               
696Returns:
697        TODO:
698
699See Also:
700
701****************************************************************************/
702BERR_Code BI2C_P_ReadCmd
703(
704        BI2C_ChannelHandle      hChn,                   /* Device channel handle */
705        uint16_t                chipAddr,                       /* i2c chip address.  this is unshifted */
706        void                    *pSubAddr,                      /* pointer to register address */
707        uint8_t                 numSubAddrBytes,        /* number of bytes in register address */
708        uint8_t                 *pData,                         /* storage */
709        size_t                  numBytes,                       /* number of bytes to read */
710        bool                    mutex,                          /* protect with a mutex */
711    bool            ack                 /* check for ack? */
712);
713
714/***************************************************************************
715Summary:
716        This function is the main read function
717
718Description:
719        This function is called by public read functions
720               
721Returns:
722        TODO:
723
724See Also:
725
726****************************************************************************/
727BERR_Code BI2C_P_ReadSwCmd
728(
729        BI2C_ChannelHandle      hChn,                   /* Device channel handle */
730        uint16_t                chipAddr,                       /* i2c chip address.  this is unshifted */
731        void                    *pSubAddr,                      /* pointer to register address */
732        uint8_t                 numSubAddrBytes,        /* number of bytes in register address */
733        uint8_t                 *pData,                         /* storage */
734        size_t                  numBytes,                       /* number of bytes to read */
735        bool                    eddc,                           /* EDDC mode */
736        uint8_t                 segment,                        /* EDDC segment */
737        bool                    checkForAck                 /* Ignore ack? */
738);
739
740/***************************************************************************
741Summary:
742        This function is the burst mode read function
743
744Description:
745        This function is called by public read functions
746               
747Returns:
748        TODO:
749
750See Also:
751
752****************************************************************************/
753BERR_Code BI2C_P_BurstReadCmd
754(
755        BI2C_ChannelHandle      hChn,                   /* Device channel handle */
756        uint16_t                chipAddr,                       /* i2c chip address.  this is unshifted */
757        void                    *pSubAddr,                      /* pointer to register address */
758        uint8_t                 numSubAddrBytes,        /* number of bytes in register address */
759        uint8_t                 *pData,                         /* storage */
760        size_t                  numBytes                        /* number of bytes to read */
761);
762
763/***************************************************************************
764Summary:
765        This function is the burst mode read function
766
767Description:
768        This function is called by public read functions
769               
770Returns:
771        TODO:
772
773See Also:
774
775****************************************************************************/
776BERR_Code BI2C_P_BurstReadCmdNoAck
777(
778        BI2C_ChannelHandle      hChn,                   /* Device channel handle */
779        uint16_t                chipAddr,                       /* i2c chip address.  this is unshifted */
780        void                    *pSubAddr,                      /* pointer to register address */
781        uint8_t                 numSubAddrBytes,        /* number of bytes in register address */
782        uint8_t                 *pData,                         /* storage */
783        size_t                  numBytes                        /* number of bytes to read */
784);
785
786/***********************************************************************func
787 * Name: BI2C_P_ReadBy4BytesCmd
788 *   - Read data from i2c slave device.
789 *       write (1 byte of slave device register's address, subAddr)
790 *   and read  (0-8 bytes of data)
791 *   Using i2c Write.& Read
792 *
793 * NOTE: This function will be called by BI2C_P_Read, BI2C_P_ReadA16, BI2C_P_ReadNoAddr
794 ***************************************************************************/
795BERR_Code BI2C_P_ReadBy4BytesCmd
796(
797    BI2C_ChannelHandle  hChn,           /* Device channel handle */
798    uint16_t        chipAddr,           /* i2c chip address.  this is unshifted */
799    void            *pSubAddr,          /* pointer to register address */
800    uint8_t         numSubAddrBytes,    /* number of bytes in register address */
801    uint8_t         *pData,             /* storage */
802    size_t          numBytes,           /* number of bytes to read */
803    bool            mutex,              /* protect with a mutex */
804    bool            ack                 /* check for ack? */
805);
806
807/***************************************************************************
808Summary:
809        This function is the main write function
810
811Description:
812        This function is called by public write functions
813               
814Returns:
815        TODO:
816
817See Also:
818
819****************************************************************************/
820BERR_Code BI2C_P_WriteCmd
821(
822        BI2C_ChannelHandle      hChn,                   /* Device channel handle */
823        uint16_t                        chipAddr,               /* i2c chip address.  this is unshifted */
824        uint32_t                        subAddr,                /* register address */
825        uint8_t                         numSubAddrBytes,        /* number of bytes in register address */
826        const uint8_t           *pData,                 /* storage */
827        size_t                          numBytes,               /* number of bytes to write */
828        bool                            isNvram,                /* is this a nvram access? */ 
829        bool                            mutex,          /* protect with a mutex */
830        bool                            ack             /* check for ack? */
831);
832
833/***************************************************************************
834Summary:
835        This function is the main write function
836
837Description:
838        This function is called by public write functions
839               
840Returns:
841        TODO:
842
843See Also:
844
845****************************************************************************/
846BERR_Code BI2C_P_WriteSwCmd
847(
848        BI2C_ChannelHandle      hChn,                   /* Device channel handle */
849        uint16_t                        chipAddr,               /* i2c chip address.  this is unshifted */
850        void                            *pSubAddr,              /* pointer to register address */
851        uint8_t                         numSubAddrBytes,        /* number of bytes in register address */
852        const uint8_t           *pData,                 /* storage */
853        size_t                          numBytes,               /* number of bytes to write */
854        bool                            isNvram                 /* is this a nvram access? */ 
855);
856
857/***********************************************************************func
858 * Name: BI2C_P_WriteBy4BytesCmd
859 *   - Write data to an i2c slave device.
860 *
861 * NOTE: This function will be called by BI2C_P_Write, BI2C_P_WriteA16, BI2C_P_WriteNoAddr
862 ***************************************************************************/
863BERR_Code BI2C_P_WriteBy4BytesCmd
864(
865    BI2C_ChannelHandle  hChn,           /* Device channel handle */
866    uint16_t            chipAddr,       /* i2c chip address.  this is unshifted */
867    uint32_t            subAddr,        /* register address */
868    uint8_t             numSubAddrBytes,    /* number of bytes in register address */
869    const uint8_t       *pData,     /* storage */
870    size_t              numBytes,       /* number of bytes to write */
871    bool                isNvram,        /* is this a nvram access? */ 
872    bool                mutex,           /* protect with a mutex */
873    bool                ack             /* check for ack? */
874);
875
876/***************************************************************************
877Summary:
878        This function waits for I2C transfer to complete
879
880Description:
881        This function waits for event if interrupt is enabled.  If interrupt is
882        not enabled, it stays in a loop and polls until timeout occurs.
883               
884Returns:
885        TODO:
886
887See Also:
888
889****************************************************************************/
890BERR_Code BI2C_P_WaitForCompletion
891(
892        BI2C_ChannelHandle      hChn,                           /* Device channel handle */
893        uint32_t                        numBytes                        /* number of bytes to transfer */
894);
895
896/***************************************************************************
897Summary:
898        This function waits for an NVRAM I2C slave device transfer to complete
899
900Description:
901        This function waits a calculated amount of time for an NVRAM I2C
902        slave device to respond with an acknowledgement.
903               
904Returns:
905        TODO:
906
907See Also:
908
909****************************************************************************/
910BERR_Code BI2C_P_WaitForNVMToAcknowledge
911(
912        BI2C_ChannelHandle  hChn,                               /* Device channel handle */
913        uint16_t                        chipAddr,                       /* i2c chip address.  this is unshifted */
914        void                            *pSubAddr,                      /* pointer to register address */
915        uint8_t                         numSubAddrBytes,        /* number of bytes in register address */
916        size_t                          numBytes                        /* number of bytes to write */
917);
918
919/***************************************************************************
920Summary:
921        This function waits for data to leave the 8 byte I2C fifo.
922
923Description:
924        This function waits a calculated amount of time for the 8 byte I2C fifo
925        to empty rather than rely on waiting for an ack.
926               
927Returns:
928        TODO:
929
930See Also:
931
932****************************************************************************/
933BERR_Code BI2C_P_WaitForDataToLeaveFIFO
934(
935        BI2C_ChannelHandle      hChn,                           /* Device channel handle */
936        uint32_t                        numBytes                        /* number of bytes to transfer */
937);
938
939
940/***************************************************************************
941Summary:
942        This function sets up I2C HW ready for HDMI HDCP Auto Ri/Pj link intergrity check feature
943
944Description:
945        This function sets up the neccessary I2C HW to use for HDMI HDCP Auto Ri/Pj
946        link intergrity check feature.
947               
948See Also:
949
950****************************************************************************/
951BERR_Code BI2C_P_SetupHdmiHwAccess(
952        void *context,                                    /* Device channel handle */
953        uint32_t dataTransferFormat,            /* Data Transfer Format */
954        uint32_t cnt1,                                          /* Counter 1 value */
955        uint32_t cnt2                                           /* Counter 2 value */
956);
957
958
959/***************************************************************************
960Summary:
961        This function is the interrupt handler for I2C
962
963Description:
964               
965Returns:
966        TODO:
967
968See Also:
969
970****************************************************************************/
971static void BI2C_P_HandleInterrupt_Isr
972(
973        void *pParam1,                                          /* Device channel handle */
974        int parm2                                                       /* not used */
975);
976
977/***************************************************************************
978Summary:
979        This function is used for initializing the i2c gpio support.
980
981Description:
982               
983Returns:
984        TODO:
985
986See Also:
987
988****************************************************************************/
989void BI2C_P_GpioInit(void);
990
991#ifdef __cplusplus
992}
993#endif
994 
995#endif
996
997
998
Note: See TracBrowser for help on using the repository browser.