eeprom 'yes' and 'required' handled with differet strings
This commit is contained in:
parent
0abe280e87
commit
3c94d6ce3a
@ -31,6 +31,7 @@ default_strings = {
|
||||
'uses_i2c': 'Uses I2C',
|
||||
'uses_spi': 'Uses SPI',
|
||||
'uses_eeprom': 'Uses EEPROM',
|
||||
'uses_eepvid': 'Uses VID/PID',
|
||||
'uses_n_gpio_pins': 'Uses {} GPIO pins',
|
||||
'bcm_pin_rev1_pi': 'BCM pin {} on Rev 1 ( very early ) Pi',
|
||||
'physical_pin_n': 'Physical pin {}',
|
||||
@ -114,6 +115,35 @@ def load_overlay(overlay):
|
||||
else:
|
||||
details.append(strings['pin_header'].format(pincount))
|
||||
|
||||
if 'eeprom' in loaded:
|
||||
eeprom = str(loaded['eeprom'])
|
||||
if eeprom == 'True':
|
||||
details.append(strings['uses_eepvid'])
|
||||
if eeprom == 'required':
|
||||
details.append(strings['uses_eeprom'])
|
||||
|
||||
if 'power' in loaded:
|
||||
uses_5v = False
|
||||
uses_3v3 = False
|
||||
|
||||
for pin in loaded['power']:
|
||||
pin = str(pin)
|
||||
if pin.startswith('bcm'):
|
||||
pin = pinout.bcm_to_physical(pin[3:])
|
||||
|
||||
if pin in ['2','4']:
|
||||
uses_5v = True
|
||||
|
||||
if pin in ['1','17']:
|
||||
uses_3v3 = True
|
||||
|
||||
if uses_5v and uses_3v3:
|
||||
details.append(strings['uses_5v_and_3v3'])
|
||||
elif uses_5v:
|
||||
details.append(strings['uses_5v'])
|
||||
elif uses_3v3:
|
||||
details.append(strings['uses_3v3'])
|
||||
|
||||
'''
|
||||
If the overlay includes a collection of pins then
|
||||
loop through them and count how many non-power pins are used
|
||||
@ -144,43 +174,14 @@ def load_overlay(overlay):
|
||||
if pin in ['19','21','23'] and data['mode'] == 'spi':
|
||||
uses_spi = True
|
||||
|
||||
|
||||
|
||||
if uses > 0:
|
||||
details.append(strings['uses_n_gpio_pins'].format(uses))
|
||||
|
||||
if uses_i2c:
|
||||
details.append(strings['uses_i2c'])
|
||||
|
||||
if uses_spi:
|
||||
details.append(strings['uses_spi'])
|
||||
|
||||
if 'eeprom' in loaded:
|
||||
eeprom = str(loaded['eeprom'])
|
||||
if eeprom == 'dtb':
|
||||
details.append(strings['uses_eeprom'])
|
||||
|
||||
if 'power' in loaded:
|
||||
uses_5v = False
|
||||
uses_3v3 = False
|
||||
|
||||
for pin in loaded['power']:
|
||||
pin = str(pin)
|
||||
if pin.startswith('bcm'):
|
||||
pin = pinout.bcm_to_physical(pin[3:])
|
||||
|
||||
if pin in ['2','4']:
|
||||
uses_5v = True
|
||||
|
||||
if pin in ['1','17']:
|
||||
uses_3v3 = True
|
||||
|
||||
if uses_5v and uses_3v3:
|
||||
details.append(strings['uses_5v_and_3v3'])
|
||||
elif uses_5v:
|
||||
details.append(strings['uses_5v'])
|
||||
elif uses_3v3:
|
||||
details.append(strings['uses_3v3'])
|
||||
if uses > 0:
|
||||
details.append(strings['uses_n_gpio_pins'].format(uses))
|
||||
|
||||
# A URL to more information about the add-on board, could be a GitHub readme or an about page
|
||||
if 'url' in loaded:
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
default_desc: The comprehensive Raspberry Pi GPIO Pinout guide for the original Raspberry
|
||||
default_title: Raspberry Pi GPIO Pinout - Pi 1, B+, Pi 2
|
||||
default_title: Raspberry Pi GPIO Pinout
|
||||
title_suffix: " at Raspberry Pi GPIO Pinout"
|
||||
base_url: /pinout/
|
||||
resource_url: /resources/
|
||||
@ -16,6 +16,7 @@ strings:
|
||||
- type_hat: 'HAT form-factor'
|
||||
- type_phat: 'pHAT form-factor'
|
||||
- type_classic: 'Classic form-factor'
|
||||
- uses_eepvid: 'EEPROM Hersteller ID'
|
||||
- uses_eeprom: 'benutzt EEPROM'
|
||||
- uses_i2c: 'benutzt I2C'
|
||||
- uses_spi: 'benutzt SPI'
|
||||
@ -28,7 +29,7 @@ strings:
|
||||
- wiring_pi_pin: 'Wiring Pi Anschluss {}'
|
||||
- made_by: 'Hersteller: {manufacturer}'
|
||||
- more_information: 'Mehr Informationen'
|
||||
- github_repository: 'GitHub Repository'
|
||||
- github_repository: 'GitHub'
|
||||
- buy_now: 'jetzt kaufen'
|
||||
featured:
|
||||
- display-o-tron
|
||||
|
@ -9,7 +9,7 @@ description: Add-on board that includes an 8×8 RGB LED matrix, 5-button joystic
|
||||
url: https://www.raspberrypi.org/products/sense-hat/
|
||||
image: 'sense-hat.png'
|
||||
pincount: 40
|
||||
eeprom: dtb
|
||||
eeprom: required
|
||||
power:
|
||||
'1':
|
||||
'2':
|
||||
|
@ -9,7 +9,7 @@ description: Add-on board that includes an 8×8 RGB LED matrix, 5-button joystic
|
||||
url: https://www.raspberrypi.org/products/sense-hat/
|
||||
image: 'sense-hat.png'
|
||||
pincount: 40
|
||||
eeprom: dtb
|
||||
eeprom: required
|
||||
power:
|
||||
'1':
|
||||
'2':
|
||||
|
@ -16,9 +16,10 @@ strings:
|
||||
- type_hat: 'HAT form-factor'
|
||||
- type_phat: 'pHAT form-factor'
|
||||
- type_classic: 'Classic form-factor'
|
||||
- uses_eeprom: 'EEPROM auto-config'
|
||||
- uses_i2c: 'Uses I2C'
|
||||
- uses_spi: 'Uses SPI'
|
||||
- uses_eepvid: 'EEPROM product ID'
|
||||
- uses_eeprom: 'EEPROM auto configuration'
|
||||
- uses_i2c: 'Communication over I2C'
|
||||
- uses_spi: 'Communication over SPI'
|
||||
- uses_5v_and_3v3: 'Needs 5v and 3v3 power'
|
||||
- uses_5v: 'Needs 5v power'
|
||||
- uses_3v3: 'Needs 3v3 power'
|
||||
|
@ -16,6 +16,7 @@ strings:
|
||||
- type_hat: 'formato HAT'
|
||||
- type_phat: 'formato pHAT'
|
||||
- type_classic: 'formato clásico'
|
||||
- uses_eepvid: 'EEPROM ID'
|
||||
- uses_eeprom: 'Usa EEPROM'
|
||||
- uses_i2c: 'Usa I2C'
|
||||
- uses_spi: 'Usa SPI'
|
||||
@ -28,7 +29,7 @@ strings:
|
||||
- wiring_pi_pin: 'Wiring Pi pin {}'
|
||||
- made_by: 'Hecho por {manufacturer}'
|
||||
- more_information: 'More Information'
|
||||
- github_repository: 'GitHub Repository'
|
||||
- github_repository: 'GitHub'
|
||||
- buy_now: 'Buy Now'
|
||||
featured:
|
||||
- ab-adc-pi-zero
|
||||
|
@ -9,7 +9,7 @@ description: Add-on board that includes an 8×8 RGB LED matrix, 5-button joystic
|
||||
url: https://www.raspberrypi.org/products/sense-hat/
|
||||
image: 'sense-hat.png'
|
||||
pincount: 40
|
||||
eeprom: dtb
|
||||
eeprom: required
|
||||
power:
|
||||
'1':
|
||||
'2':
|
||||
|
@ -16,9 +16,10 @@ strings:
|
||||
- type_hat: 'format HAT'
|
||||
- type_phat: 'format pHAT'
|
||||
- type_classic: 'format Classic'
|
||||
- uses_eeprom: 'configuration automatique EEPROM'
|
||||
- uses_i2c: 'bus I2C'
|
||||
- uses_spi: 'bus SPI'
|
||||
- uses_eepvid: 'identification produit par EEPROM'
|
||||
- uses_eeprom: 'configuration automatique par EEPROM'
|
||||
- uses_i2c: 'communication par bus I2C'
|
||||
- uses_spi: 'communication par bus SPI'
|
||||
- uses_5v_and_3v3: 'Alim. 5v et 3v3'
|
||||
- uses_5v: 'Alim. 5v'
|
||||
- uses_3v3: 'Alim. 3v3'
|
||||
|
@ -9,7 +9,7 @@ description: Add-on board that includes an 8×8 RGB LED matrix, 5-button joystic
|
||||
url: https://www.raspberrypi.org/products/sense-hat/
|
||||
image: 'sense-hat.png'
|
||||
pincount: 40
|
||||
eeprom: dtb
|
||||
eeprom: required
|
||||
power:
|
||||
'1':
|
||||
'2':
|
||||
|
@ -16,6 +16,7 @@ strings:
|
||||
- type_hat: 'Fattore di forma HAT'
|
||||
- type_phat: 'Fattore di forma pHAT'
|
||||
- type_classic: 'Fattore di forma classico'
|
||||
- uses_eepvid: 'Prodotto ID EEPROM'
|
||||
- uses_eeprom: 'Utilizza EEPROM'
|
||||
- uses_i2c: 'Utilizza I2C'
|
||||
- uses_spi: 'Utilizza SPI'
|
||||
@ -28,7 +29,7 @@ strings:
|
||||
- wiring_pi_pin: 'Wiring Pi pin {}'
|
||||
- made_by: 'Prodotto da {manufacturer}'
|
||||
- more_information: 'Maggiori informazioni'
|
||||
- github_repository: 'GitHub Repository'
|
||||
- github_repository: 'GitHub'
|
||||
- buy_now: 'Acquista'
|
||||
featured:
|
||||
- display-o-tron
|
||||
|
@ -9,7 +9,7 @@ description: Add-on board that includes an 8×8 RGB LED matrix, 5-button joystic
|
||||
url: https://www.raspberrypi.org/products/sense-hat/
|
||||
image: 'sense-hat.png'
|
||||
pincount: 40
|
||||
eeprom: dtb
|
||||
eeprom: required
|
||||
power:
|
||||
'1':
|
||||
'2':
|
||||
|
@ -16,6 +16,7 @@ strings:
|
||||
- type_hat: 'HAT form-factor'
|
||||
- type_phat: 'pHAT form-factor'
|
||||
- type_classic: 'Classic form-factor'
|
||||
- uses_eepvid: 'EEPROM ID'
|
||||
- uses_eeprom: 'Kullanan EEPROM'
|
||||
- uses_i2c: 'Kullanan I2C'
|
||||
- uses_spi: 'Kullanan SPI'
|
||||
|
@ -9,7 +9,7 @@ description: Add-on board that includes an 8×8 RGB LED matrix, 5-button joystic
|
||||
url: https://www.raspberrypi.org/products/sense-hat/
|
||||
image: 'sense-hat.png'
|
||||
pincount: 40
|
||||
eeprom: dtb
|
||||
eeprom: required
|
||||
power:
|
||||
'1':
|
||||
'2':
|
||||
|
Loading…
Reference in New Issue
Block a user