{"action":"created","comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments/45776076","id":45776076,"diff_hunk":"@@ -0,0 +1,196 @@\n+/*\n+ * Copyright (C) 2015 Sebastian Sontberg <sebastian@sontberg.de>\n+ *\n+ * This file is subject to the terms and conditions of the GNU Lesser\n+ * General Public License v2.1. See the file LICENSE in the top level\n+ * directory for more details.\n+ */\n+\n+/**\n+ * @ingroup     driver_periph\n+ * @{\n+ *\n+ * @file\n+ * @brief       Low-level GPIO driver implementation\n+ *\n+ * @author      Sebastian Sontberg <sebastian@sontberg.de>\n+ *\n+ * @}\n+ */\n+\n+#include <stddef.h>\n+\n+#include \"periph/gpio.h\"\n+#include \"periph_conf.h\"\n+#include \"sched.h\"\n+#include \"thread.h\"\n+\n+#define ENABLE_DEBUG    (0)\n+#include \"debug.h\"\n+\n+#define PIN(gpio)  (gpio & 0x000f)\n+#define PORT(gpio) (PORT0_BASE | ((gpio & 0x30) << 4))\n+\n+#define OMR(gpio)  ((uint32_t *)(PORT(gpio) + offsetof(PORT0_Type, OMR)))\n+#define IN(gpio)   ((uint32_t *)(PORT(gpio) + offsetof(PORT0_Type, IN)))\n+#define IOCR(gpio) ((uint8_t *)(PORT(gpio) + offsetof(PORT0_Type, IOCR0) + PIN(gpio)))\n+\n+typedef struct {\n+    gpio_cb_t cb;\n+    void *arg;\n+} gpio_int_t;\n+\n+/* storage for the callbacks of the 4 available external interrupts */\n+static gpio_int_t gpio_ints[4];\n+\n+int gpio_init(gpio_t gpio, gpio_dir_t dir, gpio_pp_t pushpull)\n+{\n+    *(IOCR(gpio)) = (dir | pushpull) << 3;","path":"cpu/xmc1000/periph/gpio.c","position":48,"original_position":48,"commit_id":"84f4e79b9c1793b4f273fe8e68cb3f2a00863872","original_commit_id":"84f4e79b9c1793b4f273fe8e68cb3f2a00863872","user":{"login":"haukepetersen","id":620834,"avatar_url":"https://avatars.githubusercontent.com/u/620834?v=3","gravatar_id":"","url":"https://api.github.com/users/haukepetersen","html_url":"https://github.com/haukepetersen","followers_url":"https://api.github.com/users/haukepetersen/followers","following_url":"https://api.github.com/users/haukepetersen/following{/other_user}","gists_url":"https://api.github.com/users/haukepetersen/gists{/gist_id}","starred_url":"https://api.github.com/users/haukepetersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haukepetersen/subscriptions","organizations_url":"https://api.github.com/users/haukepetersen/orgs","repos_url":"https://api.github.com/users/haukepetersen/repos","events_url":"https://api.github.com/users/haukepetersen/events{/privacy}","received_events_url":"https://api.github.com/users/haukepetersen/received_events","type":"User","site_admin":false},"body":"nice!","created_at":"2015-11-24T18:42:18Z","updated_at":"2015-11-24T18:42:18Z","html_url":"https://github.com/RIOT-OS/RIOT/pull/3833#discussion_r45776076","pull_request_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3833","_links":{"self":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments/45776076"},"html":{"href":"https://github.com/RIOT-OS/RIOT/pull/3833#discussion_r45776076"},"pull_request":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3833"}}},"pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3833","id":44852048,"html_url":"https://github.com/RIOT-OS/RIOT/pull/3833","diff_url":"https://github.com/RIOT-OS/RIOT/pull/3833.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/3833.patch","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/3833","number":3833,"state":"open","locked":false,"title":"cpu/boards: add xmc1100 cpu & board xmc-2go","user":{"login":"sgso","id":3769182,"avatar_url":"https://avatars.githubusercontent.com/u/3769182?v=3","gravatar_id":"","url":"https://api.github.com/users/sgso","html_url":"https://github.com/sgso","followers_url":"https://api.github.com/users/sgso/followers","following_url":"https://api.github.com/users/sgso/following{/other_user}","gists_url":"https://api.github.com/users/sgso/gists{/gist_id}","starred_url":"https://api.github.com/users/sgso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgso/subscriptions","organizations_url":"https://api.github.com/users/sgso/orgs","repos_url":"https://api.github.com/users/sgso/repos","events_url":"https://api.github.com/users/sgso/events{/privacy}","received_events_url":"https://api.github.com/users/sgso/received_events","type":"User","site_admin":false},"body":"This adds a new architecture 'xmc1000' with the Infineon XMC1100 Cortex-M0 as the only supported cpu. It is used by the 'xmc-2go' board.\r\n\r\nCPU contains drivers for timer, gpio, uart, adc, random, rtc and cpuid. I'll create a SPI one next.\r\n\r\nI can provide one or two xmc-2go boards if you want to review.\r\n\r\nI'm planning to expand this to the xmc1300 boot kit.\r\n\r\nImports two headers from the upcoming uart overhaul #3265.","created_at":"2015-09-12T11:45:48Z","updated_at":"2015-11-24T18:42:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a8772232e0f1b469c5eb1d34b7e3f018b38b01f4","assignee":{"login":"thomaseichinger","id":56618,"avatar_url":"https://avatars.githubusercontent.com/u/56618?v=3","gravatar_id":"","url":"https://api.github.com/users/thomaseichinger","html_url":"https://github.com/thomaseichinger","followers_url":"https://api.github.com/users/thomaseichinger/followers","following_url":"https://api.github.com/users/thomaseichinger/following{/other_user}","gists_url":"https://api.github.com/users/thomaseichinger/gists{/gist_id}","starred_url":"https://api.github.com/users/thomaseichinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomaseichinger/subscriptions","organizations_url":"https://api.github.com/users/thomaseichinger/orgs","repos_url":"https://api.github.com/users/thomaseichinger/repos","events_url":"https://api.github.com/users/thomaseichinger/events{/privacy}","received_events_url":"https://api.github.com/users/thomaseichinger/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones/10","html_url":"https://github.com/RIOT-OS/RIOT/milestones/Release%202015.12","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones/10/labels","id":871004,"number":10,"title":"Release 2015.12","description":"This is the next major milestone.","creator":{"login":"OlegHahm","id":1590423,"avatar_url":"https://avatars.githubusercontent.com/u/1590423?v=3","gravatar_id":"","url":"https://api.github.com/users/OlegHahm","html_url":"https://github.com/OlegHahm","followers_url":"https://api.github.com/users/OlegHahm/followers","following_url":"https://api.github.com/users/OlegHahm/following{/other_user}","gists_url":"https://api.github.com/users/OlegHahm/gists{/gist_id}","starred_url":"https://api.github.com/users/OlegHahm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OlegHahm/subscriptions","organizations_url":"https://api.github.com/users/OlegHahm/orgs","repos_url":"https://api.github.com/users/OlegHahm/repos","events_url":"https://api.github.com/users/OlegHahm/events{/privacy}","received_events_url":"https://api.github.com/users/OlegHahm/received_events","type":"User","site_admin":false},"open_issues":171,"closed_issues":161,"state":"open","created_at":"2014-11-18T10:51:58Z","updated_at":"2015-11-24T14:36:14Z","due_on":"2015-12-07T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3833/commits","review_comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3833/comments","review_comment_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/3833/comments","statuses_url":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/84f4e79b9c1793b4f273fe8e68cb3f2a00863872","head":{"label":"sgso:xmc1000_xmc2go","ref":"xmc1000_xmc2go","sha":"84f4e79b9c1793b4f273fe8e68cb3f2a00863872","user":{"login":"sgso","id":3769182,"avatar_url":"https://avatars.githubusercontent.com/u/3769182?v=3","gravatar_id":"","url":"https://api.github.com/users/sgso","html_url":"https://github.com/sgso","followers_url":"https://api.github.com/users/sgso/followers","following_url":"https://api.github.com/users/sgso/following{/other_user}","gists_url":"https://api.github.com/users/sgso/gists{/gist_id}","starred_url":"https://api.github.com/users/sgso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgso/subscriptions","organizations_url":"https://api.github.com/users/sgso/orgs","repos_url":"https://api.github.com/users/sgso/repos","events_url":"https://api.github.com/users/sgso/events{/privacy}","received_events_url":"https://api.github.com/users/sgso/received_events","type":"User","site_admin":false},"repo":{"id":21818281,"name":"RIOT","full_name":"sgso/RIOT","owner":{"login":"sgso","id":3769182,"avatar_url":"https://avatars.githubusercontent.com/u/3769182?v=3","gravatar_id":"","url":"https://api.github.com/users/sgso","html_url":"https://github.com/sgso","followers_url":"https://api.github.com/users/sgso/followers","following_url":"https://api.github.com/users/sgso/following{/other_user}","gists_url":"https://api.github.com/users/sgso/gists{/gist_id}","starred_url":"https://api.github.com/users/sgso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgso/subscriptions","organizations_url":"https://api.github.com/users/sgso/orgs","repos_url":"https://api.github.com/users/sgso/repos","events_url":"https://api.github.com/users/sgso/events{/privacy}","received_events_url":"https://api.github.com/users/sgso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sgso/RIOT","description":"RIOT -  The friendly OS for IoT","fork":true,"url":"https://api.github.com/repos/sgso/RIOT","forks_url":"https://api.github.com/repos/sgso/RIOT/forks","keys_url":"https://api.github.com/repos/sgso/RIOT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sgso/RIOT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sgso/RIOT/teams","hooks_url":"https://api.github.com/repos/sgso/RIOT/hooks","issue_events_url":"https://api.github.com/repos/sgso/RIOT/issues/events{/number}","events_url":"https://api.github.com/repos/sgso/RIOT/events","assignees_url":"https://api.github.com/repos/sgso/RIOT/assignees{/user}","branches_url":"https://api.github.com/repos/sgso/RIOT/branches{/branch}","tags_url":"https://api.github.com/repos/sgso/RIOT/tags","blobs_url":"https://api.github.com/repos/sgso/RIOT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sgso/RIOT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sgso/RIOT/git/refs{/sha}","trees_url":"https://api.github.com/repos/sgso/RIOT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sgso/RIOT/statuses/{sha}","languages_url":"https://api.github.com/repos/sgso/RIOT/languages","stargazers_url":"https://api.github.com/repos/sgso/RIOT/stargazers","contributors_url":"https://api.github.com/repos/sgso/RIOT/contributors","subscribers_url":"https://api.github.com/repos/sgso/RIOT/subscribers","subscription_url":"https://api.github.com/repos/sgso/RIOT/subscription","commits_url":"https://api.github.com/repos/sgso/RIOT/commits{/sha}","git_commits_url":"https://api.github.com/repos/sgso/RIOT/git/commits{/sha}","comments_url":"https://api.github.com/repos/sgso/RIOT/comments{/number}","issue_comment_url":"https://api.github.com/repos/sgso/RIOT/issues/comments{/number}","contents_url":"https://api.github.com/repos/sgso/RIOT/contents/{+path}","compare_url":"https://api.github.com/repos/sgso/RIOT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sgso/RIOT/merges","archive_url":"https://api.github.com/repos/sgso/RIOT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sgso/RIOT/downloads","issues_url":"https://api.github.com/repos/sgso/RIOT/issues{/number}","pulls_url":"https://api.github.com/repos/sgso/RIOT/pulls{/number}","milestones_url":"https://api.github.com/repos/sgso/RIOT/milestones{/number}","notifications_url":"https://api.github.com/repos/sgso/RIOT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sgso/RIOT/labels{/name}","releases_url":"https://api.github.com/repos/sgso/RIOT/releases{/id}","created_at":"2014-07-14T12:10:33Z","updated_at":"2015-05-03T10:26:53Z","pushed_at":"2015-11-23T05:54:24Z","git_url":"git://github.com/sgso/RIOT.git","ssh_url":"git@github.com:sgso/RIOT.git","clone_url":"https://github.com/sgso/RIOT.git","svn_url":"https://github.com/sgso/RIOT","homepage":"https://github.com/RIOT-OS/RIOT/wiki","size":22320,"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":"board_rf231usb"}},"base":{"label":"RIOT-OS:master","ref":"master","sha":"94d8c2e0fcd8259d74f611baca1fffb325040564","user":{"login":"RIOT-OS","id":3079480,"avatar_url":"https://avatars.githubusercontent.com/u/3079480?v=3","gravatar_id":"","url":"https://api.github.com/users/RIOT-OS","html_url":"https://github.com/RIOT-OS","followers_url":"https://api.github.com/users/RIOT-OS/followers","following_url":"https://api.github.com/users/RIOT-OS/following{/other_user}","gists_url":"https://api.github.com/users/RIOT-OS/gists{/gist_id}","starred_url":"https://api.github.com/users/RIOT-OS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RIOT-OS/subscriptions","organizations_url":"https://api.github.com/users/RIOT-OS/orgs","repos_url":"https://api.github.com/users/RIOT-OS/repos","events_url":"https://api.github.com/users/RIOT-OS/events{/privacy}","received_events_url":"https://api.github.com/users/RIOT-OS/received_events","type":"Organization","site_admin":false},"repo":{"id":7370241,"name":"RIOT","full_name":"RIOT-OS/RIOT","owner":{"login":"RIOT-OS","id":3079480,"avatar_url":"https://avatars.githubusercontent.com/u/3079480?v=3","gravatar_id":"","url":"https://api.github.com/users/RIOT-OS","html_url":"https://github.com/RIOT-OS","followers_url":"https://api.github.com/users/RIOT-OS/followers","following_url":"https://api.github.com/users/RIOT-OS/following{/other_user}","gists_url":"https://api.github.com/users/RIOT-OS/gists{/gist_id}","starred_url":"https://api.github.com/users/RIOT-OS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RIOT-OS/subscriptions","organizations_url":"https://api.github.com/users/RIOT-OS/orgs","repos_url":"https://api.github.com/users/RIOT-OS/repos","events_url":"https://api.github.com/users/RIOT-OS/events{/privacy}","received_events_url":"https://api.github.com/users/RIOT-OS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RIOT-OS/RIOT","description":"RIOT -  The friendly OS for IoT","fork":false,"url":"https://api.github.com/repos/RIOT-OS/RIOT","forks_url":"https://api.github.com/repos/RIOT-OS/RIOT/forks","keys_url":"https://api.github.com/repos/RIOT-OS/RIOT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RIOT-OS/RIOT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RIOT-OS/RIOT/teams","hooks_url":"https://api.github.com/repos/RIOT-OS/RIOT/hooks","issue_events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/events{/number}","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/events","assignees_url":"https://api.github.com/repos/RIOT-OS/RIOT/assignees{/user}","branches_url":"https://api.github.com/repos/RIOT-OS/RIOT/branches{/branch}","tags_url":"https://api.github.com/repos/RIOT-OS/RIOT/tags","blobs_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/refs{/sha}","trees_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/{sha}","languages_url":"https://api.github.com/repos/RIOT-OS/RIOT/languages","stargazers_url":"https://api.github.com/repos/RIOT-OS/RIOT/stargazers","contributors_url":"https://api.github.com/repos/RIOT-OS/RIOT/contributors","subscribers_url":"https://api.github.com/repos/RIOT-OS/RIOT/subscribers","subscription_url":"https://api.github.com/repos/RIOT-OS/RIOT/subscription","commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/commits{/sha}","git_commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/commits{/sha}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/comments{/number}","issue_comment_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments{/number}","contents_url":"https://api.github.com/repos/RIOT-OS/RIOT/contents/{+path}","compare_url":"https://api.github.com/repos/RIOT-OS/RIOT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RIOT-OS/RIOT/merges","archive_url":"https://api.github.com/repos/RIOT-OS/RIOT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RIOT-OS/RIOT/downloads","issues_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues{/number}","pulls_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls{/number}","milestones_url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones{/number}","notifications_url":"https://api.github.com/repos/RIOT-OS/RIOT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/labels{/name}","releases_url":"https://api.github.com/repos/RIOT-OS/RIOT/releases{/id}","created_at":"2012-12-29T20:38:40Z","updated_at":"2015-11-23T06:42:43Z","pushed_at":"2015-11-24T17:31:44Z","git_url":"git://github.com/RIOT-OS/RIOT.git","ssh_url":"git@github.com:RIOT-OS/RIOT.git","clone_url":"https://github.com/RIOT-OS/RIOT.git","svn_url":"https://github.com/RIOT-OS/RIOT","homepage":"https://github.com/RIOT-OS/RIOT/wiki","size":77968,"stargazers_count":565,"watchers_count":565,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":438,"mirror_url":null,"open_issues_count":434,"forks":438,"open_issues":434,"watchers":565,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3833"},"html":{"href":"https://github.com/RIOT-OS/RIOT/pull/3833"},"issue":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/issues/3833"},"comments":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/issues/3833/comments"},"review_comments":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3833/comments"},"review_comment":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/3833/commits"},"statuses":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/84f4e79b9c1793b4f273fe8e68cb3f2a00863872"}}}}