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.

[参考译文] TMDSDSK6713:按下 switch 后发生什么情况?(程序如何工作)

Guru**** 2589225 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/592279/tmdsdsk6713-what-happened-after-pressing-switch-how-program-works

器件型号:TMDSDSK6713

您好,  

  我想了解按下开关后发生了什么情况?

在我的项目中,我使用 #include 库。

为了便于理解、当我在"dsk6713_dp.c"文件中看到时、函数为 DSK_DIP_Get

uint32 DSK6713_DIP_Get (uint32 dipNum)

/*检查 dipNum 的边界*/
IF (dipNum >= 4)
返回(uint32)-1;

/*读取 DIP 开关*/
如果((DSK6713_rget (DSK6713_USER_REG)&(0x10 << dipNum))== 0)
返回0;
其他
返回1;

和函数 DSK6713为:

UINT8 DSK6713_rget (Int16寄存器)

uint8 *pdata;

/*返回寄存器的低8位*/
pdata =(uint8 *)(DSK6713_CPLD _BASE + RegNum);
返回(* pdata & 0xff);

我编写了脚本并对其进行调试,但这似乎是错误的?  

这是它的脚本


#include "dsk6713_AIC23.h"//编解码器、DSK 的支持文件
#include "dsk6713_led.h"
#include "dsk6713_dp.h"
#include
#include
#include
#include

uint32 fs = DSK6713_AIC23_FREQ_8kHz;//设置采样率

void main()

int press_sw_0;
int dipNum;

CSL_init();

DSK6713_DIP_init ();//init 来自 BSL 的 DIP

press_sw_0 = 1;// ko an
dipNum=1;
while (1)//infinite loop[类型文本]

uint8 *pdata_debug;

pdata_debug =(uint8 *)(DSK6713_CPLD_BASE + DSK6713_USER_REG);
printf ("*pdata_debug =%d\n"、*pdata_debug);
printf ("*pdata & 0xff =%d\n"、*pdata_debug & 0xff);
printf ("((DSK6713_rget (DSK6713_USER_REG)&(0x10 << dipNum))=%d\n"、(* pdat_debug & 0xff)&(0x10 <<dipNum));

如何解释?

非常感谢!