keil_examples/UART/dma.c
/******************************************************************************
** Function name:		DMA_IRQHandler
**
** Descriptions:		DMA interrupt handler
**
** parameters:		None
** Returned value:	None
** 
******************************************************************************/
Function name:         DMA_IRQHandler
Descriptions:          DMA interrupt handler

None
Returned value:        None
Function name : DMA_IRQHandler Descriptions : DMA interrupt handler None Returned value : None
void DMA_IRQHandler(void) 
{
  uint32_t regVal;
  regVal = LPC_GPDMA->IntTCStat;
  if ( regVal )
  {
	DMATCCount++;
	LPC_GPDMA->IntTCClear = regVal;
	if ( regVal & (0x01<<0) )
	{
	  DMAChannel_Init( 1, P2M );
	  LPC_GPDMACH1->CConfig |= 0x0C001|(DMA_UART1_RX<<1)|(0x00<<6)|(0x02<<11);
	  LPC_UART1->FCR |= 0x08;
	  UARTDMA0Done = 1;
	}
	else if ( regVal & (0x01<<1) )
	{
	  UARTDMA1Done = 1;
	}
	else if ( regVal & (0x01<<2) )
	{
	  DMAChannel_Init( 3, P2M );
	  LPC_GPDMACH3->CConfig |= 0x0C001|(DMA_UART0_RX<<1)|(0x00<<6)|(0x02<<11);
	  LPC_UART0->FCR |= 0x08;
	  UARTDMA2Done = 1;
	}
	else if ( regVal & (0x01<<3) )
	{
	  UARTDMA3Done = 1;
	}
  } 
  regVal = LPC_GPDMA->IntErrStat;
  if ( regVal )
  {
	DMAErrCount++;
	LPC_GPDMA->IntErrClr = regVal;
  }
  return;
}
void DMA_IRQHandler ( void ) { uint32_t regVal ; regVal = LPC_GPDMA -> IntTCStat ; if ( regVal ) { DMATCCount ++ ; LPC_GPDMA -> IntTCClear = regVal ; if ( regVal & ( 0x01 << 0 ) ) { DMAChannel_Init ( 1 , P2M ) ; LPC_GPDMACH1 -> CConfig |= 0x0C001 | ( DMA_UART1_RX << 1 ) | ( 0x00 << 6 ) | ( 0x02 << 11 ) ; LPC_UART1 -> FCR |= 0x08 ; UARTDMA0Done = 1 ; } else if ( regVal & ( 0x01 << 1 ) ) { UARTDMA1Done = 1 ; } else if ( regVal & ( 0x01 << 2 ) ) { DMAChannel_Init ( 3 , P2M ) ; LPC_GPDMACH3 -> CConfig |= 0x0C001 | ( DMA_UART0_RX << 1 ) | ( 0x00 << 6 ) | ( 0x02 << 11 ) ; LPC_UART0 -> FCR |= 0x08 ; UARTDMA2Done = 1 ; } else if ( regVal & ( 0x01 << 3 ) ) { UARTDMA3Done = 1 ; } } regVal = LPC_GPDMA -> IntErrStat ; if ( regVal ) { DMAErrCount ++ ; LPC_GPDMA -> IntErrClr = regVal ; } return ; }
Function name:         DMA_IRQHandler
Descriptions:          DMA interrupt handler
Function name : DMA_IRQHandler Descriptions : DMA interrupt handler