logic_level_shifter module#

class LogicLevelShifter(*args, **kwargs)[source]#

Bases: Circuit

Logic Level Shifter Module Uses a BSS138 N-channel MOSFET to shift logic levels bidirectionally

hv = Port()#
lv = Port()#
lv_signal = Port()#
hv_signal = Port()#
fet = BSS138()#
lv_pullup = Resistor(resistance=10000.0).insert(Port(), Port())#
hv_pullup = Resistor(resistance=10000.0).insert(Port(), Port())#
nets = [add(BSS138().S, Port()), add(BSS138().D, Port()), add(BSS138().G, Port())]#
class I2CLevelShifter(*args, **kwargs)[source]#

Bases: Circuit

I2C Level Shifter Module Uses two logic level shifters for SCL and SDA lines

lv = Port()#
hv = Port()#
scl_shift = LogicLevelShifter()#
sda_shift = LogicLevelShifter()#
lv_i2c = I2C()#
hv_i2c = I2C()#
nets = [add(I2C().scl, LogicLevelShifter().lv_signal), add(I2C().scl, LogicLevelShifter().hv_signal), add(I2C().sda, LogicLevelShifter().lv_signal), add(I2C().sda, LogicLevelShifter().hv_signal), add(add(Port(), LogicLevelShifter().hv), LogicLevelShifter().hv), add(add(Port(), LogicLevelShifter().lv), LogicLevelShifter().lv)]#
Device#

alias of I2CLevelShifter