🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    callbacks for SPI/UART?

    ESPHome
    1
    1
    45
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      Lippy
      last edited by

      Hi folks!

      I am starting a project and already made some progress with my software. I am using SPI and UART (among other stuff).

      HardwareSerial provides an OnReceiveCallback. Good. But what about Transmitting? HardwareSerial.Write transmits data. Or better, it buffers it in the background and transmits it. When will this be finished? How can I detect an ongoing/finished transmission? Why is there no OnTransmitFinishedCallback?

      Similar with SPI:
      this enables CS line, transmits data and disables CS line.
      30ba4700-d40d-41e4-b9ed-de26cdb3e20f-image.png

      But this is blocking. Even if SPI frequencies are high and such transmissions are only taking a few 100microseconds. Why is this not done similiar like UART with background transmission and OnReceivedCallback or similar?

      In HardwareSerial I was able to find this OnReceiveCallback after digging a lot in the provided libs. But what about SPI?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post