iop.c

来自「C语言编写的监控中心终端程序。基于GPRS上传收发数据功能」· C语言 代码 · 共 49 行

C
49
字号
#include "config.h"
#include "regmap.h"
#include "global.h"
#include "dma.h"
#include "memmap.h"
#include "set.h"

void iop_init(const BYTE *rom, int len)
{
    UINT16		i;
    UINT32		*p, *q;

#if 1
#ifndef SUPPORT_COMBO
    regs0->gpio_sel |= ((1 << 8));		// disable rom A19 set to GPIO
    regs0->gpio_sel |= ((3 << 7));		// gpio A8,A9
    regs0->gpio_sel &= (~(1 << 9));		// gpio A10
    regs0->gpio_master[0] &= (~(0x07 << 8));	// dsa used
#endif

//  regs0->gpio_master[0] &= (~(0x07 << 0));	// game GPIO 0,2

#ifdef EMU_DEMO_BOARD
    regs0->gpio_master[1] &= (~(0x0f << 6));	//vfd and ir GPIO 22,23,24,25
#else
    regs0->gpio_master[1] &= (~(0x017 << 5));	//vfd and ir GPIO 21,22,23,25
#endif

#ifdef SUPPORT_ESP
    regs0->gpio_master[2] &= (~(1 << 8));
#endif

//  audio clk divided from GPIO 40
//  regs0->pos_cfg = 0x08;
//  regs0->gpio_oe[2] &= (~(0x0100));
//  regs0->gpio_master[2] |= (0x100);
#endif

    regs0->iop_control = -1;	// RF_DSP24_RESET | RF_DSP24_STALL;

    p = (UINT32 *)rom;
    q = (UINT32 *)(SDRAM_BASE + regs0->iopya * 1024);
    len = (len + 3) & ~0x03;
    for (i = 0; i < len / 4; i++)
	*q++ = *p++;
//  MIPS_flush_LBC_cache();
    regs0->iop_control = 0;
}

⌨️ 快捷键说明

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