7 years, 5 months ago.

DigitalOut and open drain

Hi everybody. Is there a way to setup a DigitalOut as OpenDrain mode? I see the OpenDrain mode is available only as DigitalIn. Can someone suggest me the right way?

Regards.

2 Answers

7 years, 5 months ago.

OpenDrain mode doesnt make sense on a DigitalIn. The API doesnt seem to have a mode option for the DigitalOut class. You could try the DigitalInOut instead and use it as output only: See here. The DigitalInOut supports a mode selection parameter, but I have never tested it to see if it works.

7 years, 5 months ago.

Use DigitalInOut (https://developer.mbed.org/handbook/DigitalInOut) and set the mode to open drain,