Added platforms and components (befinnings of f4ll_cpp)
This commit is contained in:
parent
482d3b8248
commit
7481a66667
8 changed files with 267 additions and 0 deletions
52
components/f4ll_cpp/dmahelper.h
Normal file
52
components/f4ll_cpp/dmahelper.h
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* dma_helper.h
|
||||
*
|
||||
* Created on: Sep 18, 2019
|
||||
* Author: abody
|
||||
*/
|
||||
|
||||
#ifndef DMA_HELPER_H_
|
||||
#define DMA_HELPER_H_
|
||||
#include <inttypes.h>
|
||||
#include <platform/dma_ll.h>
|
||||
|
||||
#ifndef DECLARE_MOCK
|
||||
#define DECLARE_MOCK(x)
|
||||
#endif
|
||||
|
||||
class DmaHelper {
|
||||
public:
|
||||
DmaHelper(DMA_TypeDef *dma, uint32_t stream);
|
||||
volatile uint32_t* GetIsReg(DMA_TypeDef *dma, uint32_t stream);
|
||||
volatile uint32_t* GetIfcReg(DMA_TypeDef *dma, uint32_t stream);
|
||||
uint32_t GetDmeMask(uint32_t stream);
|
||||
uint32_t GetTeMask(uint32_t stream);
|
||||
uint32_t GetHtMask(uint32_t stream);
|
||||
uint32_t GetTcMask(uint32_t stream);
|
||||
uint32_t GetFeMask(uint32_t stream);
|
||||
|
||||
private:
|
||||
DMA_TypeDef *m_dma;
|
||||
uint32_t m_stream;
|
||||
volatile uint32_t *m_isReg;
|
||||
volatile uint32_t *m_ifcReg;
|
||||
uint32_t m_feMask;
|
||||
uint32_t m_dmeMask;
|
||||
uint32_t m_teMask;
|
||||
uint32_t m_htMask;
|
||||
uint32_t m_tcMask;
|
||||
};
|
||||
|
||||
|
||||
#ifdef UNITTEST
|
||||
DECLARE_MOCK(Dma_GetIsReg);
|
||||
DECLARE_MOCK(Dma_GetIfcReg);
|
||||
DECLARE_MOCK(Dma_GetDmeMask);
|
||||
DECLARE_MOCK(Dma_GetTeMask);
|
||||
DECLARE_MOCK(Dma_GetHtMask);
|
||||
DECLARE_MOCK(Dma_GetTcMask);
|
||||
DECLARE_MOCK(Dma_GetFeMask);
|
||||
DECLARE_MOCK(Dma_Init);
|
||||
#endif
|
||||
|
||||
#endif /* DMA_HELPER_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue