⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dma_pc_i.c

📁 MMI层OBJ不能完全编译
💻 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<DMA_BUF_SIZE; n++)
  {
    dma_source_buffer [n] = 0x55555555;
    dma_destination_buffer [n] = 0xFEFEFEFE;
  }

  return;
}


/*-----------------------------------------------------------------------*/
/* dma_hisr()                                                            */
/* This is a simulated hisr for the PC                                   */
/*                                                                       */
/* This function is called when an DMA interrupt is received.            */
/*-----------------------------------------------------------------------*/
void dma_hisr_pc (T_DMA_TYPE_CHANNEL_NUMBER d_dma_channel_number)
{

  /* Check if notification is required, otherwise 
     skip this part. Determine the reason now  */
  if (dma_channel_array[d_dma_channel_number].dma_end_notification_bool 
                     == DMA_NOTIFICATION)
  {
    /* Send a message to the client */
    dma_send_status_message(d_dma_channel_number, DMA_COMPLETED,
                            dma_channel_array[d_dma_channel_number].return_path);
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -