--- /dev/null
+#!/usr/bin/env python3
+# Copyright (C) 2025 Bdale Garbee <bdale@gag.com>. GPLv3+
+
+import gpiod
+import signal
+import sys
+import time
+
+from gpiod.line import Direction, Value
+
+def handler(signum, frame):
+ print('Ctrl+C pressed, shutting down cleanly.')
+ set_line_values(
+ "/dev/gpiochip0",
+ { 4: Value.INACTIVE, # indicate 'not ready' to LPC
+ 20: Value.INACTIVE, # turn continuity LED off
+ 21: Value.INACTIVE, # turn armed LED off
+ 25: Value.ACTIVE # put ADS8688 in reset
+ }
+ )
+ exit(1)
+
+signal.signal(signal.SIGINT, handler)
+
+def set_line_values(chip_path, line_values):
+ value_str = {Value.ACTIVE: "Active", Value.INACTIVE: "Inactive"}
+
+ request = gpiod.request_lines(
+ chip_path,
+ consumer=sys.argv[0],
+ config={
+ tuple(line_values.keys()): gpiod.LineSettings(direction=Direction.OUTPUT)
+ },
+ )
+ request.set_values(line_values)
+
+if __name__ == "__main__":
+ try:
+ # initialize hardware
+ set_line_values(
+ "/dev/gpiochip0",
+ {25: Value.ACTIVE, # take ADS8688 out of reset
+ 4: Value.ACTIVE, # indicate 'ready' to LPC
+ 20: Value.ACTIVE, # turn continuity LED on
+ 21: Value.INACTIVE # turn armed LED off
+ }
+ )
+ # Iterate until ctrl/c
+ while True:
+ print('tick')
+ time.sleep(1)
+
+ except OSError as ex:
+ print(ex, "\nD'oh!")
+