On Thursday 26 January 2006 11:27 am, Paul Hilton wrote:
> I am currently trying to understand the internal workings of
> owfs (et.al.), not ready to start writing adapter code for it
> (e.g. looking at ow_link.c still makes me glaze over).

Hi Paul,

The best example for adapter code is ow_ds9097.c

Basically all the adapter does is write/read bits (either 1 at a time, or 
several for efficiency), and reset.

The only externally visible  (for any adapter) is XXX_detect (DS9097_detect in 
this case). This function opens the device, tests existence (if possible), 
sets the call-back functions, and updates the name in the appropriate 
structure.

There are entries for higher-level functions (based on the primatives from the 
DS2480B) like byte write/read, better searching, power to bus, etc, but these 
will be handled by the bit commands if not otherwise implemented.

Implementing a bit-banging adapter thus involves 
1. copying and modifying OW_ds9097.c 
2. putting the detect function in ow_connection.h
3. recognizing a command line parameter in ow_opt.c
4. putting the actual call to the detect in  ow_lib.c

The LINK code supports ascii mode of the LINK, so you see byte and search 
support, reset, and power mode.

The DS9097U supports the DS2480B. It has a lot of cruft from the public domain 
kit, especially for low-level serial port commands. Since it works well, and 
probably encapsulates many tricks, I left those details untouched.

The DS9490 USB adapter is messy because A. libusb calls are messy, and B. 
handling reconnection with USB dynamic port allocation is messy. Eventually 
we will clean it a bit, but it works remarkably well. (A testament to 
Christian Magnusson).

You can see why I'm intrigued by the DS1410E. The goal is tantalizingly close. 
There are implementations of working code available. The primatives supported 
are the bit write/read and reset. I think you are right, it's a timing issue. 
I'm going to look more closely at PARAPIN.

Paul Alfille



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to