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(): ...@@ -136,6 +136,16 @@ def RegLoopbackTest():
passCount = passCount + 1 passCount = passCount + 1
print("PASS [%d]" % (passCount)) 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: # PrintCliSyntax:
# #
...@@ -150,6 +160,7 @@ Valid tests (case sensitive): ...@@ -150,6 +160,7 @@ Valid tests (case sensitive):
- MultiBytePacketSend - MultiBytePacketSend
- MemLoopback - MemLoopback
- RegLoopback - RegLoopback
- ReadRegs
""" """
# #
...@@ -166,7 +177,8 @@ cliTest = sys.argv[1] ...@@ -166,7 +177,8 @@ cliTest = sys.argv[1]
testMapping = {'SingleBytePacketsSend' : [SingleBytePacketsSendTest], testMapping = {'SingleBytePacketsSend' : [SingleBytePacketsSendTest],
'MultiBytePacketSend' : [MultiBytePacketSendTest], 'MultiBytePacketSend' : [MultiBytePacketSendTest],
'MemLoopback' : [MemLoopbackTest], 'MemLoopback' : [MemLoopbackTest],
'RegLoopback' : [RegLoopbackTest]} 'RegLoopback' : [RegLoopbackTest],
'ReadRegs' : [ReadRegsTest]}
if cliTest not in testMapping: if cliTest not in testMapping:
sys.stderr.write('%s is not a valid test.\n' % (cliTest,)) sys.stderr.write('%s is not a valid test.\n' % (cliTest,))
PrintCliSyntax() 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