Tweak labels, add PCM, drop tabs, fix bugs

This commit is contained in:
Phil Howard 2020-08-25 01:04:12 +01:00
parent 47eba67472
commit 9721bc1320
9 changed files with 86 additions and 139 deletions

View File

@ -1,5 +1,4 @@
<div id="leftcolumn">
<ul id="mode"><li class="selected">BCM</li><li>GPIO</li></ul>
<nav id="gpio">
<div id="pinbase"></div>
{{nav}}
@ -33,6 +32,12 @@
<span class="pin"></span> UART <small>(Universal Asyncronous Receiver/Transmitter)</small>
</a>
</li>
<li class="pcm">
<a href="/pinout/pcm" title="PCM (Pulse Code Modulation)">
<span class="default"></span>
<span class="pin"></span> PCM <small>(Pulse Code Modulation)</small>
</a>
</li>
<li class="gnd">
<a href="/pinout/ground" title="Ground">
<span class="default"></span>

View File

@ -51,8 +51,8 @@ default_strings = {
'uses_i2c': 'Uses I2C',
'uses_spi': 'Uses SPI',
'uses_n_gpio_pins': 'Uses {} GPIO pins',
'bcm_pin_rev1_pi': 'BCM pin {} on Rev 1 ( very early ) Pi',
'physical_pin_n': 'Physical pin {}',
'bcm_pin_rev1_pi': 'GPIO/BCM pin {} on Rev 1 ( very early ) Pi',
'physical_pin_n': 'Physical/Board pin {}',
'wiring_pi_pin': 'Wiring Pi pin {}',
'made_by': 'Made by {manufacturer}',
'more_information': 'More Information',
@ -343,9 +343,9 @@ def render_pin_page(pin_num):
bcm = pin['scheme']['bcm']
pin_url = 'gpio{}'.format(bcm)
pin_text_name = 'BCM {}'.format(bcm)
pin_text_name = 'GPIO {}'.format(bcm)
pin_subtext.append('BCM pin {}'.format(bcm))
pin_subtext.append('GPIO/BCM pin {}'.format(bcm))
if 'wiringpi' in pin['scheme']:
wiringpi = pin['scheme']['wiringpi']
pin_subtext.append('Wiring Pi pin {}'.format(wiringpi))
@ -456,7 +456,7 @@ def render_pin(pin_num, selected_url, overlay=None):
pin_url = 'gpio{}'.format(bcm)
if pin_name != '':
pin_subname = ' <small>({})</small>'.format(pin_name)
pin_name = '<span class="name">BCM {}</span>{}'.format(bcm, pin_subname)
pin_name = '<span class="name">GPIO {}</span>{}'.format(bcm, pin_subname)
if 'wiringpi' in pin['scheme']:
wiringpi = pin['scheme']['wiringpi']

View File

@ -4,46 +4,6 @@ jQuery(document).ready(function(){
$('pre').addClass('prettyprint').addClass('linenums');
$('#gpio li').each(function(){
var gpio = $(this).find('.default .phys').text();
var bcm = $(this).find('.default .name').text().replace('BCM ', '').trim();
$(this).find('.default .name').text(bcm);
$(this).data('gpio', gpio);
$(this).data('bcm', bcm);
});
$('#mode').show().find('li').on('click', function(e){
e.preventDefault();
e.stopPropagation();
$(this).parents('ul').find('li').removeClass('selected');
$(this).addClass('selected');
$('li .phys').text('');
switch($(this).text()) {
case 'GPIO':
$('#gpio li').each(function(){
var gpio = $(this).data('gpio');
var bcm = $(this).data('bcm');
if($(this).hasClass('gpio')) {
$(this).find('.name').text(gpio);
}
$(this).find('.phys').text(bcm);
});
break;
case 'BCM':
$('#gpio li').each(function(){
var gpio = $(this).data('gpio');
var bcm = $(this).data('bcm');
if($(this).hasClass('gpio')) {
$(this).find('.name').text(bcm);
}
$(this).find('.phys').text(gpio);
});
break;
}
});
window.prettyPrint&&prettyPrint();
var groups = $('#sections .boards .group');
@ -106,7 +66,7 @@ jQuery(document).ready(function(){
overlay_slideUp = setTimeout(function(){dropdown.slideUp(100);}, 100);
})
$('article p').each(function(){
$('article p,article li').each(function(){
html = $(this).html();
html = html.replace(
@ -116,10 +76,18 @@ jQuery(document).ready(function(){
}
)
html = html.replace(
/GPIO\ ([0-9]{1,2})/gi,
function(str, c1){
var pin = $("#gpio li").filter(function(){return $(this).find("span.name").text() == "GPIO " + c1}).find('.phys').text();
return '<span title="Click for details about pin ' + pin + '" class="pin-hover" data-pin="' + pin + '">' + str + '</span>';
}
)
$(this).html(html);
});
$('article p .pin-hover').hover(function(){
$('article p .pin-hover, article li .pin-hover').hover(function(){
var pin = $(this).data('pin');
$('li.pin' + pin).addClass('hover-pin');
},function(){
@ -127,9 +95,9 @@ jQuery(document).ready(function(){
$('li.pin' + pin).removeClass('hover-pin');
});
$('article p').on('click','.pin-hover',function(){
$('article').on('click', '.pin-hover', function(){
var pin = $(this).data('pin');
$('li.pin' + pin + ' a').trigger('click');
})
window.location = $('li.pin' + pin + ' a').attr('href');
});
});

View File

@ -6,6 +6,7 @@ $color-green: #859900;
$color-red: #DC322F;
$color-yellow: #B58900;
$color-blue: #268BD2;
$color-cyan: #2aa198;
$color-dark: #073642;
@ -39,10 +40,11 @@ table {
th {background:$color-dark;color:$color-content-bg;}
&.details {
font-size:inherit;
width:100%;
td, th {
border:none;vertical-align:top;
border:none;vertical-align:top;padding:0;
}
img {margin-top:54px;}
@ -157,8 +159,8 @@ h1,h2,h3,h4,h5,h6 {font-family:"Palatino Linotype", "Book Antiqua", Palatino, se
article {
padding:15px;
.pin-hover {cursor:help;}
.pin-hover:hover {color:#880000;}
.pin-hover {cursor:help;color:#880000;}
.pin-hover:hover {color:#AA0000;}
img {max-width:100%;}
.details img {min-width:200px;}
a {
@ -167,6 +169,7 @@ h1,h2,h3,h4,h5,h6 {font-family:"Palatino Linotype", "Book Antiqua", Palatino, se
&:hover {text-decoration:none;}
}
li {margin-bottom:10px;}
ul {margin-left:20px;margin-top:10px;margin-bottom:10px;}
}
}
@ -410,34 +413,6 @@ Left Column
GPIO nav
*/
#mode {
position: relative;
top: 64px;
cursor: pointer;
cursor: hand;
display: none;
li {
display: inline-block;
padding: 3px 10px;
margin-top: 2px;
margin-right: 2px;
background: $color-content-bg;
color: $color-dark;
font-size: .84em;
line-height: 1.45em;
&:hover {
background:lighten($nav-bg, 20);
}
&.selected {
background:$nav-bg;
color: $color-content-bg;
&:hover {
background:$nav-bg;
}
}
}
}
nav {
position:relative;
width:316px;
@ -613,6 +588,7 @@ nav {
.bottom li.hover-pin a {
color:#FFF;
background:rgba(200,0,0,0.6);
.phys {color:#FFF}
}
.pin1 a:hover, .pin1.active a, .pin1 .pin {border-radius:0;}
@ -622,6 +598,7 @@ nav {
.gpio .pin {background:$color-green;}
.i2c .pin {background:$color-blue;}
.spi .pin {background:$color-pink;}
.pcm .pin {background:$color-cyan;}
.uart .pin {background:$color-purple;}
}
@ -670,6 +647,7 @@ nav {
.i2c .pin {background:$color-blue;}
.spi .pin {background:$color-pink;}
.uart .pin {background:$color-purple;}
.pcm .pin {background:$color-cyan;}
.pin {
display:block;

View File

@ -22,10 +22,12 @@ table {
background: #073642;
color: #EBE6D3; }
table.details {
font-size: inherit;
width: 100%; }
table.details td, table.details th {
border: none;
vertical-align: top; }
vertical-align: top;
padding: 0; }
table.details img {
margin-top: 54px; }
table.pin-functions {
@ -122,9 +124,10 @@ h1, h2, h3, h4, h5, h6 {
#content article {
padding: 15px; }
#content article .pin-hover {
cursor: help; }
#content article .pin-hover:hover {
cursor: help;
color: #880000; }
#content article .pin-hover:hover {
color: #AA0000; }
#content article img {
max-width: 100%; }
#content article .details img {
@ -134,6 +137,8 @@ h1, h2, h3, h4, h5, h6 {
text-decoration: underline; }
#content article a:hover {
text-decoration: none; }
#content article li {
margin-bottom: 10px; }
#content article ul {
margin-left: 20px;
margin-top: 10px;
@ -314,29 +319,6 @@ Left Column
/*
GPIO nav
*/
#mode {
position: relative;
top: 64px;
cursor: pointer;
cursor: hand;
display: none; }
#mode li {
display: inline-block;
padding: 3px 10px;
margin-top: 2px;
margin-right: 2px;
background: #EBE6D3;
color: #073642;
font-size: .84em;
line-height: 1.45em; }
#mode li:hover {
background: #92b978; }
#mode li.selected {
background: #5F8645;
color: #EBE6D3; }
#mode li.selected:hover {
background: #5F8645; }
nav {
position: relative;
width: 316px;
@ -465,6 +447,9 @@ nav {
#gpio .bottom li.hover-pin a {
color: #FFF;
background: rgba(200, 0, 0, 0.6); }
#gpio ul li.hover-pin a .phys,
#gpio .bottom li.hover-pin a .phys {
color: #FFF; }
#gpio .pin1 a:hover, #gpio .pin1.active a, #gpio .pin1 .pin {
border-radius: 0; }
#gpio .pow3v3 .pin {
@ -477,6 +462,8 @@ nav {
background: #268BD2; }
#gpio .spi .pin {
background: #D33682; }
#gpio .pcm .pin {
background: #2aa198; }
#gpio .uart .pin {
background: #6c71c4; }
@ -522,6 +509,8 @@ nav {
background: #D33682; }
#legend .uart .pin {
background: #6c71c4; }
#legend .pcm .pin {
background: #2aa198; }
#legend .pin {
display: block;
border: 1px solid transparent;

View File

@ -6,7 +6,7 @@ type: display
formfactor: pHAT
manufacturer: Waveshare
description: an E-Ink display pHAT for with embedded controller, communicating via SPI interface.
url: https://www.waveshare.com/product/2.13inch-e-paper-hat.htm
url: http://www.waveshare.com/wiki/2.13inch_e-Paper_HAT
buy: https://www.waveshare.com/product/2.13inch-e-paper-hat.htm
image: 'waveshare213paper.png'
pincount: 40
@ -35,4 +35,9 @@ This is an E-Ink display HAT for Raspberry Pi, 2.13inch, 250x122 resolution, wit
Due to the advantages like ultra low power consumption, wide viewing angle, clear display without electricity, it is an ideal choice for applications such as shelf label, industrial instrument, and so on.
The WIKI for this pHAT can be found here: http://www.waveshare.com/wiki/2.13inch_e-Paper_HAT
## Features
* 250x122 resolution
* SPI interface
* Support for partial refresh
* Low power consumption

View File

@ -23,10 +23,10 @@ We've [added a board explorer](/boards)! Use it to find the pinout for a Raspber
## What do these numbers mean?
* BCM - Broadcom pin number, commonly called "GPIO", these are the ones you probably want to use with RPi.GPIO and GPIO Zero
* WiringPi - Wiring Pi pin number (shown as a tooltip), for Gordon Henderson's Wiring Pi library
* Physical - Number corresponding to the pin's physical location on the header
* Rev 1 Pi - Alternate BCM numbers for the original, 26-pin model "A" and "B" Pi
* GPIO - General Purpose Input/Output, aka "BCM" or "Broadcom". These are the big numbers, eg "GPIO 22." You'll use these with RPi.GPIO and GPIO Zero.
* Physical - or "Board" correspond to the pin's physical location on the header. These are the small numbers next to the header, eh "Physical Pin 15".
* WiringPi - for Gordon Henderson's Wiring Pi library. These are shown as a tooltip when you mouseover a pin.
* Rev 1 Pi - alternate GPIO/BCM numbers for the original, 26-pin model "A" and "B" Pi.
## What's the orientation of this pinout?

View File

@ -19,8 +19,8 @@ strings:
- uses_5v: 'Needs 5v power'
- uses_3v3: 'Needs 3v3 power'
- uses_n_gpio_pins: 'Uses {} GPIO pins'
- bcm_pin_rev1_pi: 'BCM pin {} on Rev 1 ( very early ) Pi'
- physical_pin_n: 'Physical pin {}'
- bcm_pin_rev1_pi: 'GPIO/BCM pin {} on Rev 1 ( very early ) Pi'
- physical_pin_n: 'Physical/Board pin {}'
- wiring_pi_pin: 'Wiring Pi pin {}'
- made_by: 'Made by {manufacturer}'
- more_information: 'More Information'

View File

@ -8,7 +8,7 @@ pins:
name: 5v Power
type: "+5v"
'3':
name: SDA
name: I2C1 SDA
description: I2C Data
type: GPIO/I2C
scheme:
@ -25,7 +25,7 @@ pins:
name: 5v Power
type: "+5v"
'5':
name: SCL
name: I2C1 SCL
description: I2C Clock
type: GPIO/I2C
scheme:
@ -55,7 +55,7 @@ pins:
alt4: AVEIN VID0
alt5: JTAG TDI
'8':
name: TXD
name: UART TX
description: UART Transmit
type: GPIO/UART
scheme:
@ -72,7 +72,7 @@ pins:
name: Ground
type: GND
'10':
name: RXD
name: UART RX
description: UART Receive
type: GPIO/UART
scheme:
@ -99,9 +99,9 @@ pins:
alt4: SPI1 CE1
alt5: UART1 RTS
'12':
name: PWM0
description: PWM0
type: GPIO
name: PCM CLK
description: PCM Clock
type: GPIO/PCM
scheme:
wiringpi: 1
bcm: 18
@ -168,7 +168,7 @@ pins:
alt3: SD1 DAT0
alt4: JTAG TDO
'19':
name: MOSI
name: SPI0 MOSI
type: GPIO/SPI
scheme:
wiringpi: 12
@ -183,7 +183,7 @@ pins:
name: Ground
type: GND
'21':
name: MISO
name: SPI0 MISO
type: GPIO/SPI
scheme:
wiringpi: 13
@ -207,7 +207,7 @@ pins:
alt3: SD1 DAT1
alt4: JTAG TCK
'23':
name: SCLK
name: SPI0 SCLK
type: GPIO/SPI
scheme:
wiringpi: 14
@ -219,7 +219,7 @@ pins:
alt3: AVEOUT VID7
alt4: AVEIN VID7
'24':
name: CE0
name: SPI0 CE0
description: SPI Chip Select 0
type: GPIO/SPI
scheme:
@ -235,7 +235,7 @@ pins:
name: Ground
type: GND
'26':
name: CE1
name: SPI0 CE1
description: SPI Chip Select 1
type: GPIO/SPI
scheme:
@ -248,7 +248,7 @@ pins:
alt3: AVEOUT VID3
alt4: AVEIN VID3
'27':
name: ID_SD
name: EEPROM SDA
description: HAT EEPROM i2c Data
type: GPIO/I2C
scheme:
@ -261,7 +261,7 @@ pins:
alt3: AVEOUT VCLK
alt4: AVEIN VCLK
'28':
name: ID_SC
name: EEPROM SCL
description: HAT EEPROM i2c Clock
type: GPIO/I2C
scheme:
@ -305,6 +305,7 @@ pins:
'32':
name: PWM0
type: GPIO
description: PWM0
scheme:
wiringpi: 26
bcm: 12
@ -318,6 +319,7 @@ pins:
'33':
name: PWM1
type: GPIO
description: PWM1
scheme:
wiringpi: 23
bcm: 13
@ -332,9 +334,9 @@ pins:
name: Ground
type: GND
'35':
name: MISO
description: SPI Master-In
type: GPIO/SPI
name: PCM FS
description: PCM Frame Sync
type: GPIO/PCM
scheme:
wiringpi: 24
bcm: 19
@ -371,9 +373,9 @@ pins:
alt3: SD1 DAT2
alt4: JTAG TDI
'38':
name: MOSI
description: SPI Master-Out
type: GPIO/SPI
name: PCM DIN
description: PCM Data-In
type: GPIO/PCM
scheme:
wiringpi: 28
bcm: 20
@ -388,9 +390,9 @@ pins:
name: Ground
type: GND
'40':
name: SCLK
description: SPI Clock
type: GPIO/SPI
name: PCM DOUT
description: PCM Data-Out
type: GPIO/PCM
scheme:
wiringpi: 29
bcm: 21