# This is the module register Front Panel I/O Control 0x811c variable FPIO 0 variable FPIO.B15 0 variable FPIO.B14 0 variable FPIO.B6 0 variable FPIO.B5 0 variable FPIO.B4 0 variable FPIO.B3 0 variable FPIO.B2 0 variable FPIO.B1 0 variable FPIO.B0 0 proc GetFPIO {} { variable FPIO variable FPIO.B15 variable FPIO.B14 variable FPIO.B6 variable FPIO.B5 variable FPIO.B4 variable FPIO.B3 variable FPIO.B2 variable FPIO.B1 variable FPIO.B0 set FPIO [ReadRegister FPIOControl] set FPIO.B0 [expr $FPIO & 1] set FPIO.B1 [expr ($FPIO >> 1) & 1] set FPIO.B2 [expr ($FPIO >> 2) & 1] set FPIO.B3 [expr ($FPIO >> 3) & 1] set FPIO.B4 [expr ($FPIO >> 4) & 1] set FPIO.B5 [expr ($FPIO >> 5) & 1] set FPIO.B6 [expr ($FPIO >> 6) & 3] set FPIO.B14 [expr ($FPIO >> 14) & 1] set FPIO.B15 [expr ($FPIO >> 15) & 1] } proc SetFPIO {} { variable FPIO variable FPIO.B15 variable FPIO.B14 variable FPIO.B6 variable FPIO.B5 variable FPIO.B4 variable FPIO.B3 variable FPIO.B2 variable FPIO.B1 variable FPIO.B0 set FPIO [expr \ ([set FPIO.B15] << 15) | \ ([set FPIO.B14] << 14) | \ ([set FPIO.B6] << 6) | \ ([set FPIO.B5] << 5) | \ ([set FPIO.B4] << 4) | \ ([set FPIO.B3] << 3) | \ ([set FPIO.B2] << 2) | \ ([set FPIO.B1] << 1) | \ ([set FPIO.B0])] WriteRegister FPIOControl $FPIO } proc DrawFPIO {} { set html "" append html "
" append html "
| TRGOUT | " append html "TRGOUT Test Mode | " append html "LVDS GPIO Mode | " append html "LVDS I/O 15..12 | " append html "LVDS I/O 11..8 | " append html "LVDS I/O 7..4 | " append html "LVDS I/O 3..0 | " append html "LVDS GPIO Output | " append html "LEMO I/O | " append html "
| " append html "" append html " | " # Bit 14: append html "" append html "" append html " | " # Bit 6/7 append html "" append html "" append html " | " # Bit 5 append html "" append html "" append html " | " # Bit 4: append html "" append html "" append html " | " # Bit 3: append html "" append html "" append html " | " # Bit 2: append html "" append html "" append html " | " # Bit 1: append html "" append html "" append html " | " # Bit 0: append html "" append html "" append html " | " append html "