LL_DmaHelper (c++)
This commit is contained in:
parent
f0ddd19150
commit
663d68baf1
5 changed files with 81 additions and 9 deletions
46
lib/ll_dmahelper.h
Normal file
46
lib/ll_dmahelper.h
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* ll_dmahelper.h
|
||||
*
|
||||
* Created on: Oct 25, 2019
|
||||
* Author: abody
|
||||
*/
|
||||
|
||||
#ifndef LL_DMAHELPER_H_
|
||||
#define LL_DMAHELPER_H_
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <platform/dma_ll.h>
|
||||
|
||||
namespace f4ll {
|
||||
|
||||
class LL_DmaHelper {
|
||||
public:
|
||||
LL_DmaHelper(DMA_TypeDef *dma, uint32_t stream);
|
||||
~LL_DmaHelper() = delete;
|
||||
|
||||
inline DMA_TypeDef* GetDMA() { return m_dma; }
|
||||
inline uint32_t GetStream() { return m_stream; }
|
||||
inline volatile uint32_t* GetIsReg() { return m_isReg; }
|
||||
inline volatile uint32_t* GetIcfReg() { return m_ifcReg; }
|
||||
inline uint32_t GetFeMask() { return m_FEMasks[m_stream]; }
|
||||
inline uint32_t GetDmeMask() { return m_DMEMasks[m_stream]; }
|
||||
inline uint32_t GetTeMask() { return m_TEMasks[m_stream]; }
|
||||
inline uint32_t GetHtMask() { return m_HTMasks[m_stream]; }
|
||||
inline uint32_t GetTcMask() { return m_TCMasks[m_stream]; }
|
||||
|
||||
private:
|
||||
DMA_TypeDef *m_dma;
|
||||
uint32_t m_stream;
|
||||
volatile uint32_t *m_isReg;
|
||||
volatile uint32_t *m_ifcReg;
|
||||
|
||||
static const uint32_t m_FEMasks[8];
|
||||
static const uint32_t m_DMEMasks[8];
|
||||
static const uint32_t m_TEMasks[8];
|
||||
static const uint32_t m_HTMasks[8];
|
||||
static const uint32_t m_TCMasks[8];
|
||||
};
|
||||
|
||||
} /* namespace f4ll */
|
||||
|
||||
#endif /* LL_DMAHELPER_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue