pikapython/port/linux/package/pikascript/PikaStdDevice.pyi

457 lines
7.0 KiB
Python
Raw Normal View History

2021-10-01 20:00:15 +08:00
from PikaObj import *
2022-05-24 13:55:39 +08:00
class BaseDev(TinyObj):
def addEventCallBack(self, eventCallback: any): ...
# need override
2022-07-28 18:23:25 +08:00
def platformGetEventId(self): ...
class GPIO(BaseDev):
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(BaseDev):
def __init__(self):
pass
2022-06-04 15:33:58 +08:00
2021-10-01 20:00:15 +08:00
# 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
2022-06-04 16:28:36 +08:00
# need override
def platformGetTick():
pass
2022-07-28 18:23:25 +08:00
def sleep(self, s: float):
pass
def time(self) -> float:
pass
def time_ns(self) -> int:
pass
def gmtime(self, unix_time: float):
pass
def localtime(self, unix_time: float):
pass
def mktime(self) -> int:
pass
2022-06-04 15:33:58 +08:00
def asctime(self):
pass
2022-06-04 15:33:58 +08:00
def ctime(self, unix_time: float):
pass
2021-10-01 20:00:15 +08:00
class ADC(BaseDev):
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(BaseDev):
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
def writeBytes(self, data: bytes, length: int):
pass
2022-04-07 22:57:59 +08:00
def read(self, length: int) -> str:
2021-10-01 20:00:15 +08:00
pass
def readBytes(self, length: int) -> bytes:
pass
2021-10-01 20:00:15 +08:00
# 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
def platformWriteBytes(self):
pass
2021-10-01 20:00:15 +08:00
# need override
2022-04-07 22:57:59 +08:00
def platformRead(self):
2021-10-01 20:00:15 +08:00
pass
# need override
def platformReadBytes(self):
pass
# need override
2022-04-07 22:57:59 +08:00
def platformDisable(self):
pass
2021-10-01 20:00:15 +08:00
2022-05-24 13:55:39 +08:00
class IIC(BaseDev):
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
def writeBytes(self, addr: int, data: bytes, length: int):
pass
2022-04-07 22:57:59 +08:00
def read(self, addr: int, length: int) -> str:
pass
def readBytes(self, addr: int, length: int) -> bytes:
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
def platformWriteBytes(self):
pass
# need override
2022-04-07 22:57:59 +08:00
def platformRead(self):
pass
# need override
def platformReadBytes(self):
pass
# need override
2022-04-07 22:57:59 +08:00
def platformDisable(self):
pass
2022-05-24 13:55:39 +08:00
class PWM(BaseDev):
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(BaseDev):
2022-04-14 23:13:17 +08:00
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 writeBytes(self, data: bytes, length: int):
pass
2022-04-14 23:13:17 +08:00
def read(self, length: int) -> str:
pass
def readBytes(self, length: int) -> bytes:
pass
2022-04-14 23:13:17 +08:00
# need override
def platformEnable(self):
pass
# need override
def platformWrite(self):
pass
# need override
def platformWriteBytes(self):
pass
2022-04-14 23:13:17 +08:00
# need override
def platformRead(self):
pass
# need override
def platformReadBytes(self):
pass
2022-04-14 23:13:17 +08:00
# need override
def platformDisable(self):
pass
2022-04-15 14:50:27 +08:00
class CAN(BaseDev):
2022-04-15 14:50:27 +08:00
def __init__(self):
pass
def setName(self, name: str):
pass
def setId(self, id: int):
pass
def setBaudRate(self, baudRate: int):
pass
def setMode(self, mode: str):
pass
def enable(self):
pass
def disable(self):
pass
def write(self, data: str):
pass
def writeBytes(self, data: bytes, length: int):
pass
2022-04-15 14:50:27 +08:00
def read(self, length: int) -> str:
pass
def readBytes(self, length: int) -> bytes:
pass
2022-05-24 13:55:39 +08:00
def addFilter(self, id: int, ide: int, rtr: int, mode: int, mask: int, hdr: int):
2022-04-15 14:53:25 +08:00
pass
2022-04-15 14:50:27 +08:00
# need override
def platformEnable(self):
pass
# need override
def platformWrite(self):
pass
# need override
def platformWriteBytes(self):
pass
2022-04-15 14:50:27 +08:00
# need override
def platformRead(self):
pass
# need override
def platformReadBytes(self):
pass
2022-04-15 14:50:27 +08:00
# need override
def platformDisable(self):
pass