0x%02x", $my_eep[$i]); } Function print_sys_config($sys_conf){ $fields = array("Operating_mode","Soft_en","En_polarity","Apc_en","Power_dn_en", "Ext_temp_en","Md_polarity","Cml_en"); $comment1 = array("Configuration set by external uP", "Transmitter enable", "Active high", "Automatic power control mode (apc)", "Reduce power consumption when transmitter is disabled", "Temperature externally supplied through i2c", "Anode connected to MD pin", "CML compatible input termination 50 Ohm"); $comment0 = array("Configuration load from EEPROM", "Transmitter disable", "Active low", "Constant current control mode", "No power reduction when transmitter is disables", "Temperature from the internal temperature sensor", "Cathode connected to MD pin", "Floating differential termination 100 Ohm"); printf("0x60 SYS_CONFIG 0x%02x
", $sys_conf); for ($i=0; $i<8; $i++){ $bit = ($sys_conf >> $i) & 1; if ($bit == 1) $comm = $comment1[$i]; else $comm = $comment0[$i]; printf("- bit %2d %s = %d -> %s
", $i, $fields[$i], $bit, $comm); } } Function print_flt_conf($flt_conf){ $fields = array("Over_current_en","Under_pwr_en","Over_pwr_en","Force_flt", "Flt_pin_overdrive","Flt_pin_polarity","Auto_shudtn_en","Lpc_en", "Flt_drv_mode"," ","Rapid_restart_en","Rep_flt_inhibit"); $comment1 = array("Enables detection of a laser overcurrent fault", "Enables detection of a laser undercurrent fault", "Enables detection of a laser overpower fault", "Force the FAULT pin active, when Flt_pin_overdrive=1", "The FAULT pin is = Force_flt", "FAULT pin active high", "Disable transmitter when a fault orrurs", "Enable laser power servo control", " ", " ", "Rapid restart enabled (within 1 ms)", "Inhibit repeated attempts to clear a fault"); $comment0 = array("Disables detection of a laser overcurrent fault", "Disables detection of a laser undercurrent fault", "Disables detection of a laser overpower fault", "Force the FAULT pin inactive, when Flt_pin_overdrive=1", "The FAULT pin is driven when a fault occurs", "FAULT pin active low", "Continue to drive the laser when a fault orrurs", "Disable laser power servo control, allows external control of SRC_DAC and MOD_DAC registers", " ", " ", "Rapid restart disabled", "Allow repeated attempts to clear a fault and re-enable the transmitter"); $flt_drv_mode = array("Open drain (3.3mA sink capability)", "Open drain, 280uA internal pull up", "Open drain, 425uA internal pull up", "Push-pull (3.3mA source and sink capability)"); printf("0x63 0x62 FLT_CONFIG 0x%04x
\n",$flt_conf); for($i=0; $i<12; $i++){ if($i == 8){ $bit = ($flt_conf >> $i) & 3; printf("- bits 9..8 %s %d -> %s
", $fields[$i], $bit, $flt_drv_mode[$bit]); $i++; } else { $bit = ($flt_conf >> $i) & 1; if ($bit == 1) $comm = $comment1[$i]; else $comm = $comment0[$i]; printf("- bit %2d %s = %d -> %s
", $i, $fields[$i], $bit, $comm); } } } Function print_eep_details($my_eep){ $md_range = array(4, 17, 68, 272, 1088); print_sys_config($my_eep[0]); $apc_mode = ($my_eep[0] >> 3) & 1; $isrc_rng = ((($my_eep[5] >> 2) & 3) + 1)*9; $eep_data = dechex($my_eep[1]); $ib_limit = 1.0*($my_eep[1] & 0x7F)/128.0*$isrc_rng; printf("0x61 IB_LIMIT 0x%02x -> Bias current upper limit = %0.3f mA\n
",$my_eep[1], $ib_limit); $flt_conf = ($my_eep[3] << 8) | $my_eep[2]; print_flt_conf($flt_conf); $ib_imd = ($my_eep[5] << 8) | $my_eep[4]; $ib_nom = ($ib_imd & 0x3FF)/1024.0*$isrc_rng; $imd_rng = $my_eep[13] >> 2; printf("0x65 0x64 IB(IMD) 0x%04x
", $ib_imd); printf("- bits 11..10 Source current range Isrc_rng = 0..%d mA
", $isrc_rng); if ($apc_mode == 1) printf("APC mode, not implemented
"); else printf("- bits 9..0 Bias current set Ibias = %0.3f mA
", $ib_nom); printf(" 0x66 IB_TC1(IMD_TC1) 0x%02x
",$my_eep[6]); printf(" 0x67 IB_TC2(IMD_TC2) 0x%02x
",$my_eep[7]); $im_rng = ((($my_eep[9] >> 2) & 3) + 1)*9; $im = ($my_eep[9] << 8) | $my_eep[8]; $im_ma = ( $im & 0x3FF)/1024.0*$im_rng; printf("0x69 0x68 IM 0x%04x
", $im); printf("- bits 11..10 Modulation current range Imod_rng = 0..%d mA
", $im_rng); printf("- bits 9..0 Modulation current Im = %0.3f mA
",$im_ma); printf(" 0x6A IM_TC1 0x%02x
",$my_eep[10]); printf(" 0x6B IM_TC2 0x%02x
",$my_eep[11]); $t_nom = ($my_eep[13] << 8) | $my_eep[12]; printf(" 0x6D 0x6C T_NOM 0x%04x
", $t_nom); printf("- bits 11..10 Monitor diode current range %d to %d uA
",$md_range[$imd_rng],$md_range[$imd_rng+1]*2); $tmp_nom = ($t_nom & 0x3FF)*0.5-273; printf("- bits 9..0 Nominal temperature %0.1f C
", $tmp_nom); printf("0x6E LOOP_GAIN 0x%02x
", $my_eep[14]); printf("0x6F PEAKING 0x%02x
", $my_eep[15]); } ?>