Prusa MINI Firmware overview
MarlinSerial< Cfg > Class Template Reference

#include <MarlinSerial.h>

Collaboration diagram for MarlinSerial< Cfg >:

Classes

struct  ring_buffer_r
 
struct  ring_buffer_t
 

Public Member Functions

 MarlinSerial ()
 
 operator bool ()
 

Static Public Member Functions

static FORCE_INLINE void store_rxd_char ()
 
static FORCE_INLINE void _tx_udr_empty_irq ()
 
static void begin (const long)
 
static void end ()
 
static int peek ()
 
static int read ()
 
static void flush ()
 
static ring_buffer_pos_t available ()
 
static void write (const uint8_t c)
 
static void flushTX ()
 
static FORCE_INLINE uint8_t dropped ()
 
static FORCE_INLINE uint8_t buffer_overruns ()
 
static FORCE_INLINE uint8_t framing_errors ()
 
static FORCE_INLINE ring_buffer_pos_t rxMaxEnqueued ()
 
static FORCE_INLINE void write (const char *str)
 
static FORCE_INLINE void write (const uint8_t *buffer, size_t size)
 
static FORCE_INLINE void print (const String &s)
 
static FORCE_INLINE void print (const char *str)
 
static void print (char, int=BYTE)
 
static void print (unsigned char, int=BYTE)
 
static void print (int, int=DEC)
 
static void print (unsigned int, int=DEC)
 
static void print (long, int=DEC)
 
static void print (unsigned long, int=DEC)
 
static void print (double, int=2)
 
static void println (const String &s)
 
static void println (const char[])
 
static void println (char, int=BYTE)
 
static void println (unsigned char, int=BYTE)
 
static void println (int, int=DEC)
 
static void println (unsigned int, int=DEC)
 
static void println (long, int=DEC)
 
static void println (unsigned long, int=DEC)
 
static void println (double, int=2)
 
static void println ()
 

Protected Types

typedef TypeSelector<(Cfg::RX_SIZE >256), uint16_t, uint8_t >::type ring_buffer_pos_t
 

Static Protected Member Functions

static FORCE_INLINE ring_buffer_pos_t atomic_read_rx_head ()
 
static FORCE_INLINE void atomic_set_rx_tail (ring_buffer_pos_t value)
 
static FORCE_INLINE ring_buffer_pos_t atomic_read_rx_tail ()
 

Static Protected Attributes

static constexpr R_UCSRxA< Cfg::PORT > R_UCSRA = 0
 
static constexpr R_UDRx< Cfg::PORT > R_UDR = 0
 
static constexpr R_UBRRxH< Cfg::PORT > R_UBRRH = 0
 
static constexpr R_UBRRxL< Cfg::PORT > R_UBRRL = 0
 
static constexpr B_RXENx< Cfg::PORT > B_RXEN = 0
 
static constexpr B_TXENx< Cfg::PORT > B_TXEN = 0
 
static constexpr B_TXCx< Cfg::PORT > B_TXC = 0
 
static constexpr B_RXCIEx< Cfg::PORT > B_RXCIE = 0
 
static constexpr B_UDREx< Cfg::PORT > B_UDRE = 0
 
static constexpr B_FEx< Cfg::PORT > B_FE = 0
 
static constexpr B_DORx< Cfg::PORT > B_DOR = 0
 
static constexpr B_UDRIEx< Cfg::PORT > B_UDRIE = 0
 
static constexpr B_RXCx< Cfg::PORT > B_RXC = 0
 
static constexpr B_U2Xx< Cfg::PORT > B_U2X = 0
 
static ring_buffer_r rx_buffer
 
static ring_buffer_t tx_buffer
 
static bool _written
 
static constexpr uint8_t XON_XOFF_CHAR_SENT = 0x80
 
static constexpr uint8_t XON_XOFF_CHAR_MASK = 0x1F
 
static constexpr uint8_t XON_CHAR = 17
 
static constexpr uint8_t XOFF_CHAR = 19
 
static uint8_t xon_xoff_state
 
static uint8_t rx_dropped_bytes
 
static uint8_t rx_buffer_overruns
 
static uint8_t rx_framing_errors
 
static ring_buffer_pos_t rx_max_enqueued
 
static volatile bool rx_tail_value_not_stable
 
static volatile uint16_t rx_tail_value_backup
 

Member Typedef Documentation

◆ ring_buffer_pos_t

template<typename Cfg>
typedef TypeSelector<(Cfg::RX_SIZE>256), uint16_t, uint8_t>::type MarlinSerial< Cfg >::ring_buffer_pos_t
protected

Constructor & Destructor Documentation

◆ MarlinSerial()

template<typename Cfg>
MarlinSerial< Cfg >::MarlinSerial ( )
211 {};

Member Function Documentation

◆ atomic_read_rx_head()

template<typename Cfg>
static FORCE_INLINE ring_buffer_pos_t MarlinSerial< Cfg >::atomic_read_rx_head ( )
staticprotected

◆ atomic_set_rx_tail()

template<typename Cfg>
static FORCE_INLINE void MarlinSerial< Cfg >::atomic_set_rx_tail ( ring_buffer_pos_t  value)
staticprotected

◆ atomic_read_rx_tail()

template<typename Cfg>
static FORCE_INLINE ring_buffer_pos_t MarlinSerial< Cfg >::atomic_read_rx_tail ( )
staticprotected

◆ store_rxd_char()

template<typename Cfg>
static FORCE_INLINE void MarlinSerial< Cfg >::store_rxd_char ( )
static

◆ _tx_udr_empty_irq()

template<typename Cfg>
static FORCE_INLINE void MarlinSerial< Cfg >::_tx_udr_empty_irq ( )
static

◆ begin()

template<typename Cfg>
static void MarlinSerial< Cfg >::begin ( const long  )
static

◆ end()

template<typename Cfg>
static void MarlinSerial< Cfg >::end ( )
static

◆ peek()

template<typename Cfg>
static int MarlinSerial< Cfg >::peek ( )
static

◆ read()

template<typename Cfg>
static int MarlinSerial< Cfg >::read ( )
static

◆ flush()

template<typename Cfg>
static void MarlinSerial< Cfg >::flush ( )
static

◆ available()

template<typename Cfg>
static ring_buffer_pos_t MarlinSerial< Cfg >::available ( )
static

◆ write() [1/3]

template<typename Cfg>
static void MarlinSerial< Cfg >::write ( const uint8_t  c)
static
Here is the caller graph for this function:

◆ flushTX()

template<typename Cfg>
static void MarlinSerial< Cfg >::flushTX ( )
static

◆ dropped()

template<typename Cfg>
static FORCE_INLINE uint8_t MarlinSerial< Cfg >::dropped ( )
static
221 { return Cfg::DROPPED_RX ? rx_dropped_bytes : 0; }

◆ buffer_overruns()

template<typename Cfg>
static FORCE_INLINE uint8_t MarlinSerial< Cfg >::buffer_overruns ( )
static
222 { return Cfg::RX_OVERRUNS ? rx_buffer_overruns : 0; }

◆ framing_errors()

template<typename Cfg>
static FORCE_INLINE uint8_t MarlinSerial< Cfg >::framing_errors ( )
static
223 { return Cfg::RX_FRAMING_ERRORS ? rx_framing_errors : 0; }

◆ rxMaxEnqueued()

template<typename Cfg>
static FORCE_INLINE ring_buffer_pos_t MarlinSerial< Cfg >::rxMaxEnqueued ( )
static
224 { return Cfg::MAX_RX_QUEUED ? rx_max_enqueued : 0; }

◆ write() [2/3]

template<typename Cfg>
static FORCE_INLINE void MarlinSerial< Cfg >::write ( const char *  str)
static
226 { while (*str) write(*str++); }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write() [3/3]

template<typename Cfg>
static FORCE_INLINE void MarlinSerial< Cfg >::write ( const uint8_t buffer,
size_t  size 
)
static
227 { while (size--) write(*buffer++); }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print() [1/9]

template<typename Cfg>
static FORCE_INLINE void MarlinSerial< Cfg >::print ( const String &  s)
static
228 { for (int i = 0; i < (int)s.length(); i++) write(s[i]); }
Here is the call graph for this function:

◆ print() [2/9]

template<typename Cfg>
static FORCE_INLINE void MarlinSerial< Cfg >::print ( const char *  str)
static
229 { write(str); }
Here is the call graph for this function:

◆ print() [3/9]

template<typename Cfg>
static void MarlinSerial< Cfg >::print ( char  ,
int  = BYTE 
)
static

◆ print() [4/9]

template<typename Cfg>
static void MarlinSerial< Cfg >::print ( unsigned char  ,
int  = BYTE 
)
static

◆ print() [5/9]

template<typename Cfg>
static void MarlinSerial< Cfg >::print ( int  ,
int  = DEC 
)
static

◆ print() [6/9]

template<typename Cfg>
static void MarlinSerial< Cfg >::print ( unsigned int  ,
int  = DEC 
)
static

◆ print() [7/9]

template<typename Cfg>
static void MarlinSerial< Cfg >::print ( long  ,
int  = DEC 
)
static

◆ print() [8/9]

template<typename Cfg>
static void MarlinSerial< Cfg >::print ( unsigned long  ,
int  = DEC 
)
static

◆ print() [9/9]

template<typename Cfg>
static void MarlinSerial< Cfg >::print ( double  ,
int  = 2 
)
static

◆ println() [1/10]

template<typename Cfg>
static void MarlinSerial< Cfg >::println ( const String &  s)
static

◆ println() [2/10]

template<typename Cfg>
static void MarlinSerial< Cfg >::println ( const char  [])
static

◆ println() [3/10]

template<typename Cfg>
static void MarlinSerial< Cfg >::println ( char  ,
int  = BYTE 
)
static

◆ println() [4/10]

template<typename Cfg>
static void MarlinSerial< Cfg >::println ( unsigned char  ,
int  = BYTE 
)
static

◆ println() [5/10]

template<typename Cfg>
static void MarlinSerial< Cfg >::println ( int  ,
int  = DEC 
)
static

◆ println() [6/10]

template<typename Cfg>
static void MarlinSerial< Cfg >::println ( unsigned int  ,
int  = DEC 
)
static

◆ println() [7/10]

template<typename Cfg>
static void MarlinSerial< Cfg >::println ( long  ,
int  = DEC 
)
static

◆ println() [8/10]

template<typename Cfg>
static void MarlinSerial< Cfg >::println ( unsigned long  ,
int  = DEC 
)
static

◆ println() [9/10]

template<typename Cfg>
static void MarlinSerial< Cfg >::println ( double  ,
int  = 2 
)
static

◆ println() [10/10]

template<typename Cfg>
static void MarlinSerial< Cfg >::println ( )
static

◆ operator bool()

template<typename Cfg>
MarlinSerial< Cfg >::operator bool ( )
249 { return true; }

Member Data Documentation

◆ R_UCSRA

template<typename Cfg>
constexpr R_UCSRxA<Cfg::PORT> MarlinSerial< Cfg >::R_UCSRA = 0
staticconstexprprotected

◆ R_UDR

template<typename Cfg>
constexpr R_UDRx<Cfg::PORT> MarlinSerial< Cfg >::R_UDR = 0
staticconstexprprotected

◆ R_UBRRH

template<typename Cfg>
constexpr R_UBRRxH<Cfg::PORT> MarlinSerial< Cfg >::R_UBRRH = 0
staticconstexprprotected

◆ R_UBRRL

template<typename Cfg>
constexpr R_UBRRxL<Cfg::PORT> MarlinSerial< Cfg >::R_UBRRL = 0
staticconstexprprotected

◆ B_RXEN

template<typename Cfg>
constexpr B_RXENx<Cfg::PORT> MarlinSerial< Cfg >::B_RXEN = 0
staticconstexprprotected

◆ B_TXEN

template<typename Cfg>
constexpr B_TXENx<Cfg::PORT> MarlinSerial< Cfg >::B_TXEN = 0
staticconstexprprotected

◆ B_TXC

template<typename Cfg>
constexpr B_TXCx<Cfg::PORT> MarlinSerial< Cfg >::B_TXC = 0
staticconstexprprotected

◆ B_RXCIE

template<typename Cfg>
constexpr B_RXCIEx<Cfg::PORT> MarlinSerial< Cfg >::B_RXCIE = 0
staticconstexprprotected

◆ B_UDRE

template<typename Cfg>
constexpr B_UDREx<Cfg::PORT> MarlinSerial< Cfg >::B_UDRE = 0
staticconstexprprotected

◆ B_FE

template<typename Cfg>
constexpr B_FEx<Cfg::PORT> MarlinSerial< Cfg >::B_FE = 0
staticconstexprprotected

◆ B_DOR

template<typename Cfg>
constexpr B_DORx<Cfg::PORT> MarlinSerial< Cfg >::B_DOR = 0
staticconstexprprotected

◆ B_UDRIE

template<typename Cfg>
constexpr B_UDRIEx<Cfg::PORT> MarlinSerial< Cfg >::B_UDRIE = 0
staticconstexprprotected

◆ B_RXC

template<typename Cfg>
constexpr B_RXCx<Cfg::PORT> MarlinSerial< Cfg >::B_RXC = 0
staticconstexprprotected

◆ B_U2X

template<typename Cfg>
constexpr B_U2Xx<Cfg::PORT> MarlinSerial< Cfg >::B_U2X = 0
staticconstexprprotected

◆ rx_buffer

template<typename Cfg>
ring_buffer_r MarlinSerial< Cfg >::rx_buffer
staticprotected

◆ tx_buffer

template<typename Cfg>
ring_buffer_t MarlinSerial< Cfg >::tx_buffer
staticprotected

◆ _written

template<typename Cfg>
bool MarlinSerial< Cfg >::_written
staticprotected

◆ XON_XOFF_CHAR_SENT

template<typename Cfg>
constexpr uint8_t MarlinSerial< Cfg >::XON_XOFF_CHAR_SENT = 0x80
staticconstexprprotected

◆ XON_XOFF_CHAR_MASK

template<typename Cfg>
constexpr uint8_t MarlinSerial< Cfg >::XON_XOFF_CHAR_MASK = 0x1F
staticconstexprprotected

◆ XON_CHAR

template<typename Cfg>
constexpr uint8_t MarlinSerial< Cfg >::XON_CHAR = 17
staticconstexprprotected

◆ XOFF_CHAR

template<typename Cfg>
constexpr uint8_t MarlinSerial< Cfg >::XOFF_CHAR = 19
staticconstexprprotected

◆ xon_xoff_state

template<typename Cfg>
uint8_t MarlinSerial< Cfg >::xon_xoff_state
staticprotected

◆ rx_dropped_bytes

template<typename Cfg>
uint8_t MarlinSerial< Cfg >::rx_dropped_bytes
staticprotected

◆ rx_buffer_overruns

template<typename Cfg>
uint8_t MarlinSerial< Cfg >::rx_buffer_overruns
staticprotected

◆ rx_framing_errors

template<typename Cfg>
uint8_t MarlinSerial< Cfg >::rx_framing_errors
staticprotected

◆ rx_max_enqueued

template<typename Cfg>
ring_buffer_pos_t MarlinSerial< Cfg >::rx_max_enqueued
staticprotected

◆ rx_tail_value_not_stable

template<typename Cfg>
volatile bool MarlinSerial< Cfg >::rx_tail_value_not_stable
staticprotected

◆ rx_tail_value_backup

template<typename Cfg>
volatile uint16_t MarlinSerial< Cfg >::rx_tail_value_backup
staticprotected
MarlinSerial::rx_dropped_bytes
static uint8_t rx_dropped_bytes
Definition: MarlinSerial.h:191
i
uint8_t i
Definition: screen_test_graph.c:72
MarlinSerial::write
static void write(const uint8_t c)
MarlinSerial::rx_max_enqueued
static ring_buffer_pos_t rx_max_enqueued
Definition: MarlinSerial.h:195
MarlinSerial::rx_framing_errors
static uint8_t rx_framing_errors
Definition: MarlinSerial.h:191
createSpeedLookupTable.int
int
Definition: createSpeedLookupTable.py:15
MarlinSerial::rx_buffer_overruns
static uint8_t rx_buffer_overruns
Definition: MarlinSerial.h:191
size
static png_bytep size_t size
Definition: pngwrite.c:2170