Highly integrated and compact motor driver