Commit 4aa6dcd1 authored by Michael J. Lyons's avatar Michael J. Lyons

Adding ReadReg test script, which reads and prints the values of all sixteen spi registers

parent 77852efa
......@@ -136,6 +136,16 @@ def RegLoopbackTest():
passCount = passCount + 1
print("PASS [%d]" % (passCount))
#
# ReadRegsTest
#
# Reads out the value of all registers
#
def ReadRegsTest():
for regId in range(16):
regVal = spi.ReadReg(regId)
print("Reg%d = 0x%08x" % (regId, regVal))
#
# PrintCliSyntax:
#
......@@ -150,6 +160,7 @@ Valid tests (case sensitive):
- MultiBytePacketSend
- MemLoopback
- RegLoopback
- ReadRegs
"""
#
......@@ -166,7 +177,8 @@ cliTest = sys.argv[1]
testMapping = {'SingleBytePacketsSend' : [SingleBytePacketsSendTest],
'MultiBytePacketSend' : [MultiBytePacketSendTest],
'MemLoopback' : [MemLoopbackTest],
'RegLoopback' : [RegLoopbackTest]}
'RegLoopback' : [RegLoopbackTest],
'ReadRegs' : [ReadRegsTest]}
if cliTest not in testMapping:
sys.stderr.write('%s is not a valid test.\n' % (cliTest,))
PrintCliSyntax()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment