You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When yue use the CH422G expander with the build command EXPANDER=ch422g, the dirver will be included in the firmware. When you later init the driver with
import ch422g # kommt neu von kdschlooser, hat meine Änderung übernommen
# but we need to create a new device on the bus for the io_expander
io_expander_device = I2C.Device(I2C_BUS, dev_id=ch422g.I2C_ADDR, reg_bits=ch422g.BITS)
# Now we need to set the I2C device to the io expander driver
ch422g.Pin.set_device(io_expander_device)
the function Pin.set_device shout set the device in the base class in io_expander_framework. via the call of "cls._device = device" in the Pin Class of ch422g line 39.
This does not work, possibly due to misfunction in micropython.
When you later on call
tp_reset_pin = ch422g.Pin(
ch422g.EXIO1, # sets the pin to use on the IO expander
mode=ch422g.Pin.OUT, # sets the mode as output
# 0 if the pin needs to be high to to reset
# 1 if the state needs to be low to perform a reset
value=0)
```
you will get an error "_device not registered. When you call " io_expander_framework.Pin.set_device( device)
" instead of "cls._device = device" ther driver is OK.
**Expected behavior**
the device should be registred in the class.
The text was updated successfully, but these errors were encountered:
Describe the bug
When yue use the CH422G expander with the build command EXPANDER=ch422g, the dirver will be included in the firmware. When you later init the driver with
the function Pin.set_device shout set the device in the base class in io_expander_framework. via the call of "cls._device = device" in the Pin Class of ch422g line 39.
This does not work, possibly due to misfunction in micropython.
When you later on call
The text was updated successfully, but these errors were encountered: