

#ifndef _SN_H
#define _SN_H



/********************************************************************
 * 
 * SN.H and SN.C provide some functions to communicate with
 * a unique serial number chips like the Dallas Semiconductor DS2401.
 *
 * The DS2401 is a unique serial number chip which returns a 64 bit 
 * unique number
 * 
 * The SN.H and SN.C are designed to interface to different serial 
 * number chips, not specifically the DS2401. However at this current 
 * time, only the DS2401 is supported 
 *
 *********************************************************************/

#define SN_NUMBER_OF_CHAR			8

/* Definition of the 64 bit data structure */
/* This structure is normally only modified by */
/* the SN_SetBit function */
/* The SN_SetBit function accepts a bit-number where */
/* bit-number 0 is the LSB, and bit-number 63 is the MSB */
typedef struct  
{
	unsigned char wData[SN_NUMBER_OF_CHAR];
} SerialNumber_t;


/* Function declarations */
/* To get the serial number */
void SN_GetSerialNumber(SerialNumber_t *psSerial);
void SN_OneWireBusInit(void);

/* To perform bit operations */
char SN_GetBit(SerialNumber_t *psSerial, const unsigned int nBitNumber);
void SN_SetBit(SerialNumber_t *psSerial, const unsigned int nBitNumber, const unsigned char cValue);


#endif //_SN_H