Download Debugger User`s Manual
Transcript
Freescale Semiconductor, Inc. Library Function Descriptions 14.2.52 dsp_rmem_blk—Read Block of DSP Memory Locations Freescale Semiconductor, Inc... #include "simcom.h" #include "protocom.h" #include "coreaddr.h" int dsp_rmem_blk(device_index,memory_map,address,count,return_value) int device_index; /* DSP device to be affected by command */ enum memory_map memory_map;/* memory designator */ unsigned long address;/* DSP memory address to read */ unsigned long count;/* number of memory locations to read */ unsigned long *return_value;/* Returned memory value(s) */ dsp_rmem_blk() reads count locations starting at address from memory memory_map in device device_index and writes it to the memory block pointed to by return_value. If memory_map implies a two word value, the values are returned in order, with the low-order half of the first word followed by the high-order half, then the low-order half of the second word. For word n (counting from 0) in the memory block, the low-order value is stored in return_value[2*n], the high-order value in return_value[2*n+1]. The function return value indicates whether the memory locations exist. It returns 1 if all the locations exist, 0 otherwise. The memory_map parameter selects the appropriate dt_memory structure from dt_var.mem for the selected device. These structures are described in the simdev.h file. The memory_map parameter can be obtained with the function dsp_findmem() by using the memory name as a key. Use the emulator help mem command for a list of valid memory names. The memory_map enum is memory_map_ concatenated with a valid memory name. See Example 14-52. Example 14-52. dsp_rmem_blk() /* Read 20 X memory locations starting at 100 from device 0. */ #include "simcom.h" #include "protocom.h" #include "coreaddr.h" unsigned long address; unsigned long count; unsigned long memval[20]; int devn; int ok; devn=0; dsp_new(devn,"56002");/* Allocate structure for device 0, a 56002 */ address=100L; count=20L; ok=dsp_rmem(devn,memory_map_x,address,count,&memval[0]); Motorola Library Functions For More Information On This Product, Go to: www.freescale.com 14-49