# This is the register Config 0x8000 variable Config 0 variable Config.Monitor 0 variable Config.TRnEnable 0 variable Config.TRnRdOutEnable 0 variable Config.TRPolarity 0 variable Config.TestMode 0 proc GetConfig {} { variable Config variable Config.Monitor variable Config.TRnEnable variable Config.TRnRdOutEnable variable Config.TRPolarity variable Config.TestMode set Config [ReadRegister Config] set Config.TestMode [expr ($Config >> 3) & 1] set Config.TRPolarity [expr ($Config >> 6) & 1] set Config.TRnRdOutEnable [expr ($Config >> 11) & 1] set Config.TRnEnable [expr ($Config >> 12) & 1] set Config.Monitor [expr ($Config >> 28) & 15] } proc SetConfig {} { variable Config variable Config.Monitor variable Config.TRnEnable variable Config.TRnRdOutEnable variable Config.TRPolarity variable Config.TestMode set Config [expr \ ([set Config.TestMode] << 3) + \ (1 << 4) + \ ([set Config.TRPolarity] << 6) + \ (1 << 8) + \ ([set Config.TRnRdOutEnable] << 11) + \ ([set Config.TRnEnable] << 12) + \ ([set Config.Monitor] << 28) \ ] WriteRegister Config $Config } proc DrawConfig {} { set html "" append html "
" append html "
| Test Mode | " append html "TR Trigger Polarity | " append html "TRn Readout Enable | " append html "Trigger Enable | " append html "Monitor Signal | " append html "
| " append html "" append html " | " # Bit 6: Trigger Polarity append html "" append html "" append html " | " # Bit 11 : Signal TRn Readout Enable append html "" append html "" append html " | " # Bit 12: TRn Trigger Enable : append html "" append html "" append html " | " # Bit 31:28: Monitor Signal : append html "" append html "" append html " | " append html "