iic.h revision 1.1.2.2 1 1.1.2.2 nathanw /* $NetBSD: iic.h,v 1.1.2.2 2002/02/28 04:11:44 nathanw Exp $ */
2 1.1.2.2 nathanw
3 1.1.2.2 nathanw /*
4 1.1.2.2 nathanw * Copyright (c) 1996 Mark Brinicombe.
5 1.1.2.2 nathanw * All rights reserved.
6 1.1.2.2 nathanw *
7 1.1.2.2 nathanw * Redistribution and use in source and binary forms, with or without
8 1.1.2.2 nathanw * modification, are permitted provided that the following conditions
9 1.1.2.2 nathanw * are met:
10 1.1.2.2 nathanw * 1. Redistributions of source code must retain the above copyright
11 1.1.2.2 nathanw * notice, this list of conditions and the following disclaimer.
12 1.1.2.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
13 1.1.2.2 nathanw * notice, this list of conditions and the following disclaimer in the
14 1.1.2.2 nathanw * documentation and/or other materials provided with the distribution.
15 1.1.2.2 nathanw * 3. All advertising materials mentioning features or use of this software
16 1.1.2.2 nathanw * must display the following acknowledgement:
17 1.1.2.2 nathanw * This product includes software developed by Brini.
18 1.1.2.2 nathanw * 4. The name of the company nor the name of the author may be used to
19 1.1.2.2 nathanw * endorse or promote products derived from this software without specific
20 1.1.2.2 nathanw * prior written permission.
21 1.1.2.2 nathanw *
22 1.1.2.2 nathanw * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED
23 1.1.2.2 nathanw * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24 1.1.2.2 nathanw * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 1.1.2.2 nathanw * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
26 1.1.2.2 nathanw * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 1.1.2.2 nathanw * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 1.1.2.2 nathanw * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 1.1.2.2 nathanw * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 1.1.2.2 nathanw * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 1.1.2.2 nathanw * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 1.1.2.2 nathanw * SUCH DAMAGE.
33 1.1.2.2 nathanw *
34 1.1.2.2 nathanw * RiscBSD kernel project
35 1.1.2.2 nathanw *
36 1.1.2.2 nathanw * iic.h
37 1.1.2.2 nathanw *
38 1.1.2.2 nathanw * header file for IIC
39 1.1.2.2 nathanw *
40 1.1.2.2 nathanw * Created : 15/04/96
41 1.1.2.2 nathanw */
42 1.1.2.2 nathanw
43 1.1.2.2 nathanw /*
44 1.1.2.2 nathanw * IIC bus driver attach arguments
45 1.1.2.2 nathanw */
46 1.1.2.2 nathanw
47 1.1.2.2 nathanw #ifdef _KERNEL
48 1.1.2.2 nathanw
49 1.1.2.2 nathanw struct iicbus_attach_args {
50 1.1.2.2 nathanw int ib_addr; /* i/o address */
51 1.1.2.2 nathanw void *ib_aux; /* driver specific */
52 1.1.2.2 nathanw };
53 1.1.2.2 nathanw
54 1.1.2.2 nathanw #define iic_bitdelay 10
55 1.1.2.2 nathanw
56 1.1.2.2 nathanw #define IIC_WRITE 0x00
57 1.1.2.2 nathanw #define IIC_READ 0x01
58 1.1.2.2 nathanw
59 1.1.2.2 nathanw /* Prototypes for assembly functions */
60 1.1.2.2 nathanw
61 1.1.2.2 nathanw void iic_set_state __P((int data, int clock));
62 1.1.2.2 nathanw void iic_set_state_and_ack __P((int data, int clock));
63 1.1.2.2 nathanw void iic_delay __P((int delay));
64 1.1.2.2 nathanw
65 1.1.2.2 nathanw /* Prototype for kernel interface to IIC bus */
66 1.1.2.2 nathanw
67 1.1.2.2 nathanw int iic_control __P((u_char address, u_char *buffer, int count));
68 1.1.2.2 nathanw
69 1.1.2.2 nathanw #endif /* _KERNEL */
70 1.1.2.2 nathanw
71 1.1.2.2 nathanw /* End of iic.h */
72