Changes between Version 4 and Version 5 of EEPROM_onewire
- Timestamp:
- Jul 28, 2006, 4:43:00 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
EEPROM_onewire
v4 v5 8 8 * Readable 64-bit lasered ROM containing 8-bit family code, 48-bit serial code, and 8-bit Cyclic Redundancy check (CRC). 9 9 * Readable 16-bit serial code given by WARP 10 * The provided libaries are divided into OneWire_l.c and !OneWire.c -- The latter contains everything the User needs to drive the EEPROM.11 * The !OneWire.c library provides the following functionality:10 * The provided libaries are divided into EEPROM_l.c and EEPROM.c -- The latter contains everything the User needs to drive the EEPROM. 11 * The EEPROM.c library provides the following functionality: 12 12 * Read valid calibration values that have been stored to a radio's EEPROM 13 13 14 * Write calibration value to a radio's EEPROM 14 15 * Read valid MAC addresses of the FPGA board and radios from the FPGA's EEPROM … … 19 20 * Write data to the EEPROMs data pages 20 21 21 A part of the header file !OneWire.h is given below.22 A part of the header file EEPROM.h is given below. 22 23 23 '''''short Warp OneWire_ReadRadioCal(unsigned int* baseaddr, char RxNTx, char val_select)'''''[[BR]]24 '''''short WarpEEPROM_ReadRadioCal(unsigned int* baseaddr, char RxNTx, char val_select)'''''[[BR]] 24 25 // This function checks to see if a valid calibration value is stored on the EEPROM[[BR]] 25 26 // and returns the value if so.[[BR]] 26 // baseaddr is the base address of the ONEWIREdevice[[BR]]27 // baseaddr is the base address of the EEPROM device[[BR]] 27 28 // RxNTx specifies whether the values are the Rx or Tx values. 1 indicates Rx[[BR]] 28 29 // val_select selects which value to write[[BR]] … … 31 32 // the least significant byte is the I-value.[[BR]] 32 33 33 '''''char Warp OneWire_WriteRadioCal(unsigned int* baseaddr, char RxNTx, char val_select, char I_val, char Q_val);'''''[[BR]]34 '''''char WarpEEPROM_WriteRadioCal(unsigned int* baseaddr, char RxNTx, char val_select, char I_val, char Q_val);'''''[[BR]] 34 35 // This functions writes a calibration value to the EEPROM[[BR]] 35 // baseaddr is the base address of the ONEWIREdevice[[BR]]36 // baseaddr is the base address of the EEPROM device[[BR]] 36 37 // RxNTx specifies whether the values are the Rx or Tx values. 1 indicates Rx[[[BR]] 37 38 // val_select selects which value to write[[BR]] … … 41 42 // Returns SUCCESS if all goes well, FAILURE otherwise[[BR]] 42 43 43 '''''void Warp OneWire_ReadMACAddress(unsigned int* baseaddr, char dev_select, char *MAC);'''''[[BR]]44 '''''void WarpEEPROM_ReadMACAddress(unsigned int* baseaddr, char dev_select, char *MAC);'''''[[BR]] 44 45 // This function writes a 6-byte MAC address into a 6-byte array addressed by a pointer.[[BR]] 45 // baseaddr is the base address of the ONEWIREdevice[[BR]]46 // baseaddr is the base address of the EEPROM device[[BR]] 46 47 // dev_select specifies which device's MAC address to read[[BR]] 47 48 // 0: FPGA Board 1: Radio1 2: Radio2 3: Radio3 4: Radio4[[BR]] 48 49 // *MAC is a pointer to a 6-byte array[[BR]] 49 50 50 '''''char Warp OneWire_WriteMACAddress(unsigned int* baseaddr, char dev_select, char *MAC);'''''[[BR]]51 '''''char WarpEEPROM_WriteMACAddress(unsigned int* baseaddr, char dev_select, char *MAC);'''''[[BR]] 51 52 // This function writes a 6-byte MAC address into the EEPROM.[[BR]] 52 // baseaddr is the base address of the ONEWIREdevice[[BR]]53 // baseaddr is the base address of the EEPROM device[[BR]] 53 54 // dev_select specifies which device's MAC address to read[[BR]] 54 55 // 0: FPGA Board 1: Radio1 2: Radio2 3: Radio3 4: Radio4[[BR]] … … 56 57 // Returns SUCCESS if all goes well, FAILURE otherwise[[BR]] 57 58 58 '''''short Warp OneWire_ReadWARPSerial(unsigned int* baseaddr);'''''[[BR]]59 '''''short WarpEEPROM_ReadWARPSerial(unsigned int* baseaddr);'''''[[BR]] 59 60 // Returns the the 2-byte serial number assigned by Rice WARP[[BR]] 60 61 61 '''''void Warp OneWire_ReadDSSerial(unsigned int* baseaddr, unsigned char *Serial);'''''[[BR]]62 '''''void WarpEEPROM_ReadDSSerial(unsigned int* baseaddr, unsigned char *Serial);'''''[[BR]] 62 63 // Get Serial number from a EEPROM device. Assumes it is the only device on the bus.[[BR]] 63 // baseaddr is the base address of the ONEWIREdevice[[BR]]64 // baseaddr is the base address of the EEPROM device[[BR]] 64 65 // returns a memory array containing the 1 byte family code, 6 byte serial[[BR]] 65 66 // serial number and 1 byte CRC value[[BR]] 66 // Assumes the !OneWire master has been intialized.[[BR]]67 67 68 '''''char WarpOneWire_ReadUserMem(unsigned int* baseaddr, char page, char sector, unsigned char *array);'''''[[BR]] 69 68 '''''char WarpEEPROM_ReadUserMem(unsigned int* baseaddr, char page, char sector, unsigned char *array);'''''[[BR]] 70 69 // This function reads from a specified memory location in the 1024-bit memory.[[BR]] 71 70 // Returns an 8-byte sector of the EEPROM. [[BR]] 72 // baseaddr is the base address of the ONEWIREdevice[[BR]]71 // baseaddr is the base address of the EEPROM device[[BR]] 73 72 // page must be 1-3, and refers to memory pages on the device[[BR]] 74 73 // sector must be 1-3, and refers to the appropriate sector on the device[[BR]] … … 76 75 // Returns SUCCESS if no error, otherwise FAILURE[[BR]] 77 76 78 '''''char Warp OneWire_WriteUserMem(unsigned int* baseaddr, char page, char sector, unsigned char *array);'''''[[BR]]77 '''''char WarpEEPROM_WriteUserMem(unsigned int* baseaddr, char page, char sector, unsigned char *array);'''''[[BR]] 79 78 // Writes a given 8-byte array to a designated location in memory.[[BR]] 80 79 // Essentially a wrapper of the !WriteScratch, !ReadScratch and Scratch2Mem functions[[BR]] 81 // baseaddr is the base address of the ONEWIREdevice[[BR]]80 // baseaddr is the base address of the EEPROM device[[BR]] 82 81 // page must be 1-3, and refers to memory pages on the device[[BR]] 83 82 // sector must be 1-3, and refers to the appropriate sector on the device[[BR]]