{"action":"created","comment":{"url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/comments/45141343","id":45141343,"diff_hunk":"@@ -0,0 +1,65 @@\n+UART\n+****\n+\n+.. py:module:: microbit.uart\n+\n+The ``uart`` module lets you talk to a device connected to your board using\n+a serial interface.\n+\n+\n+Functions\n+=========\n+\n+.. py:function:: init(baudrate=9600, bits=8, parity=None, stop=1, pins=None)\n+\n+    Initialize serial communication with the specified parameters on the\n+    specified ``pins``. Note that for correct communication, the parameters\n+    have to be the same on both communicating devices.\n+\n+    The ``baudrate`` defines the speed of communication. Common baud\n+    rates include:\n+\n+        * 9600\n+        * 14400\n+        * 19200\n+        * 28800\n+        * 38400\n+        * 57600\n+        * 115200\n+\n+    The ``bits`` defines the size of bytes being transmitted, and the board only\n+    supports 8. The ``parity`` parameter defines how partity is checked, and it can\n+    be ``None``, ``microbit.uart.ODD`` or ``microbit.uart.EVEN``. The ``stop``\n+    parameter tells the number of stop bits, and has to be 1 for this board.\n+\n+    If no ``pins`` are specified, ``microbit.pin0`` is used as the TX pin, and\n+    ``microbit.pin1`` as the RX pin. You can also specify which pins you want\n+    by passing a tuple of two pins as ``pins``, the first one being TX, and the\n+    second one, RX.\n+\n+    .. note::\n+\n+        When connecting the device, make sure you \"cross\" the wires -- the TX\n+        pin on your board needs to be connected with the RX pin on the device,\n+        and the RX pin -- with the TX pin on the device. Also make sure the\n+        ground pins of both devices are connected.\n+\n+.. py:function:: any()\n+\n+    Return ``True`` if there are any bytes to be read in the input buffer.\n+    Return ``False`` when the buffer is empty.\n+\n+.. py:function:: read(buf_in, size)","path":"docs/uart.rst","position":52,"original_position":52,"commit_id":"e9801b0c486cf725609a7ef3c3b586cfc18fcd28","original_commit_id":"e9801b0c486cf725609a7ef3c3b586cfc18fcd28","user":{"login":"deshipu","id":1181357,"avatar_url":"https://avatars.githubusercontent.com/u/1181357?v=3","gravatar_id":"","url":"https://api.github.com/users/deshipu","html_url":"https://github.com/deshipu","followers_url":"https://api.github.com/users/deshipu/followers","following_url":"https://api.github.com/users/deshipu/following{/other_user}","gists_url":"https://api.github.com/users/deshipu/gists{/gist_id}","starred_url":"https://api.github.com/users/deshipu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deshipu/subscriptions","organizations_url":"https://api.github.com/users/deshipu/orgs","repos_url":"https://api.github.com/users/deshipu/repos","events_url":"https://api.github.com/users/deshipu/events{/privacy}","received_events_url":"https://api.github.com/users/deshipu/received_events","type":"User","site_admin":false},"body":"All of those functions need proper descriptions and proper parameters. Unfortunately I don't know the Micropython C API well enough to guess them from the source code, and there is no other source of information.","created_at":"2015-11-17T23:57:53Z","updated_at":"2015-11-17T23:57:53Z","html_url":"https://github.com/bbcmicrobit/micropython/pull/87#discussion_r45141343","pull_request_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/87","_links":{"self":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/comments/45141343"},"html":{"href":"https://github.com/bbcmicrobit/micropython/pull/87#discussion_r45141343"},"pull_request":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/87"}}},"pull_request":{"url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/87","id":50071243,"html_url":"https://github.com/bbcmicrobit/micropython/pull/87","diff_url":"https://github.com/bbcmicrobit/micropython/pull/87.diff","patch_url":"https://github.com/bbcmicrobit/micropython/pull/87.patch","issue_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/87","number":87,"state":"open","locked":false,"title":"Initial documentation for uart","user":{"login":"deshipu","id":1181357,"avatar_url":"https://avatars.githubusercontent.com/u/1181357?v=3","gravatar_id":"","url":"https://api.github.com/users/deshipu","html_url":"https://github.com/deshipu","followers_url":"https://api.github.com/users/deshipu/followers","following_url":"https://api.github.com/users/deshipu/following{/other_user}","gists_url":"https://api.github.com/users/deshipu/gists{/gist_id}","starred_url":"https://api.github.com/users/deshipu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deshipu/subscriptions","organizations_url":"https://api.github.com/users/deshipu/orgs","repos_url":"https://api.github.com/users/deshipu/repos","events_url":"https://api.github.com/users/deshipu/events{/privacy}","received_events_url":"https://api.github.com/users/deshipu/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-08T21:50:47Z","updated_at":"2015-11-17T23:57:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93a0f95624417aa500d31f8b0926d3c218517860","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/87/commits","review_comments_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/87/comments","review_comment_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/87/comments","statuses_url":"https://api.github.com/repos/bbcmicrobit/micropython/statuses/e9801b0c486cf725609a7ef3c3b586cfc18fcd28","head":{"label":"deshipu:uart-docs","ref":"uart-docs","sha":"e9801b0c486cf725609a7ef3c3b586cfc18fcd28","user":{"login":"deshipu","id":1181357,"avatar_url":"https://avatars.githubusercontent.com/u/1181357?v=3","gravatar_id":"","url":"https://api.github.com/users/deshipu","html_url":"https://github.com/deshipu","followers_url":"https://api.github.com/users/deshipu/followers","following_url":"https://api.github.com/users/deshipu/following{/other_user}","gists_url":"https://api.github.com/users/deshipu/gists{/gist_id}","starred_url":"https://api.github.com/users/deshipu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deshipu/subscriptions","organizations_url":"https://api.github.com/users/deshipu/orgs","repos_url":"https://api.github.com/users/deshipu/repos","events_url":"https://api.github.com/users/deshipu/events{/privacy}","received_events_url":"https://api.github.com/users/deshipu/received_events","type":"User","site_admin":false},"repo":{"id":44597197,"name":"micropython-1","full_name":"deshipu/micropython-1","owner":{"login":"deshipu","id":1181357,"avatar_url":"https://avatars.githubusercontent.com/u/1181357?v=3","gravatar_id":"","url":"https://api.github.com/users/deshipu","html_url":"https://github.com/deshipu","followers_url":"https://api.github.com/users/deshipu/followers","following_url":"https://api.github.com/users/deshipu/following{/other_user}","gists_url":"https://api.github.com/users/deshipu/gists{/gist_id}","starred_url":"https://api.github.com/users/deshipu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deshipu/subscriptions","organizations_url":"https://api.github.com/users/deshipu/orgs","repos_url":"https://api.github.com/users/deshipu/repos","events_url":"https://api.github.com/users/deshipu/events{/privacy}","received_events_url":"https://api.github.com/users/deshipu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/deshipu/micropython-1","description":"Port of MicroPython for the BBC micro:bit","fork":true,"url":"https://api.github.com/repos/deshipu/micropython-1","forks_url":"https://api.github.com/repos/deshipu/micropython-1/forks","keys_url":"https://api.github.com/repos/deshipu/micropython-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deshipu/micropython-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deshipu/micropython-1/teams","hooks_url":"https://api.github.com/repos/deshipu/micropython-1/hooks","issue_events_url":"https://api.github.com/repos/deshipu/micropython-1/issues/events{/number}","events_url":"https://api.github.com/repos/deshipu/micropython-1/events","assignees_url":"https://api.github.com/repos/deshipu/micropython-1/assignees{/user}","branches_url":"https://api.github.com/repos/deshipu/micropython-1/branches{/branch}","tags_url":"https://api.github.com/repos/deshipu/micropython-1/tags","blobs_url":"https://api.github.com/repos/deshipu/micropython-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deshipu/micropython-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deshipu/micropython-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/deshipu/micropython-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deshipu/micropython-1/statuses/{sha}","languages_url":"https://api.github.com/repos/deshipu/micropython-1/languages","stargazers_url":"https://api.github.com/repos/deshipu/micropython-1/stargazers","contributors_url":"https://api.github.com/repos/deshipu/micropython-1/contributors","subscribers_url":"https://api.github.com/repos/deshipu/micropython-1/subscribers","subscription_url":"https://api.github.com/repos/deshipu/micropython-1/subscription","commits_url":"https://api.github.com/repos/deshipu/micropython-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/deshipu/micropython-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/deshipu/micropython-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/deshipu/micropython-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/deshipu/micropython-1/contents/{+path}","compare_url":"https://api.github.com/repos/deshipu/micropython-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deshipu/micropython-1/merges","archive_url":"https://api.github.com/repos/deshipu/micropython-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deshipu/micropython-1/downloads","issues_url":"https://api.github.com/repos/deshipu/micropython-1/issues{/number}","pulls_url":"https://api.github.com/repos/deshipu/micropython-1/pulls{/number}","milestones_url":"https://api.github.com/repos/deshipu/micropython-1/milestones{/number}","notifications_url":"https://api.github.com/repos/deshipu/micropython-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deshipu/micropython-1/labels{/name}","releases_url":"https://api.github.com/repos/deshipu/micropython-1/releases{/id}","created_at":"2015-10-20T09:52:54Z","updated_at":"2015-10-20T09:52:55Z","pushed_at":"2015-11-17T23:52:42Z","git_url":"git://github.com/deshipu/micropython-1.git","ssh_url":"git@github.com:deshipu/micropython-1.git","clone_url":"https://github.com/deshipu/micropython-1.git","svn_url":"https://github.com/deshipu/micropython-1","homepage":"","size":918,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bbcmicrobit:master","ref":"master","sha":"08530be27df4b87c03aa38db16a17851e7e49c48","user":{"login":"bbcmicrobit","id":15104236,"avatar_url":"https://avatars.githubusercontent.com/u/15104236?v=3","gravatar_id":"","url":"https://api.github.com/users/bbcmicrobit","html_url":"https://github.com/bbcmicrobit","followers_url":"https://api.github.com/users/bbcmicrobit/followers","following_url":"https://api.github.com/users/bbcmicrobit/following{/other_user}","gists_url":"https://api.github.com/users/bbcmicrobit/gists{/gist_id}","starred_url":"https://api.github.com/users/bbcmicrobit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbcmicrobit/subscriptions","organizations_url":"https://api.github.com/users/bbcmicrobit/orgs","repos_url":"https://api.github.com/users/bbcmicrobit/repos","events_url":"https://api.github.com/users/bbcmicrobit/events{/privacy}","received_events_url":"https://api.github.com/users/bbcmicrobit/received_events","type":"Organization","site_admin":false},"repo":{"id":40358251,"name":"micropython","full_name":"bbcmicrobit/micropython","owner":{"login":"bbcmicrobit","id":15104236,"avatar_url":"https://avatars.githubusercontent.com/u/15104236?v=3","gravatar_id":"","url":"https://api.github.com/users/bbcmicrobit","html_url":"https://github.com/bbcmicrobit","followers_url":"https://api.github.com/users/bbcmicrobit/followers","following_url":"https://api.github.com/users/bbcmicrobit/following{/other_user}","gists_url":"https://api.github.com/users/bbcmicrobit/gists{/gist_id}","starred_url":"https://api.github.com/users/bbcmicrobit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbcmicrobit/subscriptions","organizations_url":"https://api.github.com/users/bbcmicrobit/orgs","repos_url":"https://api.github.com/users/bbcmicrobit/repos","events_url":"https://api.github.com/users/bbcmicrobit/events{/privacy}","received_events_url":"https://api.github.com/users/bbcmicrobit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bbcmicrobit/micropython","description":"Port of MicroPython for the BBC micro:bit","fork":false,"url":"https://api.github.com/repos/bbcmicrobit/micropython","forks_url":"https://api.github.com/repos/bbcmicrobit/micropython/forks","keys_url":"https://api.github.com/repos/bbcmicrobit/micropython/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bbcmicrobit/micropython/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bbcmicrobit/micropython/teams","hooks_url":"https://api.github.com/repos/bbcmicrobit/micropython/hooks","issue_events_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/events{/number}","events_url":"https://api.github.com/repos/bbcmicrobit/micropython/events","assignees_url":"https://api.github.com/repos/bbcmicrobit/micropython/assignees{/user}","branches_url":"https://api.github.com/repos/bbcmicrobit/micropython/branches{/branch}","tags_url":"https://api.github.com/repos/bbcmicrobit/micropython/tags","blobs_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/refs{/sha}","trees_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bbcmicrobit/micropython/statuses/{sha}","languages_url":"https://api.github.com/repos/bbcmicrobit/micropython/languages","stargazers_url":"https://api.github.com/repos/bbcmicrobit/micropython/stargazers","contributors_url":"https://api.github.com/repos/bbcmicrobit/micropython/contributors","subscribers_url":"https://api.github.com/repos/bbcmicrobit/micropython/subscribers","subscription_url":"https://api.github.com/repos/bbcmicrobit/micropython/subscription","commits_url":"https://api.github.com/repos/bbcmicrobit/micropython/commits{/sha}","git_commits_url":"https://api.github.com/repos/bbcmicrobit/micropython/git/commits{/sha}","comments_url":"https://api.github.com/repos/bbcmicrobit/micropython/comments{/number}","issue_comment_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues/comments{/number}","contents_url":"https://api.github.com/repos/bbcmicrobit/micropython/contents/{+path}","compare_url":"https://api.github.com/repos/bbcmicrobit/micropython/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bbcmicrobit/micropython/merges","archive_url":"https://api.github.com/repos/bbcmicrobit/micropython/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bbcmicrobit/micropython/downloads","issues_url":"https://api.github.com/repos/bbcmicrobit/micropython/issues{/number}","pulls_url":"https://api.github.com/repos/bbcmicrobit/micropython/pulls{/number}","milestones_url":"https://api.github.com/repos/bbcmicrobit/micropython/milestones{/number}","notifications_url":"https://api.github.com/repos/bbcmicrobit/micropython/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bbcmicrobit/micropython/labels{/name}","releases_url":"https://api.github.com/repos/bbcmicrobit/micropython/releases{/id}","created_at":"2015-08-07T11:58:53Z","updated_at":"2015-11-17T12:07:09Z","pushed_at":"2015-11-17T23:52:42Z","git_url":"git://github.com/bbcmicrobit/micropython.git","ssh_url":"git@github.com:bbcmicrobit/micropython.git","clone_url":"https://github.com/bbcmicrobit/micropython.git","svn_url":"https://github.com/bbcmicrobit/micropython","homepage":"","size":6720,"stargazers_count":102,"watchers_count":102,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":34,"forks":13,"open_issues":34,"watchers":102,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/87"},"html":{"href":"https://github.com/bbcmicrobit/micropython/pull/87"},"issue":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/issues/87"},"comments":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/issues/87/comments"},"review_comments":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/87/comments"},"review_comment":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/pulls/87/commits"},"statuses":{"href":"https://api.github.com/repos/bbcmicrobit/micropython/statuses/e9801b0c486cf725609a7ef3c3b586cfc18fcd28"}}}}