6This script demonstrates reading of GPRs using readRegister() and
7SFRs with bitfields using method evaluate().
8It reads from a register specified in command line and prints its value.
11import isystem.connect
as ic
18def unsigned64(x: int) -> int:
20 This function performs a kind of cast from signed 64-bint int to unsigned one.
22 return x & 0xffffffffffffffff
26cmgr = ic.ConnectionMgr()
27cmgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
29debugCtrl = ic.CDebugFacade(cmgr)
32 print(
"Usage : ", sys.argv[0],
"<general purpose register name>")
33 print(
"Example: ", sys.argv[0],
"R0")
36registerName = sys.argv[1]
37value = debugCtrl.readRegister(ic.IConnectDebug.fRealTime, registerName)
38print(registerName,
'=', hex(unsigned64(value.getLong())))
41registerName =
'@GPIOA\\ODR'
42value = debugCtrl.evaluate(ic.IConnectDebug.fRealTime, registerName)
43print(registerName,
'=', hex(unsigned64(value.getLong())))
46registerName =
'@GPIOA\\LCKR\\LCKK'
47value = debugCtrl.evaluate(ic.IConnectDebug.fRealTime, registerName)
48print(registerName,
'=', hex(unsigned64(value.getLong())))