pikapython/package/PikaStdDevice/PikaStdDevice.py

210 lines
2.8 KiB
Python
Raw Normal View History

2021-10-01 20:00:15 +08:00
from PikaObj import *
class GPIO(TinyObj):
2021-12-10 23:02:40 +08:00
def __init__():
pass
2021-10-01 20:00:15 +08:00
def init():
pass
def setPin(pinName: str):
pass
def getPin() -> str:
pass
def setMode(mode: str):
pass
def getMode() -> str:
pass
2021-12-10 23:02:40 +08:00
def setPull(pull: str):
2021-10-25 20:16:08 +08:00
pass
2021-10-01 20:00:15 +08:00
def enable():
pass
def disable():
pass
def high():
pass
def low():
pass
2021-12-10 23:02:40 +08:00
def read() -> int:
2021-10-25 20:16:08 +08:00
pass
2021-10-01 20:00:15 +08:00
# need be overrid
def platformHigh():
pass
# need override
def platformLow():
pass
# need override
def platformEnable():
pass
# need override
def platformDisable():
pass
# need override
def platformSetMode():
2021-10-01 20:00:15 +08:00
pass
2021-10-25 20:16:08 +08:00
# need override
def platformRead():
2021-10-25 20:16:08 +08:00
pass
2021-10-01 20:00:15 +08:00
class Time(TinyObj):
# need override
def sleep_s(s: int):
pass
# need override
def sleep_ms(ms: int):
pass
class ADC(TinyObj):
2021-12-10 23:02:40 +08:00
def __init__():
pass
2021-10-01 20:00:15 +08:00
def init():
pass
def setPin(pin: str):
pass
def enable():
pass
def read() -> float:
pass
# need override
def platformEnable():
2021-10-01 20:00:15 +08:00
pass
# need override
def platformRead():
2021-10-01 20:00:15 +08:00
pass
class UART(TinyObj):
2021-12-10 23:02:40 +08:00
def __init__():
pass
2021-10-01 20:00:15 +08:00
def init():
pass
def setBaudRate(baudRate: int):
pass
def setId(id: int):
pass
def enable():
pass
def write(data: str):
pass
def read(length: int) -> str:
pass
# need override
def platformEnable():
2021-10-01 20:00:15 +08:00
pass
# need override
def platformWrite():
2021-10-01 20:00:15 +08:00
pass
# need override
def platformRead():
2021-10-01 20:00:15 +08:00
pass
class IIC(TinyObj):
2021-12-10 23:02:40 +08:00
def __init__():
pass
def init():
pass
def setPinSCL(pin: str):
pass
def setPinSDA(pin: str):
pass
def setDeviceAddr(addr: int):
pass
def enable():
pass
def write(addr: int, data: str):
pass
def read(addr: int, length: int) -> str:
pass
# need override
def platformEnable():
pass
# need override
def platformWrite():
pass
# need override
def platformRead():
pass
2021-10-01 20:00:15 +08:00
class PWM(TinyObj):
2021-12-10 23:02:40 +08:00
def __init__():
pass
2021-10-01 20:00:15 +08:00
def init():
pass
def setPin(pin: str):
pass
def setFrequency(freq: int):
pass
def setDuty(duty: float):
pass
def enable():
pass
def getFrequency() -> int:
pass
def getDuty() -> float:
pass
# need override
def platformEnable():
2021-10-01 20:00:15 +08:00
pass
# need override
def platformSetFrequency():
2021-10-01 20:00:15 +08:00
pass
# need override
def platformSetDuty():
2021-10-01 20:00:15 +08:00
pass