                 Multi-Windows Visual C Build 
                    1-Wire Public Domain 
                       V3.10 03/24/06

This build creates a 1-Wire library that supports all three
1-Wire PC adapters:
 
   DS9490R/B - USB
   DS9097U   - Serial 
   DS1410E   - Parallel 
   
The 1-Wire library 'owlib.lib' can be found in the owlib folder
along with the complete source files. Most of the library 
components are the standard 1-Wire Public Domain kit files with
simple string replacements to prevent naming collisions.  See
the document 'build.pdf' to see how it was created.

The 1-Wire library supports the following standard API (see
main 1-Wire Public Domain kit for documentation):

 // Session
 SMALLINT owAcquire(int portnum, char *port_zstr);
 void     owRelease(int portnum);

 // Network
 SMALLINT  owFirst(int portnum, SMALLINT do_reset, SMALLINT alarm_only);
 SMALLINT  owNext(int portnum, SMALLINT do_reset, SMALLINT alarm_only);
 void      owSerialNum(int portnum, uchar *serialnum_buf, SMALLINT do_read);
 void      owFamilySearchSetup(int portnum, SMALLINT search_family);
 void      owSkipFamily(int portnum);
 SMALLINT  owAccess(int portnum);
 SMALLINT  owVerify(int portnum, SMALLINT alarm_only);
 SMALLINT  owOverdriveAccess(int portnum);

 // Link
 SMALLINT owTouchReset(int portnum);
 SMALLINT owTouchBit(int portnum, SMALLINT sendbit);
 SMALLINT owTouchByte(int portnum, SMALLINT sendbyte);
 SMALLINT owWriteByte(int portnum, SMALLINT sendbyte);
 SMALLINT owReadByte(int portnum);
 SMALLINT owSpeed(int portnum, SMALLINT new_speed);
 SMALLINT owLevel(int portnum, SMALLINT new_level);
 SMALLINT owProgramPulse(int portnum);
 SMALLINT owWriteBytePower(int portnum, SMALLINT sendbyte);
 SMALLINT owReadBytePower(int portnum);
 SMALLINT owHasPowerDelivery(int portnum);
 SMALLINT owHasProgramPulse(int portnum);
 SMALLINT owHasOverDrive(int portnum);
 SMALLINT owReadBitPower(int portnum, SMALLINT applyPowerResponse);

 // Transport
 SMALLINT owBlock(int portnum, SMALLINT do_reset, uchar *tran_buf, SMALLINT tran_len);
 SMALLINT owProgramByte(int portnum, SMALLINT write_byte, int addr, SMALLINT write_cmd,
                        SMALLINT crc_type, SMALLINT do_access);
 // Misc functions
 void      msDelay(int len);
 long      msGettick(void); 

 // Common functions: crcutil.c 
 void setcrc16(int portnum, ushort reset);
 ushort docrc16(int portnum, ushort cdata);
 void setcrc8(int portnum, uchar reset);
 uchar docrc8(int portnum, uchar x);

 // Common functions: owerr.c
 int owGetErrorNum(void);
 void owClearError(void);
 int owHasErrors(void);
 void owRaiseError(int);
 void owPrintErrorMsg(FILE *);
 void owPrintErrorMsgStd();
 char *owGetErrorMsg(int);

The 1-Wire adapter type is discerned based on the string format passed
to the owAcquire API. For example to run the demo 'temp' with different
adapters:

  port_zstr = "COM1"         (will use DS9097U on COM1)
  port_zstr = "\\.\DS2490-1" (will use DS9490 on USB enumeration 1) 
  port_zstr = "1"            (will use the DS1410E on LPT1) 

When using the standard owAcquire the calling application is restricted 
to one adapter type. To circumvent this restriction a new API, owAcquireEx 
was added to select the adapter type based on a numerical value and it 
returns the 'portnum' that will be used to call all other API. The syntax 
for owAcquireEx is as follows:

 //---------------------------------------------------------------------------
 // Attempt to acquire the specified 1-Wire net.
 //
 // 'port_zstr'     - zero terminated port name.  For this platform
 //                   use format {port number, port type}.  The port types
 //                   are: 2 LPT/DS1410E, 5 COM/DS2480B, 6 USB/DS9490
 //
 // Returns: port number or -1 if not successful in setting up the port.
 //
 SMALLINT owAcquireEx(char *port_zstr)

The demo applications for version 3.10 of the 1-Wire Public Domain kit
have been converted to use owAcquireEx so the adapter type and port
number can be supplied on the command line. For example:

 >temp {1,5} (will use DS9097U on COM1)
 >temp {1,6} (will use DS9490 on USB enumeration 1) 
 >temp {1,2} (will use the DS1410E on LPT1) 

All of the standard 1-Wire Public Domain kit demo applications are
built with the 'owlib.lib' library. The workspace 'multiwvc' contains 
a project for each demo. The demos include:

 atodtst
 counter
 coupler
 debit
 debitvm
 fish
 gethumd
 humalog
 initcopr
 initcoprvm 
 memutil
 mweather
 ps_check
 ps_init
 shaapp
 sha_chk
 sha_init
 swtloop
 swtsngl
 temp
 thermodl
 thermoms
 tm_check
 tm_init
 tstfind

In addition to the standard demos, a new demo was added that takes
advantage of the owAcquireEx API and scans for all available 1-Wire
adapters. It then does a looping 1-Wire search on all of the adapters
found. It is very similar in operation to the standard 'tstfind' demo
except no port name is required on the command line.  The new demo
is called 'tstfindm'.

For further documentation see the main 1-Wire Public Domain 3.10 kit:
  http://www.maxim-ic.com/products/ibutton/software/1wire/wirekit.cfm

The binaries for the demos can be found in the 'release' folder.

