pikapython/package/PikaStdDevice/PikaStdDevice.py

314 lines
4.6 KiB
Python
Raw Normal View History

2021-10-01 20:00:15 +08:00
from PikaObj import *
class GPIO(TinyObj):
2022-04-07 22:57:59 +08:00
def __init__(self):
2021-12-10 23:02:40 +08:00
pass
2022-04-07 22:57:59 +08:00
def init(self):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def setPin(self, pinName: str):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def setId(self, id: int):
2022-02-26 14:40:56 +08:00
pass
2022-04-07 22:57:59 +08:00
def getId(self) -> int:
2022-02-26 14:40:56 +08:00
pass
2022-04-07 22:57:59 +08:00
def getPin(self) -> str:
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def setMode(self, mode: str):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def getMode(self) -> str:
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def setPull(self, pull: str):
2021-10-25 20:16:08 +08:00
pass
2022-04-07 22:57:59 +08:00
def enable(self):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def disable(self):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def high(self):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def low(self):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def read(self) -> int:
2021-10-25 20:16:08 +08:00
pass
2021-10-01 20:00:15 +08:00
# need be overrid
2022-04-07 22:57:59 +08:00
def platformHigh(self):
2021-10-01 20:00:15 +08:00
pass
# need override
2022-04-07 22:57:59 +08:00
def platformLow(self):
2021-10-01 20:00:15 +08:00
pass
# need override
2022-04-07 22:57:59 +08:00
def platformEnable(self):
2021-10-01 20:00:15 +08:00
pass
# need override
2022-04-07 22:57:59 +08:00
def platformDisable(self):
2021-10-01 20:00:15 +08:00
pass
# need override
2022-04-07 22:57:59 +08:00
def platformSetMode(self):
2021-10-01 20:00:15 +08:00
pass
2021-10-25 20:16:08 +08:00
# need override
2022-04-07 22:57:59 +08:00
def platformRead(self):
2021-10-25 20:16:08 +08:00
pass
2021-10-01 20:00:15 +08:00
class Time(TinyObj):
# need override
2022-04-07 22:57:59 +08:00
def sleep_s(self, s: int):
2021-10-01 20:00:15 +08:00
pass
# need override
2022-04-07 22:57:59 +08:00
def sleep_ms(self, ms: int):
2021-10-01 20:00:15 +08:00
pass
class ADC(TinyObj):
2022-04-07 22:57:59 +08:00
def __init__(self):
2021-12-10 23:02:40 +08:00
pass
2022-04-07 22:57:59 +08:00
def init(self):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def setPin(self, pin: str):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def enable(self):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def disable(self):
pass
2022-04-07 22:57:59 +08:00
def read(self) -> float:
2021-10-01 20:00:15 +08:00
pass
# need override
2022-04-07 22:57:59 +08:00
def platformEnable(self):
2021-10-01 20:00:15 +08:00
pass
# need override
2022-04-07 22:57:59 +08:00
def platformRead(self):
2021-10-01 20:00:15 +08:00
pass
# need override
2022-04-07 22:57:59 +08:00
def platformDisable(self):
pass
2021-10-01 20:00:15 +08:00
class UART(TinyObj):
2022-04-07 22:57:59 +08:00
def __init__(self):
2021-12-10 23:02:40 +08:00
pass
2022-04-07 22:57:59 +08:00
def init(self):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def setBaudRate(self, baudRate: int):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def setId(self, id: int):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def enable(self):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def disable(self):
pass
2022-04-07 22:57:59 +08:00
def write(self, data: str):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def read(self, length: int) -> str:
2021-10-01 20:00:15 +08:00
pass
# need override
2022-04-07 22:57:59 +08:00
def platformEnable(self):
2021-10-01 20:00:15 +08:00
pass
# need override
2022-04-07 22:57:59 +08:00
def platformWrite(self):
2021-10-01 20:00:15 +08:00
pass
# need override
2022-04-07 22:57:59 +08:00
def platformRead(self):
2021-10-01 20:00:15 +08:00
pass
# need override
2022-04-07 22:57:59 +08:00
def platformDisable(self):
pass
2021-10-01 20:00:15 +08:00
class IIC(TinyObj):
2022-04-07 22:57:59 +08:00
def __init__(self):
2021-12-10 23:02:40 +08:00
pass
2022-04-07 22:57:59 +08:00
def init(self):
pass
2022-04-07 22:57:59 +08:00
def setPinSCL(self, pin: str):
pass
2022-04-07 22:57:59 +08:00
def setPinSDA(self, pin: str):
pass
2022-04-07 22:57:59 +08:00
def setDeviceAddr(self, addr: int):
pass
2022-04-07 22:57:59 +08:00
def enable(self):
pass
2022-04-07 22:57:59 +08:00
def disable(self):
pass
2022-04-07 22:57:59 +08:00
def write(self, addr: int, data: str):
pass
2022-04-07 22:57:59 +08:00
def read(self, addr: int, length: int) -> str:
pass
# need override
2022-04-07 22:57:59 +08:00
def platformEnable(self):
pass
# need override
2022-04-07 22:57:59 +08:00
def platformWrite(self):
pass
# need override
2022-04-07 22:57:59 +08:00
def platformRead(self):
pass
# need override
2022-04-07 22:57:59 +08:00
def platformDisable(self):
pass
2021-10-01 20:00:15 +08:00
class PWM(TinyObj):
2022-04-07 22:57:59 +08:00
def __init__(self):
2021-12-10 23:02:40 +08:00
pass
2022-04-07 22:57:59 +08:00
def init(self):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def setName(self, name: str):
pass
2022-04-07 22:57:59 +08:00
def getName(self) -> str:
pass
2022-04-07 22:57:59 +08:00
def setChannel(self, ch: int):
pass
2022-04-07 22:57:59 +08:00
def getChannel(self) -> int:
pass
2022-04-07 22:57:59 +08:00
def setPin(self, pin: str):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def setFrequency(self, freq: int):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def setFreq(self, freq: int):
pass
2022-04-07 22:57:59 +08:00
def setDuty(self, duty: float):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def enable(self):
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def disable(self):
pass
2022-04-07 22:57:59 +08:00
def getFrequency(self) -> int:
2021-10-01 20:00:15 +08:00
pass
2022-04-07 22:57:59 +08:00
def getDuty(self) -> float:
2021-10-01 20:00:15 +08:00
pass
# need override
2022-04-07 22:57:59 +08:00
def platformEnable(self):
2021-10-01 20:00:15 +08:00
pass
# need override
2022-04-07 22:57:59 +08:00
def platformSetFrequency(self):
2021-10-01 20:00:15 +08:00
pass
# need override
2022-04-07 22:57:59 +08:00
def platformSetDuty(self):
2021-10-01 20:00:15 +08:00
pass
# need override
2022-04-07 22:57:59 +08:00
def platformDisable(self):
pass
2022-04-14 23:13:17 +08:00
class SPI(TinyObj):
def __init__(self):
pass
def setPinSCK(self, pin: str):
pass
def setPinMOSI(self, pin: str):
pass
def setPinMISO(self, pin: str):
pass
def setName(self, name: str):
pass
def setId(self, id: int):
pass
def setPolarity(self, polarity: int):
pass
def setPhase(self, phase: int):
pass
def setBaudRate(self, baudRate: int):
pass
def enable(self):
pass
def disable(self):
pass
def write(self, data: str):
pass
def read(self, length: int) -> str:
pass
# need override
def platformEnable(self):
pass
# need override
def platformWrite(self):
pass
# need override
def platformRead(self):
pass
# need override
def platformDisable(self):
pass