uStepper S-lite
|
Function prototypes and definitions for the uStepper TMC2208 driver library. More...
#include <stdlib.h>
#include <stdint.h>
#include <avr/pgmspace.h>
#include <Arduino.h>
#include <util/delay.h>
Go to the source code of this file.
Classes | |
class | Tmc2208 |
Prototype of class for accessing all features of the TMC2208 in a single object. More... | |
Macros | |
#define | TMC2208_WRITE_BIT 0x80 |
#define | TMC2208_I_SCALE_ANALOG_MASK 0x01 |
#define | TMC2208_I_SCALE_ANALOG_SHIFT 0 |
#define | TMC2208_INTERNAL_RSENSE_MASK 0x02 |
#define | TMC2208_INTERNAL_RSENSE_SHIFT 1 |
#define | TMC2208_EN_SPREADCYCLE_MASK 0x04 |
#define | TMC2208_EN_SPREADCYCLE_SHIFT 2 |
#define | TMC2208_SHAFT_MASK 0x08 |
#define | TMC2208_SHAFT_SHIFT 3 |
#define | TMC2208_INDEX_OTPW_MASK 0x10 |
#define | TMC2208_INDEX_OTPW_SHIFT 4 |
#define | TMC2208_INDEX_STEP_MASK 0x20 |
#define | TMC2208_INDEX_STEP_SHIFT 5 |
#define | TMC2208_PDN_DISABLE_MASK 0x40 |
#define | TMC2208_PDN_DISABLE_SHIFT 6 |
#define | TMC2208_MSTEP_REG_SELECT_MASK 0x80 |
#define | TMC2208_MSTEP_REG_SELECT_SHIFT 7 |
#define | TMC2208_MULTISTEP_FILT_MASK 0x0100 |
#define | TMC2208_MULTISTEP_FILT_SHIFT 8 |
#define | TMC2208_TEST_MODE_MASK 0x0200 |
#define | TMC2208_TEST_MODE_SHIFT 9 |
#define | TMC2208_RESET_MASK 0x01 |
#define | TMC2208_RESET_SHIFT 0 |
#define | TMC2208_DRV_ERR_MASK 0x02 |
#define | TMC2208_DRV_ERR_SHIFT 1 |
#define | TMC2208_UV_CP_MASK 0x04 |
#define | TMC2208_UV_CP_SHIFT 2 |
#define | TMC2208_IFCNT_MASK 0xFF |
#define | TMC2208_IFCNT_SHIFT 0 |
#define | TMC2208_SLAVECONF_MASK 0x0F00 |
#define | TMC2208_SLAVECONF_SHIFT 8 |
#define | TMC2208_OTPBIT_MASK 0x07 |
#define | TMC2208_OTPBIT_SHIFT 0 |
#define | TMC2208_OTPBYTE_MASK 0x30 |
#define | TMC2208_OTPBYTE_SHIFT 4 |
#define | TMC2208_OTPMAGIC_MASK 0xFF00 |
#define | TMC2208_OTPMAGIC_SHIFT 8 |
#define | TMC2208_OTP0_BYTE_0_READ_DATA_MASK 0x01 |
#define | TMC2208_OTP0_BYTE_0_READ_DATA_SHIFT 0 |
#define | TMC2208_OTP1_BYTE_1_READ_DATA_MASK 0x02 |
#define | TMC2208_OTP1_BYTE_1_READ_DATA_SHIFT 8 |
#define | TMC2208_OTP2_BYTE_2_READ_DATA_MASK 0x04 |
#define | TMC2208_OTP2_BYTE_2_READ_DATA_SHIFT 16 |
#define | TMC2208_ENN_MASK 0x01 |
#define | TMC2208_ENN_SHIFT 0 |
#define | TMC2208_MS1_MASK 0x04 |
#define | TMC2208_MS1_SHIFT 2 |
#define | TMC2208_MS2_MASK 0x08 |
#define | TMC2208_MS2_SHIFT 3 |
#define | TMC2208_DIAG_MASK 0x10 |
#define | TMC2208_DIAG_SHIFT 4 |
#define | TMC2208_PDN_UART_MASK 0x40 |
#define | TMC2208_PDN_UART_SHIFT 6 |
#define | TMC2208_STEP_MASK 0x80 |
#define | TMC2208_STEP_SHIFT 7 |
#define | TMC2208_SEL_A_MASK 0x0100 |
#define | TMC2208_SEL_A_SHIFT 8 |
#define | TMC2208_DIR_MASK 0x0200 |
#define | TMC2208_DIR_SHIFT 9 |
#define | TMC2208_VERSION_MASK 0xFF000000 |
#define | TMC2208_VERSION_SHIFT 24 |
#define | TMC2208_FCLKTRIM_MASK 0x1F |
#define | TMC2208_FCLKTRIM_SHIFT 0 |
#define | TMC2208_OTTRIM_MASK 0x30 |
#define | TMC2208_OTTRIM_SHIFT 8 |
#define | TMC2208_IHOLD_MASK 0x1F |
#define | TMC2208_IHOLD_SHIFT 0 |
#define | TMC2208_IRUN_MASK 0x1F00 |
#define | TMC2208_IRUN_SHIFT 8 |
#define | TMC2208_IHOLDDELAY_MASK 0x0F0000 |
#define | TMC2208_IHOLDDELAY_SHIFT 16 |
#define | TMC2208_TPOWERDOWN_MASK 0xFF |
#define | TMC2208_TPOWERDOWN_SHIFT 0 |
#define | TMC2208_TSTEP_MASK 0x0FFFFF |
#define | TMC2208_TSTEP_SHIFT 0 |
#define | TMC2208_TPWMTHRS_MASK 0x0FFFFF |
#define | TMC2208_TPWMTHRS_SHIFT 0 |
#define | TMC2208_VACTUAL_MASK 0xFFFFFF |
#define | TMC2208_VACTUAL_SHIFT 0 |
#define | TMC2208_MSCNT_MASK 0x03FF |
#define | TMC2208_MSCNT_SHIFT 0 |
#define | TMC2208_CUR_A_MASK 0x01FF |
#define | TMC2208_CUR_A_SHIFT 0 |
#define | TMC2208_CUR_B_MASK 0x01FF0000 |
#define | TMC2208_CUR_B_SHIFT 16 |
#define | TMC2208_TOFF_MASK 0x0F |
#define | TMC2208_TOFF_SHIFT 0 |
#define | TMC2208_HSTRT_MASK 0x70 |
#define | TMC2208_HSTRT_SHIFT 4 |
#define | TMC2208_HEND_MASK 0x0780 |
#define | TMC2208_HEND_SHIFT 7 |
#define | TMC2208_TBL_MASK 0x018000 |
#define | TMC2208_TBL_SHIFT 15 |
#define | TMC2208_VSENSE_MASK 0x020000 |
#define | TMC2208_VSENSE_SHIFT 17 |
#define | TMC2208_MRES_MASK 0x0F000000 |
#define | TMC2208_MRES_SHIFT 24 |
#define | TMC2208_INTPOL_MASK 0x10000000 |
#define | TMC2208_INTPOL_SHIFT 28 |
#define | TMC2208_DEDGE_MASK 0x20000000 |
#define | TMC2208_DEDGE_SHIFT 29 |
#define | TMC2208_DISS2G_MASK 0x40000000 |
#define | TMC2208_DISS2G_SHIFT 30 |
#define | TMC2208_DISS2VS_MASK 0x80000000 |
#define | TMC2208_DISS2VS_SHIFT 31 |
#define | TMC2208_OTPW_MASK 0x01 |
#define | TMC2208_OTPW_SHIFT 0 |
#define | TMC2208_OT_MASK 0x02 |
#define | TMC2208_OT_SHIFT 1 |
#define | TMC2208_S2GA_MASK 0x04 |
#define | TMC2208_S2GA_SHIFT 2 |
#define | TMC2208_S2GB_MASK 0x08 |
#define | TMC2208_S2GB_SHIFT 3 |
#define | TMC2208_S2VSA_MASK 0x10 |
#define | TMC2208_S2VSA_SHIFT 4 |
#define | TMC2208_S2VSB_MASK 0x20 |
#define | TMC2208_S2VSB_SHIFT 5 |
#define | TMC2208_OLA_MASK 0x40 |
#define | TMC2208_OLA_SHIFT 6 |
#define | TMC2208_OLB_MASK 0x80 |
#define | TMC2208_OLB_SHIFT 7 |
#define | TMC2208_T120_MASK 0x0100 |
#define | TMC2208_T120_SHIFT 8 |
#define | TMC2208_T143_MASK 0x0200 |
#define | TMC2208_T143_SHIFT 9 |
#define | TMC2208_T150_MASK 0x0400 |
#define | TMC2208_T150_SHIFT 10 |
#define | TMC2208_T157_MASK 0x0800 |
#define | TMC2208_T157_SHIFT 11 |
#define | TMC2208_CS_ACTUAL_MASK 0x1F0000 |
#define | TMC2208_CS_ACTUAL_SHIFT 16 |
#define | TMC2208_STEALTH_MASK 0x40000000 |
#define | TMC2208_STEALTH_SHIFT 30 |
#define | TMC2208_STST_MASK 0x80000000 |
#define | TMC2208_STST_SHIFT 31 |
#define | TMC2208_PWM_OFS_MASK 0xFF |
#define | TMC2208_PWM_OFS_SHIFT 0 |
#define | TMC2208_PWM_GRAD_MASK 0xFF00 |
#define | TMC2208_PWM_GRAD_SHIFT 8 |
#define | TMC2208_PWM_FREQ_MASK 0x030000 |
#define | TMC2208_PWM_FREQ_SHIFT 16 |
#define | TMC2208_PWM_AUTOSCALE_MASK 0x040000 |
#define | TMC2208_PWM_AUTOSCALE_SHIFT 18 |
#define | TMC2208_PWM_AUTOGRAD_MASK 0x080000 |
#define | TMC2208_PWM_AUTOGRAD_SHIFT 19 |
#define | TMC2208_FREEWHEEL_MASK 0x300000 |
#define | TMC2208_FREEWHEEL_SHIFT 20 |
#define | TMC2208_PWM_REG_MASK 0x0F000000 |
#define | TMC2208_PWM_REG_SHIFT 24 |
#define | TMC2208_PWM_LIM_MASK 0xF0000000 |
#define | TMC2208_PWM_LIM_SHIFT 28 |
#define | TMC2208_PWM_SCALE_SUM_MASK 0xFF |
#define | TMC2208_PWM_SCALE_SUM_SHIFT 0 |
#define | TMC2208_PWM_SCALE_AUTO_MASK 0x01FF0000 |
#define | TMC2208_PWM_SCALE_AUTO_SHIFT 16 |
#define | TMC2208_PWM_OFS_AUTO_MASK 0xFF |
#define | TMC2208_PWM_OFS_AUTO_SHIFT 0 |
#define | TMC2208_PWM_GRAD_AUTO_MASK 0xFF0000 |
#define | TMC2208_PWM_GRAD_AUTO_SHIFT 16 |
#define | ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) |
#define | NORMALDIRECTION 0 |
#define | INVERSEDIRECTION 1 |
#define | UARTCLKDELAY() __asm__ volatile ( "nop \n\t" "nop \n\t" "nop \n\t" "nop \n\t" "nop \n\t" "nop \n\t" "nop \n\t" "nop \n\t" "nop \n\t" "nop \n\t" "nop \n\t" "nop \n\t" ) |
default values | |
| |
#define | R00 0x00000041 |
#define | R10 0x00001F00 |
#define | R6C 0x10000053 |
#define | R70 0xC10D0024 |
Register addresses | |
| |
#define | TMC2208_GCONF 0x00 |
#define | TMC2208_GSTAT 0x01 |
#define | TMC2208_IFCNT 0x02 |
#define | TMC2208_SLAVECONF 0x03 |
#define | TMC2208_OTP_PROG 0x04 |
#define | TMC2208_OTP_READ 0x05 |
#define | TMC2208_IOIN 0x06 |
#define | TMC2208_FACTORY_CONF 0x07 |
#define | TMC2208_IHOLD_IRUN 0x10 |
#define | TMC2208_TPOWERDOWN 0x11 |
#define | TMC2208_TSTEP 0x12 |
#define | TMC2208_TPWMTHRS 0x13 |
#define | TMC2208_VACTUAL 0x22 |
#define | TMC2208_MSCNT 0x6A |
#define | TMC2208_MSCURACT 0x6B |
#define | TMC2208_CHOPCONF 0x6C |
#define | TMC2208_DRVSTATUS 0x6F |
#define | TMC2208_PWMCONF 0x70 |
#define | TMC2208_PWMSCALE 0x71 |
#define | TMC2208_PWM_AUTO 0x72 |
software UART pins | |
| |
#define | UARTTXPORT PORTC |
#define | UARTTXDDR DDRC |
#define | UARTTXPIN 3 |
#define | UARTRXPORT PORTC |
#define | UARTRXDDR DDRC |
#define | UARTRXPIN 2 |
Function prototypes and definitions for the uStepper TMC2208 driver library.
This file contains class and function prototypes for the library, as well as necessary constants and global variables.
Definition in file TMC2208.h.