/*
 * dma_ll.c
 *
 *  Created on: Nov 22, 2019
 *      Author: abody
 */
#include "dma_ll.h"
#include <CppUTestExt/MockSupport_c.h>
#include <platform/helpers.h>

__attribute__((weak)) DMA_TypeDef _DMA1;
__attribute__((weak)) DMA_TypeDef _DMA2;


void LL_DMA_EnableIT_TC(DMA_TypeDef *DMAx, uint32_t Stream)
{
	mock_c()->actualCall(__FUNCTION__)->
			withPointerParameters(TOSTR(DMAx), DMAx)->
			withUnsignedIntParameters(TOSTR(Stream), Stream);
}


void LL_DMA_EnableIT_TE(DMA_TypeDef *DMAx, uint32_t Stream)
{
	mock_c()->actualCall(__FUNCTION__)->
			withPointerParameters(TOSTR(DMAx), DMAx)->
			withUnsignedIntParameters(TOSTR(Stream), Stream);
}


void LL_DMA_SetM2MDstAddress(DMA_TypeDef* DMAx, uint32_t Stream, uint32_t MemoryAddress)
{
	mock_c()->actualCall(__FUNCTION__)->
			withPointerParameters(TOSTR(DMAx), DMAx)->
			withUnsignedIntParameters(TOSTR(Stream), Stream)->
			withUnsignedIntParameters(TOSTR(MemoryAddress), MemoryAddress);
}


void LL_DMA_SetM2MSrcAddress(DMA_TypeDef* DMAx, uint32_t Stream, uint32_t MemoryAddress)
{
	mock_c()->actualCall(__FUNCTION__)->
			withPointerParameters(TOSTR(DMAx), DMAx)->
			withUnsignedIntParameters(TOSTR(Stream), Stream)->
			withUnsignedIntParameters(TOSTR(MemoryAddress), MemoryAddress);
}


uint32_t LL_DMA_GetDataLength(DMA_TypeDef* DMAx, uint32_t Stream)
{
	return mock_c()->actualCall(__FUNCTION__)->
			withPointerParameters(TOSTR(DMAx), DMAx)->
			withUnsignedIntParameters(TOSTR(Stream), Stream)->
			returnUnsignedIntValueOrDefault(0);
}


void LL_DMA_SetDataLength(DMA_TypeDef* DMAx, uint32_t Stream, uint32_t NbData)
{
	mock_c()->actualCall(__FUNCTION__)->
			withPointerParameters(TOSTR(DMAx), DMAx)->
			withUnsignedIntParameters(TOSTR(Stream), Stream)->
			withUnsignedIntParameters(TOSTR(NbData), NbData);
}


void LL_DMA_EnableStream(DMA_TypeDef *DMAx, uint32_t Stream)
{
	mock_c()->actualCall(__FUNCTION__)->
			withPointerParameters(TOSTR(DMAx), DMAx)->
			withUnsignedIntParameters(TOSTR(Stream), Stream);
}


void LL_DMA_DisableStream(DMA_TypeDef *DMAx, uint32_t Stream)
{
	mock_c()->actualCall(__FUNCTION__)->
			withPointerParameters(TOSTR(DMAx), DMAx)->
			withUnsignedIntParameters(TOSTR(Stream), Stream);
}


void LL_DMA_ConfigAddresses(DMA_TypeDef* DMAx, uint32_t Stream, uint32_t SrcAddress, uint32_t DstAddress, uint32_t Direction)
{
	mock_c()->actualCall(__FUNCTION__)->
			withPointerParameters(TOSTR(DMAx), DMAx)->
			withUnsignedIntParameters(TOSTR(Stream), Stream)->
			withUnsignedIntParameters(TOSTR(SrcAddress), SrcAddress)->
			withUnsignedIntParameters(TOSTR(DstAddress), DstAddress)->
			withUnsignedIntParameters(TOSTR(Direction), Direction);
}



