{"action":"created","comment":{"url":"https://api.github.com/repos/kammce/SJSU-Dev2/pulls/comments/208247230","pull_request_review_id":144015353,"id":208247230,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODI0NzIzMA==","diff_hunk":"@@ -1,13 +1,176 @@\n #pragma once\n \n #include <cstdint>\n+#include <cstdio>\n+#include \"config.hpp\"\n+#include \"L0_LowLevel/LPC40xx.h\"\n+#include \"L1_Drivers/pin_configure.hpp\"\n \n class PwmInterface\n {\n  public:\n+    enum SysClk : uint8_t\n+    {\n+        kActivatePwm0 = (1 << 5),\n+        kActivatePwm1 = (1 << 6)\n+    };\n+    enum PwmConfigure : uint8_t\n+    {\n+        kTimerMode = 0,\n+        kUsePwmCap0 = (0 << 2),\n+        kCounterEnable = (1 << 0),\n+        kResetMr0 = (1 << 1),\n+        kPwmEnable = (1 << 3)\n+    };\n     virtual void Initialize(uint32_t frequency_hz = 1'000) = 0;\n     virtual void SetDutyCycle(float duty_cycle) = 0;\n     virtual float GetDutyCycle() = 0;\n     virtual void SetFrequency(uint32_t frequency_hz) = 0;\n     virtual uint32_t GetFrequency() = 0;\n };\n+\n+class Pwm : public PwmInterface\n+{\n+ public:\n+    static constexpr uint8_t kPwmFunction = 0b001;\n+    static constexpr uint8_t kGpioFunction = 0b000;\n+    // The variable that holds the MR values\n+    static constexpr volatile uint32_t * match_register_table[7] = \n+    {\n+        & LPC_PWM1->MR0,\n+        & LPC_PWM1->MR1,\n+        & LPC_PWM1->MR2,\n+        & LPC_PWM1->MR3,\n+        & LPC_PWM1->MR4,\n+        & LPC_PWM1->MR5,\n+        & LPC_PWM1->MR6\n+    };\n+\n+","path":"firmware/library/L1_Drivers/pwm.hpp","position":49,"original_position":49,"commit_id":"af441a10e6b5ee7a33ee3a14cbf0485313ccf97b","original_commit_id":"af441a10e6b5ee7a33ee3a14cbf0485313ccf97b","user":{"login":"kammce","id":4549768,"node_id":"MDQ6VXNlcjQ1NDk3Njg=","avatar_url":"https://avatars0.githubusercontent.com/u/4549768?v=4","gravatar_id":"","url":"https://api.github.com/users/kammce","html_url":"https://github.com/kammce","followers_url":"https://api.github.com/users/kammce/followers","following_url":"https://api.github.com/users/kammce/following{/other_user}","gists_url":"https://api.github.com/users/kammce/gists{/gist_id}","starred_url":"https://api.github.com/users/kammce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kammce/subscriptions","organizations_url":"https://api.github.com/users/kammce/orgs","repos_url":"https://api.github.com/users/kammce/repos","events_url":"https://api.github.com/users/kammce/events{/privacy}","received_events_url":"https://api.github.com/users/kammce/received_events","type":"User","site_admin":false},"body":"Remove extra newline.","created_at":"2018-08-07T14:13:32Z","updated_at":"2018-08-07T14:40:35Z","html_url":"https://github.com/kammce/SJSU-Dev2/pull/137#discussion_r208247230","pull_request_url":"https://api.github.com/repos/kammce/SJSU-Dev2/pulls/137","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/kammce/SJSU-Dev2/pulls/comments/208247230"},"html":{"href":"https://github.com/kammce/SJSU-Dev2/pull/137#discussion_r208247230"},"pull_request":{"href":"https://api.github.com/repos/kammce/SJSU-Dev2/pulls/137"}}},"pull_request":{"url":"https://api.github.com/repos/kammce/SJSU-Dev2/pulls/137","id":205270388,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1MjcwMzg4","html_url":"https://github.com/kammce/SJSU-Dev2/pull/137","diff_url":"https://github.com/kammce/SJSU-Dev2/pull/137.diff","patch_url":"https://github.com/kammce/SJSU-Dev2/pull/137.patch","issue_url":"https://api.github.com/repos/kammce/SJSU-Dev2/issues/137","number":137,"state":"open","locked":false,"title":"Pwm driver implementation","user":{"login":"delwin-lei","id":16160196,"node_id":"MDQ6VXNlcjE2MTYwMTk2","avatar_url":"https://avatars0.githubusercontent.com/u/16160196?v=4","gravatar_id":"","url":"https://api.github.com/users/delwin-lei","html_url":"https://github.com/delwin-lei","followers_url":"https://api.github.com/users/delwin-lei/followers","following_url":"https://api.github.com/users/delwin-lei/following{/other_user}","gists_url":"https://api.github.com/users/delwin-lei/gists{/gist_id}","starred_url":"https://api.github.com/users/delwin-lei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delwin-lei/subscriptions","organizations_url":"https://api.github.com/users/delwin-lei/orgs","repos_url":"https://api.github.com/users/delwin-lei/repos","events_url":"https://api.github.com/users/delwin-lei/events{/privacy}","received_events_url":"https://api.github.com/users/delwin-lei/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-31T23:31:46Z","updated_at":"2018-08-07T14:40:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ff7406c41e533854f468be434a5567119679f32a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kammce/SJSU-Dev2/pulls/137/commits","review_comments_url":"https://api.github.com/repos/kammce/SJSU-Dev2/pulls/137/comments","review_comment_url":"https://api.github.com/repos/kammce/SJSU-Dev2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kammce/SJSU-Dev2/issues/137/comments","statuses_url":"https://api.github.com/repos/kammce/SJSU-Dev2/statuses/af441a10e6b5ee7a33ee3a14cbf0485313ccf97b","head":{"label":"delwin-lei:pwm_driver","ref":"pwm_driver","sha":"af441a10e6b5ee7a33ee3a14cbf0485313ccf97b","user":{"login":"delwin-lei","id":16160196,"node_id":"MDQ6VXNlcjE2MTYwMTk2","avatar_url":"https://avatars0.githubusercontent.com/u/16160196?v=4","gravatar_id":"","url":"https://api.github.com/users/delwin-lei","html_url":"https://github.com/delwin-lei","followers_url":"https://api.github.com/users/delwin-lei/followers","following_url":"https://api.github.com/users/delwin-lei/following{/other_user}","gists_url":"https://api.github.com/users/delwin-lei/gists{/gist_id}","starred_url":"https://api.github.com/users/delwin-lei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delwin-lei/subscriptions","organizations_url":"https://api.github.com/users/delwin-lei/orgs","repos_url":"https://api.github.com/users/delwin-lei/repos","events_url":"https://api.github.com/users/delwin-lei/events{/privacy}","received_events_url":"https://api.github.com/users/delwin-lei/received_events","type":"User","site_admin":false},"repo":{"id":137277734,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcyNzc3MzQ=","name":"SJSU-Dev2","full_name":"delwin-lei/SJSU-Dev2","owner":{"login":"delwin-lei","id":16160196,"node_id":"MDQ6VXNlcjE2MTYwMTk2","avatar_url":"https://avatars0.githubusercontent.com/u/16160196?v=4","gravatar_id":"","url":"https://api.github.com/users/delwin-lei","html_url":"https://github.com/delwin-lei","followers_url":"https://api.github.com/users/delwin-lei/followers","following_url":"https://api.github.com/users/delwin-lei/following{/other_user}","gists_url":"https://api.github.com/users/delwin-lei/gists{/gist_id}","starred_url":"https://api.github.com/users/delwin-lei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delwin-lei/subscriptions","organizations_url":"https://api.github.com/users/delwin-lei/orgs","repos_url":"https://api.github.com/users/delwin-lei/repos","events_url":"https://api.github.com/users/delwin-lei/events{/privacy}","received_events_url":"https://api.github.com/users/delwin-lei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/delwin-lei/SJSU-Dev2","description":"Firmware framework written by San Jose State University for the SJTwo board and LPC4078 microprocessor","fork":true,"url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2","forks_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/forks","keys_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/teams","hooks_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/hooks","issue_events_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/issues/events{/number}","events_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/events","assignees_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/assignees{/user}","branches_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/branches{/branch}","tags_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/tags","blobs_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/git/refs{/sha}","trees_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/statuses/{sha}","languages_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/languages","stargazers_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/stargazers","contributors_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/contributors","subscribers_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/subscribers","subscription_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/subscription","commits_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/commits{/sha}","git_commits_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/git/commits{/sha}","comments_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/comments{/number}","issue_comment_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/issues/comments{/number}","contents_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/contents/{+path}","compare_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/merges","archive_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/downloads","issues_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/issues{/number}","pulls_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/pulls{/number}","milestones_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/milestones{/number}","notifications_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/labels{/name}","releases_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/releases{/id}","deployments_url":"https://api.github.com/repos/delwin-lei/SJSU-Dev2/deployments","created_at":"2018-06-13T22:21:03Z","updated_at":"2018-08-06T03:48:19Z","pushed_at":"2018-08-06T04:47:01Z","git_url":"git://github.com/delwin-lei/SJSU-Dev2.git","ssh_url":"git@github.com:delwin-lei/SJSU-Dev2.git","clone_url":"https://github.com/delwin-lei/SJSU-Dev2.git","svn_url":"https://github.com/delwin-lei/SJSU-Dev2","homepage":null,"size":55331,"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,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kammce:master","ref":"master","sha":"591a706ca51e4992a5f276c47b1b4325d5b6d92a","user":{"login":"kammce","id":4549768,"node_id":"MDQ6VXNlcjQ1NDk3Njg=","avatar_url":"https://avatars0.githubusercontent.com/u/4549768?v=4","gravatar_id":"","url":"https://api.github.com/users/kammce","html_url":"https://github.com/kammce","followers_url":"https://api.github.com/users/kammce/followers","following_url":"https://api.github.com/users/kammce/following{/other_user}","gists_url":"https://api.github.com/users/kammce/gists{/gist_id}","starred_url":"https://api.github.com/users/kammce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kammce/subscriptions","organizations_url":"https://api.github.com/users/kammce/orgs","repos_url":"https://api.github.com/users/kammce/repos","events_url":"https://api.github.com/users/kammce/events{/privacy}","received_events_url":"https://api.github.com/users/kammce/received_events","type":"User","site_admin":false},"repo":{"id":128694826,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg2OTQ4MjY=","name":"SJSU-Dev2","full_name":"kammce/SJSU-Dev2","owner":{"login":"kammce","id":4549768,"node_id":"MDQ6VXNlcjQ1NDk3Njg=","avatar_url":"https://avatars0.githubusercontent.com/u/4549768?v=4","gravatar_id":"","url":"https://api.github.com/users/kammce","html_url":"https://github.com/kammce","followers_url":"https://api.github.com/users/kammce/followers","following_url":"https://api.github.com/users/kammce/following{/other_user}","gists_url":"https://api.github.com/users/kammce/gists{/gist_id}","starred_url":"https://api.github.com/users/kammce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kammce/subscriptions","organizations_url":"https://api.github.com/users/kammce/orgs","repos_url":"https://api.github.com/users/kammce/repos","events_url":"https://api.github.com/users/kammce/events{/privacy}","received_events_url":"https://api.github.com/users/kammce/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kammce/SJSU-Dev2","description":"Firmware framework written by San Jose State University for the SJTwo board and LPC4078 microprocessor","fork":false,"url":"https://api.github.com/repos/kammce/SJSU-Dev2","forks_url":"https://api.github.com/repos/kammce/SJSU-Dev2/forks","keys_url":"https://api.github.com/repos/kammce/SJSU-Dev2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kammce/SJSU-Dev2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kammce/SJSU-Dev2/teams","hooks_url":"https://api.github.com/repos/kammce/SJSU-Dev2/hooks","issue_events_url":"https://api.github.com/repos/kammce/SJSU-Dev2/issues/events{/number}","events_url":"https://api.github.com/repos/kammce/SJSU-Dev2/events","assignees_url":"https://api.github.com/repos/kammce/SJSU-Dev2/assignees{/user}","branches_url":"https://api.github.com/repos/kammce/SJSU-Dev2/branches{/branch}","tags_url":"https://api.github.com/repos/kammce/SJSU-Dev2/tags","blobs_url":"https://api.github.com/repos/kammce/SJSU-Dev2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kammce/SJSU-Dev2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kammce/SJSU-Dev2/git/refs{/sha}","trees_url":"https://api.github.com/repos/kammce/SJSU-Dev2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kammce/SJSU-Dev2/statuses/{sha}","languages_url":"https://api.github.com/repos/kammce/SJSU-Dev2/languages","stargazers_url":"https://api.github.com/repos/kammce/SJSU-Dev2/stargazers","contributors_url":"https://api.github.com/repos/kammce/SJSU-Dev2/contributors","subscribers_url":"https://api.github.com/repos/kammce/SJSU-Dev2/subscribers","subscription_url":"https://api.github.com/repos/kammce/SJSU-Dev2/subscription","commits_url":"https://api.github.com/repos/kammce/SJSU-Dev2/commits{/sha}","git_commits_url":"https://api.github.com/repos/kammce/SJSU-Dev2/git/commits{/sha}","comments_url":"https://api.github.com/repos/kammce/SJSU-Dev2/comments{/number}","issue_comment_url":"https://api.github.com/repos/kammce/SJSU-Dev2/issues/comments{/number}","contents_url":"https://api.github.com/repos/kammce/SJSU-Dev2/contents/{+path}","compare_url":"https://api.github.com/repos/kammce/SJSU-Dev2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kammce/SJSU-Dev2/merges","archive_url":"https://api.github.com/repos/kammce/SJSU-Dev2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kammce/SJSU-Dev2/downloads","issues_url":"https://api.github.com/repos/kammce/SJSU-Dev2/issues{/number}","pulls_url":"https://api.github.com/repos/kammce/SJSU-Dev2/pulls{/number}","milestones_url":"https://api.github.com/repos/kammce/SJSU-Dev2/milestones{/number}","notifications_url":"https://api.github.com/repos/kammce/SJSU-Dev2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kammce/SJSU-Dev2/labels{/name}","releases_url":"https://api.github.com/repos/kammce/SJSU-Dev2/releases{/id}","deployments_url":"https://api.github.com/repos/kammce/SJSU-Dev2/deployments","created_at":"2018-04-09T00:49:32Z","updated_at":"2018-08-06T00:30:04Z","pushed_at":"2018-08-07T05:30:58Z","git_url":"git://github.com/kammce/SJSU-Dev2.git","ssh_url":"git@github.com:kammce/SJSU-Dev2.git","clone_url":"https://github.com/kammce/SJSU-Dev2.git","svn_url":"https://github.com/kammce/SJSU-Dev2","homepage":null,"size":50023,"stargazers_count":8,"watchers_count":8,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"archived":false,"open_issues_count":68,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":31,"open_issues":68,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kammce/SJSU-Dev2/pulls/137"},"html":{"href":"https://github.com/kammce/SJSU-Dev2/pull/137"},"issue":{"href":"https://api.github.com/repos/kammce/SJSU-Dev2/issues/137"},"comments":{"href":"https://api.github.com/repos/kammce/SJSU-Dev2/issues/137/comments"},"review_comments":{"href":"https://api.github.com/repos/kammce/SJSU-Dev2/pulls/137/comments"},"review_comment":{"href":"https://api.github.com/repos/kammce/SJSU-Dev2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kammce/SJSU-Dev2/pulls/137/commits"},"statuses":{"href":"https://api.github.com/repos/kammce/SJSU-Dev2/statuses/af441a10e6b5ee7a33ee3a14cbf0485313ccf97b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"kammce"}}