www.pudn.com > drivers.rar > dma_pc_i.c


/** 
 * @file  dma_pc_i.c 
 * 
 * API for DMA SWE. 
 * 
 * @author   () 
 * @version 0.1 
 */ 
 
/* 
 * History: 
 * 
 *  Date        Author          Modification 
 *  ------------------------------------------------------------------- 
 *  7/2/2003   ()   Create. 
 * 
 * (C) Copyright 2003 by Texas Instruments Incorporated, All Rights Reserved 
 */ 
 
 
 
#include "dma/dma_api.h" 
#include "dma/dma_i.h" 
#include "dma/dma_message.h" 
 
#ifndef _WINDOWS 
#include "nucleus.h" 
#include "inth/iq.h" 
#endif 
 
#ifdef _WINDOWS 
#include "dma/pc/dma_pc_i.h" 
#endif //_WINDOWS 
 
extern T_DMA_CHANNEL_ARRAY dma_channel_array [DMA_MAX_NUMBER_OF_CHANNEL];  
extern T_DMA_QUEUE_ARRAY   dma_queue_array   [DMA_MAX_QUEUED_REQUESTS]; 
extern UINT8 dma_function_status [DMA_MAX_NUMBER_OF_CHANNEL]; 
 
 
/* Used for pc simulation of memory copy */ 
#define DMA_BUF_SIZE 64 
UINT32 dma_source_buffer      [DMA_BUF_SIZE]; 
UINT32 dma_destination_buffer [DMA_BUF_SIZE]; 
 
/* Stub functions */ 
void f_dma_channel_disable(T_DMA_TYPE_CHANNEL_NUMBER d_dma_channel_number)   
{ 
  return; 
} 
 
void f_dma_channel_soft_reset (T_DMA_TYPE_CHANNEL_NUMBER channel) 
{ 
  return; 
} 
 
void f_dma_channel_enable (T_DMA_TYPE_CHANNEL_NUMBER d_dma_channel_number) 
{ 
 
  DMA_SEND_TRACE("DMA Warning PC simulation!! This is a simulated copy,", DMA_TRACE_LEVEL); 
  DMA_SEND_TRACE("DMA not all parameters are taken into account !!", DMA_TRACE_LEVEL); 
 
  memcpy (&dma_destination_buffer, &dma_source_buffer, sizeof(dma_source_buffer)); 
  dma_hisr_pc (d_dma_channel_number); 
  return; 
} 
 
void f_dma_channel_parameter_set(T_DMA_TYPE_CHANNEL_PARAMETER *p_dma_channel_parameter) 
{ 
  UINT8 n; 
 
  for (n=0; n