Skip to content
Snippets Groups Projects
Commit 2acca144 authored by Mitchel Humpherys's avatar Mitchel Humpherys
Browse files

lrdp-v2: register.py: add doctest for single-bit fields

The Register class supports single-bit field definitions. Add a doctest
for example purposes and regression testing.

Change-Id: Ib04762aca8cb00256e16c29ac2ab71d47d0c06da
parent a2510954
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,14 @@ class Register(object):
>>> abc.other = 0x3
>>> hex(abc.value)
'0x31'
>>> abc.add_field("just_a_bit", (4, 4))
>>> abc.just_a_bit
1
>>> abc.just_a_bit = 0
>>> abc.just_a_bit
0
>>> hex(abc.value)
'0x21'
>>> abc.value = 0
>>> abc.value
0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment