linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
Cc: Hugo Meric <hugo.meric-Qt13gs6zZMY@public.gmane.org>,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [lm-sensors] HMC6343
Date: Tue, 07 Jul 2009 11:38:46 +0000	[thread overview]
Message-ID: <4A5333C6.3080802@cam.ac.uk> (raw)
In-Reply-To: <20090707095934.7b86524f-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>

Moved to linux-i2c, as per Jean's suggestion.

> On Tue, 7 Jul 2009 01:04:30 +0000 (GMT), Hugo Meric wrote:
>> Hello,
>>
>> I'm currently working with the HMC6343. I don't succeed to
>> communicate using the i2c interface and unfortunately the company
>> does not have any experience with Linux... 
Just to simplify things (specifically people looking for data sheets
to try and answer your question) please put more details / links
in for the chips you are talking about.
I already use your file
>> i2c-dev.h to communicate with four DS1050
Googling suggests that's a pulse-width modulator
http://www.maxim-ic.com/getds.cfm?qv_pk=2614
 and one SRF02, 
Ultrasonic range finder?
http://www.robot-electronics.co.uk/htm/srf02techSer.htm
and I'd
>> like to know if it is possible to use it for the HMC6343 because
>> the communication protocol seems to be different.
http://www.magneticsensors.com/datasheets/HMC6343.pdf

Basically it's protocol is a standard smbus type write byte command
(address 0x19) followed by a delay (command specific) and then
a read of multiple bytes (number is command dependant.)

Unfortunately the device doesn't seem do anything helpful like notify
you of how many bytes it is sending (as per smbus block read).

I fear to make this work you'll need to write a kernel space driver.
The first step is a conventional smbus send byte command. Follow this
with a suitable delay. The second will need to make use of
i2c_transfer with a msg looking something like

char bob[6];
struct i2c_msg read_msg = {
       .addr = 0x19,
       .flags = I2C_M_RD,
       .len = 6, // as appropriate to the command
       .buf = bob,
};

then i2c_transfer(adap, &read_msg, 1);

should do the job.

---
Jonathan Cameron

       reply	other threads:[~2009-07-07 11:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <23114.97301.qm@web28307.mail.ukl.yahoo.com>
     [not found] ` <20090707095934.7b86524f@hyperion.delvare>
     [not found]   ` <20090707095934.7b86524f-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-07-07 11:38     ` Jonathan Cameron [this message]
     [not found]       ` <4A5333C6.3080802-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
2009-07-07 11:46         ` [lm-sensors] HMC6343 Jean Delvare
     [not found]           ` <20090707134638.6ff1b324-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-07-07 11:54             ` Jonathan Cameron
     [not found]               ` <4A53375B.9070304-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
2009-07-07 12:20                 ` HMC6343 Jean Delvare
     [not found]               ` <874671.80619.qm@web28313.mail.ukl.yahoo.com>
     [not found]                 ` <874671.80619.qm-KpgP/9vcbyPGRxTy+Q50vsz6deESKz/lQQ4Iyu8u01E@public.gmane.org>
2009-07-08 10:37                   ` Re : [lm-sensors] HMC6343 Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A5333C6.3080802@cam.ac.uk \
    --to=jic23-kwpb1pkirijaa/9udqfwiw@public.gmane.org \
    --cc=hugo.meric-Qt13gs6zZMY@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).