{"action":"created","issue":{"url":"https://api.github.com/repos/micropython/micropython/issues/1642","labels_url":"https://api.github.com/repos/micropython/micropython/issues/1642/labels{/name}","comments_url":"https://api.github.com/repos/micropython/micropython/issues/1642/comments","events_url":"https://api.github.com/repos/micropython/micropython/issues/1642/events","html_url":"https://github.com/micropython/micropython/issues/1642","id":118521586,"number":1642,"title":"Implement Asynchronous UART TX","user":{"login":"ryannathans","id":1307375,"avatar_url":"https://avatars.githubusercontent.com/u/1307375?v=3","gravatar_id":"","url":"https://api.github.com/users/ryannathans","html_url":"https://github.com/ryannathans","followers_url":"https://api.github.com/users/ryannathans/followers","following_url":"https://api.github.com/users/ryannathans/following{/other_user}","gists_url":"https://api.github.com/users/ryannathans/gists{/gist_id}","starred_url":"https://api.github.com/users/ryannathans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryannathans/subscriptions","organizations_url":"https://api.github.com/users/ryannathans/orgs","repos_url":"https://api.github.com/users/ryannathans/repos","events_url":"https://api.github.com/users/ryannathans/events{/privacy}","received_events_url":"https://api.github.com/users/ryannathans/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-24T02:54:37Z","updated_at":"2015-11-24T08:25:59Z","closed_at":null,"body":"I am attempting to write large blocks (eg: 2048 bytes) of data to the UART at low baudrates whilst attempting to execute other code. I've discovered that the UART TX is actually blocking until the write is completed. This is a bit of a pain...\r\n\r\nThis issue is for creating an asynchronous write option for UART. Related to #1533 \r\n\r\nProbably either interrupt or DMA driven. Should ideally behave like the UART RX does, with a definable buffer in python code, or block as it currently does.\r\n\r\nReading related issues it seems like #1422 has had some success using DMA. Personally, I don't require the callback as I'm not streaming from a file, just an existing bytearray in memory.\r\n\r\nI haven't had a chance to read the huge threads on some of the issues I've found so I'm not 100% up to date yet..."},"comment":{"url":"https://api.github.com/repos/micropython/micropython/issues/comments/159193169","html_url":"https://github.com/micropython/micropython/issues/1642#issuecomment-159193169","issue_url":"https://api.github.com/repos/micropython/micropython/issues/1642","id":159193169,"user":{"login":"danicampora","id":7749335,"avatar_url":"https://avatars.githubusercontent.com/u/7749335?v=3","gravatar_id":"","url":"https://api.github.com/users/danicampora","html_url":"https://github.com/danicampora","followers_url":"https://api.github.com/users/danicampora/followers","following_url":"https://api.github.com/users/danicampora/following{/other_user}","gists_url":"https://api.github.com/users/danicampora/gists{/gist_id}","starred_url":"https://api.github.com/users/danicampora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danicampora/subscriptions","organizations_url":"https://api.github.com/users/danicampora/orgs","repos_url":"https://api.github.com/users/danicampora/repos","events_url":"https://api.github.com/users/danicampora/events{/privacy}","received_events_url":"https://api.github.com/users/danicampora/received_events","type":"User","site_admin":false},"created_at":"2015-11-24T08:25:59Z","updated_at":"2015-11-24T08:25:59Z","body":"Hi,\r\n\r\nRegarding asynchronous writes, this has been considered before, and it's somewhat planned to be added to the new hardware API. For the UART, it might be as follows:\r\n\r\n```python\r\nuart.write(buf, async=True)\r\n```\r\n\r\nand if a callback notification is desired, previously you should have done:\r\n\r\n```python\r\nuart.irq(handler=some_handler, trigger=UART.TX_DONE, priority=...)\r\n```\r\n"}}