From owner-freebsd-arm@freebsd.org Sat May 4 11:05:57 2019 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D65E6158A4B7 for ; Sat, 4 May 2019 11:05:56 +0000 (UTC) (envelope-from per@hedeland.org) Received: from outbound1g.eu.mailhop.org (outbound1g.eu.mailhop.org [52.28.6.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EB9684E8B for ; Sat, 4 May 2019 11:05:54 +0000 (UTC) (envelope-from per@hedeland.org) ARC-Seal: i=1; a=rsa-sha256; t=1556966983; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=IJanFwFO6bImdbpYKs1Dp/BNsxQUn2xN9VArZPTwlB3uU+Y4pY0ivcn1B1Oje2FKCttL4n/8g0V/3 /29JmwgczS9EdfbvnoxRtp8pBr81meJMNG8FAdaMxe4qbRA2/DpV09LnVN7hvh4+iFUyztSLR6vVTx y2UH4DPktEN0xt5kRqZ7Y19fuLIc0oBXhLf/7uFtNHFJFYZvsoGaALOr5WkR2Lt5NSNpgZTigJhNBx 8Xu43OqJRmP+iDOt1+8njEXhW9Z3mSpBAxOvoGWBgs1UQoJPrbnluKY+BVKkrIt0AgSXCK5ztFFNVB PX0fmoy/cHaaqdU99SEmI0i0zOkD/aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:content-type:in-reply-to:mime-version:date: message-id:cc:from:references:to:subject:dkim-signature:from; bh=QWIIBlA/9pSxi9yPqAwsasVDrMknmB07AtTwxZlZgcU=; b=tlfTDMXCSP3JYXEAYb+3RKhMvo3eAWUkjF7QFDkpFg3pZpj/TOzEeYsZ9dB5Wd26KX4l3mzPaXUH7 w/Wa87JIPDVgS9DjHFi+YIK4OGHU+u9tM4pe94+ooDMiZsABhsE8NMq2a43UeMFzujV9SJixCSYEwN y32aY+4G4rikzRwb4JHlxHJlDj+Nq71qjGFL7koBjPqnLR1vkDP5XjITdNxPnlotg9zElyyqHbAh8A hFVHnxCray8yL5piDnfWpNnI5NQavA3KUC1hUa98r4fV+sNNUYoYARpFnx9/FmnDkQQU5bNJqGgghO itENWgVsu4OXwF1y/hbjqbaAs9HzreA== ARC-Authentication-Results: i=1; outbound3.eu.mailhop.org; spf=none smtp.mailfrom=hedeland.org smtp.remote-ip=81.228.155.78; dmarc=none header.from=hedeland.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:content-type:in-reply-to:mime-version:date: message-id:cc:from:references:to:subject:from; bh=QWIIBlA/9pSxi9yPqAwsasVDrMknmB07AtTwxZlZgcU=; b=wGUtVZ9fFP2uJhsNZ6jXzsROakcyjym5m+kG3uIe3+CEm/7KFij73ulN91pDUjaAlXVJCnvLN92YZ PGMWXnh2vziPzUA+VU3iILAZgnHyWuumH2ODkDbVX0MMw2Z7PUmicpiPsh2mlTgwBDebhwCaOsDYQa sIovucXotIS+dFHMy28qy+D/RlVmP+B+0mG7moy0jUKazIq0dry3Rkr8Mqtjxxo9fDMbTlIXAxCQDu 27SO1k8Suj9kWTz19nYRFyruSTxYLpKXkuMlcW+PmJeyaWpr8E8q25zwpEGD9GfkuP7FnbIfLymhiG stt/nrSN4bWGvLo26AB0VrTiS1oQVGw== X-MHO-RoutePath: cGVyaGVkZWxhbmQ= X-MHO-User: 517d37f8-6e5a-11e9-908b-352056dbf2de X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 81.228.155.78 X-Mail-Handler: DuoCircle Outbound SMTP Received: from hedeland.org (unknown [81.228.155.78]) by outbound3.eu.mailhop.org (Halon) with ESMTPSA id 517d37f8-6e5a-11e9-908b-352056dbf2de; Sat, 04 May 2019 10:49:41 +0000 (UTC) Received: from pluto.hedeland.org (pluto.hedeland.org [10.1.1.5]) by tellus.hedeland.org (8.15.2/8.15.2) with ESMTPS id x44AndSV068468 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Sat, 4 May 2019 12:49:40 +0200 (CEST) (envelope-from per@hedeland.org) Subject: Re: FreeBsd I2C utility gives same value as MSB and LSB from DS75 sensor 16bit register. To: Prasad M References: From: Per Hedeland Cc: freebsd-arm@freebsd.org Message-ID: <0360da02-b4c2-b1be-3e72-2bf5f106ee91@hedeland.org> Date: Sat, 4 May 2019 12:49:39 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 3EB9684E8B X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=outbound.mailhop.org header.s=dkim-high header.b=wGUtVZ9f X-Spamd-Result: default: False [-5.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_XOIP(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[outbound.mailhop.org:+]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.01)[hedeland.org,mx2.mailhop.org]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-1.22)[ipnet: 52.28.0.0/16(-4.78), asn: 16509(-1.28), country: US(-0.06)]; MIME_TRACE(0.00)[0:+]; RECEIVED_SPAMHAUS_PBL(0.00)[78.155.228.81.zen.spamhaus.org : 127.0.0.11]; ASN(0.00)[asn:16509, ipnet:52.28.0.0/16, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_ALLOW(-1.00)[i=1]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[outbound.mailhop.org:s=dkim-high]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[hedeland.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[212.6.28.52.list.dnswl.org : 127.0.20.0]; R_SPF_NA(0.00)[]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2019 11:05:57 -0000 On 2019-05-03 13:43, Prasad M wrote: > Hi Folks, > > I am trying to access a DS75 I2C temperature sensor. It kind of works with > the default i2c utility. But it returns twice the high byte instead of the > high and low byte for the temperature. Probably because it does 1 byte > reads on the I2C bus, sending a stop condition after every byte. > > The device expects continuous reads and no stop/start in between the 2 > bytes. Trying all options i2c, most notably the -m mode switch, yields the > same results all the time. Looking at the code in i2c.c > > Could any one help to solve this problem with working I2CRDWR utility. Hm, it's not entirely clear to me what you're asking for, but if it is a variant of i2c(8) that uses the I2CRDWR ioctl for data transfers, you can find one at https://github.com/vzaigrin/newi2c - note the comments/caveats though. FWIW, it worked fine for me when figuring out the ads1015 AD converter (after which I wrote my own "dedicated" code for that, using I2CRDWR). --Per