Closed microbit-carlos closed 1 month ago
@dpgeorge Looks like the nRF way to set up open drain is to call drive mode to 6, with CODAL via uBit.io.P0.setDriveMode(6)
:
https://github.com/lancaster-university/codal-nrf52/blob/0643733703b4f8f788af81a996f40d1f1a1527bc/inc/NRF52Pin.h#L423-L438
Drive mode from the datasheet, where S0D1 means setting the pin low works as normal and setting it high does nothing :
Could also set it into "high drive mode" H0D1, to pull more current.
Would it be possible to add a way in CODAL to configure a pin in open drain mode?
This is something required for implementing 1-wire protocols on top level languages like MicroPython.