| 1 | The EEPROM pretty much rocks. There isn't a whole lot else to say. Just kidding, there's plenty, but I am just beginning to say all that there is to say, so please bear with me as I update this page. =) |
| 2 | |
| 3 | = The EEPROM = |
| 4 | == Basic Functionality == |
| 5 | * 1024-bit memory space divided into 4 pages. |
| 6 | * 3 of these have unlimited user read and write capabilities |
| 7 | * the other page is used for storing calibration values and MAC addresses |
| 8 | * Reading and writing these values requires the user to provide a pointer to an 8-byte data array |
| 9 | * Readable 64-bit lasered ROM containing 8-bit family code, 48-bit serial code, and 8-bit Cyclic Redundancy check (CRC). |
| 10 | * Readable 16-bit serial code given by WARP |
| 11 | * The libaries are divided into OneWire_l.c and !OneWire.c -- The latter contains everything the User needs to use the EEPROM. |
| 12 | * The !OneWire.c library provides the following functionality: |
| 13 | * Read valid calibration values that have been stored to a radio's EEPROM |
| 14 | * Write calibration value to a radio's EEPROM |
| 15 | * Read valid MAC addresses of the FPGA board and radios from the FPGA's EEPROM |
| 16 | * Write MAC addresses of the FPGA board and radios to the FPGA's EEPROM |
| 17 | * Read the 16-bit serial number given by WARP |
| 18 | * Read the 64-bit lasered ROM written by the EEPROM manufacturer |
| 19 | * Read data from the EEPROMs data pages |
| 20 | * Write data to the EEPROMs data pages |
| 21 | |
| 22 | The header file of !OneWire.c library is given below. |
| 23 | |
| 24 | '''''short WarpOneWire_ReadRadioCal(unsigned int* baseaddr, char RxNTx, char val_select)'''''[[BR]] |
| 25 | // This function checks to see if a valid calibration value is stored on the EEPROM[[BR]] |
| 26 | // and returns the value if so.[[BR]] |
| 27 | // baseaddr is the base address of the ONEWIRE device[[BR]] |
| 28 | // RxNTx specifies whether the values are the Rx or Tx values. 1 indicates Rx[[BR]] |
| 29 | // val_select selects which value to write[[BR]] |
| 30 | // 0: DC offset 1: Gain IQ 2: Phase IQ[[BR]] |
| 31 | // Returns a short where the most significant byte is the Q-value and [[BR]] |
| 32 | // the least significant byte is the I-value.[[BR]] |
| 33 | |
| 34 | '''''char WarpOneWire_WriteRadioCal(unsigned int* baseaddr, char RxNTx, char val_select, char I_val, char Q_val);'''''[[BR]] |
| 35 | // This functions writes a calibration value to the EEPROM[[BR]] |
| 36 | // baseaddr is the base address of the ONEWIRE device[[BR]] |
| 37 | // RxNTx specifies whether the values are the Rx or Tx values. 1 indicates Rx[[[BR]] |
| 38 | // val_select selects which value to write[[BR]] |
| 39 | // 0: DC offset 1: Gain IQ 2: Phase IQ[[BR]] |
| 40 | // I_val is the I-component to be stored[[BR]] |
| 41 | // Q_val is the Q-component to be stored[[BR]] |
| 42 | // Returns SUCCESS if all goes well, FAILURE otherwise[[BR]] |
| 43 | |
| 44 | '''''void WarpOneWire_ReadMACAddress(unsigned int* baseaddr, char dev_select, char *MAC);'''''[[BR]] |
| 45 | // This function writes a 6-byte MAC address into a 6-byte array addressed by a pointer.[[BR]] |
| 46 | // baseaddr is the base address of the ONEWIRE device[[BR]] |
| 47 | // dev_select specifies which device's MAC address to read[[BR]] |
| 48 | // 0: FPGA Board 1: Radio1 2: Radio2 3: Radio3 4: Radio4[[BR]] |
| 49 | // *MAC is a pointer to a 6-byte array[[BR]] |
| 50 | |
| 51 | '''''char WarpOneWire_WriteMACAddress(unsigned int* baseaddr, char dev_select, char *MAC);'''''[[BR]] |
| 52 | // This function writes a 6-byte MAC address into the EEPROM.[[BR]] |
| 53 | // baseaddr is the base address of the ONEWIRE device[[BR]] |
| 54 | // dev_select specifies which device's MAC address to read[[BR]] |
| 55 | // 0: FPGA Board 1: Radio1 2: Radio2 3: Radio3 4: Radio4[[BR]] |
| 56 | // *MAC is a pointer to a 6-byte array containing the address[[BR]] |
| 57 | // Returns SUCCESS if all goes well, FAILURE otherwise[[BR]] |
| 58 | |
| 59 | '''''short WarpOneWire_ReadWARPSerial(unsigned int* baseaddr);'''''[[BR]] |
| 60 | // Returns the the 2-byte serial number assigned by Rice WARP[[BR]] |
| 61 | |
| 62 | '''''void WarpOneWire_ReadDSSerial(unsigned int* baseaddr, unsigned char *Serial);'''''[[BR]] |
| 63 | // Get Serial number from a EEPROM device. Assumes it is the only device on the bus.[[BR]] |
| 64 | // baseaddr is the base address of the ONEWIRE device[[BR]] |
| 65 | // returns a memory array containing the 1 byte family code, 6 byte serial[[BR]] |
| 66 | // serial number and 1 byte CRC value[[BR]] |
| 67 | // Assumes the !OneWire master has been intialized.[[BR]] |
| 68 | |
| 69 | '''''char WarpOneWire_ReadUserMem(unsigned int* baseaddr, char page, char sector, unsigned char *array);'''''[[BR]] |
| 70 | |
| 71 | // This function reads from a specified memory location in the 1024-bit memory.[[BR]] |
| 72 | // Returns an 8-byte sector of the EEPROM. [[BR]] |
| 73 | // baseaddr is the base address of the ONEWIRE device[[BR]] |
| 74 | // page must be 1-3, and refers to memory pages on the device[[BR]] |
| 75 | // sector must be 1-3, and refers to the appropriate sector on the device[[BR]] |
| 76 | // array must be an 8 byte array[[[BR]] |
| 77 | // Returns SUCCESS if no error, otherwise FAILURE[[BR]] |
| 78 | |
| 79 | '''''char WarpOneWire_WriteUserMem(unsigned int* baseaddr, char page, char sector, unsigned char *array);'''''[[BR]] |
| 80 | // Writes a given 8-byte array to a designated location in memory.[[BR]] |
| 81 | // Essentially a wrapper of the !WriteScratch, !ReadScratch and Scratch2Mem functions[[BR]] |
| 82 | // baseaddr is the base address of the ONEWIRE device[[BR]] |
| 83 | // page must be 1-3, and refers to memory pages on the device[[BR]] |
| 84 | // sector must be 1-3, and refers to the appropriate sector on the device[[BR]] |
| 85 | // array must be an 8 byte array[[BR]] |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |