* I2C Master with limited transmission sizes
@ 2013-11-16 3:38 Peter Hüwe
[not found] ` <201311160438.36636.PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Peter Hüwe @ 2013-11-16 3:38 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
Hi,
I'm currently writing a driver for a cheap usb-to-i2c master device, which
unfortunately can only write 31 bytes (+slave addr) and read 32 bytes.
What is the correct behavior if a user requests larger read/writes?
Simply set i2c_msg.len to the bytes transmitted?
(in this case i2cdump -i doesn't honor this length ?)
Or should the master try to split up the requests?
but if so how, as some devices don't support continuous reads.
Thanks,
Peter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: I2C Master with limited transmission sizes
[not found] ` <201311160438.36636.PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
@ 2013-11-17 11:15 ` Wolfram Sang
2013-11-18 23:03 ` Peter Hüwe
0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2013-11-17 11:15 UTC (permalink / raw)
To: Peter Hüwe; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 699 bytes --]
> I'm currently writing a driver for a cheap usb-to-i2c master device, which
> unfortunately can only write 31 bytes (+slave addr) and read 32 bytes.
Which one?
> What is the correct behavior if a user requests larger read/writes?
> Simply set i2c_msg.len to the bytes transmitted?
No!
> Or should the master try to split up the requests?
If you have control over sending start/stop bits, you could omit the
stop condition unless you transfered all of the 32 byte chunks and issue
the stop at the end.
If you can't, don't advertise I2C_FUNC_I2C, but SMBUS functions (without
the block functions again). That will work for most devices.
Hope that helps,
Wolfram
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: I2C Master with limited transmission sizes
2013-11-17 11:15 ` Wolfram Sang
@ 2013-11-18 23:03 ` Peter Hüwe
0 siblings, 0 replies; 3+ messages in thread
From: Peter Hüwe @ 2013-11-18 23:03 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA
Hi Wolfram,
thanks for your answer.
> > I'm currently writing a driver for a cheap usb-to-i2c master device,
> > which unfortunately can only write 31 bytes (+slave addr) and read 32
> > bytes.
>
> Which one?
CH341 based ones like this one http://wch-ic.com/download/down.asp?id=114
They go for about ~12 USD on ebay so quite affordable.
lsusb shows it as
ID 1a86:5512 QinHeng Electronics CH341 in EPP/MEM/I2C mode, EPP/I2C adapter
> If you have control over sending start/stop bits, you could omit the
> stop condition unless you transfered all of the 32 byte chunks and issue
> the stop at the end.
This should be possible - I'll give it a try.
Once I've finished my testing I'll post it here for review.
Thanks,
Peter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-18 23:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-16 3:38 I2C Master with limited transmission sizes Peter Hüwe
[not found] ` <201311160438.36636.PeterHuewe-Mmb7MZpHnFY@public.gmane.org>
2013-11-17 11:15 ` Wolfram Sang
2013-11-18 23:03 ` Peter Hüwe
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.