VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.1.0/xf86i2c.h@ 81043

Last change on this file since 81043 was 51223, checked in by vboxsync, 11 years ago

Additions/x11/x11include: added header files for X.Org Server 1.0 and 1.1.

  • Property svn:eol-style set to native
File size: 3.2 KB
Line 
1/*
2 * Copyright (C) 1998 Itai Nahshon, Michael Schimek
3 */
4
5/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.h,v 1.10 2003/07/16 01:38:47 dawes Exp $ */
6
7#ifndef _XF86I2C_H
8#define _XF86I2C_H
9
10#include "regionstr.h"
11
12typedef unsigned char I2CByte;
13typedef unsigned short I2CSlaveAddr;
14
15typedef struct _I2CBusRec *I2CBusPtr;
16typedef struct _I2CDevRec *I2CDevPtr;
17
18/* I2C masters have to register themselves */
19
20typedef struct _I2CBusRec {
21 char * BusName;
22 int scrnIndex;
23
24 void (*I2CUDelay) (I2CBusPtr b, int usec);
25
26 void (*I2CPutBits)(I2CBusPtr b, int scl, int sda);
27 void (*I2CGetBits)(I2CBusPtr b, int *scl, int *sda);
28
29 /* Look at the generic routines to see how these functions should behave. */
30
31 Bool (*I2CStart) (I2CBusPtr b, int timeout);
32 Bool (*I2CAddress)(I2CDevPtr d, I2CSlaveAddr);
33 void (*I2CStop) (I2CDevPtr d);
34 Bool (*I2CPutByte)(I2CDevPtr d, I2CByte data);
35 Bool (*I2CGetByte)(I2CDevPtr d, I2CByte *data, Bool);
36
37 DevUnion DriverPrivate;
38
39 int HoldTime; /* 1 / bus clock frequency, 5 or 2 usec */
40
41 int BitTimeout; /* usec */
42 int ByteTimeout; /* usec */
43 int AcknTimeout; /* usec */
44 int StartTimeout; /* usec */
45 int RiseFallTime; /* usec */
46
47 I2CDevPtr FirstDev;
48 I2CBusPtr NextBus;
49 Bool (*I2CWriteRead)(I2CDevPtr d, I2CByte *WriteBuffer, int nWrite,
50 I2CByte *ReadBuffer, int nRead);
51} I2CBusRec;
52
53I2CBusPtr xf86CreateI2CBusRec(void);
54void xf86DestroyI2CBusRec(I2CBusPtr pI2CBus, Bool unalloc, Bool devs_too);
55Bool xf86I2CBusInit(I2CBusPtr pI2CBus);
56I2CBusPtr xf86I2CFindBus(int scrnIndex, char *name);
57int xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr **pppI2CBus);
58
59
60/* I2C slave devices */
61
62typedef struct _I2CDevRec {
63 char * DevName;
64
65 int BitTimeout; /* usec */
66 int ByteTimeout; /* usec */
67 int AcknTimeout; /* usec */
68 int StartTimeout; /* usec */
69
70 I2CSlaveAddr SlaveAddr;
71 I2CBusPtr pI2CBus;
72 I2CDevPtr NextDev;
73 DevUnion DriverPrivate;
74} I2CDevRec;
75
76I2CDevPtr xf86CreateI2CDevRec(void);
77void xf86DestroyI2CDevRec(I2CDevPtr pI2CDev, Bool unalloc);
78Bool xf86I2CDevInit(I2CDevPtr pI2CDev);
79I2CDevPtr xf86I2CFindDev(I2CBusPtr, I2CSlaveAddr);
80
81/* See descriptions of these functions in xf86i2c.c */
82
83Bool xf86I2CProbeAddress(I2CBusPtr pI2CBus, I2CSlaveAddr);
84Bool xf86I2CWriteRead(I2CDevPtr d, I2CByte *WriteBuffer, int nWrite,
85 I2CByte *ReadBuffer, int nRead);
86#define xf86I2CRead(d, rb, nr) xf86I2CWriteRead(d, NULL, 0, rb, nr)
87Bool xf86I2CReadStatus(I2CDevPtr d, I2CByte *pbyte);
88Bool xf86I2CReadByte(I2CDevPtr d, I2CByte subaddr, I2CByte *pbyte);
89Bool xf86I2CReadBytes(I2CDevPtr d, I2CByte subaddr, I2CByte *pbyte, int n);
90Bool xf86I2CReadWord(I2CDevPtr d, I2CByte subaddr, unsigned short *pword);
91#define xf86I2CWrite(d, wb, nw) xf86I2CWriteRead(d, wb, nw, NULL, 0)
92Bool xf86I2CWriteByte(I2CDevPtr d, I2CByte subaddr, I2CByte byte);
93Bool xf86I2CWriteBytes(I2CDevPtr d, I2CByte subaddr, I2CByte *WriteBuffer, int nWrite);
94Bool xf86I2CWriteWord(I2CDevPtr d, I2CByte subaddr, unsigned short word);
95Bool xf86I2CWriteVec(I2CDevPtr d, I2CByte *vec, int nValues);
96
97#endif /*_XF86I2C_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette