Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
Public Member Functions | List of all members
modules::globals::Globals Class Reference

Globals keep track of global state variables in the firmware. More...

#include <globals.h>

Public Member Functions

void Init ()
 Initializes the global storage hive - basically looks into EEPROM to gather information.
 
uint8_t ActiveSlot () const
 
FilamentLoadState FilamentLoaded () const
 
void SetFilamentLoaded (uint8_t slot, FilamentLoadState newFilamentLoaded)
 
uint16_t DriveErrors () const
 
void IncDriveErrors ()
 Increment MMU errors by 1.
 
void SetMotorsMode (bool stealth)
 
bool MotorsStealth () const
 
config::U_mm FSensorToNozzle_mm () const
 
void ResetFSensorToNozzle ()
 
void SetFSensorToNozzle_mm (uint8_t fss2Nozzle_mm)
 
config::U_mm FSensorUnloadCheck_mm () const
 
void ResetFSensorUnloadCheck ()
 
void SetFSensorUnloadCheck_mm (uint8_t fs2UnlCheck_mm)
 
config::U_mm_s PulleyLoadFeedrate_mm_s () const
 
void ResetPulleyLoadFeedrate ()
 
void SetPulleyLoadFeedrate_mm_s (uint16_t pulleyLoadFR_mm_s)
 
config::U_mm_s PulleySlowFeedrate_mm_s () const
 
void ResetPulleySlowFeedrate ()
 
void SetPulleySlowFeedrate_mm_s (uint16_t pulleySlowFR_mm_s)
 
config::U_mm_s PulleyUnloadFeedrate_mm_s () const
 
void ResetPulleyUnloadFeedrate ()
 
void SetPulleyUnloadFeedrate_mm_s (uint16_t pulleyUnloadFR_mm_s)
 
config::U_mm_s SelectorFeedrate_mm_s () const
 
void ResetSelectorFeedrate ()
 
void SetSelectorFeedrate_mm_s (uint16_t selectorFR_mm_s)
 
config::U_deg_s IdlerFeedrate_deg_s () const
 
void ResetIdlerFeedrate ()
 
void SetIdlerFeedrate_deg_s (uint16_t idlerFR_deg_s)
 
config::U_mm_s SelectorHomingFeedrate_mm_s () const
 
void ResetSelectorHomingFeedrate ()
 
void SetSelectorHomingFeedrate_mm_s (uint16_t selectorFR_mm_s)
 
config::U_deg_s IdlerHomingFeedrate_deg_s () const
 
void ResetIdlerHomingFeedrate ()
 
void SetIdlerHomingFeedrate_deg_s (uint16_t idlerFR_deg_s)
 
uint8_t StallGuardThreshold (config::Axis axis) const
 
void SetStallGuardThreshold (config::Axis axis, uint8_t sgthrs)
 Stores the new StallGuard threshold for an axis into EEPROM (does not affect the current state of TMC drivers at all)
 
uint8_t CutIRunCurrent () const
 
void ResetCutIRunCurrent ()
 
void SetCutIRunCurrent (uint8_t v)
 
config::U_mm CutLength () const
 
void ResetCutLength ()
 
void SetCutLength (uint8_t v)
 

Detailed Description

Globals keep track of global state variables in the firmware.

Member Function Documentation

◆ ActiveSlot()

uint8_t modules::globals::Globals::ActiveSlot ( ) const
Returns
active filament slot on the MMU unit. This value basically means there is some piece of filament blocking the selector from moving freely. Slots are numbered 0-4

◆ CutIRunCurrent()

uint8_t modules::globals::Globals::CutIRunCurrent ( ) const
inline
Returns
Cut iRun current level (value for TMC2130)

◆ DriveErrors()

uint16_t modules::globals::Globals::DriveErrors ( ) const
Returns
the total number of MMU errors so far Errors are stored in the EEPROM

◆ FilamentLoaded()

FilamentLoadState modules::globals::Globals::FilamentLoaded ( ) const
Returns
true if filament is considered as loaded

◆ MotorsStealth()

bool modules::globals::Globals::MotorsStealth ( ) const
inline
Returns
true if the motors are to be operated in stealth mode

◆ SetFilamentLoaded()

void modules::globals::Globals::SetFilamentLoaded ( uint8_t  slot,
FilamentLoadState  newFilamentLoaded 
)

Sets the filament loaded flag value, usually after some command/operation. Also updates the EEPROM records accordingly

Parameters
slotslot index
newFilamentLoadednew state

◆ SetMotorsMode()

void modules::globals::Globals::SetMotorsMode ( bool  stealth)

Set normal or stealth mode for all of the motors Used to keep track of the last set mode to be able to return to it properly after homing sequences and/or after restarting the MMU

Parameters
stealthtrue means use stealth mode, false means use normal mode

◆ StallGuardThreshold()

uint8_t modules::globals::Globals::StallGuardThreshold ( config::Axis  axis) const
Returns
current StallGuard threshold for an axis

The documentation for this class was generated from the following files: