This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: i2c interface polled/IT driven transfer
- From: Jonathan Larmour <jifl at eCosCentric dot com>
- To: Csordás Péter <csordas at mit dot bme dot hu>
- Cc: eCos Patches <ecos-patches at ecos dot sourceware dot org>
- Date: Mon, 16 Oct 2006 13:07:30 +0100
- Subject: Re: i2c interface polled/IT driven transfer
- References: <002c01c6f099$7a86e080$60fd4298@mit.bme.hu>
Csordás Péter wrote:
Hi
I realised, that the I2C API does not offer the possibolity of switching
between polled and IT driven transaction (like the SPI does).
I've added this functionality on device level , taking one bit of
i2c_flags. (unlike in case of SPI, in order to leave the current
interface functions unchanged)
Opinions?
Personally I'm not sure there's a need. The driver can automatically adapt
between polled and interrupt-driven mode with a test of whether global
interrupts are enabled or not. If only one or other mode is desired than
per-driver CDL can eliminate unwanted code. This is what I've done in some
of my own (non-public) drivers.
It seems better to me for the decision between polled vs interrupt driven
not to have to be explicitly chosen by higher level code, particularly
since that higher layer code may itself be generic (not part of the
application) and be even less aware of global interrupt state.
Jifl
--
eCosCentric http://www.eCosCentric.com/ The eCos and RedBoot experts
------["The best things in life aren't things."]------ Opinions==mine