def print_drv_regs(name, motor):
    """
    Dumps the current gate driver regisers for the specified motor
    """
    fault = motor.gate_driver.drv_fault
    status_reg_1 = motor.gate_driver.status_reg_1
    status_reg_2 = motor.gate_driver.status_reg_2
    ctrl_reg_1 = motor.gate_driver.ctrl_reg_1
    ctrl_reg_2 = motor.gate_driver.ctrl_reg_2
    print(name + ': ' + str(fault))
    print('DRV Fault Code: ' + str(fault))
    print('Status Reg 1: ' + str(status_reg_1) + ' (' + format(status_reg_1,
        '#010b') + ')')
    print('Status Reg 2: ' + str(status_reg_2) + ' (' + format(status_reg_2,
        '#010b') + ')')
    print('Control Reg 1: ' + str(ctrl_reg_1) + ' (' + format(ctrl_reg_1,
        '#013b') + ')')
    print('Control Reg 2: ' + str(ctrl_reg_2) + ' (' + format(ctrl_reg_2,
        '#09b') + ')')
