-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move id eeprom and rsl to lib/rpi-hat/
- Loading branch information
1 parent
90a014a
commit 9ebfd81
Showing
3 changed files
with
105 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
"""Raspberry Pi HAT EEPROM.""" | ||
|
||
from "generics/interfaces.ato" import I2C, Power | ||
from "generics/resistors.ato" import I2CPullup | ||
|
||
from "lib/capacitors.ato" import PowerDecouplingCap100nf | ||
from "lib/eeproms.ato" import CAT24C32WI_GT3 | ||
from "lib/headers.ato" import PinHeader1x2PinDipStraightTHT | ||
from "lib/resistors.ato" import Resistor1608 | ||
|
||
|
||
module RpiHatIdEeprom: | ||
""" | ||
Raspberry Pi HAT EEPROM | ||
|
||
# Reference | ||
|
||
* [Raspberry Pi HAT+ Specification](https://datasheets.raspberrypi.com/hat/hat-plus-specification.pdf) | ||
* [Raspberry Pi HAT EEPROM circuit diagram](https://github.com/raspberrypi/hats/blob/5f2058bf8eebf43dd19d7218f1e38d14a9835231/eeprom-circuit.png) | ||
""" | ||
# power | ||
power_3v3 = new Power | ||
signal gnd ~ power_3v3.gnd | ||
|
||
# EEPROM I2C | ||
i2c = new I2C | ||
|
||
# write protect pull-up resistor | ||
wp_pullup = new Resistor1608 | ||
wp_pullup.value = 1kohm +/- 5% | ||
|
||
# write enable header (fit jumper to enable write) | ||
we_header = new PinHeader1x2PinDipStraightTHT | ||
we_header.p1 ~ gnd | ||
we_header.p2 ~ wp_pullup.p1 | ||
|
||
# EEPROM | ||
eeprom = new CAT24C32WI_GT3 | ||
eeprom.power ~ power_3v3 | ||
eeprom.wp ~ wp_pullup.p2 | ||
eeprom.i2c ~ i2c | ||
# EEPROM at address 0x50 (A0-A2 tied to ground) | ||
eeprom.a0 ~ gnd | ||
eeprom.a1 ~ gnd | ||
eeprom.a2 ~ gnd | ||
|
||
# power decoupling capacitor | ||
power_cap = new PowerDecouplingCap100nf | ||
power_cap.power ~ power_3v3 | ||
|
||
# I2C pull-up resistors | ||
i2c_pullup = new I2CPullup | ||
i2c_pullup.r_scl.value = 3.9kohm +/- 20% | ||
i2c_pullup.r_scl.package = "0603" | ||
i2c_pullup.r_sda.value = 3.9kohm +/- 20% | ||
i2c_pullup.r_sda.package = "0603" | ||
i2c_pullup.power ~ power_3v3 | ||
i2c_pullup.i2c ~ i2c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"""Robot signal light.""" | ||
|
||
from "generics/interfaces.ato" import Pair, Power | ||
|
||
from "lib/connectors.ato" import JstB2bPhKS | ||
from "lib/leds.ato" import LEDIndicatorAmber | ||
from "lib/mosfets.ato" import LowSideSwitch60V115mA | ||
|
||
|
||
module RobotSignalLight: | ||
""" | ||
Robot signal light. | ||
|
||
Consists of an on-board LED, and a connector for a remote off-board signal | ||
light. | ||
""" | ||
# power | ||
power_5v = new Power | ||
signal gnd ~ power_5v.gnd | ||
|
||
input = new Pair | ||
input.gnd ~ power_5v.gnd | ||
|
||
# low side switch | ||
switch = new LowSideSwitch60V115mA | ||
switch.gate_resistor.value = 100ohm +/- 20% | ||
switch.pulldown_resistor.value = 1.2Mohm +/- 20% | ||
switch.input.io ~ input.io | ||
switch.input.gnd ~ gnd | ||
switch.power ~ power_5v | ||
|
||
# on-board signal LED | ||
status_indicator = new LEDIndicatorAmber | ||
status_indicator.current = 5mA to 10mA | ||
status_indicator.v_in = 4.9V to 5.1V | ||
status_indicator.input ~ switch.load.p | ||
status_indicator.gnd ~ switch.load.n | ||
|
||
# off-board signal connector | ||
connector = new JstB2bPhKS | ||
connector.p1 ~ switch.load.p | ||
connector.p2 ~ switch.load.n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters