From 9a1a21c4acebe8db6938f5a4c873bf683749d682 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Sun, 27 Jan 2019 11:16:43 +0000 Subject: [PATCH] Alt i2c address list for #246 --- generate-html.py | 14 ++++++++++++-- src/en/overlay/ab-adc-pi-plus.md | 6 ++++-- src/en/overlay/ab-adc-pi-zero.md | 4 +++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/generate-html.py b/generate-html.py index c46be6e..014cbaa 100755 --- a/generate-html.py +++ b/generate-html.py @@ -219,9 +219,19 @@ def load_overlay(overlay): for addr in loaded['i2c']: data = loaded['i2c'][addr] addr = str(addr) - dev=data['device'].upper() + dev = data['device'].upper() + alt = None + try: + alt = data['alternate'] + if type(alt) is list: + alt = ", ".join(alt) + except KeyError: + pass if data is not None and 'device' in data: - details.append('{address}: {device}'.format(address=addr, device=dev)) + if alt is not None: + details.append('{address}: {device} (Alt: {alt})'.format(address=addr, device=dev, alt=alt)) + else: + details.append('{address}: {device}'.format(address=addr, device=dev)) links = {} diff --git a/src/en/overlay/ab-adc-pi-plus.md b/src/en/overlay/ab-adc-pi-plus.md index 8c29680..0318abe 100644 --- a/src/en/overlay/ab-adc-pi-plus.md +++ b/src/en/overlay/ab-adc-pi-plus.md @@ -32,22 +32,24 @@ pin: mode: i2c i2c: '0x68': + alternate: [ '0x69', '0x6A', '0x6B', '0x6C', '0x6D', '0x6E', '0x6F' ] name: MCP3424 device: MCP3424 '0x69': + alternate: [ '0x68', '0x6A', '0x6B', '0x6C', '0x6D', '0x6E', '0x6F' ] name: MCP3424 device: MCP3424 --> #ADC Pi Plus -The ADC Pi Plus is an 8 channel 17 bit analogue to digital converter designed to work with the Raspberry Pi. The ADC Pi Plus is based on two Microchip MCP3424 A/D converters each containing 4 analogue inputs. The MCP3424 is a delta-sigma A/D converter with low noise differential inputs. +The ADC Pi Plus is an 8 channel 17 bit analogue to digital converter designed to work with the Raspberry Pi. The ADC Pi Plus is based on two Microchip MCP3424 A/D converters each containing 4 analogue inputs. The MCP3424 is a delta-sigma A/D converter with low noise differential inputs. The board is stackable allowing you to use up to four ADC Pi Plus boards on a Raspberry Pi. ##Features - 8 x 17-bit 0 to 5V Single Ended Inputs - Control via the Raspberry Pi I2C port - Stack up to 4 ADC Pi Plus boards on a single Raspberry Pi -- Jumper selectable I2C addresses +- Jumper selectable I2C addresses (0x68 to 0x6F) - Buffered 5V I2C port - Based on the MCP3424 from Microchip Technologies Inc - Single Ended full-scale range of 5.0V diff --git a/src/en/overlay/ab-adc-pi-zero.md b/src/en/overlay/ab-adc-pi-zero.md index 8e52e5f..f80a10a 100644 --- a/src/en/overlay/ab-adc-pi-zero.md +++ b/src/en/overlay/ab-adc-pi-zero.md @@ -30,9 +30,11 @@ pin: mode: i2c i2c: '0x68': + alternate: [ '0x69', '0x6A', '0x6B', '0x6C', '0x6D', '0x6E', '0x6F' ] name: MCP3424 device: MCP3424 '0x69': + alternate: [ '0x68', '0x6A', '0x6B', '0x6C', '0x6D', '0x6E', '0x6F' ] name: MCP3424 device: MCP3424 --> @@ -45,7 +47,7 @@ The ADC Pi Zero is an 8 channel 17 bit analogue to digital converter designed to - 8 x 17-bit 0 to 5V Single Ended Inputs - Control via the Raspberry Pi I2C port - Stack up to 4 ADC Pi Zero boards on a single Raspberry Pi -- Jumper selectable I2C addresses +- Jumper selectable I2C addresses (0x68 to 0x6F) - Buffered 5V I2C port - Based on the MCP3424 from Microchip Technologies Inc - Single Ended full-scale range of 5.0V