Skip to content

Commit 03d2f1f

Browse files
committed
examples/sysfsgpio: add invert (active-low) attribute to examples
Add the new invert (active-low) attribute to the examples and add calls to the new invert method Signed-off-by: Perry Melange <[email protected]>
1 parent 8e68f4d commit 03d2f1f

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
desk:
2-
GpioDigitalOutputDriver:
2+
SysfsGPIO:
33
index: 60
4+
invert: False

examples/sysfsgpio/import-gpio.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ targets:
55
name: gpio
66
drivers:
77
GpioDigitalOutputDriver: {}
8-
options:
9-
coordinator_address: 'labgrid:20408'

examples/sysfsgpio/sysfsgpio.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
StepLogger.start()
1414

1515
t = Target("main")
16-
r = SysfsGPIO(t, name=None, index=60)
16+
r = SysfsGPIO(t, name=None, index=60, invert=True)
1717
d = GpioDigitalOutputDriver(t, name=None)
1818

1919
p = t.get_driver("DigitalOutputProtocol")
2020
print(t.resources)
21+
print("Testing IO")
2122
p.set(True)
2223
print(p.get())
2324
time.sleep(2)

examples/sysfsgpio/sysfsgpio_remote.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
p = t.get_driver("DigitalOutputProtocol")
1717
print(t.resources)
18+
print("Testing IO")
1819
p.set(True)
1920
print(p.get())
2021
time.sleep(2)

tests/test_sysfsgpioagent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ def set(self, val):
3636
super().set(val)
3737

3838
def test_instantiation(self):
39-
gpio_line = TestGpioAgent.GpioDigitalOutputMock(index=13)
39+
gpio_line = TestGpioAgent.GpioDigitalOutputMock(index=13, invert=False)
4040
assert isinstance(gpio_line, GpioDigitalOutput)
4141

4242
def test_set(self):
43-
gpio_line = TestGpioAgent.GpioDigitalOutputMock(index=13)
43+
gpio_line = TestGpioAgent.GpioDigitalOutputMock(index=13, invert=False)
4444
for val in [True, False, True, False]:
4545
gpio_line.set(val)
4646
assert gpio_line.get() == val

0 commit comments

Comments
 (0)