This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DSP2812例程BLDC3_1中DATALOG模块的疑问

如题:请问各位大佬们这个DATALOG 模块的作用是什么?初始化时这几句是什么作用

    dlog.trig_value = 0x01;
    dlog.size = 0x400;
    dlog.prescalar = 1;

其头文件如下:

#ifndef __DLOG4CH_H__
#define __DLOG4CH_H__
 
#define NULL    0
 
typedef struct {    long  task;          // Variable:  Task address pointer  
                    int  *iptr1;         // Input: First input pointer (Q15)     
                    int  *iptr2;         // Input: Second input pointer (Q15)        
                    int  *iptr3;         // Input: Third input pointer (Q15) 
                    int  *iptr4;         // Input: Fourth input pointer (Q15) 
                    int  trig_value;     // Input: Trigger point (Q15)       
                    int  prescalar;      // Parameter: Data log prescale     
                    int  skip_cntr;      // Variable:  Data log skip counter     
                    int  cntr;           // Variable:  Data log counter      
                    long write_ptr;      // Variable:  Graph address pointer              
                    int  size;           // Parameter: Maximum data buffer    
                    int  (*init)();      // Pointer to init function         
                    int  (*update)();    // Pointer to update function        
               } DLOG_4CH;               
                                                        
typedef DLOG_4CH *DLOG_4CH_handle;                           
                                                        
void DLOG_4CH_init(void *);
void DLOG_4CH_update(void *);                                                        
                                                        
/*=============================================================================
Default initalizer for the DLOG_4CH object.
==============================================================================*/
                    
#define DLOG_4CH_DEFAULTS { 0UL, \
                            NULL, \
                            NULL, \
                            NULL, \
                            NULL, \
                            0, \
                            1, \
                            0, \
                            0, \
                            0UL, \
                            0x400, \
                            (int (*)(int))DLOG_4CH_init, \
                            (int (*)(int))DLOG_4CH_update }
#endif
         其初始化语句如下:
// Initialize DATALOG module       
    dlog.iptr1 = &DlogCh1; 
    dlog.iptr2 = &DlogCh2;
    dlog.iptr3 = &DlogCh3;
    dlog.iptr4 = &DlogCh4;
    dlog.trig_value = 0x01;
    dlog.size = 0x400;
    dlog.prescalar = 1;
    dlog.init(&dlog);

  • 请您看一下下面路径下的文档

    tidcs/DMC/c28/v32x/lib/doc/data_log.pdf

    This module stores the real-time values of four user selectable software Q15 variables in the data RAM provided on the 28xx DSP. Four variables are selected by configuring four module inputs, iptr1, iptr2, iptr3 and iptr4, point to the address of the four variables. The starting addresses of the four RAM locations, where the data values are stored, are set to DLOG_4CH_buff1, DLOG_4CH_buff2, DLOG_4CH_buff3, and DLOG_4CH_buff4. The DATALOG buffer size, prescalar, and trigger value are also configurable.