Download Reference Manual
Transcript
Library Function Descriptions memory_map_ concatenated with a valid memory name. As an example, memory_map_pa refers to off-chip pa memory on the 96002 device. See Example 14-62. Example 14-62. dsp_wmem_blk() /* Copy 100 values in X:$c400 to P:$a000 */ #include "simcom.h" #include "protocom.h" #include "coreaddr.h" int devn; unsigned long address, count, memval[100]; memval=0L; devn=0; dsp_new(devn,"56002");/* Allocate structure for device 0, a 56002 */ address=0xc400; dsp_rmem(devn,memory_map_x,address,100L,&memval[0]); /* fetch 100 values */ address=0xa000; /* from X:$c400 */ dsp_wmem(devn,memory_map_p,address,100L,&memval[0]); /* and write to P:$a000 */ 14.2.63 dsp_wreg—Write a DSP Device Register #include "simcom.h" #include "protocom.h" dsp_wreg(device_index,periph_num,reg_num,reg_val) int device_index; /* DSP device index to be affected by command */ int periph_num;/* DSP peripheral number */ int reg_num;/* DSP register number */ unsigned long *reg_val;/* Value to be written to register */ dsp_wreg() writes a selected register in the a DSP device. Use the emulator "help reg" command to obtain a list of the valid periph_num and reg_num values, and reg_val size for each register. Also, the function dsp_findreg() can be used to obtain the peripheral and register number by using the register name as a key. If a register requires more than one word to represent the data value the least significant word should be at [reg_val], with more significant words at [reg_val+1], etc. See Example 14-63. Motorola Library Functions 14-57