Re: Nucleus RTOS I/O Driver Advice

"Michel" wrote in news: snipped-for-privacy@z14g2000cwz.googlegroups.com:

I am new to Nucleus RTOS and I am trying to sketch out the architecture > for a set of drivers that I will write for a BSP. I would greatly > appreciate any tips or I/O driver examples that might help me along > with the design. > > I want to use the standard Nucleus I/O driver requests to implement > (among others) a two layered I/O driver to access an RTC connected on > an I2C bus.

They're model might be a bit "heavy" for I2C and RTC access. Did they advise you to use their driver model?

The problem I see before me is that the RTC HISR function is not > allowed to suspend on the assign request to the I2C driver. > > One option is to have the HISR simply indicate that an event has > occurred and define a request by which the calling task can probe the > state of the RTC device.

Exactly.

I end up with the same problem if I want to start a timer that polls > the state the of the RTC device, the timer callback is not allowed to > suspend either. > > Should I create a task inside the I/O driver that waits for the HISR to > tell it when to read data from the RTC device (a third layer of ISR)?

How about a function call the falls asleep if the HISR hasn't NU_Set_Events() on your event of interest yet? Since you'll be calling it from a task, why create another task?

Is there something fundamentally wrong with my design? Am I trying to > build too much intelligence into a driver? The driver documentation > from Nucleus is not very informative. A good starting point would be an > example of a fully functional layered Nucleus I/O driver(s) that handle > interrupts and asynchronous notifications using callback functions. > Thanks in advance for any help.

I think you may be trying to make the driver too complex. You could probably write a simply I/O driver with NU_Sleep() polling on the device and forgo much of the complexity. I don't know if you can live without interrupts on receive though. The I/O driver model for Nucleus PLUS is there for those who require one, it is not required to be use (I've never used it) and you can still play quite nicely with the RTOS even if you don't use their I/O driver model.

--
- Mark ->
--
Reply to
Mark A. Odell
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.