Prusa-MMU-Private
PrusaMultiMaterialUpgradev3firmwareforMK3SMK4
Classes | Public Member Functions | List of all members
hal::usart::USART Class Reference

Classes

struct  USART_InitTypeDef
 
struct  USART_TypeDef
 

Public Member Functions

uint8_t Peek () const
 
bool ReadEmpty () const
 
uint8_t Read ()
 
void Write (uint8_t c)
 
void WriteS (const char *str)
 
void WriteS_P (const char *str_P)
 
void puts (const char *str)
 
void puts_P (const char *str_P)
 
bool CanWrite () const
 
void Flush ()
 blocks until the TX buffer was successfully transmitted
 
 __attribute__ ((always_inline)) inline void rx_enable()
 Enable the RX receiver.
 
 __attribute__ ((always_inline)) inline void Init(USART_InitTypeDef *const conf)
 Initializes USART interface.
 
 __attribute__ ((always_inline)) inline void ISR_RX()
 implementation of the receive ISR's body
 
 __attribute__ ((always_inline)) inline void ISR_UDRE()
 implementation of the transmit ISR's body
 
 USART (USART_TypeDef *husart)
 

Member Function Documentation

◆ CanWrite()

bool hal::usart::USART::CanWrite ( ) const
inline
Returns
true if there is at least one byte free in the TX buffer (i.e. some space to add a character to be sent)

◆ Peek()

uint8_t hal::usart::USART::Peek ( ) const
inline
Returns
current character from the UART without extracting it from the read buffer

◆ puts()

void hal::usart::USART::puts ( const char *  str)
Parameters
strc string to be sent. NL is appended Works on RAM strings

◆ puts_P()

void hal::usart::USART::puts_P ( const char *  str_P)
Parameters
str_Pc string to be sent. NL is appended Works on PROGMEM strings

◆ Read()

uint8_t hal::usart::USART::Read ( )
Returns
current character from the UART and extracts it from the read buffer

◆ ReadEmpty()

bool hal::usart::USART::ReadEmpty ( ) const
inline
Returns
true if there are no bytes to be read

◆ Write()

void hal::usart::USART::Write ( uint8_t  c)
Parameters
ccharacter to be pushed into the TX buffer (to be sent)

◆ WriteS()

void hal::usart::USART::WriteS ( const char *  str)
Parameters
strpointer to a string in RAM to be pushed byte-by-byte into the TX buffer (to be sent) No NL character is appended

◆ WriteS_P()

void hal::usart::USART::WriteS_P ( const char *  str_P)
Parameters
str_Ppointer to a string in PROGMEM to be pushed byte-by-byte into the TX buffer (to be sent) No NL character is appended

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