{"action":"created","comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments/142015756","pull_request_review_id":66322871,"id":142015756,"diff_hunk":"@@ -0,0 +1,144 @@\n+/*\n+ * Copyright(C) 2017 Francois Berder <fberder@outlook.fr>\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+#include \"assert.h\"\n+#include \"board.h\"\n+#include \"mutex.h\"\n+#include \"periph/gpio.h\"\n+#include \"periph/spi.h\"\n+\n+#define SPIxCON(U)          ((U).regs[0x00 / 4])\n+#define SPIxCONCLR(U)       ((U).regs[0x04 / 4])\n+#define SPIxCONSET(U)       ((U).regs[0x08 / 4])\n+#define SPIxSTAT(U)         ((U).regs[0x10 / 4])\n+#define SPIxSTATCLR(U)      ((U).regs[0x14 / 4])\n+#define SPIxBUF(U)          ((U).regs[0x20 / 4])\n+#define SPIxBRG(U)          ((U).regs[0x30 / 4])\n+#define SPIxCON2(U)         ((U).regs[0x40 / 4])\n+#define SPI_REGS_SPACING    (_SPI2_BASE_ADDRESS - _SPI1_BASE_ADDRESS)\n+\n+/* PERIPHERAL_CLOCK must be defined in board file */\n+\n+\n+typedef struct PIC32_SPI_tag {\n+    volatile uint32_t   *regs;\n+} PIC32_SPI_T;\n+\n+static PIC32_SPI_T pic_spi[SPI_NUMOF + 1];\n+static mutex_t locks[SPI_NUMOF + 1];\n+\n+void spi_init(spi_t bus)\n+{\n+    assert(bus != 0 && bus <= SPI_NUMOF);\n+\n+    mutex_init(&locks[bus]);\n+\n+    PMD5SET = _PMD5_SPI1MD_MASK << (bus - 1);\n+    spi_init_pins(bus);\n+}\n+\n+void spi_init_pins(spi_t bus)\n+{\n+    assert(bus != 0 && bus <= SPI_NUMOF);","path":"cpu/mips_pic32_common/periph/spi.c","position":48,"original_position":48,"commit_id":"96fd9b882bf04ad509191bbcecf8e6abd57ae9cd","original_commit_id":"96fd9b882bf04ad509191bbcecf8e6abd57ae9cd","user":{"login":"kaspar030","id":4679640,"avatar_url":"https://avatars0.githubusercontent.com/u/4679640?v=4","gravatar_id":"","url":"https://api.github.com/users/kaspar030","html_url":"https://github.com/kaspar030","followers_url":"https://api.github.com/users/kaspar030/followers","following_url":"https://api.github.com/users/kaspar030/following{/other_user}","gists_url":"https://api.github.com/users/kaspar030/gists{/gist_id}","starred_url":"https://api.github.com/users/kaspar030/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaspar030/subscriptions","organizations_url":"https://api.github.com/users/kaspar030/orgs","repos_url":"https://api.github.com/users/kaspar030/repos","events_url":"https://api.github.com/users/kaspar030/events{/privacy}","received_events_url":"https://api.github.com/users/kaspar030/received_events","type":"User","site_admin":false},"body":"parens","created_at":"2017-09-30T21:32:54Z","updated_at":"2017-09-30T21:34:57Z","html_url":"https://github.com/RIOT-OS/RIOT/pull/7383#discussion_r142015756","pull_request_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/7383","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments/142015756"},"html":{"href":"https://github.com/RIOT-OS/RIOT/pull/7383#discussion_r142015756"},"pull_request":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/7383"}}},"pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/7383","id":131200890,"html_url":"https://github.com/RIOT-OS/RIOT/pull/7383","diff_url":"https://github.com/RIOT-OS/RIOT/pull/7383.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/7383.patch","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/7383","number":7383,"state":"open","locked":false,"title":"clicker,wifire: Add SPI peripheral support","user":{"login":"francois-berder","id":18538310,"avatar_url":"https://avatars2.githubusercontent.com/u/18538310?v=4","gravatar_id":"","url":"https://api.github.com/users/francois-berder","html_url":"https://github.com/francois-berder","followers_url":"https://api.github.com/users/francois-berder/followers","following_url":"https://api.github.com/users/francois-berder/following{/other_user}","gists_url":"https://api.github.com/users/francois-berder/gists{/gist_id}","starred_url":"https://api.github.com/users/francois-berder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francois-berder/subscriptions","organizations_url":"https://api.github.com/users/francois-berder/orgs","repos_url":"https://api.github.com/users/francois-berder/repos","events_url":"https://api.github.com/users/francois-berder/events{/privacy}","received_events_url":"https://api.github.com/users/francois-berder/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-07-18T22:26:35Z","updated_at":"2017-09-30T21:34:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e136f658741d26643ca1f14f0b607c9514b927bc","assignee":{"login":"neiljay","id":21042410,"avatar_url":"https://avatars0.githubusercontent.com/u/21042410?v=4","gravatar_id":"","url":"https://api.github.com/users/neiljay","html_url":"https://github.com/neiljay","followers_url":"https://api.github.com/users/neiljay/followers","following_url":"https://api.github.com/users/neiljay/following{/other_user}","gists_url":"https://api.github.com/users/neiljay/gists{/gist_id}","starred_url":"https://api.github.com/users/neiljay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neiljay/subscriptions","organizations_url":"https://api.github.com/users/neiljay/orgs","repos_url":"https://api.github.com/users/neiljay/repos","events_url":"https://api.github.com/users/neiljay/events{/privacy}","received_events_url":"https://api.github.com/users/neiljay/received_events","type":"User","site_admin":false},"assignees":[{"login":"neiljay","id":21042410,"avatar_url":"https://avatars0.githubusercontent.com/u/21042410?v=4","gravatar_id":"","url":"https://api.github.com/users/neiljay","html_url":"https://github.com/neiljay","followers_url":"https://api.github.com/users/neiljay/followers","following_url":"https://api.github.com/users/neiljay/following{/other_user}","gists_url":"https://api.github.com/users/neiljay/gists{/gist_id}","starred_url":"https://api.github.com/users/neiljay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neiljay/subscriptions","organizations_url":"https://api.github.com/users/neiljay/orgs","repos_url":"https://api.github.com/users/neiljay/repos","events_url":"https://api.github.com/users/neiljay/events{/privacy}","received_events_url":"https://api.github.com/users/neiljay/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/7383/commits","review_comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/7383/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/7383/comments","statuses_url":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/96fd9b882bf04ad509191bbcecf8e6abd57ae9cd","head":{"label":"francois-berder:pic32-periph-spi","ref":"pic32-periph-spi","sha":"96fd9b882bf04ad509191bbcecf8e6abd57ae9cd","user":{"login":"francois-berder","id":18538310,"avatar_url":"https://avatars2.githubusercontent.com/u/18538310?v=4","gravatar_id":"","url":"https://api.github.com/users/francois-berder","html_url":"https://github.com/francois-berder","followers_url":"https://api.github.com/users/francois-berder/followers","following_url":"https://api.github.com/users/francois-berder/following{/other_user}","gists_url":"https://api.github.com/users/francois-berder/gists{/gist_id}","starred_url":"https://api.github.com/users/francois-berder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francois-berder/subscriptions","organizations_url":"https://api.github.com/users/francois-berder/orgs","repos_url":"https://api.github.com/users/francois-berder/repos","events_url":"https://api.github.com/users/francois-berder/events{/privacy}","received_events_url":"https://api.github.com/users/francois-berder/received_events","type":"User","site_admin":false},"repo":{"id":70479127,"name":"RIOT","full_name":"francois-berder/RIOT","owner":{"login":"francois-berder","id":18538310,"avatar_url":"https://avatars2.githubusercontent.com/u/18538310?v=4","gravatar_id":"","url":"https://api.github.com/users/francois-berder","html_url":"https://github.com/francois-berder","followers_url":"https://api.github.com/users/francois-berder/followers","following_url":"https://api.github.com/users/francois-berder/following{/other_user}","gists_url":"https://api.github.com/users/francois-berder/gists{/gist_id}","starred_url":"https://api.github.com/users/francois-berder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francois-berder/subscriptions","organizations_url":"https://api.github.com/users/francois-berder/orgs","repos_url":"https://api.github.com/users/francois-berder/repos","events_url":"https://api.github.com/users/francois-berder/events{/privacy}","received_events_url":"https://api.github.com/users/francois-berder/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/francois-berder/RIOT","description":"RIOT -  The friendly OS for IoT","fork":true,"url":"https://api.github.com/repos/francois-berder/RIOT","forks_url":"https://api.github.com/repos/francois-berder/RIOT/forks","keys_url":"https://api.github.com/repos/francois-berder/RIOT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/francois-berder/RIOT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/francois-berder/RIOT/teams","hooks_url":"https://api.github.com/repos/francois-berder/RIOT/hooks","issue_events_url":"https://api.github.com/repos/francois-berder/RIOT/issues/events{/number}","events_url":"https://api.github.com/repos/francois-berder/RIOT/events","assignees_url":"https://api.github.com/repos/francois-berder/RIOT/assignees{/user}","branches_url":"https://api.github.com/repos/francois-berder/RIOT/branches{/branch}","tags_url":"https://api.github.com/repos/francois-berder/RIOT/tags","blobs_url":"https://api.github.com/repos/francois-berder/RIOT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/francois-berder/RIOT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/francois-berder/RIOT/git/refs{/sha}","trees_url":"https://api.github.com/repos/francois-berder/RIOT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/francois-berder/RIOT/statuses/{sha}","languages_url":"https://api.github.com/repos/francois-berder/RIOT/languages","stargazers_url":"https://api.github.com/repos/francois-berder/RIOT/stargazers","contributors_url":"https://api.github.com/repos/francois-berder/RIOT/contributors","subscribers_url":"https://api.github.com/repos/francois-berder/RIOT/subscribers","subscription_url":"https://api.github.com/repos/francois-berder/RIOT/subscription","commits_url":"https://api.github.com/repos/francois-berder/RIOT/commits{/sha}","git_commits_url":"https://api.github.com/repos/francois-berder/RIOT/git/commits{/sha}","comments_url":"https://api.github.com/repos/francois-berder/RIOT/comments{/number}","issue_comment_url":"https://api.github.com/repos/francois-berder/RIOT/issues/comments{/number}","contents_url":"https://api.github.com/repos/francois-berder/RIOT/contents/{+path}","compare_url":"https://api.github.com/repos/francois-berder/RIOT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/francois-berder/RIOT/merges","archive_url":"https://api.github.com/repos/francois-berder/RIOT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/francois-berder/RIOT/downloads","issues_url":"https://api.github.com/repos/francois-berder/RIOT/issues{/number}","pulls_url":"https://api.github.com/repos/francois-berder/RIOT/pulls{/number}","milestones_url":"https://api.github.com/repos/francois-berder/RIOT/milestones{/number}","notifications_url":"https://api.github.com/repos/francois-berder/RIOT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/francois-berder/RIOT/labels{/name}","releases_url":"https://api.github.com/repos/francois-berder/RIOT/releases{/id}","deployments_url":"https://api.github.com/repos/francois-berder/RIOT/deployments","created_at":"2016-10-10T10:54:21Z","updated_at":"2017-04-26T10:21:49Z","pushed_at":"2017-09-30T15:02:29Z","git_url":"git://github.com/francois-berder/RIOT.git","ssh_url":"git@github.com:francois-berder/RIOT.git","clone_url":"https://github.com/francois-berder/RIOT.git","svn_url":"https://github.com/francois-berder/RIOT","homepage":"https://github.com/RIOT-OS/RIOT/wiki","size":43499,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"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":"RIOT-OS:master","ref":"master","sha":"4ff174dd02767ec357eeb8b2b64b629926d4a24a","user":{"login":"RIOT-OS","id":3079480,"avatar_url":"https://avatars2.githubusercontent.com/u/3079480?v=4","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://avatars2.githubusercontent.com/u/3079480?v=4","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}","deployments_url":"https://api.github.com/repos/RIOT-OS/RIOT/deployments","created_at":"2012-12-29T20:38:40Z","updated_at":"2017-09-29T10:40:27Z","pushed_at":"2017-09-30T20:58: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":43186,"stargazers_count":1404,"watchers_count":1404,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":843,"mirror_url":null,"open_issues_count":691,"forks":843,"open_issues":691,"watchers":1404,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/7383"},"html":{"href":"https://github.com/RIOT-OS/RIOT/pull/7383"},"issue":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/issues/7383"},"comments":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/issues/7383/comments"},"review_comments":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/7383/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/7383/commits"},"statuses":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/96fd9b882bf04ad509191bbcecf8e6abd57ae9cd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kaspar030"}}