libClearCore/src/SerialBase.cpp
SerialBase::SerialBase(const PeripheralRoute *ctsMisoInfo,
                       const PeripheralRoute *rtsSsInfo,
                       const PeripheralRoute *rxSckInfo,
                       const PeripheralRoute *txMosiInfo,
                       uint8_t peripheral)
    : m_parity(PARITY_N),
      m_stopBits(1),
      m_charSize(8),
      m_portMode(PortModes::UART),
      m_polarity(SCK_LOW),
      m_phase(LEAD_CHANGE),
      m_ssMode(LINE_OFF),
      m_rtsMode(LINE_HW),
      m_flowControl(false),
      m_ctsMisoInfo(ctsMisoInfo),
      m_rtsSsInfo(rtsSsInfo),
      m_rxSckInfo(rxSckInfo),
      m_txMosiInfo(txMosiInfo),
      m_baudRate(9600),
      m_peripheral(peripheral),
      m_portOpen(false),
      m_serialBreak(false),
      m_dreIrqN(static_cast<IRQn_Type>(INT32_MAX)),
      m_dmaRxChannel(DMA_INVALID_CHANNEL),
      m_dmaTxChannel(DMA_INVALID_CHANNEL),
      m_bufferIn{0}, m_bufferOut{0},
      m_inHead(0), m_inTail(0),
      m_outHead(0), m_outTail(0) {
    static Sercom *const sercom_instances[SERCOM_INST_NUM] = SERCOM_INSTS;
    m_serPort = sercom_instances[ctsMisoInfo->sercomNum];
}
/**
    Construct this instance and remember all the pads and bit locations.
**/
Construct this instance and remember all the pads and bit locations.
Construct this instance and remember all the pads and bit locations .
SerialBase::SerialBase(const PeripheralRoute *ctsMisoInfo,
                       const PeripheralRoute *rtsSsInfo,
                       const PeripheralRoute *rxSckInfo,
                       const PeripheralRoute *txMosiInfo,
                       uint8_t peripheral)
    : m_parity(PARITY_N),
      m_stopBits(1),
      m_charSize(8),
      m_portMode(PortModes::UART),
      m_polarity(SCK_LOW),
      m_phase(LEAD_CHANGE),
      m_ssMode(LINE_OFF),
      m_rtsMode(LINE_HW),
      m_flowControl(false),
      m_ctsMisoInfo(ctsMisoInfo),
      m_rtsSsInfo(rtsSsInfo),
      m_rxSckInfo(rxSckInfo),
      m_txMosiInfo(txMosiInfo),
      m_baudRate(9600),
      m_peripheral(peripheral),
      m_portOpen(false),
      m_serialBreak(false),
      m_dreIrqN(static_cast<IRQn_Type>(INT32_MAX)),
      m_dmaRxChannel(DMA_INVALID_CHANNEL),
      m_dmaTxChannel(DMA_INVALID_CHANNEL),
      m_bufferIn{0}, m_bufferOut{0},
      m_inHead(0), m_inTail(0),
      m_outHead(0), m_outTail(0) {
    static Sercom *const sercom_instances[SERCOM_INST_NUM] = SERCOM_INSTS;
    m_serPort = sercom_instances[ctsMisoInfo->sercomNum];
}
SerialBase :: SerialBase ( const PeripheralRoute * ctsMisoInfo , const PeripheralRoute * rtsSsInfo , const PeripheralRoute * rxSckInfo , const PeripheralRoute * txMosiInfo , uint8_t peripheral ) : m_parity ( PARITY_N ) , m_stopBits ( 1 ) , m_charSize ( 8 ) , m_portMode ( PortModes :: UART ) , m_polarity ( SCK_LOW ) , m_phase ( LEAD_CHANGE ) , m_ssMode ( LINE_OFF ) , m_rtsMode ( LINE_HW ) , m_flowControl ( false ) , m_ctsMisoInfo ( ctsMisoInfo ) , m_rtsSsInfo ( rtsSsInfo ) , m_rxSckInfo ( rxSckInfo ) , m_txMosiInfo ( txMosiInfo ) , m_baudRate ( 9600 ) , m_peripheral ( peripheral ) , m_portOpen ( false ) , m_serialBreak ( false ) , m_dreIrqN ( static_cast < IRQn_Type > ( INT32_MAX ) ) , m_dmaRxChannel ( DMA_INVALID_CHANNEL ) , m_dmaTxChannel ( DMA_INVALID_CHANNEL ) , m_bufferIn { 0 } , m_bufferOut { 0 } , m_inHead ( 0 ) , m_inTail ( 0 ) , m_outHead ( 0 ) , m_outTail ( 0 ) { static Sercom * const sercom_instances [ SERCOM_INST_NUM ] = SERCOM_INSTS ; m_serPort = sercom_instances [ ctsMisoInfo -> sercomNum ] ; }
Construct this instance and remember all the pads and bit locations.
Construct this instance and remember all the pads and bit locations .