MP6602 library
Loading...
Searching...
No Matches
MP6602.h File Reference
#include <Arduino.h>
#include <SPI.h>

Go to the source code of this file.

Classes

class  MP6602SPI
class  MP6602

Enumerations

enum class  MP6602RegAddr : uint8_t {
  CTRL = 0x00 , CTRL2 = 0x01 , ISET = 0x02 , STALL = 0x03 ,
  BEMF = 0x04 , TSTP = 0x05 , OCP = 0x06 , FAULT = 0x07
}
enum class  MP6602StepMode : uint8_t {
  MicroStep1 = 0b000 , MicroStep2 = 0b001 , MicroStep4 = 0b010 , MicroStep8 = 0b011 ,
  MicroStep16 = 0b100 , MicroStep32 = 0b101
}
 Possible arguments to setStepMode(). More...
enum class  MP6602FaultBit : uint8_t {
  STALL = 9 , OLA = 8 , OLB = 7 , OCP = 6 ,
  OTS = 5 , OTW = 4 , OVP = 3 , VINUV = 2 ,
  VCCUV = 1 , FLT = 0
}
enum class  MP6602OCPBit : uint8_t { OCPAH = 3 , OCPAL = 2 , OCPBH = 1 , OCPBL = 0 }

Detailed Description

This is the main header file for the MP6602 library, a library for controlling the MP6602 stepper motor driver.

For more information about this library, see:

https://github.com/pololu/mp6602-arduino

That is the main repository for this library.

Definition in file MP6602.h.

Enumeration Type Documentation

◆ MP6602FaultBit

enum class MP6602FaultBit : uint8_t
strong

Bits that are set in the return value of readFault() to indicate warning and fault conditions.

See the MP6602 datasheet for detailed descriptions of these conditions.

Enumerator
STALL 

Rotor stall.

OLA 

Open load on bridge A.

OLB 

Open load on bridge B.

OCP 

Over-current protection event (logical OR of bits in OCP register; read-only).

OTS 

Over-temperature shutdown.

OTW 

Over-temperature warning.

OVP 

Over-voltage protection.

VINUV 

VIN under-voltage.

VCCUV 

VCC under-voltage (set at start-up and reset).

FLT 

Fault indication (logical OR of other bits in FAULT register except VCCUV and VINUV; 0 when nFAULT pin is high, 1 when low).

Definition at line 134 of file MP6602.h.

◆ MP6602OCPBit

enum class MP6602OCPBit : uint8_t
strong

Bits that are set in the return value of readOCP() to indicate over-current protection events.

See the MP6602 datasheet for detailed descriptions of these conditions.

Enumerator
OCPAH 

Bridge A high-side OCP (such as short to ground).

OCPAL 

Bridge A low-side OCP (such as short to VIN).

OCPBH 

Bridge B high-side OCP (such as as short to ground).

OCPBL 

Bridge B low-side OCP (such as short to VIN).

Definition at line 152 of file MP6602.h.

◆ MP6602RegAddr

enum class MP6602RegAddr : uint8_t
strong

Addresses of control and status registers. The datasheet incudes the read/write bit in the address, so the addresses given here are right shifted by 1 to remove that read/write bit.

Definition at line 23 of file MP6602.h.

◆ MP6602StepMode

enum class MP6602StepMode : uint8_t
strong

Possible arguments to setStepMode().

Enumerator
MicroStep1 

Full step with 71% current.

MicroStep2 

1/2-step

MicroStep4 

1/4-step

MicroStep8 

1/8-step

MicroStep16 

1/16-step

MicroStep32 

1/32-step

Definition at line 120 of file MP6602.h.