Yes you can use M584 to reassign a spare driver.

https://duet3d.dozuki.com/Wiki/Gcode#Section_M584_Set_drive_mapping