ZHCUC16A May 2024 – September 2024
LMH1239 GUI 支持为 EVM 编写 JavaScript 脚本。用户可以通过按 Upload Script File 按钮上传脚本。用户可以按 Run 按钮来执行当前在文件输入中选择的脚本,然后按 Stop 按钮来终止当前脚本。支持的命令包括 read、write 和 log。用户只能对 Register Map 页面中的寄存器应用 read 和 write 命令。如需了解相关示例,请参阅下面的代码块。
/** Texas Instruments Javascript sample script for reading registers, writing registers and checking CDR lock.*/
const SCRIPT_START_MESSAGE = 'Script Started';
const SCRIPT_END_MESSAGE = 'Script Ended';
function main() {
/* Log to text file */
log(SCRIPT_START_MESSAGE);
/* Select the CDR Registers Page by writing to register 0xFF (channel_control4) */
write('channel_control_4', 0x04);
/* Defines a variable */
let CDRLockValue;
/* Read the CDR lock value register and log the value. If the CDR is locked the output will read 0x39 (57 in decimal).*/
CDRLockValue = read("channel_sm_1");
log("The CDR lock value register reads " + CDRLockValue + " in decimal");
/* Log to text file */
log(SCRIPT_END_MESSAGE)
}