removing prefix LL_ from class/struct names under f4ll namespace
This commit is contained in:
parent
180f2ef624
commit
7cdc79c2ac
17 changed files with 184 additions and 183 deletions
51
components/f4ll/inc/usartcore.h
Normal file
51
components/f4ll/inc/usartcore.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* ll_dmadrivenusartcore.h
|
||||
*
|
||||
* Created on: Nov 4, 2019
|
||||
* Author: abody
|
||||
*/
|
||||
|
||||
#ifndef LL_USARTCORE_H_
|
||||
#define LL_USARTCORE_H_
|
||||
#include <platform/usart_ll.h>
|
||||
|
||||
#include "f4ll/dmahelper.h"
|
||||
|
||||
namespace f4ll {
|
||||
|
||||
class UsartCore
|
||||
{
|
||||
public:
|
||||
static inline void HandleUsartIrq(UsartCore *_this) { _this->UsartIsr(); }
|
||||
static inline void HandleRxDmaIrq(UsartCore *_this) { _this->RxDmaIsr(); }
|
||||
static inline void HandleTxDmaIrq(UsartCore *_this) { _this->TxDmaIsr(); }
|
||||
|
||||
protected:
|
||||
UsartCore(USART_TypeDef *usart, DMA_TypeDef *dma, uint32_t streamRx, uint32_t streamTx);
|
||||
|
||||
virtual void ReceiverIdle() = 0;
|
||||
virtual void TransmissionComplete() = 0;
|
||||
|
||||
virtual void RxDmaTransferComplete() = 0;
|
||||
virtual void RxDmaHalfTransfer() = 0;
|
||||
virtual void RxDmaError(DmaHelper::DmaErrorType reason) = 0;
|
||||
|
||||
virtual void TxDmaTransferComplete() = 0;
|
||||
virtual void TxDmaHalfTransfer() = 0;
|
||||
virtual void TxDmaError(DmaHelper::DmaErrorType reason) = 0;
|
||||
|
||||
void SetupTransmit(void const *buffer, uint16_t length);
|
||||
void SetupReceive(void *buffer, uint16_t length);
|
||||
|
||||
void UsartIsr();
|
||||
void RxDmaIsr();
|
||||
void TxDmaIsr();
|
||||
|
||||
USART_TypeDef *m_usart;
|
||||
DmaHelper m_rxDma;
|
||||
DmaHelper m_txDma;
|
||||
};
|
||||
|
||||
} /* namespace f4ll */
|
||||
|
||||
#endif /* LL_USARTCORE_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue