483 lines
9.5 KiB
HTML
483 lines
9.5 KiB
HTML
<html>
|
|
<head>
|
|
|
|
<style>
|
|
.pin-marker {
|
|
position: absolute;
|
|
z-index: 1;
|
|
border-radius: 50%;
|
|
background-color: white;
|
|
border: 2px blue solid;
|
|
cursor: pointer;
|
|
color: black;
|
|
text-align: center;
|
|
line-height: 200%;
|
|
}
|
|
|
|
.pin-marker:hover {
|
|
background-color: #f15a24;
|
|
color: white;
|
|
transform: scale(2);
|
|
z-index: 2;
|
|
}
|
|
|
|
.pin-marker.highlight {
|
|
border: 2px #f15a24 solid;
|
|
}
|
|
|
|
.pin-marker.selected {
|
|
background-color: #fc935a;
|
|
}
|
|
|
|
#connector-container {
|
|
width: 100%;
|
|
height: 50%;
|
|
overflow-x: scroll;
|
|
position: relative;
|
|
}
|
|
|
|
#connector-div {
|
|
height: 100%;
|
|
position: relative;
|
|
z-index: 0;
|
|
}
|
|
|
|
#connector-img {
|
|
height: 100%;
|
|
z-index: 0;
|
|
}
|
|
|
|
table {
|
|
font-family: Arial, Helvetica, sans-serif;
|
|
border-collapse: collapse;
|
|
width: clamp(100%, 100%, 1000px);
|
|
text-align: left;
|
|
}
|
|
|
|
@media (min-width: 1000px) {
|
|
table {
|
|
font-size: 1rem;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 1000px) {
|
|
table {
|
|
font-size: 3rem;
|
|
}
|
|
}
|
|
|
|
table tbody tr {
|
|
cursor: pointer;
|
|
}
|
|
|
|
table td, table th {
|
|
border: 1px solid black;
|
|
padding: 8px;
|
|
}
|
|
|
|
table tr:nth-child(even){
|
|
background-color: #fc935a;
|
|
}
|
|
|
|
table tr:hover {
|
|
background-color: #f15a24;
|
|
}
|
|
|
|
table th {
|
|
padding-top: 12px;
|
|
padding-bottom: 12px;
|
|
text-align: left;
|
|
background-color: #f15a24;
|
|
color: black;
|
|
}
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
html {
|
|
background-color: black;
|
|
color: white;
|
|
}
|
|
|
|
table td, table th {
|
|
border: 1px solid #ddd;
|
|
}
|
|
|
|
table th {
|
|
color: white
|
|
}
|
|
|
|
table tr:nth-child(even){
|
|
background-color: #230c00;
|
|
color: white;
|
|
}
|
|
|
|
table tr:hover {
|
|
background-color: #f15a24;
|
|
}
|
|
}
|
|
|
|
</style>
|
|
|
|
<script type="text/javascript" src="yaml.min.js"></script>
|
|
<script type="text/javascript">
|
|
var connectorYaml = `
|
|
pins:
|
|
- pin: 1
|
|
id: [GPIOE_11, GPIOE_11]
|
|
class: [event_inputs, switch_inputs]
|
|
function: Digital trigger/switch input
|
|
ts_name: Digital 2
|
|
type: din
|
|
|
|
- pin: 2
|
|
id: [GPIOE_12, GPIOE_12]
|
|
class: [event_inputs, switch_inputs]
|
|
function: Digital trigger/switch input
|
|
ts_name: Digital 3
|
|
type: din
|
|
|
|
- pin: 3
|
|
id: [GPIOE_13, GPIOE_13]
|
|
class: [event_inputs, switch_inputs]
|
|
function: Digital trigger/switch input
|
|
ts_name: Digital 4
|
|
type: din
|
|
|
|
- pin: 4
|
|
function: Variable Reluctance #2 positive
|
|
type: vr
|
|
|
|
- id: GPIOE_8
|
|
class: event_inputs
|
|
ts_name: VR 2
|
|
|
|
- pin: 5
|
|
function: Variable Reluctance #1 positive
|
|
type: vr
|
|
|
|
- id: GPIOE_7
|
|
class: event_inputs
|
|
ts_name: VR 1
|
|
|
|
- pin: 6
|
|
function: ETB 1 negative
|
|
type: etb
|
|
|
|
- pin: 7
|
|
function: ETB 1 positive
|
|
type: etb
|
|
|
|
- pin: 8
|
|
function: ETB 2 negative
|
|
type: etb
|
|
|
|
- pin: 9
|
|
id: [GPIOE_14, GPIOE_14]
|
|
class: [event_inputs, switch_inputs]
|
|
function: Digital trigger/switch input
|
|
ts_name: Digital 5
|
|
type: din
|
|
|
|
- pin: 10
|
|
id: [GPIOC_6, GPIOC_6]
|
|
class: [event_inputs, switch_inputs]
|
|
function: Digital trigger/switch input
|
|
ts_name: Digital 1
|
|
type: din
|
|
|
|
- pin: 11
|
|
id: [GPIOE_15, GPIOE_15]
|
|
class: [event_inputs, switch_inputs]
|
|
function: Digital trigger/switch input
|
|
ts_name: Digital 6
|
|
type: din
|
|
|
|
- pin: 12
|
|
function: Variable Reluctance #2 negative
|
|
type: vr
|
|
|
|
- pin: 13
|
|
function: Variable Reluctance #1 negative
|
|
type: vr
|
|
|
|
- pin: 14
|
|
function: Reserved For Future Use
|
|
|
|
- pin: 15
|
|
function: ETB 2 positive
|
|
type: etb
|
|
|
|
- pin: 16
|
|
function: CAN bus low
|
|
type: can
|
|
|
|
- pin: 17
|
|
function: CAN bus high
|
|
type: can
|
|
|
|
- pin: 18
|
|
id: EFI_ADC_7
|
|
class: analog_inputs
|
|
ts_name: Battery Sense
|
|
function: Ignition power / ECU power source. Connect this pin to the output of your ignition switch.
|
|
type: 12v
|
|
|
|
- pin: 19
|
|
function: Power GND
|
|
type: gnd
|
|
|
|
- pin: 20
|
|
function: Power GND
|
|
type: gnd
|
|
|
|
- pin: 21
|
|
function: Reserved For Future Use
|
|
|
|
- pin: 22
|
|
function: Reserved For Future Use
|
|
|
|
- pin: 23
|
|
function: Power supply from main relay. Connect this pin to the output of the car's main relay that also powers injectors, coils, etc. Supplies power to electronic throttle drivers and high side outputs.
|
|
type: 12v
|
|
|
|
info:
|
|
image:
|
|
file: black23.jpg
|
|
pins:
|
|
- pin: 1
|
|
x: 239
|
|
y: 312
|
|
- pin: 2
|
|
x: 343
|
|
y: 312
|
|
- pin: 3
|
|
x: 447
|
|
y: 312
|
|
- pin: 4
|
|
x: 551
|
|
y: 312
|
|
- pin: 5
|
|
x: 655
|
|
y: 312
|
|
- pin: 6
|
|
x: 759
|
|
y: 312
|
|
- pin: 7
|
|
x: 863
|
|
y: 312
|
|
- pin: 8
|
|
x: 967
|
|
y: 312
|
|
- pin: 9
|
|
x: 291
|
|
y: 412
|
|
- pin: 10
|
|
x: 395
|
|
y: 412
|
|
- pin: 11
|
|
x: 499
|
|
y: 412
|
|
- pin: 12
|
|
x: 603
|
|
y: 412
|
|
- pin: 13
|
|
x: 707
|
|
y: 412
|
|
- pin: 14
|
|
x: 811
|
|
y: 412
|
|
- pin: 15
|
|
x: 915
|
|
y: 412
|
|
- pin: 16
|
|
x: 239
|
|
y: 512
|
|
- pin: 17
|
|
x: 343
|
|
y: 512
|
|
- pin: 18
|
|
x: 447
|
|
y: 512
|
|
- pin: 19
|
|
x: 551
|
|
y: 512
|
|
- pin: 20
|
|
x: 655
|
|
y: 512
|
|
- pin: 21
|
|
x: 759
|
|
y: 512
|
|
- pin: 22
|
|
x: 863
|
|
y: 512
|
|
- pin: 23
|
|
x: 967
|
|
y: 512
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`;
|
|
|
|
function addRow(table, pin, pdiv) {
|
|
var template = document.getElementById("table-template");
|
|
var clone = template.content.cloneNode(true);
|
|
var row = clone.querySelector(".data");
|
|
var pdata = clone.querySelector(".pin-data");
|
|
var idata = clone.querySelector(".id-data");
|
|
var tdata = clone.querySelector(".type-data");
|
|
var fdata = clone.querySelector(".function-data");
|
|
var cdata = clone.querySelector(".color-data");
|
|
pdata.textContent = pin.pin;
|
|
idata.textContent = pin.id;
|
|
tdata.textContent = pin.type
|
|
fdata.textContent = pin.function;
|
|
cdata.textContent = pin.color
|
|
row.addEventListener('click', function(pin, pdiv) {
|
|
clickPin(pin, pdiv);
|
|
}.bind(null, pin, pdiv));
|
|
table.appendChild(clone);
|
|
}
|
|
|
|
function clickPin(pin, pdiv) {
|
|
var table = document.getElementById("info-table").querySelector("tbody");
|
|
table.innerHTML = "";
|
|
if (Array.isArray(pin.id)) {
|
|
var pinIds = pin.id.filter((value, index) => {
|
|
return pin.id.indexOf(value) === index;
|
|
});
|
|
for (var i = 0; i < pinIds.length; i++) {
|
|
addRow(table, {pin: pin.pin, id: pinIds[i], function: pin.function}, pdiv);
|
|
}
|
|
} else {
|
|
addRow(table, pin, pdiv);
|
|
}
|
|
var pins = document.querySelectorAll(".pin-marker");
|
|
for (var i = 0; i < pins.length; i++) {
|
|
if (pins[i].dataset.type == pin.type) {
|
|
pins[i].classList.add("highlight");
|
|
} else {
|
|
pins[i].classList.remove("highlight");
|
|
}
|
|
pins[i].classList.remove("selected");
|
|
}
|
|
pdiv.classList.add("selected");
|
|
}
|
|
|
|
function adjustMarkers() {
|
|
var cdiv = document.getElementById("connector-div");
|
|
cdiv.style.width = document.getElementById("connector-img").clientWidth;
|
|
var pins = document.querySelectorAll(".pin-marker");
|
|
for (var i = 0; i < pins.length; i++) {
|
|
var height = cdiv.clientHeight * 0.05;
|
|
pins[i].style.height = height + "px";
|
|
pins[i].style.width = height + "px";
|
|
pins[i].style.marginTop = "-" + (height * 0.5) + "px";
|
|
pins[i].style.marginLeft = "-" + (height * 0.5) + "px";
|
|
pins[i].style.fontSize = (height * 0.5) + "px";
|
|
}
|
|
}
|
|
|
|
window.addEventListener('load', function() {
|
|
var connector = YAML.parse(connectorYaml);
|
|
document.getElementById("connector-img").addEventListener('load', function() {
|
|
for (var i = 0; i < connector.pins.length; i++) {
|
|
var pin = connector.pins[i];
|
|
if (!pin.pin) {
|
|
continue;
|
|
}
|
|
var pinfo;
|
|
for (var ii = 0; ii < connector.info.pins.length; ii++) {
|
|
if (connector.info.pins[ii].pin == pin.pin) {
|
|
pinfo = connector.info.pins[ii];
|
|
break;
|
|
}
|
|
}
|
|
var cdiv = document.getElementById("connector-div");
|
|
var template = document.getElementById("pin-template");
|
|
var clone = template.content.cloneNode(true);
|
|
var pdiv = clone.querySelector("div");
|
|
var img = document.getElementById("connector-img");
|
|
var imgHeight = img.naturalHeight;
|
|
var imgWidth = img.naturalWidth;
|
|
pdiv.textContent = pinfo.pin;
|
|
pdiv.style.top = ((pinfo.y / imgHeight) * 100) + "%";
|
|
pdiv.style.left = ((pinfo.x / imgWidth) * 100) + "%";
|
|
pdiv.dataset.type = pin.type;
|
|
pdiv.addEventListener("click", function(pin, pdiv) {
|
|
clickPin(pin, pdiv);
|
|
}.bind(null, pin, pdiv));
|
|
cdiv.appendChild(pdiv);
|
|
var fullTable = document.getElementById("pinout-table").querySelector("tbody");
|
|
addRow(fullTable, connector.pins[i], pdiv);
|
|
}
|
|
adjustMarkers();
|
|
});
|
|
document.getElementById("connector-img").src = connector.info.image.file;
|
|
});
|
|
|
|
window.addEventListener('resize', function() {
|
|
adjustMarkers();
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
|
|
<template id="pin-template">
|
|
<div class="pin-marker"></div>
|
|
</template>
|
|
|
|
<div id="connector-container">
|
|
<div id="connector-div">
|
|
<img id="connector-img"></img>
|
|
</div>
|
|
</div>
|
|
|
|
<template id="table-template">
|
|
<tr class="data">
|
|
<td class="pin-data"></td>
|
|
<td class="id-data"></td>
|
|
<td class="type-data"></td>
|
|
<td class="function-data"></td>
|
|
<td class="color-data"></td>
|
|
</tr>
|
|
</template>
|
|
|
|
<table id="info-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Pin Number</th>
|
|
<th>Firmware ID</th>
|
|
<th>Type</th>
|
|
<th>Typical Function</th>
|
|
<th>Pigtail Color</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
</tbody>
|
|
</table>
|
|
|
|
<br/>
|
|
<br/>
|
|
<br/>
|
|
<br/>
|
|
|
|
<h2>Full Pinout Table</h2>
|
|
<table id="pinout-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Pin Number</th>
|
|
<th>Firmware ID</th>
|
|
<th>Type</th>
|
|
<th>Typical Function</th>
|
|
<th>Pigtail Color</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
</tbody>
|
|
</table>
|
|
|
|
</body>
|
|
</html>
|