Jrk G2 library for Arduino
Classes | Enumerations | Variables
JrkG2.h File Reference
#include <Arduino.h>
#include <Stream.h>
#include <Wire.h>
Include dependency graph for JrkG2.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  JrkG2Base
 
class  JrkG2Serial
 
class  JrkG2I2C
 

Enumerations

enum  JrkG2Error {
  AwaitingCommand = 0, NoPower = 1, MotorDriver = 2, InputInvalid = 3,
  InputDisconnect = 4, FeedbackDisconnect = 5, SoftOvercurrent = 6, SerialSignal = 7,
  SerialOverrun = 8, SerialBufferFull = 9, SerialCrc = 10, SerialProtocol = 11,
  SerialTimeout = 12, HardOvercurrent = 13
}
 
enum  JrkG2Command {
  SetTarget = 0xC0, SetTargetLowResRev = 0xE0, SetTargetLowResFwd = 0xE1, ForceDutyCycleTarget = 0xF2,
  ForceDutyCycle = 0xF4, MotorOff = 0xFF, GetVariable8 = 0x80, GetVariable16 = 0xA0,
  GetEEPROMSettings = 0xE3, GetVariables = 0xE5, SetRAMSettings = 0xE6, GetRAMSettings = 0xEA,
  GetCurrentChoppingOccurrenceCount = 0xEC
}
 
enum  JrkG2ForceMode { None = 0, DutyCycleTarget = 1, DutyCycle = 2 }
 
enum  JrkG2Reset {
  PowerUp = 0, Brownout = 1, ResetLine = 2, Watchdog = 4,
  Software = 8, StackOverflow = 16, StackUnderflow = 32
}
 
enum  JrkG2Pin {
  SCL = 0, SDA = 1, TX = 2, RX = 3,
  RC = 4, AUX = 5, FBA = 6, FBT = 7
}
 This enum defines the Jrk G2's control and feedback pins.
 
enum  JrkG2OptionsByte3 { ResetIntegral = 0, CoastWhenOff = 1 }
 

Variables

const uint16_t JrkG2InputNull = 0xFFFF
 
const uint8_t JrkG2CommReadError = 50
 

Detailed Description

This is the main header file for the Jrk G2 Motor Controller library for Arduino.

For more information about the library, see the main repository at: https://github.com/pololu/jrk-g2-arduino

Definition in file JrkG2.h.

Enumeration Type Documentation

enum JrkG2Command
strong

This enum defines the Jrk G2 command bytes which are used for its serial and I2C interfaces. These bytes are used by the library and you should not need to use them.

Definition at line 50 of file JrkG2.h.

enum JrkG2Error
strong

This enum defines the Jrk's error bits. See the "Error handling" section of the Jrk G2 user's guide for more information about what these errors mean.

See JrkG2Base::getErrorFlagsHalting() and JrkG2Base::getErrorFlagsOccurred().

Definition at line 29 of file JrkG2.h.

enum JrkG2ForceMode
strong

This enum defines the modes in which the Jrk G2's duty cycle target or duty cycle, normally derived from the output of its PID algorithm, can be overridden with a forced value.

See JrkG2Base::getForceMode(), JrkG2Base::forceDutyCycleTarget(), and JrkG2Base::forceDutyCycle().

Definition at line 73 of file JrkG2.h.

enum JrkG2OptionsByte3
strong

This enum defines the bits in the Jrk G2's Options Byte 3 register. You should not need to use this directly. See JrkG2Base::setResetIntegral(), JrkG2Base::getResetIntegral(), JrkG2Base::setCoastWhenOff(), and JrkG2Base::getCoastWhenOff().

Definition at line 112 of file JrkG2.h.

enum JrkG2Reset
strong

This enum defines the possible causes of a full microcontroller reset for the Jrk G2.

See JrkG2Base::getDeviceReset().

Definition at line 84 of file JrkG2.h.

Variable Documentation

const uint8_t JrkG2CommReadError = 50

This value is returned by getLastError() if the last communication with the device resulted in an unsuccessful read (e.g. timeout or NACK).

Definition at line 23 of file JrkG2.h.

const uint16_t JrkG2InputNull = 0xFFFF

This is used to represent a null or missing value for some of the Jrk G2's 16-bit input variables.

Definition at line 19 of file JrkG2.h.