{"action":"created","comment":{"url":"https://api.github.com/repos/openkosmosorg/kubos-hal/pulls/comments/63780881","id":63780881,"diff_hunk":"@@ -0,0 +1,148 @@\n+/*\n+ * KubOS HAL\n+ * Copyright (C) 2016 Kubos Corporation\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+#ifndef K_UART_H\n+#define K_UART_H\n+\n+#include \"FreeRTOS.h\"\n+#include \"queue.h\"\n+#include <stdint.h>\n+\n+#include \"pins.h\"\n+\n+#ifndef K_NUM_UARTS\n+#define K_NUM_UARTS YOTTA_CFG_HARDWARE_UARTCOUNT\n+#endif\n+\n+#ifndef K_UART_CONSOLE\n+#define K_UART_CONSOLE YOTTA_CFG_HARDWARE_CONSOLE_UART\n+#endif\n+\n+#ifndef K_UART_CONSOLE_BAUDRATE\n+#define K_UART_CONSOLE_BAUDRATE YOTTA_CFG_HARDWARE_CONSOLE_BAUDRATE\n+#endif\n+\n+typedef enum {\n+    K_UART1 = 0,\n+    K_UART2,\n+    K_UART3,\n+    K_UART4,\n+    K_UART5,\n+    K_UART6\n+} KUARTNum;\n+\n+typedef void (*KUART_RxHandler) (uint8_t *buf, int len, void *task_woken);\n+\n+typedef enum {\n+    K_WORD_LEN_8BIT = 0,\n+    K_WORD_LEN_9BIT\n+} KWordLen;\n+\n+typedef enum {\n+    K_STOP_BITS_1 = 0,\n+    K_STOP_BITS_1_5,\n+    K_STOP_BITS_2\n+} KStopBits;\n+\n+typedef enum {\n+    K_PARITY_NONE = 0,\n+    K_PARITY_EVEN,\n+    K_PARITY_ODD\n+} KParity;\n+\n+typedef struct {\n+    const char *dev_path;\n+    uint32_t baud_rate;\n+    KWordLen word_len;\n+    KStopBits stop_bits;\n+    KParity parity;\n+\n+    uint8_t rx_queue_len;\n+    uint8_t tx_queue_len;\n+    KUART_RxHandler *rx_handler;","path":"kubos-hal/uart.h","position":75,"original_position":75,"commit_id":"4585db493916dca68b1eeeff3318bf095310c709","original_commit_id":"4585db493916dca68b1eeeff3318bf095310c709","user":{"login":"rplauche","id":5727559,"avatar_url":"https://avatars.githubusercontent.com/u/5727559?v=3","gravatar_id":"","url":"https://api.github.com/users/rplauche","html_url":"https://github.com/rplauche","followers_url":"https://api.github.com/users/rplauche/followers","following_url":"https://api.github.com/users/rplauche/following{/other_user}","gists_url":"https://api.github.com/users/rplauche/gists{/gist_id}","starred_url":"https://api.github.com/users/rplauche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rplauche/subscriptions","organizations_url":"https://api.github.com/users/rplauche/orgs","repos_url":"https://api.github.com/users/rplauche/repos","events_url":"https://api.github.com/users/rplauche/events{/privacy}","received_events_url":"https://api.github.com/users/rplauche/received_events","type":"User","site_admin":false},"body":"Is this function pointer actually getting used?","created_at":"2016-05-18T20:58:32Z","updated_at":"2016-05-18T20:58:32Z","html_url":"https://github.com/openkosmosorg/kubos-hal/pull/2#discussion_r63780881","pull_request_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/openkosmosorg/kubos-hal/pulls/comments/63780881"},"html":{"href":"https://github.com/openkosmosorg/kubos-hal/pull/2#discussion_r63780881"},"pull_request":{"href":"https://api.github.com/repos/openkosmosorg/kubos-hal/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/openkosmosorg/kubos-hal/pulls/2","id":69753897,"html_url":"https://github.com/openkosmosorg/kubos-hal/pull/2","diff_url":"https://github.com/openkosmosorg/kubos-hal/pull/2.diff","patch_url":"https://github.com/openkosmosorg/kubos-hal/pull/2.patch","issue_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/issues/2","number":2,"state":"open","locked":false,"title":"initial KubOS HAL UART API","user":{"login":"marshall","id":29191,"avatar_url":"https://avatars.githubusercontent.com/u/29191?v=3","gravatar_id":"","url":"https://api.github.com/users/marshall","html_url":"https://github.com/marshall","followers_url":"https://api.github.com/users/marshall/followers","following_url":"https://api.github.com/users/marshall/following{/other_user}","gists_url":"https://api.github.com/users/marshall/gists{/gist_id}","starred_url":"https://api.github.com/users/marshall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marshall/subscriptions","organizations_url":"https://api.github.com/users/marshall/orgs","repos_url":"https://api.github.com/users/marshall/repos","events_url":"https://api.github.com/users/marshall/events{/privacy}","received_events_url":"https://api.github.com/users/marshall/received_events","type":"User","site_admin":false},"body":"this implementation uses an RX and TX character queue to asynchronously\r\npush data to and from the UART device with interrupts. drivers will\r\nimplement the kprv_* family of private functions at the bottom of uart.h\r\n\r\nopenkosmosorg/kubos-hal-stm32f407vg#1","created_at":"2016-05-11T22:37:53Z","updated_at":"2016-05-18T20:58:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d4f97fa280c66f673bfa3a55c982513743601e3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/pulls/2/commits","review_comments_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/pulls/2/comments","review_comment_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/issues/2/comments","statuses_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/statuses/4585db493916dca68b1eeeff3318bf095310c709","head":{"label":"marshall:uartAPI","ref":"uartAPI","sha":"4585db493916dca68b1eeeff3318bf095310c709","user":{"login":"marshall","id":29191,"avatar_url":"https://avatars.githubusercontent.com/u/29191?v=3","gravatar_id":"","url":"https://api.github.com/users/marshall","html_url":"https://github.com/marshall","followers_url":"https://api.github.com/users/marshall/followers","following_url":"https://api.github.com/users/marshall/following{/other_user}","gists_url":"https://api.github.com/users/marshall/gists{/gist_id}","starred_url":"https://api.github.com/users/marshall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marshall/subscriptions","organizations_url":"https://api.github.com/users/marshall/orgs","repos_url":"https://api.github.com/users/marshall/repos","events_url":"https://api.github.com/users/marshall/events{/privacy}","received_events_url":"https://api.github.com/users/marshall/received_events","type":"User","site_admin":false},"repo":{"id":58587176,"name":"kubos-hal","full_name":"marshall/kubos-hal","owner":{"login":"marshall","id":29191,"avatar_url":"https://avatars.githubusercontent.com/u/29191?v=3","gravatar_id":"","url":"https://api.github.com/users/marshall","html_url":"https://github.com/marshall","followers_url":"https://api.github.com/users/marshall/followers","following_url":"https://api.github.com/users/marshall/following{/other_user}","gists_url":"https://api.github.com/users/marshall/gists{/gist_id}","starred_url":"https://api.github.com/users/marshall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marshall/subscriptions","organizations_url":"https://api.github.com/users/marshall/orgs","repos_url":"https://api.github.com/users/marshall/repos","events_url":"https://api.github.com/users/marshall/events{/privacy}","received_events_url":"https://api.github.com/users/marshall/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/marshall/kubos-hal","description":"KubOS HAL","fork":true,"url":"https://api.github.com/repos/marshall/kubos-hal","forks_url":"https://api.github.com/repos/marshall/kubos-hal/forks","keys_url":"https://api.github.com/repos/marshall/kubos-hal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marshall/kubos-hal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marshall/kubos-hal/teams","hooks_url":"https://api.github.com/repos/marshall/kubos-hal/hooks","issue_events_url":"https://api.github.com/repos/marshall/kubos-hal/issues/events{/number}","events_url":"https://api.github.com/repos/marshall/kubos-hal/events","assignees_url":"https://api.github.com/repos/marshall/kubos-hal/assignees{/user}","branches_url":"https://api.github.com/repos/marshall/kubos-hal/branches{/branch}","tags_url":"https://api.github.com/repos/marshall/kubos-hal/tags","blobs_url":"https://api.github.com/repos/marshall/kubos-hal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marshall/kubos-hal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marshall/kubos-hal/git/refs{/sha}","trees_url":"https://api.github.com/repos/marshall/kubos-hal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marshall/kubos-hal/statuses/{sha}","languages_url":"https://api.github.com/repos/marshall/kubos-hal/languages","stargazers_url":"https://api.github.com/repos/marshall/kubos-hal/stargazers","contributors_url":"https://api.github.com/repos/marshall/kubos-hal/contributors","subscribers_url":"https://api.github.com/repos/marshall/kubos-hal/subscribers","subscription_url":"https://api.github.com/repos/marshall/kubos-hal/subscription","commits_url":"https://api.github.com/repos/marshall/kubos-hal/commits{/sha}","git_commits_url":"https://api.github.com/repos/marshall/kubos-hal/git/commits{/sha}","comments_url":"https://api.github.com/repos/marshall/kubos-hal/comments{/number}","issue_comment_url":"https://api.github.com/repos/marshall/kubos-hal/issues/comments{/number}","contents_url":"https://api.github.com/repos/marshall/kubos-hal/contents/{+path}","compare_url":"https://api.github.com/repos/marshall/kubos-hal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marshall/kubos-hal/merges","archive_url":"https://api.github.com/repos/marshall/kubos-hal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marshall/kubos-hal/downloads","issues_url":"https://api.github.com/repos/marshall/kubos-hal/issues{/number}","pulls_url":"https://api.github.com/repos/marshall/kubos-hal/pulls{/number}","milestones_url":"https://api.github.com/repos/marshall/kubos-hal/milestones{/number}","notifications_url":"https://api.github.com/repos/marshall/kubos-hal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marshall/kubos-hal/labels{/name}","releases_url":"https://api.github.com/repos/marshall/kubos-hal/releases{/id}","deployments_url":"https://api.github.com/repos/marshall/kubos-hal/deployments","created_at":"2016-05-11T22:32:40Z","updated_at":"2016-05-11T22:32:42Z","pushed_at":"2016-05-12T20:09:44Z","git_url":"git://github.com/marshall/kubos-hal.git","ssh_url":"git@github.com:marshall/kubos-hal.git","clone_url":"https://github.com/marshall/kubos-hal.git","svn_url":"https://github.com/marshall/kubos-hal","homepage":null,"size":41,"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":"openkosmosorg:master","ref":"master","sha":"78bb1caa3f1317f010156be09056fced39d49380","user":{"login":"openkosmosorg","id":13735103,"avatar_url":"https://avatars.githubusercontent.com/u/13735103?v=3","gravatar_id":"","url":"https://api.github.com/users/openkosmosorg","html_url":"https://github.com/openkosmosorg","followers_url":"https://api.github.com/users/openkosmosorg/followers","following_url":"https://api.github.com/users/openkosmosorg/following{/other_user}","gists_url":"https://api.github.com/users/openkosmosorg/gists{/gist_id}","starred_url":"https://api.github.com/users/openkosmosorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openkosmosorg/subscriptions","organizations_url":"https://api.github.com/users/openkosmosorg/orgs","repos_url":"https://api.github.com/users/openkosmosorg/repos","events_url":"https://api.github.com/users/openkosmosorg/events{/privacy}","received_events_url":"https://api.github.com/users/openkosmosorg/received_events","type":"Organization","site_admin":false},"repo":{"id":56005420,"name":"kubos-hal","full_name":"openkosmosorg/kubos-hal","owner":{"login":"openkosmosorg","id":13735103,"avatar_url":"https://avatars.githubusercontent.com/u/13735103?v=3","gravatar_id":"","url":"https://api.github.com/users/openkosmosorg","html_url":"https://github.com/openkosmosorg","followers_url":"https://api.github.com/users/openkosmosorg/followers","following_url":"https://api.github.com/users/openkosmosorg/following{/other_user}","gists_url":"https://api.github.com/users/openkosmosorg/gists{/gist_id}","starred_url":"https://api.github.com/users/openkosmosorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openkosmosorg/subscriptions","organizations_url":"https://api.github.com/users/openkosmosorg/orgs","repos_url":"https://api.github.com/users/openkosmosorg/repos","events_url":"https://api.github.com/users/openkosmosorg/events{/privacy}","received_events_url":"https://api.github.com/users/openkosmosorg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openkosmosorg/kubos-hal","description":"KubOS HAL","fork":false,"url":"https://api.github.com/repos/openkosmosorg/kubos-hal","forks_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/forks","keys_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/teams","hooks_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/hooks","issue_events_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/issues/events{/number}","events_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/events","assignees_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/assignees{/user}","branches_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/branches{/branch}","tags_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/tags","blobs_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/git/refs{/sha}","trees_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/statuses/{sha}","languages_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/languages","stargazers_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/stargazers","contributors_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/contributors","subscribers_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/subscribers","subscription_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/subscription","commits_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/commits{/sha}","git_commits_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/git/commits{/sha}","comments_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/comments{/number}","issue_comment_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/issues/comments{/number}","contents_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/contents/{+path}","compare_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/merges","archive_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/downloads","issues_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/issues{/number}","pulls_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/pulls{/number}","milestones_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/milestones{/number}","notifications_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/labels{/name}","releases_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/releases{/id}","deployments_url":"https://api.github.com/repos/openkosmosorg/kubos-hal/deployments","created_at":"2016-04-11T20:30:20Z","updated_at":"2016-04-11T20:31:18Z","pushed_at":"2016-05-12T20:09:44Z","git_url":"git://github.com/openkosmosorg/kubos-hal.git","ssh_url":"git@github.com:openkosmosorg/kubos-hal.git","clone_url":"https://github.com/openkosmosorg/kubos-hal.git","svn_url":"https://github.com/openkosmosorg/kubos-hal","homepage":null,"size":37,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openkosmosorg/kubos-hal/pulls/2"},"html":{"href":"https://github.com/openkosmosorg/kubos-hal/pull/2"},"issue":{"href":"https://api.github.com/repos/openkosmosorg/kubos-hal/issues/2"},"comments":{"href":"https://api.github.com/repos/openkosmosorg/kubos-hal/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/openkosmosorg/kubos-hal/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/openkosmosorg/kubos-hal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openkosmosorg/kubos-hal/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/openkosmosorg/kubos-hal/statuses/4585db493916dca68b1eeeff3318bf095310c709"}}}}