Started Implementing UART Register interface
This commit is contained in:
@@ -73,14 +73,53 @@ public:
|
||||
bool crc_error_flag = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Higher level interface to TMC2209 driver
|
||||
* This class simplifies dealing with the registers of the TMC2209 driver
|
||||
* so you can just set the values
|
||||
*/
|
||||
class TMC2209_Registers {
|
||||
|
||||
private:
|
||||
TMC2209_UART uart_driver;
|
||||
|
||||
REG_CHOPCONF chopconfBuffer;
|
||||
|
||||
public:
|
||||
TMC2209_Registers(TMC2209_UART uart_driver);
|
||||
|
||||
void read_all_state();
|
||||
void set_reg_gconf(
|
||||
bool i_scale_analog,
|
||||
bool internal_rsense,
|
||||
bool en_SpreadCycle,
|
||||
bool shaft,
|
||||
bool index_otpw,
|
||||
bool index_step,
|
||||
bool pdn_disable,
|
||||
bool mstep_reg_select,
|
||||
bool multistep_filt
|
||||
);
|
||||
|
||||
void set_holdCurrent(
|
||||
uint8_t currentHold,
|
||||
uint8_t currentRun,
|
||||
uint8_t holdDelay
|
||||
);
|
||||
|
||||
void set_thresholdPowerdown(uint8_t threshold);
|
||||
void set_thresholdStealthChop(uint32_t threshold);
|
||||
void set_thresholdCoolStep(uint32_t threshold);
|
||||
void set_thresholdStall(uint8_t threshold);
|
||||
|
||||
void set_chopConfig(
|
||||
bool lowsideShortProtection,
|
||||
bool GNDShortProtection,
|
||||
bool doubleEdge,
|
||||
bool interpolation,
|
||||
uint8_t microstepResolution,
|
||||
bool voltageSensatifity,
|
||||
uint8_t hysteresisOffset,
|
||||
uint8_t hysteresisStart
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user