iicbus_if.m (38775) | iicbus_if.m (40782) |
---|---|
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: iicbus_if.m,v 1.1.2.4 1998/08/13 17:10:43 son Exp $ | 26# $Id: iicbus_if.m,v 1.1.1.1 1998/09/03 20:51:50 nsouch Exp $ |
27# 28 29INTERFACE iicbus 30 31# | 27# 28 29INTERFACE iicbus 30 31# |
32# Interprete interrupt | 32# Interpret interrupt |
33# 34METHOD int intr { 35 device_t dev; 36 int event; 37 char *buf; 38}; 39 40# | 33# 34METHOD int intr { 35 device_t dev; 36 int event; 37 char *buf; 38}; 39 40# |
41# iicbus callback 42# 43METHOD int callback { 44 device_t dev; 45 int index; 46 caddr_t data; 47}; 48 49# |
|
41# Send REPEATED_START condition 42# 43METHOD int repeated_start { 44 device_t dev; 45 u_char slave; | 50# Send REPEATED_START condition 51# 52METHOD int repeated_start { 53 device_t dev; 54 u_char slave; |
55 int timeout; |
|
46}; 47 48# 49# Send START condition 50# 51METHOD int start { 52 device_t dev; 53 u_char slave; | 56}; 57 58# 59# Send START condition 60# 61METHOD int start { 62 device_t dev; 63 u_char slave; |
64 int timeout; |
|
54}; 55 56# 57# Send STOP condition 58# 59METHOD int stop { 60 device_t dev; 61}; 62 63# 64# Read from I2C bus 65# 66METHOD int read { 67 device_t dev; 68 char *buf; 69 int len; 70 int *bytes; | 65}; 66 67# 68# Send STOP condition 69# 70METHOD int stop { 71 device_t dev; 72}; 73 74# 75# Read from I2C bus 76# 77METHOD int read { 78 device_t dev; 79 char *buf; 80 int len; 81 int *bytes; |
82 int last; 83 int delay; |
|
71}; 72 73# 74# Write to the I2C bus 75# 76METHOD int write { 77 device_t dev; 78 char *buf; 79 int len; 80 int *bytes; | 84}; 85 86# 87# Write to the I2C bus 88# 89METHOD int write { 90 device_t dev; 91 char *buf; 92 int len; 93 int *bytes; |
94 int timeout; |
|
81}; 82 83# 84# Reset I2C bus 85# 86METHOD int reset { 87 device_t dev; 88 u_char speed; | 95}; 96 97# 98# Reset I2C bus 99# 100METHOD int reset { 101 device_t dev; 102 u_char speed; |
103 u_char addr; 104 u_char *oldaddr; |
|
89}; | 105}; |