Prusa3d Marlin fork
Public Member Functions | Friends | List of all members
MMU2::ProtocolLogic Class Reference

Logic layer of the MMU vs. printer communication protocol.

#include <mmu2_protocol_logic.h>

Public Member Functions

 ProtocolLogic (MMU2Serial *uart, uint8_t extraLoadDistance, uint8_t pulleySlowFeedrate)
 
void Start ()
 Start/Enable communication with the MMU.
 
void Stop ()
 Stop/Disable communication with the MMU.
 
void ToolChange (uint8_t slot)
 
void Statistics ()
 
void UnloadFilament ()
 
void LoadFilament (uint8_t slot)
 
void EjectFilament (uint8_t slot)
 
void CutFilament (uint8_t slot)
 
void ResetMMU (uint8_t mode=0)
 
void Button (uint8_t index)
 
void Home (uint8_t mode)
 
void ReadRegister (uint8_t address)
 
void WriteRegister (uint8_t address, uint16_t data)
 
void PlanExtraLoadDistance (uint8_t eld_mm)
 
uint8_t ExtraLoadDistance () const
 
void PlanPulleySlowFeedRate (uint8_t psfr)
 
uint8_t PulleySlowFeedRate () const
 
StepStatus Step ()
 Step the state machine.
 
ErrorCode Error () const
 
ProgressCode Progress () const
 
Buttons Button () const
 
uint8_t CommandInProgress () const
 
bool Running () const
 
bool FindaPressed () const
 
uint16_t FailStatistics () const
 
uint8_t MmuFwVersionMajor () const
 
uint8_t MmuFwVersionMinor () const
 
uint8_t MmuFwVersionRevision () const
 
constexpr uint8_t RetryAttempts () const
 Current number of retry attempts left.
 
void DecrementRetryAttempts ()
 
void ResetRetryAttempts ()
 Reset the retryAttempts back to the default value.
 
void ResetCommunicationTimeoutAttempts ()
 
constexpr bool InAutoRetry () const
 
void SetInAutoRetry (bool iar)
 
void SetPrinterError (ErrorCode ec)
 
void ClearPrinterError ()
 
bool IsPrinterError () const
 
ErrorCode PrinterError () const
 

Friends

class MMU2
 

Member Function Documentation

◆ Button()

Buttons MMU2::ProtocolLogic::Button ( ) const
inline
Returns
the current/latest button code as reported by the MMU

◆ DecrementRetryAttempts()

void MMU2::ProtocolLogic::DecrementRetryAttempts ( )

Decrement the retry attempts, if in a retry. Called by the MMU protocol when a sent button is acknowledged.

◆ Error()

ErrorCode MMU2::ProtocolLogic::Error ( ) const
inline
Returns
the current/latest error code as reported by the MMU

◆ ExtraLoadDistance()

uint8_t MMU2::ProtocolLogic::ExtraLoadDistance ( ) const
inline
Returns
the currently preset extra load distance

◆ PlanExtraLoadDistance()

void MMU2::ProtocolLogic::PlanExtraLoadDistance ( uint8_t  eld_mm)
inline

Sets the extra load distance to be reported to the MMU. Beware - this call doesn't send anything to the MMU. The MMU gets the newly set value either by a communication restart or via an explicit WriteRegister call

◆ PlanPulleySlowFeedRate()

void MMU2::ProtocolLogic::PlanPulleySlowFeedRate ( uint8_t  psfr)
inline

Sets the Pulley slow feed rate to be reported to the MMU. Beware - this call doesn't send anything to the MMU. The MMU gets the newly set value either by a communication restart or via an explicit WriteRegister call

◆ Progress()

ProgressCode MMU2::ProtocolLogic::Progress ( ) const
inline
Returns
the current/latest process code as reported by the MMU

◆ PulleySlowFeedRate()

uint8_t MMU2::ProtocolLogic::PulleySlowFeedRate ( ) const
inline
Returns
the currently preset Pulley slow feed rate

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