ECU/Application/dist/src/DMA_program.c
void DMA_Transfer(volatile u8 Channel, volatile u32* MEM_ADDRESS, volatile u32* PER_ADDRESS, volatile u32 Count) {
	if (Channel >= 1 && Channel < 7) {
		*((u32*) (&DMA->CNDTR1	+ (u32) (Channel - 1) * 5)) 	= 		Count;
		*((u32*) (&DMA->CMAR1 	+ (u32) (Channel - 1) * 5)) 	= (u32) MEM_ADDRESS;
		*((u32*) (&DMA->CPAR1	+ (u32) (Channel - 1) * 5)) 	= (u32) PER_ADDRESS;
		*((u32*) (&DMA->CCR1	+ (u32) (Channel - 1) * 5))	   |= 		0b1;
	}
}
/**
  * @brief  Starts and transfer
  * @param	Channel:	The DMA channel number.
  * 					Can be DMA_CHANNEL_x where x is from 1 to 6
  * @param	MEM_ADDRESS:	Pointer to the Memory address
  * @param	PER_ADDRESS:	Pointer to the Peripheral address
  * @param 	Count:			Number of (units) to transfer
  * @retval void
  */
@brief  Starts and transfer
@param      Channel:        The DMA channel number.
Can be DMA_CHANNEL_x where x is from 1 to 6
@param      MEM_ADDRESS:    Pointer to the Memory address
@param      PER_ADDRESS:    Pointer to the Peripheral address
@param      Count:                  Number of (units) to transfer
@retval void
@brief Starts and transfer @param Channel : The DMA channel number . Can be DMA_CHANNEL_x where x is from 1 to 6 @param MEM_ADDRESS : Pointer to the Memory address @param PER_ADDRESS : Pointer to the Peripheral address @param Count : Number of ( units ) to transfer @retval void
void DMA_Transfer(volatile u8 Channel, volatile u32* MEM_ADDRESS, volatile u32* PER_ADDRESS, volatile u32 Count) {
	if (Channel >= 1 && Channel < 7) {
		*((u32*) (&DMA->CNDTR1	+ (u32) (Channel - 1) * 5)) 	= 		Count;
		*((u32*) (&DMA->CMAR1 	+ (u32) (Channel - 1) * 5)) 	= (u32) MEM_ADDRESS;
		*((u32*) (&DMA->CPAR1	+ (u32) (Channel - 1) * 5)) 	= (u32) PER_ADDRESS;
		*((u32*) (&DMA->CCR1	+ (u32) (Channel - 1) * 5))	   |= 		0b1;
	}
}
void DMA_Transfer ( volatile u8 Channel , volatile u32 * MEM_ADDRESS , volatile u32 * PER_ADDRESS , volatile u32 Count ) { if ( Channel >= 1 && Channel < 7 ) { * ( ( u32 * ) ( & DMA -> CNDTR1 + ( u32 ) ( Channel - 1 ) * 5 ) ) = Count ; * ( ( u32 * ) ( & DMA -> CMAR1 + ( u32 ) ( Channel - 1 ) * 5 ) ) = ( u32 ) MEM_ADDRESS ; * ( ( u32 * ) ( & DMA -> CPAR1 + ( u32 ) ( Channel - 1 ) * 5 ) ) = ( u32 ) PER_ADDRESS ; * ( ( u32 * ) ( & DMA -> CCR1 + ( u32 ) ( Channel - 1 ) * 5 ) ) |= 0b1 ; } }
@brief  Starts and transfer
 @param      Channel:        The DMA channel number.
@brief Starts and transfer @param Channel : The DMA channel number .