8 years ago.

I2C destructor ?

Hello. I have a project which involves talking to OneWire chips (DS2431) through a I2C switch (PCA9548). What I want to do is configure the switch properly (just write a byte to its state register) then use the mbed SDA pin for OneWire communication. The switch doesn't care about the SDA line (it can even pass DC in both directions) and I've tested it with OneWire successfully. The problem is switching in software from I2C to OneWire on the same pin. I've tried it the easy way : making a global I2C instance, then a OneWire instance, but the last one always busts the previous one so that I can either have I2C working or OneWire. Is there a way to destruct one instance and create it again?

Be the first to answer this question.