You don't need to have two copies of the library code.
You need to instantiate two instances of the device interface class.