From: Dirk Eibach <eibach@domain.hid>
To: jan.kiszka@domain.hid
Cc: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] Re: [Xenomai-help] Draft for a RTDM I2C driver
Date: Fri, 17 Nov 2006 10:24:30 +0100 [thread overview]
Message-ID: <455D7FCE.5050209@domain.hid> (raw)
In-Reply-To: <455D6F83.40008@domain.hid>
jan.kiszka@domain.hid wrote:
> Dirk Eibach wrote:
>> Hello,
>>
>> I have spent some time designing a RTDM I2C driver based on the linux
>> i2c driver. It's stripped down in some aspects but porting existing
>> clients and adapters should be fairly easy.
>> For this draft I have ported the IBM PPC4xx driver, because that is what
>> I have here for testing.
>>
>> It's my first RTDM project, so I hope I haven't messed things up too much.
>>
>> Any comments welcome!
>>
>
> Great! I almost forgot this topic as it was quiet after my reply, but
> now we even have code to discuss.
It took some time for me to understand the RTDM concepts and to
understand what the i2c linux driver is doing.
> Before I start looking into implementation details, it would be nice if
> you could sketch the basic idea of your API proposal and the typical use
> cases. Code is more explicit, I know, but it's also a bit more tricky to
> grab an overview from it. Do you also have some simple demo to show how
> one should use your interface?
> What I grabbed so far:
> - for each I2C interface, a RTDM device is registered
> - rti2c-api.h is ought to become the RTDM I2C device profile
> - we have read/write and a bunch of IOCTLs as API
Here is a typical usecase:
int fd;
//open a instance of the RTDM device
fd = rt_dev_open( "rti2cppc4xx", 0);
// set the address of the device on the bus
rt_dev_ioctl(fd, RTI2C_SLAVE, addr);
// write a value to register of the addressed device
rti2c_smbus_write_byte_data(fd, register, value);
rt_dev_close(fd);
Many common i2c usecases are packed in inline functions in rti2c-api.h
so you don't need to fiddle with IOCTLs that much.
> What I didn't grabbed:
> - is transfer synchronous or asynchronous?
> - can applications access an adapter concurrently?
> - what are the major differences to the Linux model?
The interface is synchronous (just like its linux pendant). Applications
can access an adapter concurrently, access is serialized in
rti2-core.c/rti2c_smbus_xfer by a (per adapter) mutex.
The linux implementation has not only the device driver interface but
also a kernel-api. There is a i2c_driver concept, that enables you to
provide device drivers for i2c (client-)devices as kernel modules. I
left out this concept because I thought it does not fit the RTDM concept.
Further I left out all the sysfs stuff.
> I'm looking forward to see some nice generic RTI2C in Xenomai soon(er or
> later)!
Me too :)
> Jan
Dirk
next prev parent reply other threads:[~2006-11-17 9:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-17 7:39 [Xenomai-help] Draft for a RTDM I2C driver Dirk Eibach
2006-11-17 8:14 ` [Xenomai-core] " Jan Kiszka
2006-11-17 9:24 ` Dirk Eibach [this message]
2006-11-17 10:12 ` Jan Kiszka
2006-11-17 12:03 ` Dirk Eibach
2006-11-17 12:38 ` Jan Kiszka
2006-11-17 8:15 ` Jan Kiszka
-- strict thread matches above, loose matches on Subject: below --
2006-11-17 14:16 [Xenomai-core] " Dirk Eibach
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=455D7FCE.5050209@domain.hid \
--to=eibach@domain.hid \
--cc=jan.kiszka@domain.hid \
--cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.