User Tools

Site Tools


module:micropython:esp32uart:esp32uart

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
module:micropython:esp32uart:esp32uart [2021/12/19 12:27] – [Quell-Code] omdevelopmodule:micropython:esp32uart:esp32uart [2022/09/13 11:58] (current) – external edit 127.0.0.1
Line 14: Line 14:
 {{https://docs.micropython.org/en/latest/library/machine.UART.html#machine-uart | Esp32-Machine-Uart}} \\ {{https://docs.micropython.org/en/latest/library/machine.UART.html#machine-uart | Esp32-Machine-Uart}} \\
 {{https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki/uart#uartreadlinemax_len | Machine Class UART}} \\ {{https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/wiki/uart#uartreadlinemax_len | Machine Class UART}} \\
-==== Beschreibung ====+===== Version ===== 
 +{{:module:micropython:Esp32Uart:2112191237_Esp32Uart_01V01.zip | 2112191237_Esp32Uart_01V01.zip}} 
 + 
 +===== Beschreibung ====
 + 
 +**Ausgabe MicroPython-Terminal Esp32CheckUart.py** 
 +<code python> 
 +>>>Running ...Esp32CheckUart.py 
 +>>> *** Esp32CheckUart: begin 
 +CBUartOnTxLine[000 <command>
 +CBUartOnRxLine[000 <command>
 +CBUartOnTxLine[111 <command> <parameter0>
 +CBUartOnTxLine[222 <command> <parameter0> <parameter1>
 +CBUartOnRxLine[111 <command> <parameter0>
 +CBUartOnTxLine[333 <command> <parameter0> <parameter1> <parameter2>
 +CBUartOnRxLine[222 <command> <parameter0> <parameter1>
 +CBUartOnTxLine[444 <command> <parameter0> <parameter1> <parameter2> <parameter3>
 +CBUartOnRxLine[333 <command> <parameter0> <parameter1> <parameter2>
 +CBUartOnTxLine[555 <command>
 +CBUartOnRxLine[444 <command> <parameter0> <parameter1> <parameter2> <parameter3>
 +CBUartOnTxLine[666 <command> <parameter0>
 +CBUartOnRxLine[555 <command>
 +CBUartOnTxLine[777 <command> <parameter0> <parameter1>
 +CBUartOnRxLine[666 <command> <parameter0>
 +CBUartOnTxLine[888 <command> <parameter0> <parameter1> <parameter2>
 +CBUartOnRxLine[777 <command> <parameter0> <parameter1>
 +CBUartOnTxLine[999 <command> <parameter0> <parameter1> <parameter2> <parameter3>
 +CBUartOnRxLine[888 <command> <parameter0> <parameter1> <parameter2>
 +CBUartOnRxLine[999 <command> <parameter0> <parameter1> <parameter2> <parameter3>  
 +*** Esp32CheckUart: end 
 +>>> 
 +</code> 
  
-==== Quell-Code==== 
 **Main-Program: Esp32CheckUart.py** **Main-Program: Esp32CheckUart.py**
 <code python> <code python>
Line 167: Line 198:
 #     #    
 </code> </code>
 +
  
 **Library-Module: Thread.py** **Library-Module: Thread.py**
 <code python> <code python>
 +#
 +import time
 +import _thread as THR
 +#
 +# States - EStateThread :
 +stIdle = 0
 +stBusy = 1
 +stEnd = 2
 +#
 +class CThread():
 +    #
 +    def __init__(self, onstart, onbusy, onabort, onend):
 +        self.State = stIdle        
 +        self.Thread = None
 +        self.OnStart = onstart
 +        self.OnBusy = onbusy
 +        self.OnAbort = onabort
 +        self.OnEnd = onend
 +        return
 +    #
 +    def Start(self):
 +        self.State = stBusy
 +        if (None != self.OnStart):
 +            self.OnStart(self)
 +        self.ThreadID = THR.start_new_thread(self.CBOnExecute, [self])
 +        return    
 +    #
 +    def Abort(self):
 +        self.State = stEnd
 +        if (None != self.OnAbort):
 +            self.OnAbort(self)
 +        return
 +    #
 +    def CBOnExecute(self, thread):
 +        if (None != self.OnBusy):
 +            self.OnBusy(self)
 +        if (None != self.OnEnd):
 +            self.OnEnd(self)
 +        return
 +    #
 +#-------------------------------------------------------------
 +if ('__main__' == __name__):
 +    print('*** Check Thread: begin'       
 +    #
 +    # Thread = CThread(CBOnStart, CBOnBusy, CBOnAbort, CBOnEnd)
 +    # Thread.Start()
 +    # time.sleep(5.0)
 +    # Thread.Abort()
 +    #
 +    print('*** Check Thread: end')
 +#
 </code> </code>
 +
 +**Library-Module: Lines.py**
 +<code python>
 +#
 +# CLines : FirstIn-FirstOut
 +class CLines(list):
 +    #
 +    def __init__(self):
 +        self = []
 +    #
 +    def Count(self):
 +        return len(self)
 +    #
 +    def Push(self, line):
 +        self.append(line)
 +        return
 +    #
 +    def Pop(self):
 +        Line = ''
 +        if (0 < self.Count()):
 +            Line = self.pop(0)
 +        return Line
 +</code>
 +
 +**Library-Module: Define.py**
 +<code python>
 +#
 +ID_UART0      0
 +PIN_UART0_TX =  1 # USB
 +PIN_UART0_RX =  3 # USB
 +#
 +ID_UART1      1
 +PIN_UART1_RX = 25 #  9 - not usable 
 +PIN_UART1_TX = 26 # 10 - not usable 
 +#
 +ID_UART2      2
 +PIN_UART2_RX = 16
 +PIN_UART2_TX = 17
 +#
 +</code>
 +
 +
 +
 +
  
 ===== Entwicklung ===== ===== Entwicklung =====
module/micropython/esp32uart/esp32uart.1639913260.txt.gz · Last modified: 2021/12/19 13:27 (external edit)