iiconf.h (40782) | iiconf.h (42442) |
---|---|
1/*- 2 * Copyright (c) 1998 Nicolas Souchu 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1998 Nicolas Souchu 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $Id: iiconf.h,v 1.1.1.1 1998/09/03 20:51:50 nsouch Exp $ | 26 * $Id: iiconf.h,v 1.2 1998/10/31 11:31:07 nsouch Exp $ |
27 */ 28#ifndef __IICONF_H 29#define __IICONF_H 30 31#include <sys/queue.h> 32 33#define IICPRI PZERO+8 /* XXX sleep/wakeup queue priority */ 34 --- 68 unchanged lines hidden (view full) --- 103 104extern void iicbus_intr(device_t, int, char *); 105 106extern int iicbus_null_repeated_start(device_t, u_char); 107extern int iicbus_null_callback(device_t, int, caddr_t); 108 109#define iicbus_repeated_start(bus,slave,timeout) \ 110 (IICBUS_REPEATED_START(device_get_parent(bus), slave, timeout)) | 27 */ 28#ifndef __IICONF_H 29#define __IICONF_H 30 31#include <sys/queue.h> 32 33#define IICPRI PZERO+8 /* XXX sleep/wakeup queue priority */ 34 --- 68 unchanged lines hidden (view full) --- 103 104extern void iicbus_intr(device_t, int, char *); 105 106extern int iicbus_null_repeated_start(device_t, u_char); 107extern int iicbus_null_callback(device_t, int, caddr_t); 108 109#define iicbus_repeated_start(bus,slave,timeout) \ 110 (IICBUS_REPEATED_START(device_get_parent(bus), slave, timeout)) |
111#define iicbus_start(bus,slave,timeout) \ 112 (IICBUS_START(device_get_parent(bus), slave, timeout)) 113#define iicbus_stop(bus) \ 114 (IICBUS_STOP(device_get_parent(bus))) | |
115#define iicbus_reset(bus,speed,addr,oldaddr) \ 116 (IICBUS_RESET(device_get_parent(bus), speed, addr, oldaddr)) | 111#define iicbus_reset(bus,speed,addr,oldaddr) \ 112 (IICBUS_RESET(device_get_parent(bus), speed, addr, oldaddr)) |
117#define iicbus_write(bus,buf,len,sent,timeout) \ 118 (IICBUS_WRITE(device_get_parent(bus), buf, len, sent, timeout)) 119#define iicbus_read(bus,buf,len,sent,last,delay) \ 120 (IICBUS_READ(device_get_parent(bus), buf, len, sent, last, delay)) | |
121 | 113 |
114/* basic I2C operations */ 115extern int iicbus_started(device_t); 116extern int iicbus_start(device_t, u_char, int); 117extern int iicbus_stop(device_t); 118extern int iicbus_write(device_t, char *, int, int *, int); 119extern int iicbus_read(device_t, char *, int, int *, int, int); 120 121/* Read/write operations with start/stop conditions managed */ |
|
122extern int iicbus_block_write(device_t, u_char, char *, int, int *); 123extern int iicbus_block_read(device_t, u_char, char *, int, int *); 124 125extern u_char iicbus_get_addr(device_t); 126 127#endif | 122extern int iicbus_block_write(device_t, u_char, char *, int, int *); 123extern int iicbus_block_read(device_t, u_char, char *, int, int *); 124 125extern u_char iicbus_get_addr(device_t); 126 127#endif |