System-on-chip 3-phase motor control