mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 01:51:53 +08:00
optional msd and atx
This commit is contained in:
@@ -43,18 +43,22 @@ def bcm() -> Generator[None, None, None]:
|
||||
|
||||
|
||||
def set_output(pin: int, initial: bool=False) -> int:
|
||||
assert pin > 0, pin
|
||||
GPIO.setup(pin, GPIO.OUT, initial=initial)
|
||||
return pin
|
||||
|
||||
|
||||
def set_input(pin: int) -> int:
|
||||
assert pin > 0, pin
|
||||
GPIO.setup(pin, GPIO.IN)
|
||||
return pin
|
||||
|
||||
|
||||
def read(pin: int) -> bool:
|
||||
assert pin > 0, pin
|
||||
return bool(GPIO.input(pin))
|
||||
|
||||
|
||||
def write(pin: int, flag: bool) -> None:
|
||||
assert pin > 0, pin
|
||||
GPIO.output(pin, flag)
|
||||
|
||||
Reference in New Issue
Block a user