On Mon, 2005-07-11 at 04:52, Matthew Percival wrote: > G'Day, > > > > I have now just finished writing a kernel module which handles the > > > OMAP's hardware support for 1-Wire, and have used a test program to > > > interact with the DS2431. All that remains to do is have a nice, user > > > program that can handle interactions with any number of any kind of > > > 1-Wire device. Since one happens to be available here, I figured the > > > best approach would be to add in support for my driver to owlib. > > Sounds great. > > > > > > I am reading through the source to try and work out how this would best > > > be done, but I thought it would be a good idea to ask the developers how > > > they would suggest going about it: after all, you have a much better > > > idea of how this all works than I am likely to figure out in the next > > > few days. > > Pretty easy. You are right, the adapter support is quite well encapsulated. > > > > Basically all adapter support is in owlib, and transparent to higher levels. > > > > The type of adapter is determined mainly from the command line (though the > > serial adapters are distinguished by their response to a query). > > > > Unique support is in the files > > > > module/owlib/src/c/* > > > > where * is ow_ds1410.c > > ow_ds9097.c > > ow_ds9097U.c > > ow_ds9490.c > > > > (also ow_server.c and ow_badadapter.c) > > > > I would base my support on ow_9097.c which is a bit-banging passive serial > > support. > > Thanks for the suggestions: it has made things a lot easier to work > through! I had actually skipped those files (ow_ds9097.c, etc) assuming > they were 1-Wire devices, rather than adaptors --- I did not think I > would find anything useful in them. Was I ever wrong! > > I have written ow_omap.c as well as made a variety of additions to > other files here and there, and am now able to add `-o /dev/wire' to the > command line when I load owfs. When I mount owfs, I get bus.0/, and > when I cat the files in system/adapter/ I now get the information I > would expect to see. I do not, however, get any devices in bus.0/ --- > obviously I am still lacking something. > > My first, key, question is this: where does the actual polling for > devices occur, and what do I have to ensure I do/have to be able to get > it to at least recognise the existence of the device?
If you look for a directory listing, there is a loop in ow_dir.c:FS_real_dir() which starts with BUS_select() and BUS_first(). BUS_select() calls BUS_select_low() in ow_bus.c and it will reset the 1-wire bus and eventually select the main or aux branch on a DS2409, or address a specific 1-wire device. BUS_first() initiate some structs and calls BUS_next() (which is translated to DS9490_next_both() (or the other *_next_both for other adapters). *_next_both is called until there are no more devices on the 1-wire bus. I doubt that you could skip the omap_reset() function since it's used to address a specific device or the branch on the DS2490. (and reset the 1-wire bus which more devices need) ow_xxxx.c:CheckPresence_low() will check if a device exists on any connected adapter. It calls ow_verify.c:BUS_normalverify(). As you can see that function reset the 1-wire bus and address the wanted device via BUS_select(), and then send presence check to the device. /Christian > > Secondly, I currently have `f->reset' set to a dummy function, as I was > not sure what the purpose of this was, and if it really applied to my > device at all. If someone could just tell be the basic purpose of this > function, I will be able to work out what to do with it. > > Thanks for the help again: I feel I am on the verge of being able to > see my device, and it is entirely due to the assistance here! > > -- Matthew > > > > ------------------------------------------------------- > This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening > July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual > core and dual graphics technology at this free one hour event hosted by HP, > AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar > _______________________________________________ > Owfs-developers mailing list > Owfs-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/owfs-developers ------------------------------------------------------- This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual core and dual graphics technology at this free one hour event hosted by HP, AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar _______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers