diff --git a/generate-html.py b/generate-html.py index fd2d4a4..4f08ba8 100755 --- a/generate-html.py +++ b/generate-html.py @@ -7,6 +7,11 @@ import os import time import sys import pinout +import yaml +import markjaml + +reload(sys) +sys.setdefaultencoding('utf8') lang = "en-GB" base_url = '/pinout/' @@ -17,26 +22,6 @@ if len(sys.argv) > 1: pinout.load(lang) -'''overlays = [ - 'ground', - 'spi', - 'uart', - 'i2c', - 'wiringpi', - 'arduino-spi', - 'rtk-000-001', - 'piborg-ledborg', - 'piglow', - 'pibrella', - 'unicorn-hat', - 'skywriter-hat', - 'explorer-hat-pro', - 'explorer-hat', - 'display-o-tron', - 'dots', - 'traffic-hat' -]''' - overlays = pinout.settings['overlays'] template = open('src/{}/template/layout.html'.format(lang)).read() @@ -83,11 +68,13 @@ def slugify(value): def load_overlay(overlay): try: - loaded = json.load(open('src/{}/overlay/{}.json'.format(lang,overlay))) + data = markjaml.load('src/{}/overlay/{}.md'.format(lang,overlay)) + + loaded = data['data'] + loaded['long_description'] = data['html'] except IOError: return None - loaded['long_description'] = load_md('description/overlay/{}.md'.format(overlay)) details = [] @@ -108,6 +95,7 @@ def load_overlay(overlay): uses_3v = False uses = 0 for pin in loaded['pin']: + pin = str(pin) if pin.startswith('bcm'): pin = pinout.bcm_to_physical(pin[3:]) @@ -169,7 +157,7 @@ def render_pin_text(pin_num, pin_url, pin_name, pin_functions, pin_subtext): pin_name=pin_name, pin_functions=pin_functions, pin_subtext=pin_subtext, - pin_text=load_md('description/pins/pin-{}.md'.format(pin_num))) + pin_text=load_md('pin/pin-{}.md'.format(pin_num))) def render_overlay_page(overlay): if overlay == None: @@ -271,13 +259,18 @@ def render_pin(pin_num, selected_url, overlay=None): if 'bcm' in pin['scheme']: bcm_pin = 'bcm' + str(pin['scheme']['bcm']) - if overlay != None and ( str(pin_num) in overlay['pin'] or bcm_pin in overlay['pin']): + if overlay != None and ( pin_num in overlay['pin'] or str(pin_num) in overlay['pin'] or bcm_pin in overlay['pin']): - if str(pin_num) in overlay['pin']: + if pin_num in overlay['pin']: + overlay_pin = overlay['pin'][pin_num] + elif str(pin_num) in overlay['pin']: overlay_pin = overlay['pin'][str(pin_num)] else: overlay_pin = overlay['pin'][bcm_pin] + if overlay_pin == None: + overlay_pin = {} + pin_used = True #print(overlay) if 'name' in overlay_pin: @@ -302,8 +295,8 @@ def render_pin(pin_num, selected_url, overlay=None): pin_url = base_url + slugify('pin{}_{}'.format(pin_num,pin_url)) - if pin['name'] == 'Ground': - pin_url = base_url + 'ground' + if pin['type'] in pinout.get_setting('urls'): + pin_url = base_url + pinout.get_setting('urls')[pin['type']] selected = '' @@ -348,7 +341,7 @@ and all other pages in /pinout/ serve.py will mirror this structure for testing. ''' pages['pinout'] = {} -pages['pinout']['rendered_html'] = render_overlay_page({'name':'Index','long_description':load_md('description/index.md')}) +pages['pinout']['rendered_html'] = render_overlay_page({'name':'Index','long_description':load_md('index.md')}) navs['pinout'] = render_nav('pinout') print('Rendering pin pages...') diff --git a/markjaml.py b/markjaml.py new file mode 100644 index 0000000..8234443 --- /dev/null +++ b/markjaml.py @@ -0,0 +1,55 @@ +import json +import markdown +import yaml +import re +import unicodedata + +def slugify(value): + """ + Normalizes string, converts to lowercase, removes non-alpha characters, + and converts spaces to hyphens. + """ + value = unicode(value) + value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii') + value = re.sub('[^\w\s-]', '-', value).strip().lower() + return re.sub('[-\s]+', '-', value) + +def load(file): + ''' + Loads and parses JSON-embedded Markdown file, chopping out and + parsing any JSON contained therein. + + Returns an object that includes the JSON data, and the parsed HTML. + ''' + markson = open(file).read() + + _data = re.search(re.compile(r'', re.DOTALL),markson) + + _markdown = re.sub(re.compile(r'', re.DOTALL),'',markson) + _html = markdown.markdown(_markdown, extensions=['fenced_code']) + + # Scan for the Title in the Markdown file, this is always assumed + # to be the first string starting with a single hash/pound ( # ) sign + _title = re.search(re.compile(r'^#[^\#](.*)$', re.MULTILINE),markson) + + if _title != None: + _title = _title.group(0).replace('#','').strip() + + if _data != None: + _type = _data.group(0)[4:8].upper().strip() + + if _type == 'JSON': + _data = re.search('\{(.*)\}',_data.group(0),re.DOTALL).group(0) + _data = json.loads(_data) + elif _type == '---': + _data = re.search('\n(.*)\n',_data.group(0),re.DOTALL).group(0) + _data = yaml.load(_data) + else: + data = {} + + _data['title'] = _title + + elif _title != None: + _data = {'title':_title} + + return {'data':_data, 'html':_html} \ No newline at end of file diff --git a/pinout.py b/pinout.py index c36c7fd..e6f8992 100644 --- a/pinout.py +++ b/pinout.py @@ -1,13 +1,19 @@ import json +import yaml import time import markdown -DB_FILE = 'pi-pinout.json' -SETTINGS_FILE = 'settings.json' +DB_FILE = 'pi-pinout.yaml' +SETTINGS_FILE = 'settings.yaml' pins = None settings = None +def get_setting(setting): + if setting in settings: + return settings[setting] + return None + def render_html(*args, **kwargs): html = args[0] kwargs['v'] = str(int(time.time())) @@ -50,8 +56,14 @@ def physical_to(pin, scheme='bcm'): def load(lang='en-GB'): global pins, settings - db = json.load(open('src/{}/{}'.format(lang,DB_FILE))) - settings = json.load(open('src/{}/{}'.format(lang,SETTINGS_FILE))) + if DB_FILE.endswith('.yaml'): + db = yaml.load(open('src/{}/{}'.format(lang,DB_FILE)).read()) + else: + db = json.load(open('src/{}/{}'.format(lang,DB_FILE))) + if SETTINGS_FILE.endswith('.yaml'): + settings = yaml.load(open('src/{}/{}'.format(lang,SETTINGS_FILE)).read()) + else: + settings = json.load(open('src/{}/{}'.format(lang,SETTINGS_FILE))) pins = db['pins'] diff --git a/src/en-GB/description/overlay/display-o-tron.md b/src/en-GB/description/overlay/display-o-tron.md deleted file mode 100644 index 51ec802..0000000 --- a/src/en-GB/description/overlay/display-o-tron.md +++ /dev/null @@ -1,9 +0,0 @@ -#Display-o-Tron 3000 - -You can use the one-line product installer to get Display-o-Tron 3000 set up and ready to go, just: - -```bash -curl get.pimoroni.com/dot3k | bash -``` - -And follow the instructions! \ No newline at end of file diff --git a/src/en-GB/description/overlay/dots.md b/src/en-GB/description/overlay/dots.md deleted file mode 100644 index 1309085..0000000 --- a/src/en-GB/description/overlay/dots.md +++ /dev/null @@ -1,26 +0,0 @@ -#Raspberry Pi Dots - -###Dots is a Dot to Dot HAT board for the Raspberry Pi that lets you join-the-dots with BARE Conductive Paint! - -Every Dot on the Dots board is a "floating" metal contact just waiting to be pulled down to ground with a dab of paint. - -To read a Dot you should set its corresponding pin as an INPUT and make sure it's pulled up like so: - -```python -import RPi.GPIO as GPIO -GPIO.setmode(GPIO.BCM ) -GPIO.setup(dot_pin, GPIO.IN, GPIO.PUD_UP) -state = GPIO.input(dot_pin) -``` - -It's good practise to only turn on the PULLUP when you actually want to read the Dot, so a method like -this is recommended for reading: - -```python -def is_dot_connected(dot_pin): - GPIO.setup(dot_pin, GPIO.IN, GPIO.PUD_UP) - state = GPIO.input( dot_pin ) - GPIO.setup(dot_pin, GPIO.IN, GPIO.PUD_OFF) - return state == 0 -``` - diff --git a/src/en-GB/description/overlay/explorer-hat-pro.md b/src/en-GB/description/overlay/explorer-hat-pro.md deleted file mode 100644 index f1e60fc..0000000 --- a/src/en-GB/description/overlay/explorer-hat-pro.md +++ /dev/null @@ -1,15 +0,0 @@ -#Explorer HAT and Explorer HAT Pro - -5V inputs and outputs, touch pads, LEDs, analog inputs and an H-Bridge motor driver make up the Explorer HAT Pro- a jack of all trades prototyping side-kick for your Raspberry Pi. - -```bash -sudo apt-get install python-pip -sudo pip install explorer-hat -``` - -Then import it into your Python script and start tinkering: - -```bash -import explorerhat -explorerhat.light.on() -``` \ No newline at end of file diff --git a/src/en-GB/description/overlay/explorer-hat.md b/src/en-GB/description/overlay/explorer-hat.md deleted file mode 120000 index b960cc9..0000000 --- a/src/en-GB/description/overlay/explorer-hat.md +++ /dev/null @@ -1 +0,0 @@ -explorer-hat-pro.md \ No newline at end of file diff --git a/src/en-GB/description/overlay/pibrella.md b/src/en-GB/description/overlay/pibrella.md deleted file mode 100644 index cec800a..0000000 --- a/src/en-GB/description/overlay/pibrella.md +++ /dev/null @@ -1,17 +0,0 @@ -#Pibrella - -The all-in-one light, sound, input and output add-on board from Pimoroni vs Cyntech uses lots of IO on the Pi but leaves both Serial and I2C free leaving plenty of room for expansion if you get creative. - -Pibrella is easy to use, first you should install the module using LXTerminal/Command Line: - -```bash -sudo apt-get install python-pip -sudo pip install pibrella -``` - -Then import it into your Python script and start tinkering: - -```bash -import pibrella -pibrella.light.red.on() -``` diff --git a/src/en-GB/description/overlay/skywriter-hat.md b/src/en-GB/description/overlay/skywriter-hat.md deleted file mode 100644 index bbed683..0000000 --- a/src/en-GB/description/overlay/skywriter-hat.md +++ /dev/null @@ -1,6 +0,0 @@ -#Skywriter HAT - -Skywriter HAT senses your finger's position above it in 3 dimensions, outputting an X, Y, Z axis -which you can use in your Python scripts. - -It also recognises gestures, including swipes and more. \ No newline at end of file diff --git a/src/en-GB/description/index.md b/src/en-GB/index.md similarity index 100% rename from src/en-GB/description/index.md rename to src/en-GB/index.md diff --git a/src/en-GB/overlay/arduino-spi.json b/src/en-GB/overlay/arduino-spi.json deleted file mode 100644 index 83270d2..0000000 --- a/src/en-GB/overlay/arduino-spi.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "Arduino SPI", - "description": "Program Arduino with Raspberry Pi SPI", - "pin": { - "19": { - "name": "MOSI", - "direction": "output", - "active": "high", - "description": "Master Out / Slave In" - }, - "21": { - "name": "MISO", - "direction": "input", - "active": "high", - "description": "Master In / Slave Out" - }, - "23": { - "name": "SCKL", - "direction": "output", - "active": "high", - "description": "Clock" - }, - "24": { - "name": "CE0", - "direction": "output", - "active": "high", - "description": "Arduino Reset" - } - } -} diff --git a/src/en-GB/description/overlay/arduino-spi.md b/src/en-GB/overlay/arduino-spi.md similarity index 71% rename from src/en-GB/description/overlay/arduino-spi.md rename to src/en-GB/overlay/arduino-spi.md index 48ea1f2..1841c25 100644 --- a/src/en-GB/description/overlay/arduino-spi.md +++ b/src/en-GB/overlay/arduino-spi.md @@ -1,3 +1,29 @@ + #ATmega 328p / Arduino over SPI ###Did you know that your Pi could power and program an ATmega 328p/Arduino directly, with nothing but a few wires, a breadboard, a 16Mhz crystal oscillator and some 22pF capacitors? diff --git a/src/en-GB/overlay/display-o-tron.json b/src/en-GB/overlay/display-o-tron.json deleted file mode 100644 index e67746f..0000000 --- a/src/en-GB/overlay/display-o-tron.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "Display-o-Tron 3000", - "manufacturer": "Pimoroni", - "url": "https://github.com/pimoroni/dot3k", - "description": "A 3-line character LCD with an RGB backlight and joystick", - "pincount": 40, - "pin": { - "3": { - "mode": "i2c" - }, - "5": { - "mode": "i2c" - }, - "19": { - "mode": "spi" - }, - "23": { - "mode": "spi" - }, - "22": { - "name": "LCD CMD/DATA", - "mode": "output", - "active": "high" - }, - "7": { - "name": "Joystick Button", - "mode": "input", - "active": "low" - }, - "11": { - "name": "Joystick Left", - "mode": "input", - "active": "low" - }, - "13": { - "name": "Joystick Up", - "mode": "input", - "active": "low" - }, - "15": { - "name": "Joystick Right", - "mode": "input", - "active": "low" - }, - "21": { - "name": "Joystick Down", - "mode": "input", - "active": "low" - } - } -} diff --git a/src/en-GB/overlay/display-o-tron.md b/src/en-GB/overlay/display-o-tron.md new file mode 100644 index 0000000..236f958 --- /dev/null +++ b/src/en-GB/overlay/display-o-tron.md @@ -0,0 +1,50 @@ + +#Display-o-Tron 3000 + +You can use the one-line product installer to get Display-o-Tron 3000 set up and ready to go, just: + +```bash +curl get.pimoroni.com/dot3k | bash +``` + +And follow the instructions! diff --git a/src/en-GB/overlay/dots.json b/src/en-GB/overlay/dots.json deleted file mode 100644 index 87b68d0..0000000 --- a/src/en-GB/overlay/dots.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "Raspberry Pi Dots", - "description": "Join the dots to make a circuit", - "url": "http://www.raspberrypi.org/dots/", - "github": "https://github.com/raspberrypilearning/dots", - "pin": { - "bcm0": {"name":"Color: Blue", "direction":"input"}, - "bcm1": {"name":"Dot 7", "direction":"input"}, - "bcm2": {"name":"Dot 22", "direction":"input"}, - "bcm3": {"name":"Dot 21", "direction":"input"}, - "bcm4": {"name":"Dot 2", "direction":"input"}, - "bcm5": {"name":"Dot 9", "direction":"input"}, - "bcm6": {"name":"Dot 14", "direction":"input"}, - "bcm7": {"name":"Dot 6", "direction":"input"}, - "bcm8": {"name":"Dot 18", "direction":"input"}, - "bcm9": {"name":"Dot 17", "direction":"input"}, - "bcm10": {"name":"Color: Green", "direction":"input"}, - "bcm11": {"name":"Dot 8", "direction":"input"}, - "bcm12": {"name":"Dot 10", "direction":"input"}, - "bcm13": {"name":"Cloud", "direction":"input"}, - "bcm14": {"name":"Dot 1", "direction":"input"}, - "bcm15": {"name":"Dot 3", "direction":"input"}, - "bcm16": {"name":"Dot 13", "direction":"input"}, - "bcm17": {"name":"Dot 4", "direction":"input"}, - "bcm18": {"name":"Dot 20", "direction":"input"}, - "bcm19": {"name":"Color: Orange", "direction":"input"}, - "bcm20": {"name":"Bear", "direction":"input"}, - "bcm21": {"name":"Dot 12", "direction":"input"}, - "bcm22": {"name":"Dot 15", "direction":"input"}, - "bcm23": {"name":"Dot 16", "direction":"input"}, - "bcm24": {"name":"Dot 19", "direction":"input"}, - "bcm25": {"name":"Dot 5", "direction":"input"}, - "bcm26": {"name":"Dot 11", "direction":"input"}, - "bcm27": {"name":"Color: Red", "direction":"input"} - } -} diff --git a/src/en-GB/overlay/dots.md b/src/en-GB/overlay/dots.md new file mode 100644 index 0000000..e577c39 --- /dev/null +++ b/src/en-GB/overlay/dots.md @@ -0,0 +1,117 @@ + +#Raspberry Pi Dots + +###Dots is a Dot to Dot HAT board for the Raspberry Pi that lets you join-the-dots with BARE Conductive Paint! + +Every Dot on the Dots board is a "floating" metal contact just waiting to be pulled down to ground with a dab of paint. + +To read a Dot you should set its corresponding pin as an INPUT and make sure it's pulled up like so: + +```python +import RPi.GPIO as GPIO +GPIO.setmode(GPIO.BCM ) +GPIO.setup(dot_pin, GPIO.IN, GPIO.PUD_UP) +state = GPIO.input(dot_pin) +``` + +It's good practise to only turn on the PULLUP when you actually want to read the Dot, so a method like +this is recommended for reading: + +```python +def is_dot_connected(dot_pin): + GPIO.setup(dot_pin, GPIO.IN, GPIO.PUD_UP) + state = GPIO.input( dot_pin ) + GPIO.setup(dot_pin, GPIO.IN, GPIO.PUD_OFF) + return state == 0 +``` \ No newline at end of file diff --git a/src/en-GB/overlay/explorer-hat-pro.json b/src/en-GB/overlay/explorer-hat-pro.json deleted file mode 100644 index 47b740c..0000000 --- a/src/en-GB/overlay/explorer-hat-pro.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "name": "Explorer HAT Pro", - "manufacturer": "Pimoroni", - "url": "https://github.com/pimoroni/explorer-hat", - "github": "https://github.com/pimoroni/explorer-hat", - "buy": "http://shop.pimoroni.com/products/explorer-hat", - "description": "An all-in-one light, input, motor, touch and output add-on board.", - "pincount": 40, - "i2c": { - "0x28": { - "name": "Cap Touch", - "device": "cap1208" - }, - "0x48": { - "name": "Analog Input", - "device": "ads1015" - } - }, - "pin": { - "3": {}, - "5": {}, - "8": {}, - "10": {}, - "12": {}, - "19": {}, - "21": {}, - "23": {}, - "24": {}, - "7": { - "name": "LED 1", - "mode": "output", - "active": "high" - }, - "11": { - "name": "LED 2", - "mode": "output", - "active": "high" - }, - "13": { - "name": "LED 3", - "mode": "output", - "active": "high" - }, - "29": { - "name": "LED 4", - "mode": "output", - "active": "high" - }, - "31": { - "name": "Output 1", - "mode": "output", - "active": "high" - }, - "32": { - "name": "Output 2", - "mode": "output", - "active": "high" - }, - "33": { - "name": "Output 3", - "mode": "output", - "active": "high" - }, - "36": { - "name": "Output 4", - "mode": "output", - "active": "high" - }, - "16": { - "name": "Input 1", - "mode": "input", - "active": "high" - }, - "15": { - "name": "Input 2", - "mode": "input", - "active": "high" - }, - "18": { - "name": "Input 3", - "mode": "input", - "active": "high" - }, - "22": { - "name": "Input 4", - "mode": "input", - "active": "high" - }, - "40": { - "name": "Motor 2 +", - "mode": "output", - "active": "high" - }, - "37": { - "name": "Motor 2 -", - "mode": "output", - "active": "high" - }, - "35": { - "name": "Motor 1 +", - "mode": "output", - "active": "high" - }, - "38": { - "name": "Motor 1 -", - "mode": "output", - "active": "high" - } - } -} diff --git a/src/en-GB/overlay/explorer-hat-pro.md b/src/en-GB/overlay/explorer-hat-pro.md new file mode 100644 index 0000000..78cca3d --- /dev/null +++ b/src/en-GB/overlay/explorer-hat-pro.md @@ -0,0 +1,106 @@ + +#Explorer HAT and Explorer HAT Pro + +5V inputs and outputs, touch pads, LEDs, analog inputs and an H-Bridge motor driver make up the Explorer HAT Pro- a jack of all trades prototyping side-kick for your Raspberry Pi. + +```bash +sudo apt-get install python-pip +sudo pip install explorer-hat +``` + +Then import it into your Python script and start tinkering: + +```bash +import explorerhat +explorerhat.light.on() +``` \ No newline at end of file diff --git a/src/en-GB/overlay/explorer-hat.json b/src/en-GB/overlay/explorer-hat.json deleted file mode 100644 index b9045d2..0000000 --- a/src/en-GB/overlay/explorer-hat.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "Explorer HAT", - "manufacturer": "Pimoroni", - "url": "https://github.com/pimoroni/explorer-hat", - "github": "https://github.com/pimoroni/explorer-hat", - "buy": "http://shop.pimoroni.com/products/explorer-hat", - "description": "An all-in-one light, input, touch and output add-on board.", - "pincount": 40, - "pin": { - "7": { - "name": "LED 1", - "mode": "output", - "active": "high" - }, - "11": { - "name": "LED 2", - "mode": "output", - "active": "high" - }, - "13": { - "name": "LED 3", - "mode": "output", - "active": "high" - }, - "29": { - "name": "LED 4", - "mode": "output", - "active": "high" - }, - "31": { - "name": "Output 1", - "mode": "output", - "active": "high" - }, - "32": { - "name": "Output 2", - "mode": "output", - "active": "high" - }, - "33": { - "name": "Output 3", - "mode": "output", - "active": "high" - }, - "36": { - "name": "Output 4", - "mode": "output", - "active": "high" - }, - "16": { - "name": "Input 1", - "mode": "input", - "active": "high" - }, - "15": { - "name": "Input 2", - "mode": "input", - "active": "high" - }, - "18": { - "name": "Input 3", - "mode": "input", - "active": "high" - }, - "22": { - "name": "Input 4", - "mode": "input", - "active": "high" - } - } -} diff --git a/src/en-GB/overlay/explorer-hat.md b/src/en-GB/overlay/explorer-hat.md new file mode 100644 index 0000000..60a09a1 --- /dev/null +++ b/src/en-GB/overlay/explorer-hat.md @@ -0,0 +1,74 @@ + +#Explorer HAT and Explorer HAT Pro + +5V inputs and outputs, touch pads, LEDs, analog inputs and an H-Bridge motor driver make up the Explorer HAT Pro- a jack of all trades prototyping side-kick for your Raspberry Pi. + +```bash +sudo apt-get install python-pip +sudo pip install explorer-hat +``` + +Then import it into your Python script and start tinkering: + +```bash +import explorerhat +explorerhat.light.on() +``` \ No newline at end of file diff --git a/src/en-GB/overlay/ground.json b/src/en-GB/overlay/ground.json deleted file mode 100644 index 4efd028..0000000 --- a/src/en-GB/overlay/ground.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "Ground", - "description": "Raspberry Pi Ground Pins", - "pin": { - "6": {}, - "9": {}, - "14": {}, - "20": {}, - "25": {}, - "30": {}, - "34": {}, - "39": {} - } -} diff --git a/src/en-GB/description/overlay/ground.md b/src/en-GB/overlay/ground.md similarity index 59% rename from src/en-GB/description/overlay/ground.md rename to src/en-GB/overlay/ground.md index 7a5d1d2..4e22733 100644 --- a/src/en-GB/description/overlay/ground.md +++ b/src/en-GB/overlay/ground.md @@ -1,6 +1,20 @@ + #Ground -The Ground pins on the Raspberry Pi are all electrically connected, so it doesn't matter +The Ground pins ona the Raspberry Pi are all electrically connected, so it doesn't matter which one you use if you're wiring up a voltage supply. Generally the one that's most convinient or closest to the rest of your connections is tidier diff --git a/src/en-GB/overlay/i2c.json b/src/en-GB/overlay/i2c.json deleted file mode 100644 index b2d9b27..0000000 --- a/src/en-GB/overlay/i2c.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "I2C", - "description": "Raspberry Pi i2c pins", - "pin": { - "3": { - "name": "Data", - "direction": "both", - "active": "high" - }, - "5": { - "name": "Clock", - "direction": "both", - "active": "high" - }, - "27": { - "name": "EEPROM Data", - "direction": "both", - "active": "high" - }, - "28": { - "name": "EEPROM Clock", - "direction": "both", - "active": "high" - } - } -} diff --git a/src/en-GB/description/overlay/i2c.md b/src/en-GB/overlay/i2c.md similarity index 65% rename from src/en-GB/description/overlay/i2c.md rename to src/en-GB/overlay/i2c.md index 19d4e8d..5e9e0ee 100644 --- a/src/en-GB/description/overlay/i2c.md +++ b/src/en-GB/overlay/i2c.md @@ -1,3 +1,26 @@ + #I2C - Inter Integrated Circuit The Raspberry Pi's I2C pins are an extremely useful way to talk to many different types of external peripheral; from the MCP23017 digital IO expander, to a connected ATmega. diff --git a/src/en-GB/overlay/piborg-ledborg.json b/src/en-GB/overlay/piborg-ledborg.json deleted file mode 100644 index ccea6c4..0000000 --- a/src/en-GB/overlay/piborg-ledborg.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "PiBorg LEDBorg", - "description": "A single RGB LED for your Raspberry Pi", - "buy": "https://www.piborg.org/ledborg", - "pin": { - "11": { - "name": "Red LED", - "direction": "output", - "active": "high", - "description": "PiBorg Red LED" - }, - "13": { - "name": "Green LED", - "direction": "input", - "active": "high", - "description": "PiBorg Green LED" - }, - "15": { - "name": "Blue LED", - "direction": "output", - "active": "high", - "description": "PiBorg Blue LED" - } - } -} diff --git a/src/en-GB/description/overlay/piborg-ledborg.md b/src/en-GB/overlay/piborg-ledborg.md similarity index 62% rename from src/en-GB/description/overlay/piborg-ledborg.md rename to src/en-GB/overlay/piborg-ledborg.md index 21c8742..1020280 100644 --- a/src/en-GB/description/overlay/piborg-ledborg.md +++ b/src/en-GB/overlay/piborg-ledborg.md @@ -1,3 +1,25 @@ + ###The PiBorg LedBorg is an ultra-bright RGB LED board for the Raspberry Pi. PiBorg has its own driver, so you don't need to drive it manually. diff --git a/src/en-GB/overlay/pibrella.json b/src/en-GB/overlay/pibrella.json deleted file mode 100644 index 628311f..0000000 --- a/src/en-GB/overlay/pibrella.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "Pibrella", - "manufacturer": "Pimoroni Vs Cyntech", - "url": "https://github.com/pimoroni/pibrella", - "description": "An all-in-one light, sound, input and output add-on board.", - "pincount": 26, - "pin": { - "7": { - "name": "Green LED", - "direction": "output", - "active": "high" - }, - "11": { - "name": "Yellow LED", - "direction": "output", - "active": "high" - }, - "13": { - "name": "Red LED", - "direction": "output", - "active": "high" - }, - "15": { - "name": "Output A", - "direction": "output", - "active": "high" - }, - "19": { - "name": "Input D", - "direction": "output", - "active": "high" - }, - "21": { - "name": "Input A", - "direction": "input", - "active": "high" - }, - "23": { - "name": "Button", - "direction": "input", - "active": "high" - }, - "12": { - "name": "Buzzer", - "direction": "output", - "active": "high" - }, - "16": { - "name": "Output B", - "direction": "output", - "active": "high" - }, - "18": { - "name": "Output C", - "direction": "output", - "active": "high" - }, - "22": { - "name": "Output D", - "direction": "output", - "active": "high" - }, - "24": { - "name": "Input C", - "direction": "input", - "active": "high" - }, - "26": { - "name": "Input B", - "direction": "input", - "active": "high" - } - } -} diff --git a/src/en-GB/overlay/pibrella.md b/src/en-GB/overlay/pibrella.md new file mode 100644 index 0000000..3e2abfd --- /dev/null +++ b/src/en-GB/overlay/pibrella.md @@ -0,0 +1,78 @@ + +#Pibrella + +The all-in-one light, sound, input and output add-on board from Pimoroni vs Cyntech uses lots of IO on the Pi but leaves both Serial and I2C free leaving plenty of room for expansion if you get creative. + +Pibrella is easy to use, first you should install the module using LXTerminal/Command Line: + +```bash +sudo apt-get install python-pip +sudo pip install pibrella +``` + +Then import it into your Python script and start tinkering: + +```bash +import pibrella +pibrella.light.red.on() +``` \ No newline at end of file diff --git a/src/en-GB/overlay/piglow.json b/src/en-GB/overlay/piglow.json deleted file mode 100644 index 38b4da7..0000000 --- a/src/en-GB/overlay/piglow.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "PiGlow", - "manufacturer": "Pimoroni", - "url": "https://github.com/pimoroni/piglow", - "github": "https://github.com/pimoroni/piglow", - "buy": "http://shop.pimoroni.com/products/piglow", - "description": "Simply 18 LEDs in a spiral pattern controllable in Python.", - "pincount": 26, - "pin": { - "1" : {}, - "2" : {}, - "3": { - "mode": "i2c" - }, - "5": { - "mode": "i2c" - }, - "14" : {}, - "17" : {} - } -} diff --git a/src/en-GB/overlay/piglow.md b/src/en-GB/overlay/piglow.md new file mode 100644 index 0000000..3344b8c --- /dev/null +++ b/src/en-GB/overlay/piglow.md @@ -0,0 +1,20 @@ + +#PiGlow \ No newline at end of file diff --git a/src/en-GB/description/overlay/rtk-000-001.md b/src/en-GB/overlay/rtk-000-0001.md similarity index 55% rename from src/en-GB/description/overlay/rtk-000-001.md rename to src/en-GB/overlay/rtk-000-0001.md index db49532..4320cb0 100644 --- a/src/en-GB/description/overlay/rtk-000-001.md +++ b/src/en-GB/overlay/rtk-000-0001.md @@ -1,3 +1,29 @@ + #Ryanteck Motor Controller Board ###A quick and easy way to start driving motors on your Raspberry Pi diff --git a/src/en-GB/overlay/rtk-000-001.json b/src/en-GB/overlay/rtk-000-001.json deleted file mode 100644 index 52e5c37..0000000 --- a/src/en-GB/overlay/rtk-000-001.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "Ryanteck Motor Controller Board", - "manufacturer": "Ryanteck", - "url": "http://www.ryanteck.uk/store/ryanteck-rpi-motor-controller-board", - "buy": "http://www.ryanteck.uk/store/ryanteck-rpi-motor-controller-board", - "description": "A budget motor controller with quick start guides.", - "pincount": 26, - "pin": { - "11": { - "name": "Motor 1 A", - "direction": "output", - "active": "high" - }, - "12": { - "name": "Motor 1 B", - "direction": "output", - "active": "high" - }, - "15": { - "name": "Motor 2 A", - "direction": "output", - "active": "high" - }, - "16": { - "name": "Motor 2 B", - "direction": "output", - "active": "high" - } - } -} diff --git a/src/en-GB/overlay/skywriter-hat.json b/src/en-GB/overlay/skywriter-hat.json deleted file mode 100644 index 60a5d5f..0000000 --- a/src/en-GB/overlay/skywriter-hat.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "Skywriter HAT", - "manufacturer": "Pimoroni", - "url": "https://github.com/pimoroni/skywriter-hat", - "github": "https://github.com/pimoroni/skywriter-hat", - "buy": "http://shop.pimoroni.com/products/skywriter-hat", - "description": "A 3D positional and gesture sensor.", - "pincount": 40, - "pin": { - "3": { - "mode": "i2c" - }, - "5": { - "mode": "i2c" - }, - "11": { - "name": "Reset" - }, - "13": { - "name": "Transfer" - } - } -} diff --git a/src/en-GB/overlay/skywriter-hat.md b/src/en-GB/overlay/skywriter-hat.md new file mode 100644 index 0000000..231ccea --- /dev/null +++ b/src/en-GB/overlay/skywriter-hat.md @@ -0,0 +1,25 @@ + +#Skywriter HAT + +Skywriter HAT senses your finger's position above it in 3 dimensions, outputting an X, Y, Z axis +which you can use in your Python scripts. + +It also recognises gestures, including swipes and more. \ No newline at end of file diff --git a/src/en-GB/overlay/spi.json b/src/en-GB/overlay/spi.json deleted file mode 100644 index 6953ff9..0000000 --- a/src/en-GB/overlay/spi.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "SPI", - "description": "Raspberry Pi SPI pins", - "pincount": 5, - "pin": { - "19": { - "name": "SPI0 MOSI", - "direction": "output", - "active": "high", - "description": "Master Out / Slave In" - }, - "21": { - "name": "SPI0 MISO", - "direction": "input", - "active": "high", - "description": "Master In / Slave Out" - }, - "23": { - "name": "SPI0 SCLK", - "direction": "output", - "active": "high", - "description": "Clock" - }, - "24": { - "name": "SPI0 CE0", - "direction": "output", - "active": "high", - "description": "Chip Select 0" - }, - "26": { - "name": "SPI0 CE1", - "direction": "output", - "active": "high", - "description": "Chip Select 1" - }, - "35": { - "name": "SPI1 MISO" - }, - "38": { - "name": "SPI1 MOSI" - }, - "40": { - "name": "SPI1 SCLK" - }, - "36": { - "name": "SPI1 CE2" - }, - "11": { - "name": "SPI1 CE1" - }, - "12": { - "name": "SPI1 CE0" - } - } -} diff --git a/src/en-GB/description/overlay/spi.md b/src/en-GB/overlay/spi.md similarity index 56% rename from src/en-GB/description/overlay/spi.md rename to src/en-GB/overlay/spi.md index 32f5c6f..34e04f8 100644 --- a/src/en-GB/description/overlay/spi.md +++ b/src/en-GB/overlay/spi.md @@ -1,3 +1,47 @@ + #SPI - Serial Peripheral Interface ###Known as the four-wire serial bus, SPI lets you daisy-chain multiple compatible devices off a single set of pins by assigning them different addresses. diff --git a/src/en-GB/overlay/traffic-hat.json b/src/en-GB/overlay/traffic-hat.json deleted file mode 100644 index f64a121..0000000 --- a/src/en-GB/overlay/traffic-hat.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "Traffic HAT", - "manufacturer": "Ryanteck LTD.", - "url": "http://www.ryanteck.uk/", - "buy": "http://www.ryanteck.uk/", - "description": "A quick and easy way to learn the basics of GPIO on a budget. All in a nice HAT.", - "pincount": 40, - "pin": { - "15": { - "name": "LED1 / Green", - "direction": "output", - "active": "high" - }, - "16": { - "name": "LED2 / Amber", - "direction": "output", - "active": "high" - }, - "18": { - "name": "LED3 / Red", - "direction": "output", - "active": "high" - }, - "22": { - "name": "Button", - "direction": "input", - "active": "high" - }, - - "29": { - "name": "Buzzer", - "direction": "output", - "active": "high" - } - } -} diff --git a/src/en-GB/description/overlay/traffic-hat.md b/src/en-GB/overlay/traffic-hat.md similarity index 75% rename from src/en-GB/description/overlay/traffic-hat.md rename to src/en-GB/overlay/traffic-hat.md index e4f2c27..9d84f0e 100644 --- a/src/en-GB/description/overlay/traffic-hat.md +++ b/src/en-GB/overlay/traffic-hat.md @@ -1,3 +1,34 @@ + #Traffic HAT ###A quick and easy way to learn the basics of GPIO on a budget. All in a nice HAT. @@ -78,4 +109,4 @@ while True: IO.output(22,1) # Turn the Green LED On / 1 sleep(2) -``` +``` \ No newline at end of file diff --git a/src/en-GB/overlay/uart.json b/src/en-GB/overlay/uart.json deleted file mode 100644 index 52f0c05..0000000 --- a/src/en-GB/overlay/uart.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "UART", - "description": "Raspberry Pi UART pins", - "pin": { - "8": { - "name": "TXD / Transmit", - "direction": "output", - "active": "high" - }, - "10": { - "name": "RXD / Receive", - "direction": "input", - "active": "high" - } - } -} diff --git a/src/en-GB/description/overlay/uart.md b/src/en-GB/overlay/uart.md similarity index 82% rename from src/en-GB/description/overlay/uart.md rename to src/en-GB/overlay/uart.md index afaba3f..dde34a7 100644 --- a/src/en-GB/description/overlay/uart.md +++ b/src/en-GB/overlay/uart.md @@ -1,3 +1,17 @@ + #UART - Universal Asynchronous Receiver/Transmitter ###The 2 UART pins in WiringPi are: 15, 16 diff --git a/src/en-GB/overlay/unicorn-hat.json b/src/en-GB/overlay/unicorn-hat.json deleted file mode 100644 index 2583b4c..0000000 --- a/src/en-GB/overlay/unicorn-hat.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "Unicorn HAT", - "manufacturer": "Pimoroni", - "url": "http://shop.pimoroni.com/products/unicorn-hat", - "buy": "http://shop.pimoroni.com/products/unicorn-hat", - "description": "64 blindingly bright RGB LEDs on a single HAT", - "github": "https://github.com/pimoroni/unicornhat", - "pincount": 40, - "pin": { - "12": { - "name": "Data", - "direction": "output", - "mode": "pwm", - "active": "high", - "description": "WS2812 Data" - } - } -} diff --git a/src/en-GB/description/overlay/unicorn-hat.md b/src/en-GB/overlay/unicorn-hat.md similarity index 60% rename from src/en-GB/description/overlay/unicorn-hat.md rename to src/en-GB/overlay/unicorn-hat.md index 76a22a0..1fd7d94 100644 --- a/src/en-GB/description/overlay/unicorn-hat.md +++ b/src/en-GB/overlay/unicorn-hat.md @@ -1,3 +1,20 @@ + #Unicorn HAT 64 blindingly bright LEDs packed into a HAT and driven with an ultra-fast, C library that you can talk to diff --git a/src/en-GB/overlay/wiringpi.json b/src/en-GB/overlay/wiringpi.json deleted file mode 100644 index b5a5dd6..0000000 --- a/src/en-GB/overlay/wiringpi.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "name": "WiringPi GPIO Pinout", - "page_url": "wiringpi", - "pin":{ - "3":{ - "name":"WiringPi 8" - }, - "5":{ - "name":"WiringPi 9" - }, - "7":{ - "name":"WiringPi 7" - }, - "11":{ - "name":"WiringPi 0" - }, - "13":{ - "name":"WiringPi 2" - }, - "15":{ - "name":"WiringPi 3" - }, - "19":{ - "name":"WiringPi 12" - }, - "21":{ - "name":"WiringPi 13" - }, - "23":{ - "name":"WiringPi 14" - }, - "29":{ - "name":"WiringPi 21" - }, - "31":{ - "name":"WiringPi 22" - }, - "33":{ - "name":"WiringPi 23" - }, - "35":{ - "name":"WiringPi 24" - }, - "37":{ - "name":"WiringPi 25" - }, - "8":{ - "name":"WiringPi 15" - }, - "10":{ - "name":"WiringPi 16" - }, - "12":{ - "name":"WiringPi 1" - }, - "16":{ - "name":"WiringPi 4" - }, - "18":{ - "name":"WiringPi 5" - }, - "22":{ - "name":"WiringPi 6" - }, - "24":{ - "name":"WiringPi 10" - }, - "26":{ - "name":"WiringPi 11" - }, - "32":{ - "name":"WiringPi 26" - }, - "36":{ - "name":"WiringPi 27" - }, - "38":{ - "name":"WiringPi 28" - }, - "40":{ - "name":"WiringPi 29" - } - } -} \ No newline at end of file diff --git a/src/en-GB/description/overlay/wiringpi.md b/src/en-GB/overlay/wiringpi.md similarity index 56% rename from src/en-GB/description/overlay/wiringpi.md rename to src/en-GB/overlay/wiringpi.md index b79013c..1a2e5db 100644 --- a/src/en-GB/description/overlay/wiringpi.md +++ b/src/en-GB/overlay/wiringpi.md @@ -1,3 +1,61 @@ + #Raspberry Pi WiringPi ###WiringPi is an attempt to bring Arduino-wiring-like simplicity to the Raspberry Pi. @@ -20,4 +78,4 @@ Installing to Python couldn't be easier, just: sudo pip install wiringpi2 ``` -Note the 2 on the end? That's the all new, shinier WiringPi! +Note the 2 on the end? That's the all new, shinier WiringPi! \ No newline at end of file diff --git a/src/en-GB/pi-pinout.json b/src/en-GB/pi-pinout.json deleted file mode 100644 index bf50e20..0000000 --- a/src/en-GB/pi-pinout.json +++ /dev/null @@ -1,466 +0,0 @@ -{ - "name": "Raspberry Pi GPIO Pinout", - "pins":{ - "1":{ - "name": "3v3 Power", - "type": "+3v3" - }, - "3":{ - "name": "SDA", - "description": "I2C Data", - "type": "GPIO/I2C", - "scheme": { - "wiringpi": 8, - "bcm": 2, - "bcmAlt": 0 - }, - "functions": { - "alt0": "SDA1", - "alt1": "SA3" - } - }, - "5":{ - "name": "SCL", - "description": "I2C Clock", - "type": "GPIO/I2C", - "scheme": { - "wiringpi": 9, - "bcm": 3, - "bcmAlt": 1 - }, - "functions": { - "alt0": "SCL1", - "alt1": "SA2" - } - }, - "7":{ - "name": "GPCLK0", - "type": "GPIO", - "scheme": { - "wiringpi": 7, - "bcm": 4 - }, - "functions": { - "alt0": "GPCLK0", - "alt1": "SA1", - "alt5": "ARM_TDI" - } - }, - "9":{ - "name": "Ground", - "type": "GND" - }, - "11":{ - "name": "", - "type": "GPIO", - "scheme": { - "wiringpi": 0, - "bcm": 17 - }, - "functions": { - "alt0": "Reserved", - "alt1": "SD9", - "alt2": "Reserved", - "alt3": "RTS0", - "alt4": "SPI1_CE1_N", - "alt5": "RTS1" - } - }, - "13":{ - "name": "PCM_D", - "type": "GPIO", - "scheme": { - "wiringpi": 2, - "bcm": 27, - "bcmAlt": 21 - }, - "functions": { - "alt0": "Reserved", - "alt1": "Reserved", - "alt2": "Reserved", - "alt3": "SD1_DAT3", - "alt4": "ARM_TMS" - } - }, - "15":{ - "name": "", - "type": "GPIO", - "scheme": { - "wiringpi": 3, - "bcm": 22 - }, - "functions": { - "alt0": "Reserved", - "alt1": "SD14", - "alt2": "Reserved", - "alt3": "SD1_CLK", - "alt4": "ARM_TRST" - } - }, - "17":{ - "name": "3v3 Power", - "type": "+3v3" - }, - "19":{ - "name": "MOSI", - "type": "GPIO/SPI", - "scheme": { - "wiringpi": 12, - "bcm": 10 - }, - "functions": { - "alt0": "SPI0_MOSI", - "alt1": "SD2", - "alt2": "Reserved" - } - }, - "21":{ - "name": "MISO", - "type": "GPIO/SPI", - "scheme": { - "wiringpi": 13, - "bcm": 9 - }, - "functions": { - "alt0": "SPI0_MISO", - "alt1": "SD1", - "alt2": "Reserved" - } - }, - "23":{ - "name": "SCLK", - "type": "GPIO/SPI", - "scheme": { - "wiringpi": 14, - "bcm": 11 - }, - "functions": { - "alt0": "SPI0_SCLK", - "alt1": "SD3", - "alt2": "Reserved" - } - }, - "25":{ - "name": "Ground", - "type": "GND" - }, - "27":{ - "name": "ID_SD", - "description": "HAT EEPROM i2c Data", - "type": "GPIO/I2C", - "scheme": { - "wiringpi": 30, - "bcm": 0 - }, - "functions": { - "alt0": "SDA0", - "alt1": "SA5", - "alt2": "Reserved" - } - }, - "29":{ - "name": "", - "type": "GPIO", - "scheme": { - "wiringpi": 21, - "bcm": 5 - }, - "functions": { - "alt0": "GPCLK1", - "alt1": "SA0", - "alt2": "Reserved", - "alt5": "ARM_TDO" - } - }, - "31":{ - "name": "", - "type": "GPIO", - "scheme": { - "wiringpi": 22, - "bcm": 6 - }, - "functions": { - "alt0": "GPCLK2", - "alt1": "SOE_N / SE", - "alt2": "Reserved", - "alt5": "ARM_RTCK" - } - }, - "33":{ - "name": "", - "type": "GPIO", - "scheme": { - "wiringpi": 23, - "bcm": 13 - }, - "functions": { - "alt0": "PWM1", - "alt1": "SD5", - "alt2": "Reserved", - "alt5": "ARM_TCK" - } - }, - "35":{ - "name": "MISO", - "description": "SPI Master-In", - "type": "GPIO/SPI", - "scheme": { - "wiringpi": 24, - "bcm": 19 - }, - "functions": { - "alt0": "PCM_FS", - "alt1": "SD11", - "alt2": "Reserved", - "alt3": "BSCSL SCL / SCLK", - "alt4": "SPI1_MISO", - "alt5": "PWM1" - } - }, - "37":{ - "name": "", - "type": "GPIO", - "scheme": { - "wiringpi": 25, - "bcm": 26 - }, - "functions": { - "alt0": "Reserved", - "alt1": "Reserved", - "alt2": "Reserved", - "alt3": "SD1_DAT2", - "alt4": "ARM_TDI" - } - }, - "39":{ - "name": "Ground", - "type": "GND" - }, - "2":{ - "name": "5v Power", - "type": "+5v" - }, - "4":{ - "name": "5v Power", - "type": "+5v" - }, - "6":{ - "name": "Ground", - "type": "GND" - }, - "8":{ - "name": "TXD", - "description": "UART Transmit", - "type": "GPIO/UART", - "scheme": { - "wiringpi": 15, - "bcm": 14 - }, - "functions": { - "alt0": "TXD0", - "alt1": "SD6", - "alt2": "Reserved", - "alt5": "TXD1" - } - }, - "10":{ - "name": "RXD", - "description": "UART Receive", - "type": "GPIO/UART", - "scheme": { - "wiringpi": 16, - "bcm": 15 - }, - "functions": { - "alt0": "RXD0", - "alt1": "SD7", - "alt2": "Reserved", - "alt5": "RXD1" - } - }, - "12":{ - "name": "PCM_C", - "description": "PCM Clock", - "type": "GPIO", - "scheme": { - "wiringpi": 1, - "bcm": 18 - }, - "functions": { - "alt0": "PCM_CLK", - "alt1": "SD10", - "alt2": "Reserved", - "alt3": "BSCSL SDA / MOSI", - "alt4": "SPI1_CE0_N", - "alt5": "PWM0" - } - }, - "14":{ - "name": "Ground", - "type": "GND" - }, - "16":{ - "name": "", - "type": "GPIO", - "scheme": { - "wiringpi": 4, - "bcm": 23 - }, - "functions": { - "alt0": "Reserved", - "alt1": "SD15", - "alt2": "Reserved", - "alt3": "SD1_CMD", - "alt4": "ARM_RTCK" - } - }, - "18":{ - "name": "", - "type": "GPIO", - "scheme": { - "wiringpi": 5, - "bcm": 24 - }, - "functions": { - "alt0": "Reserved", - "alt1": "SD16", - "alt2": "Reserved", - "alt3": "SD1_DAT0", - "alt4": "ARM_TDO" - } - }, - "20":{ - "name": "Ground", - "type": "GND" - }, - "22":{ - "name": "", - "type": "GPIO", - "scheme": { - "wiringpi": 6, - "bcm": 25 - }, - "functions": { - "alt0": "Reserved", - "alt1": "SD17", - "alt2": "Reserved", - "alt3": "SD1_DAT1", - "alt4": "ARM_TCK" - } - }, - "24":{ - "name": "CE0", - "description": "SPI Chip Select 0", - "type": "GPIO/SPI", - "scheme": { - "wiringpi": 10, - "bcm": 8 - }, - "functions": { - "alt0": "SPI0_CE0_N", - "alt1": "SD0", - "alt2": "Reserved" - } - }, - "26":{ - "name": "CE1", - "description": "SPI Chip Select 1", - "type": "GPIO/SPI", - "scheme": { - "wiringpi": 11, - "bcm": 7 - }, - "functions": { - "alt0": "SPI0_CE1_N", - "alt1": "SWE_N / SRW_N", - "alt2": "Reserved" - } - }, - "28":{ - "name": "ID_SC", - "description": "HAT EEPROM i2c Clock", - "type": "GPIO/I2C", - "scheme": { - "wiringpi": 31, - "bcm": 1 - }, - "functions": { - "alt0": "SCL0", - "alt1": "SA4", - "alt2": "Reserved" - } - }, - "30":{ - "name": "Ground", - "type": "GND" - }, - "32":{ - "name": "", - "type": "GPIO", - "scheme": { - "wiringpi": 26, - "bcm": 12 - }, - "functions": { - "alt0": "PWM0", - "alt1": "SD4", - "alt2": "Reserved", - "alt5": "ARM_TMS" - } - }, - "34":{ - "name": "Ground", - "type": "GND" - }, - "36":{ - "name": "", - "type": "GPIO", - "scheme": { - "wiringpi": 27, - "bcm": 16 - }, - "functions": { - "alt0": "Reserved", - "alt1": "SD8", - "alt2": "Reserved", - "alt3": "CTS0", - "alt4": "SPI1_CE2_N", - "alt5": "CTS1" - } - }, - "38":{ - "name": "MOSI", - "description": "SPI Master-Out", - "type": "GPIO/SPI", - "scheme": { - "wiringpi": 28, - "bcm": 20 - }, - "functions": { - "alt0": "PCM_DIN", - "alt1": "SD12", - "alt2": "Reserved", - "alt3": "BSCSL / MISO", - "alt4": "SPI1_MOSI", - "alt5": "CPCLK0" - } - }, - "40":{ - "name": "SCLK", - "description": "SPI Clock", - "type": "GPIO/SPI", - "scheme": { - "wiringpi": 29, - "bcm": 21 - }, - "functions": { - "alt0": "PCM_DOUT", - "alt1": "SD13", - "alt2": "Reserved", - "alt3": "BSCSL / CE_N", - "alt4": "SPI1_SCLK", - "alt5": "GPCLK1" - } - } - } -} diff --git a/src/en-GB/pi-pinout.yaml b/src/en-GB/pi-pinout.yaml new file mode 100644 index 0000000..7a9d98f --- /dev/null +++ b/src/en-GB/pi-pinout.yaml @@ -0,0 +1,368 @@ +--- +name: Raspberry Pi GPIO Pinout +pins: + '1': + name: 3v3 Power + type: "+3v3" + '2': + name: 5v Power + type: "+5v" + '3': + name: SDA + description: I2C Data + type: GPIO/I2C + scheme: + wiringpi: 8 + bcm: 2 + bcmAlt: 0 + functions: + alt0: SDA1 + alt1: SA3 + '4': + name: 5v Power + type: "+5v" + '5': + name: SCL + description: I2C Clock + type: GPIO/I2C + scheme: + wiringpi: 9 + bcm: 3 + bcmAlt: 1 + functions: + alt0: SCL1 + alt1: SA2 + '6': + name: Ground + type: GND + '7': + name: GPCLK0 + type: GPIO + scheme: + wiringpi: 7 + bcm: 4 + functions: + alt0: GPCLK0 + alt1: SA1 + alt5: ARM_TDI + '8': + name: TXD + description: UART Transmit + type: GPIO/UART + scheme: + wiringpi: 15 + bcm: 14 + functions: + alt0: TXD0 + alt1: SD6 + alt2: Reserved + alt5: TXD1 + '9': + name: Ground + type: GND + '10': + name: RXD + description: UART Receive + type: GPIO/UART + scheme: + wiringpi: 16 + bcm: 15 + functions: + alt0: RXD0 + alt1: SD7 + alt2: Reserved + alt5: RXD1 + '11': + name: '' + type: GPIO + scheme: + wiringpi: 0 + bcm: 17 + functions: + alt0: Reserved + alt1: SD9 + alt2: Reserved + alt3: RTS0 + alt4: SPI1_CE1_N + alt5: RTS1 + '12': + name: PCM_C + description: PCM Clock + type: GPIO + scheme: + wiringpi: 1 + bcm: 18 + functions: + alt0: PCM_CLK + alt1: SD10 + alt2: Reserved + alt3: BSCSL SDA / MOSI + alt4: SPI1_CE0_N + alt5: PWM0 + '13': + name: PCM_D + type: GPIO + scheme: + wiringpi: 2 + bcm: 27 + bcmAlt: 21 + functions: + alt0: Reserved + alt1: Reserved + alt2: Reserved + alt3: SD1_DAT3 + alt4: ARM_TMS + '14': + name: Ground + type: GND + '15': + name: '' + type: GPIO + scheme: + wiringpi: 3 + bcm: 22 + functions: + alt0: Reserved + alt1: SD14 + alt2: Reserved + alt3: SD1_CLK + alt4: ARM_TRST + '16': + name: '' + type: GPIO + scheme: + wiringpi: 4 + bcm: 23 + functions: + alt0: Reserved + alt1: SD15 + alt2: Reserved + alt3: SD1_CMD + alt4: ARM_RTCK + '17': + name: 3v3 Power + type: "+3v3" + '18': + name: '' + type: GPIO + scheme: + wiringpi: 5 + bcm: 24 + functions: + alt0: Reserved + alt1: SD16 + alt2: Reserved + alt3: SD1_DAT0 + alt4: ARM_TDO + '19': + name: MOSI + type: GPIO/SPI + scheme: + wiringpi: 12 + bcm: 10 + functions: + alt0: SPI0_MOSI + alt1: SD2 + alt2: Reserved + '20': + name: Ground + type: GND + '21': + name: MISO + type: GPIO/SPI + scheme: + wiringpi: 13 + bcm: 9 + functions: + alt0: SPI0_MISO + alt1: SD1 + alt2: Reserved + '22': + name: '' + type: GPIO + scheme: + wiringpi: 6 + bcm: 25 + functions: + alt0: Reserved + alt1: SD17 + alt2: Reserved + alt3: SD1_DAT1 + alt4: ARM_TCK + '23': + name: SCLK + type: GPIO/SPI + scheme: + wiringpi: 14 + bcm: 11 + functions: + alt0: SPI0_SCLK + alt1: SD3 + alt2: Reserved + '24': + name: CE0 + description: SPI Chip Select 0 + type: GPIO/SPI + scheme: + wiringpi: 10 + bcm: 8 + functions: + alt0: SPI0_CE0_N + alt1: SD0 + alt2: Reserved + '25': + name: Ground + type: GND + '26': + name: CE1 + description: SPI Chip Select 1 + type: GPIO/SPI + scheme: + wiringpi: 11 + bcm: 7 + functions: + alt0: SPI0_CE1_N + alt1: SWE_N / SRW_N + alt2: Reserved + '27': + name: ID_SD + description: HAT EEPROM i2c Data + type: GPIO/I2C + scheme: + wiringpi: 30 + bcm: 0 + functions: + alt0: SDA0 + alt1: SA5 + alt2: Reserved + '28': + name: ID_SC + description: HAT EEPROM i2c Clock + type: GPIO/I2C + scheme: + wiringpi: 31 + bcm: 1 + functions: + alt0: SCL0 + alt1: SA4 + alt2: Reserved + '29': + name: '' + type: GPIO + scheme: + wiringpi: 21 + bcm: 5 + functions: + alt0: GPCLK1 + alt1: SA0 + alt2: Reserved + alt5: ARM_TDO + '30': + name: Ground + type: GND + '31': + name: '' + type: GPIO + scheme: + wiringpi: 22 + bcm: 6 + functions: + alt0: GPCLK2 + alt1: SOE_N / SE + alt2: Reserved + alt5: ARM_RTCK + '32': + name: '' + type: GPIO + scheme: + wiringpi: 26 + bcm: 12 + functions: + alt0: PWM0 + alt1: SD4 + alt2: Reserved + alt5: ARM_TMS + '33': + name: '' + type: GPIO + scheme: + wiringpi: 23 + bcm: 13 + functions: + alt0: PWM1 + alt1: SD5 + alt2: Reserved + alt5: ARM_TCK + '34': + name: Ground + type: GND + '35': + name: MISO + description: SPI Master-In + type: GPIO/SPI + scheme: + wiringpi: 24 + bcm: 19 + functions: + alt0: PCM_FS + alt1: SD11 + alt2: Reserved + alt3: BSCSL SCL / SCLK + alt4: SPI1_MISO + alt5: PWM1 + '36': + name: '' + type: GPIO + scheme: + wiringpi: 27 + bcm: 16 + functions: + alt0: Reserved + alt1: SD8 + alt2: Reserved + alt3: CTS0 + alt4: SPI1_CE2_N + alt5: CTS1 + '37': + name: '' + type: GPIO + scheme: + wiringpi: 25 + bcm: 26 + functions: + alt0: Reserved + alt1: Reserved + alt2: Reserved + alt3: SD1_DAT2 + alt4: ARM_TDI + '38': + name: MOSI + description: SPI Master-Out + type: GPIO/SPI + scheme: + wiringpi: 28 + bcm: 20 + functions: + alt0: PCM_DIN + alt1: SD12 + alt2: Reserved + alt3: BSCSL / MISO + alt4: SPI1_MOSI + alt5: CPCLK0 + '39': + name: Ground + type: GND + '40': + name: SCLK + description: SPI Clock + type: GPIO/SPI + scheme: + wiringpi: 29 + bcm: 21 + functions: + alt0: PCM_DOUT + alt1: SD13 + alt2: Reserved + alt3: BSCSL / CE_N + alt4: SPI1_SCLK + alt5: GPCLK1 diff --git a/src/en-GB/description/pins/pin-1.md b/src/en-GB/pin/pin-1.md similarity index 100% rename from src/en-GB/description/pins/pin-1.md rename to src/en-GB/pin/pin-1.md diff --git a/src/en-GB/description/pins/pin-10.md b/src/en-GB/pin/pin-10.md similarity index 100% rename from src/en-GB/description/pins/pin-10.md rename to src/en-GB/pin/pin-10.md diff --git a/src/en-GB/description/pins/pin-12.md b/src/en-GB/pin/pin-12.md similarity index 100% rename from src/en-GB/description/pins/pin-12.md rename to src/en-GB/pin/pin-12.md diff --git a/src/en-GB/description/pins/pin-14.md b/src/en-GB/pin/pin-14.md similarity index 100% rename from src/en-GB/description/pins/pin-14.md rename to src/en-GB/pin/pin-14.md diff --git a/src/en-GB/description/pins/pin-2.md b/src/en-GB/pin/pin-2.md similarity index 100% rename from src/en-GB/description/pins/pin-2.md rename to src/en-GB/pin/pin-2.md diff --git a/src/en-GB/description/pins/pin-20.md b/src/en-GB/pin/pin-20.md similarity index 100% rename from src/en-GB/description/pins/pin-20.md rename to src/en-GB/pin/pin-20.md diff --git a/src/en-GB/description/pins/pin-25.md b/src/en-GB/pin/pin-25.md similarity index 100% rename from src/en-GB/description/pins/pin-25.md rename to src/en-GB/pin/pin-25.md diff --git a/src/en-GB/description/pins/pin-27.md b/src/en-GB/pin/pin-27.md similarity index 100% rename from src/en-GB/description/pins/pin-27.md rename to src/en-GB/pin/pin-27.md diff --git a/src/en-GB/description/pins/pin-28.md b/src/en-GB/pin/pin-28.md similarity index 100% rename from src/en-GB/description/pins/pin-28.md rename to src/en-GB/pin/pin-28.md diff --git a/src/en-GB/description/pins/pin-3.md b/src/en-GB/pin/pin-3.md similarity index 100% rename from src/en-GB/description/pins/pin-3.md rename to src/en-GB/pin/pin-3.md diff --git a/src/en-GB/description/pins/pin-30.md b/src/en-GB/pin/pin-30.md similarity index 100% rename from src/en-GB/description/pins/pin-30.md rename to src/en-GB/pin/pin-30.md diff --git a/src/en-GB/description/pins/pin-34.md b/src/en-GB/pin/pin-34.md similarity index 100% rename from src/en-GB/description/pins/pin-34.md rename to src/en-GB/pin/pin-34.md diff --git a/src/en-GB/description/pins/pin-39.md b/src/en-GB/pin/pin-39.md similarity index 100% rename from src/en-GB/description/pins/pin-39.md rename to src/en-GB/pin/pin-39.md diff --git a/src/en-GB/description/pins/pin-4.md b/src/en-GB/pin/pin-4.md similarity index 100% rename from src/en-GB/description/pins/pin-4.md rename to src/en-GB/pin/pin-4.md diff --git a/src/en-GB/description/pins/pin-5.md b/src/en-GB/pin/pin-5.md similarity index 100% rename from src/en-GB/description/pins/pin-5.md rename to src/en-GB/pin/pin-5.md diff --git a/src/en-GB/description/pins/pin-6.md b/src/en-GB/pin/pin-6.md similarity index 100% rename from src/en-GB/description/pins/pin-6.md rename to src/en-GB/pin/pin-6.md diff --git a/src/en-GB/description/pins/pin-8.md b/src/en-GB/pin/pin-8.md similarity index 100% rename from src/en-GB/description/pins/pin-8.md rename to src/en-GB/pin/pin-8.md diff --git a/src/en-GB/description/pins/pin-9.md b/src/en-GB/pin/pin-9.md similarity index 100% rename from src/en-GB/description/pins/pin-9.md rename to src/en-GB/pin/pin-9.md diff --git a/src/en-GB/settings.json b/src/en-GB/settings.json deleted file mode 100644 index bbac49b..0000000 --- a/src/en-GB/settings.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "default_desc":"The comprehensive Raspberry Pi GPIO Pinout guide for the original Raspberry Pi, B+ and Pi 2", - "default_title":"Raspberry Pi GPIO Pinout - Pi 1, B+, Pi 2", - "title_suffix":" at Raspberry Pi GPIO Pinout", - "overlays": [ - "ground", - "spi", - "uart", - "i2c", - "wiringpi", - "arduino-spi", - "rtk-000-001", - "piborg-ledborg", - "piglow", - "pibrella", - "unicorn-hat", - "skywriter-hat", - "explorer-hat-pro", - "explorer-hat", - "display-o-tron", - "dots" -] -} diff --git a/src/en-GB/settings.yaml b/src/en-GB/settings.yaml new file mode 100644 index 0000000..76a73ec --- /dev/null +++ b/src/en-GB/settings.yaml @@ -0,0 +1,25 @@ +--- +default_desc: The comprehensive Raspberry Pi GPIO Pinout guide for the original Raspberry + Pi, B+ and Pi 2 +default_title: Raspberry Pi GPIO Pinout - Pi 1, B+, Pi 2 +title_suffix: " at Raspberry Pi GPIO Pinout" +urls: + GND: ground +overlays: +- ground +- spi +- uart +- i2c +- wiringpi +- arduino-spi +- rtk-000-001 +- piborg-ledborg +- piglow +- pibrella +- unicorn-hat +- skywriter-hat +- explorer-hat-pro +- explorer-hat +- display-o-tron +- dots +- traffic-hat diff --git a/src/en-GB/description/type/3v3.md b/src/en-GB/type/3v3.md similarity index 100% rename from src/en-GB/description/type/3v3.md rename to src/en-GB/type/3v3.md diff --git a/src/en-GB/description/type/5v.md b/src/en-GB/type/5v.md similarity index 100% rename from src/en-GB/description/type/5v.md rename to src/en-GB/type/5v.md diff --git a/src/en-GB/description/type/gpio.md b/src/en-GB/type/gpio.md similarity index 100% rename from src/en-GB/description/type/gpio.md rename to src/en-GB/type/gpio.md diff --git a/src/en-GB/description/type/i2c.md b/src/en-GB/type/i2c.md similarity index 100% rename from src/en-GB/description/type/i2c.md rename to src/en-GB/type/i2c.md diff --git a/src/en-GB/description/type/pwm.md b/src/en-GB/type/pwm.md similarity index 100% rename from src/en-GB/description/type/pwm.md rename to src/en-GB/type/pwm.md diff --git a/src/en-GB/description/type/spi.md b/src/en-GB/type/spi.md similarity index 100% rename from src/en-GB/description/type/spi.md rename to src/en-GB/type/spi.md diff --git a/src/en-GB/description/type/uart.md b/src/en-GB/type/uart.md similarity index 100% rename from src/en-GB/description/type/uart.md rename to src/en-GB/type/uart.md