smbus_if.m revision 38776
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# notice, this list of conditions and the following disclaimer. 10# 2. Redistributions in binary form must reproduce the above copyright 11# notice, this list of conditions and the following disclaimer in the 12# documentation and/or other materials provided with the distribution. 13# 14# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 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: smbus_if.m,v 1.1.1.2 1998/08/13 15:16:58 son Exp $ 27# 28 29INTERFACE smbus 30 31# 32# Interprete interrupt 33# 34METHOD void intr { 35 device_t dev; 36 u_char devaddr; 37 char low; 38 char high; 39 int error; 40}; 41 42# 43# Quick command 44# 45METHOD int quick { 46 device_t dev; 47 u_char slave; 48 int how; 49}; 50 51# 52# Send Byte command 53# 54METHOD int sendb { 55 device_t dev; 56 u_char slave; 57 char byte; 58}; 59 60# 61# Receive Byte command 62# 63METHOD int recvb { 64 device_t dev; 65 u_char slave; 66 char *byte; 67}; 68 69# 70# Write Byte command 71# 72METHOD int writeb { 73 device_t dev; 74 u_char slave; 75 char cmd; 76 char byte; 77}; 78 79# 80# Write Word command 81# 82METHOD int writew { 83 device_t dev; 84 u_char slave; 85 char cmd; 86 short word; 87}; 88 89# 90# Read Byte command 91# 92METHOD int readb { 93 device_t dev; 94 u_char slave; 95 char cmd; 96 char *byte; 97}; 98 99# 100# Read Word command 101# 102METHOD int readw { 103 device_t dev; 104 u_char slave; 105 char cmd; 106 short *word; 107}; 108 109# 110# Process Call command 111# 112METHOD int pcall { 113 device_t dev; 114 u_char slave; 115 char cmd; 116 short sdata; 117 short *rdata; 118}; 119 120# 121# Block Write command 122# 123METHODE int bwrite { 124 device_t dev; 125 u_char slave; 126 char cmd; 127 u_char count; 128 char *buf; 129}; 130 131# 132# Block Read command 133# 134METHODE int bread { 135 device_t dev; 136 u_char slave; 137 char cmd; 138 u_char count; 139 char *buf; 140}; 141