TI中文支持网
TI专业的中文技术问题搜集分享网站

dm365 h3a的aew不能从驱动获取statistics

环境:DM365开发板 dvsdk_dm365_4_02_00_06,linux-driver-examples-psp03.01.01.38,linux-2.6.32.17-psp03.01.01.39

我配置了h3a的aew,模仿ti提供的h3a的demo写了一个aew的调用函数,函数如下:

int aew_Functional(void)
{
struct aew_configuration *config;
int result;
int fd;
unsigned short int *k11;
int count = 0;
FILE *fp1;

printf("\ninto aew_Functional\n");
buffer_stat = (void *)malloc(buff_size);
fp1 = fopen("aew_samp_dm365.txt", "w");

/* Open AEW Driver */
fd = open(AEW_DRIVER_NAME, O_RDWR);
if (fd < 0) {
printf("\n Error in opening device file");
return -1;

}
/* Allocate Memory For Configuration Structure */
config = (struct aew_configuration *)
malloc(sizeof(struct aew_configuration));
config->window_config.width = 100;
config->window_config.height = 8;
config->window_config.hz_line_incr = 8;
config->window_config.vt_line_incr = 8;
config->window_config.vt_cnt = 12;
config->window_config.hz_cnt = 31;
config->window_config.vt_start = 12;
config->window_config.hz_start = 128;
/* Configure black window parameter */
config->blackwindow_config.height = 2;
config->blackwindow_config.vt_start = 11;
/* Enable ALaw */
config->alaw_enable = H3A_AEW_DISABLE;
/* Set Saturation limit */
config->saturation_limit = 100;

/* Call AEW_S_PARAM to set Parameters */
buff_size = ioctl(fd, AEW_S_PARAM, config);

printf("\naew_Functional buff_size is %d\n", buff_size);

/* Call AEW_ENABLE to enable AEW Engine */
result = ioctl(fd, AEW_ENABLE); printf("\nioctl(fd, AEW_ENABLE) result is %d\n",result);

printf("\naew_Functional fd is %d,buffer_stat is 0x%x,buff_size is %d\n", fd,buffer_stat,buff_size);

result = read(fd, (void *)buffer_stat, buff_size);
//printf("\n RESULT OF READ %d", result);
if (result < 0) {
printf("\n error in StartLoop");
printf("\n Read Failed");
return -1;
}
if (result > 0) {
printf("\n Output File : aew_samp_dm365.txt");

k11 = (unsigned short int *)buffer_stat;

for (count = 0; count < buff_size / 2; count++) {
fprintf(fp1, "\n%d", (unsigned short int)k11[count]);
printf("\n%d", (unsigned short int)k11[count]);
/*printf("\n@%d@",(unsigned short int)k11[count]);*/
}

} else {
printf("\n error in StartLoop");
printf("\nNOT ABLE TO READ");

}

if (config)
free(config);
/* Close Driver File */
close(fd);
return 0;
}

我运行该函数时,不能read到statistics(如函数红色部分)。

随后,我查看了dm365_aew.c,发现static irqreturn_t aew_isr(int irq, void *dev_id)没有被调用。请问该isr函数为什么没有被调用呢?????谢谢。

kooking:

buffer_stat = (void *)malloc(buff_size);…./* Call AEW_S_PARAM to set Parameters */buff_size = ioctl(fd, AEW_S_PARAM, config);

buff_size发生了变化是不是重新分配一下更好

jeffery chen:

回复 kooking:

非常感谢!!如您所述,我确实犯了这个低级错误。

我现在可以获取到statistics,但是不知道statistics代表什么意思??文档中也没有介绍。请kooking不吝赐教哈。

附件为statistics值。谢谢

 

jeffery chen:

回复 kooking:

hi kooking:

非常感谢,可能对于该统计需要与TI签NDA协议才能明白该意义,我发个帖子问一下TI的工程师。谢谢

赞(0)
未经允许不得转载:TI中文支持网 » dm365 h3a的aew不能从驱动获取statistics
分享到: 更多 (0)