I raise a finger of warning. Do You have experience of interrupt handlers and real time programming?
Take this scenario: Your lib is running the motors, and an interrupt occurs (and does what?). When the interrupt routine is finished the lib keeps on doing whatever it was doing because the lib knows nothing about any abnormalities.