This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: i2c interface polled/IT driven transfer


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]