$i2c_Page_InputISE=0x10;// When written to $i2c_CurrentPage, makes registers 0..0xf control corresponding input (0..0xf) ISE (equalization):
// Bits 5:4 ISE short: 0 - off, 1 - minimal, 2 - moderate, 3 - maximal; bits 3:2 ISE medium, bits 1:0 ISE Long time constant
$i2c_Page_InputState=0x11;// When written to $i2c_CurrentPage, makes registers 0..0xf control corresponding input (0..0xf) enable, polarity and termination (default 6)
// Bit 2 (+4) Terminate to VDD ( 0 - connect, 1 - do not connect) - dedicated (0..7) inputs only
// Bit 1 (+2) Input power (0 - on, 1 - off)
// Bit 0 (+1) Invert signal at input
///$i2c_InputStateData= 0x04; // terminated,enabled, not inverted
$i2c_InputStateData=0x00;// terminated,disabled, not inverted
$i2c_Page_InputLOS=0x12;// When written to $i2c_CurrentPage, makes registers 0..0xf control corresponding input (0..0xf) LOS (loss of signal) threshold
$i2c_Page_OutputPreLong=0x20;// When written to $i2c_CurrentPage, makes registers 0..0xf control corresponding output (0..0xf) long time constant pre-emphasis
$i2c_Page_OutputPreShort=0x21;// When written to $i2c_CurrentPage, makes registers 0..0xf control corresponding output (0..0xf) short time constant pre-emphasis
$i2c_Page_OutputLevel=0x22;// When written to $i2c_CurrentPage, makes registers 0..0xf control corresponding output (0..0xf) short time constant pre-emphasis
// bit 4 (+0x10) - for 8-15 used as inputs only: terminate inputs 8..15 to VDDIO-0.7V
$i2c_Page_OutputState=0x23;// When written to $i2c_CurrentPage, makes registers 0..0xf control corresponding output (0..0xf) OOB signaling and output polarity
// bit 0 - OOB control: 1 - enable LOS forwarding, 0 - ignore LOS
$i2c_Page_ChannelStatus=0xf0;// When written to $i2c_CurrentPage, makes registers 0..0xf monitor corresponding input (0..0xf) LOS status
// bit 0 - LOS status: 1 - LOS detected (loss of signal), 0 - signal present (input has to be enabled, otherwise 0 is read)
// when reading from address 0x10 of this page:
// bit 0 - value of STAT0
// bit 1 - value of STAT1
$i2c_Page_Status0Configure=0x80;// When written to $i2c_CurrentPage, makes registers 0..0xf control selected input LOS to be OR-ed to STAT0 output pin (and bit)
// bit 0 : 1 - OR this input channel LOS status to STAT0
$i2c_Page_Status1Configure=0x81;// When written to $i2c_CurrentPage, makes registers 0..0xf control selected input LOS to be OR-ed to STAT1 output pin (and bit)
// bit 0 : 1 - OR this input channel LOS status to STAT1
$i2c_GlobalConnection=0x50;// Bit 4 (+0x10) - disable all outputs, bits 3:0 - input number to connect to all outputs
$i2c_GlobalInputISE=0x51;// Bits 5:4 ISE short: 0 - off, 1 - minimal, 2 - moderate, 3 - maximal; bits 3:2 ISE medium, bits 1:0 ISE Long time constant
$i2c_GlobalInputState=0x52;// Bit 2 (+4) - terminate input to VDD (0..7 only) 0-connect, 1 Normal; Bit 1 (+2) Input power off (0 - On, 1 - Off) bit0 (+1): Input polarity: 1 - inverted, 0 - normal
echo"Value for the PE_LONG (output pre-emphasis long time constant) command is expected to be pre_emphasis_level[0..15]:pre_emphasis_decay[0..7], got >$value<\n";
echo"Value for the PE_SHORT (output pre-emphasis short time constant) command is expected to be pre_emphasis_level[0..15]:pre_emphasis_decay[0..7], got >$value<\n";
<title>Usage of 103697A SATA multiplexer control interface ($script_name)</title>
</head>
<h2>Usage of $script_name:</h2>
<h3>Commands w/o parameters</h3>
<ul>
<li><i>list</i> - show settings to be programmed</li>
<li><i>debug</i> - output all I<sup>2</sup>C commands as HTML comments (visible with "view source")</li>
<li><i>dry</i> - "dry run" - simulation only, no I<sup>2</sup>C commands are sent to the device</li>
<li><i>noinit</i> - update only what is specified, do not disable unused i/o</li>
<li><i>state</i> - show current programmed state of the multiplexer</li>
<li><i><a href="$prefix_url?source">source</a></i> - show program source code (no other actions)</li>
</ul>
<h3>Commands with parameters</h3>
<p>All commands with parameters have format:</p>
<p><b>command:port=value</b>, where port can be specified in one of the following ways:</p>
<ul>
<li><i>numeric</i> - 0..11 specify I/O ports as specified for the VSC3312, "-1" means "all" (apply to all ports, lower precedence than specific ports)</li>
<li><i>J<number></i> - using connector reference designators as on 103697A circuit diagram (i.e.J3, J10)</li>
<li><i>host<number></i> - where number=1..6, with host1...host5 being 10353 (camera) boards and host6 - extrenal eSATA port</li>
<li><i>ssd<number></i> - where number=1..5, with ssd1...ssd4 being SSD directly inserted into the 103697A board and ssd5 - optional extra one connected with a cable</li>
<li><i>global</i> or <i>all</i> - apply to all ports (not valid for "connection" command).</ul>
<br/>
<h4>connection:port1=port2<br/>c:port1=port2</h4>
<p>Connect two ports. The order of the ports is arbitrary, but one has be one of the hosts, and the other - one of the SSD. If <i>noinit</i> does not appear in the url, all unused inputs and outputs will be disabled to reduce power consumption.</p>
<p>Configure ISE (input signal equalization) levels for short, medium and long time constants. Each value is in the range 0..3 (0- off, 1 - minimal, 2 - moderate, 3 - maximal)</p>
<br/>
<h4>in_state:port=terminate:invert</h4>
<p>Configure input port state. "terminate" (terminate input to VCC) can bne either 0 (off) or 1 (on), "invert" (also 0/1) control inversion of the input siognal polarity</p>
<br/>
<h4>los:port=level</h4>
<p>Configure input LOS (loss of signal) thershold level</p>
<table border="1">
<tr><th>level</th><th>threshold</th></tr>
<tr><td>0</td><td>---</td></tr>
<tr><td>1</td><td>---</td></tr>
<tr><td>2</td><td>150 mV</td></tr>
<tr><td>3</td><td>200 mV</td></tr>
<tr><td>4</td><td>250 mV</td></tr>
<tr><td>5</td><td>300 mV</td></tr>
<tr><td>6</td><td>---</td></tr>
<tr><td>7</td><td>---</td></tr>
</table>
<br/>
<h4>pre_long:port=level:decay</h4>
<p>Output pre-emphasis with 0.5ns-1.5ns decay, where. 4-bit level controls pre-emphasis amount from 0 (off) to 15 (6db), and decay - 3-bit decay, 0 corresponds to fastest (0.5ns) and 15 - slowest one (1.5ns).</p>
<br/>
<h4>pre_short:port=level:decay</h4>
<p>Output pre-emphasis with 0.03 ns-0.5 ns decay, where. 4-bit level controls pre-emphasis amount from 0 (off) to 15 (6db), and decay - 3-bit decay, 0 corresponds to fastest (0.03ns) and 15 - slowest one (0.5ns).</p>
<br/>
<h4>out_level:port=level</h4>
<p>Programs output power level - peak-to-peak differentioal voltage. These values have to be reduced when pre-emphasis is used as the actual signal adds the levels.</p>
<table border="1">
<tr><th>level</th><th>output voltage</th></tr>
<tr><td> 0</td><td>---</td></tr>
<tr><td> 1</td><td>---</td></tr>
<tr><td> 2</td><td>405 mV</td></tr>
<tr><td> 3</td><td>425 mV</td></tr>
<tr><td> 4</td><td>455 mV</td></tr>
<tr><td> 5</td><td>485 mV</td></tr>
<tr><td> 6</td><td>520 mv</td></tr>
<tr><td> 7</td><td>555 mv</td></tr>
<tr><td> 8</td><td>605 mv</td></tr>
<tr><td> 9</td><td>655 mv</td></tr>
<tr><td>10</td><td>720 mv</td></tr>
<tr><td>11</td><td>790 mv</td></tr>
<tr><td>12</td><td>890 mv</td></tr>
<tr><td>13</td><td>990 mv (no avail. in 103697A)</td></tr>
<tr><td>14</td><td>---</td></tr>
<tr><td>15</td><td>---</td></tr>
</table>
<br/>
<h4>out_state:port=mode:oob_forwarding</h4>
<p>Controls output inversion and OOB forwarding.'oob' of 1 enables, 0 - disables OOB forwarding and 'mode' can be one of</p>
if(!($rslt>=0))exitError('i2c read error from register 0x'.dechex($SA|$reg).'\n');// will exit
return$rslt;
}
functiongetMultiVals($value){
$aval=explode(':',$value);
for($i=0;$i<count($aval);$i++)$aval[$i]+=0;
return$aval;
}
functionprogramConnections($disableUnused){
global$debug,$channels,$connections,$activeOutputs,$activeInputs,$BUS,$SA,$i2c_CurrentPage,$i2c_Page_Connection,$i2c_Page_InputState,$i2c_Page_OutputLevel;// in init mode all the unused connections will be powered down