OpenMPTL - STM32 (common)
C++ Microprocessor Template Library
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
mptl::usart_irq_stream< usart_type, _fifo_type, _crlf, debug_irqs > Class Template Reference

#include <usart_stream.hpp>

Public Types

using fifo_type = _fifo_type
 
using char_type = char
 
using irq_resources = typelist< irq_handler< typename usart_type::irq, isr > >
 
using resources = typelist< typename usart_type::resources, irq_resources >
 

Static Public Member Functions

static void flush ()
 
static void open (void)
 open the stream More...
 
static void close (void)
 close the stream More...
 

Static Public Attributes

static constexpr bool crlf = _crlf
 
static fifo_type rx_fifo
 
static fifo_type tx_fifo
 
static volatile unsigned int irq_count
 
static volatile unsigned int irq_errors
 

Member Typedef Documentation

◆ char_type

template<typename usart_type , typename _fifo_type , bool _crlf = true, bool debug_irqs = false>
using mptl::usart_irq_stream< usart_type, _fifo_type, _crlf, debug_irqs >::char_type = char

◆ fifo_type

template<typename usart_type , typename _fifo_type , bool _crlf = true, bool debug_irqs = false>
using mptl::usart_irq_stream< usart_type, _fifo_type, _crlf, debug_irqs >::fifo_type = _fifo_type

◆ irq_resources

template<typename usart_type , typename _fifo_type , bool _crlf = true, bool debug_irqs = false>
using mptl::usart_irq_stream< usart_type, _fifo_type, _crlf, debug_irqs >::irq_resources = typelist< irq_handler< typename usart_type::irq, isr > >

◆ resources

template<typename usart_type , typename _fifo_type , bool _crlf = true, bool debug_irqs = false>
using mptl::usart_irq_stream< usart_type, _fifo_type, _crlf, debug_irqs >::resources = typelist< typename usart_type::resources, irq_resources >

Member Function Documentation

◆ close()

template<typename usart_type , typename _fifo_type , bool _crlf = true, bool debug_irqs = false>
static void mptl::usart_irq_stream< usart_type, _fifo_type, _crlf, debug_irqs >::close ( void  )
inlinestatic
  • disable interrupts enabled by open()
  • disable the usartX irq
  • disable USARTx

◆ flush()

template<typename usart_type , typename _fifo_type , bool _crlf = true, bool debug_irqs = false>
static void mptl::usart_irq_stream< usart_type, _fifo_type, _crlf, debug_irqs >::flush ( )
inlinestatic

◆ open()

template<typename usart_type , typename _fifo_type , bool _crlf = true, bool debug_irqs = false>
static void mptl::usart_irq_stream< usart_type, _fifo_type, _crlf, debug_irqs >::open ( void  )
inlinestatic
  • enable USARTx
  • enable usart irq channel
  • enable RXNE and PE interrupts

NOTE: Make sure the device is correctly setup before calling this function. e.g. by calling usart_device.configure()

Member Data Documentation

◆ crlf

template<typename usart_type , typename _fifo_type , bool _crlf = true, bool debug_irqs = false>
constexpr bool mptl::usart_irq_stream< usart_type, _fifo_type, _crlf, debug_irqs >::crlf = _crlf
static

◆ irq_count

template<typename usart_type , typename _fifo_type , bool _crlf = true, bool debug_irqs = false>
volatile unsigned int mptl::usart_irq_stream< usart_type, fifo_type, crlf, debug_irqs >::irq_count
static

◆ irq_errors

template<typename usart_type , typename _fifo_type , bool _crlf = true, bool debug_irqs = false>
volatile unsigned int mptl::usart_irq_stream< usart_type, fifo_type, crlf, debug_irqs >::irq_errors
static

◆ rx_fifo

template<typename usart_type , typename _fifo_type , bool _crlf = true, bool debug_irqs = false>
fifo_type mptl::usart_irq_stream< usart_type, fifo_type, crlf, debug_irqs >::rx_fifo
static

◆ tx_fifo

template<typename usart_type , typename _fifo_type , bool _crlf = true, bool debug_irqs = false>
fifo_type mptl::usart_irq_stream< usart_type, fifo_type, crlf, debug_irqs >::tx_fifo
static

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