{"action":"created","comment":{"url":"https://api.github.com/repos/ARMmbed/mbed-hal/pulls/comments/40083768","id":40083768,"diff_hunk":"@@ -112,54 +166,45 @@ void spi_frequency(spi_t *obj, int hz);\n  *\n  * @param[in] obj   The SPI peripheral to use for sending\n  * @param[in] value The value to send\n- * @return Returns the value received during send\n+ * @return returns the value received during send\n  */\n int  spi_master_write(spi_t *obj, int value);","path":"mbed-hal/spi_api.h","position":156,"original_position":156,"commit_id":"92a841a5a0240cda7bdca4516861c361de76a330","original_commit_id":"92a841a5a0240cda7bdca4516861c361de76a330","user":{"login":"salkinium","id":163066,"avatar_url":"https://avatars.githubusercontent.com/u/163066?v=3","gravatar_id":"","url":"https://api.github.com/users/salkinium","html_url":"https://github.com/salkinium","followers_url":"https://api.github.com/users/salkinium/followers","following_url":"https://api.github.com/users/salkinium/following{/other_user}","gists_url":"https://api.github.com/users/salkinium/gists{/gist_id}","starred_url":"https://api.github.com/users/salkinium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salkinium/subscriptions","organizations_url":"https://api.github.com/users/salkinium/orgs","repos_url":"https://api.github.com/users/salkinium/repos","events_url":"https://api.github.com/users/salkinium/events{/privacy}","received_events_url":"https://api.github.com/users/salkinium/received_events","type":"User","site_admin":false},"body":"Yup, but I was told not to break everything right away.\r\nWe can remove them later on.","created_at":"2015-09-22T13:16:21Z","updated_at":"2015-09-22T13:16:21Z","html_url":"https://github.com/ARMmbed/mbed-hal/pull/22#discussion_r40083768","pull_request_url":"https://api.github.com/repos/ARMmbed/mbed-hal/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/mbed-hal/pulls/comments/40083768"},"html":{"href":"https://github.com/ARMmbed/mbed-hal/pull/22#discussion_r40083768"},"pull_request":{"href":"https://api.github.com/repos/ARMmbed/mbed-hal/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/ARMmbed/mbed-hal/pulls/22","id":45567008,"html_url":"https://github.com/ARMmbed/mbed-hal/pull/22","diff_url":"https://github.com/ARMmbed/mbed-hal/pull/22.diff","patch_url":"https://github.com/ARMmbed/mbed-hal/pull/22.patch","issue_url":"https://api.github.com/repos/ARMmbed/mbed-hal/issues/22","number":22,"state":"open","locked":false,"title":"Improved SPI HAL interface","user":{"login":"salkinium","id":163066,"avatar_url":"https://avatars.githubusercontent.com/u/163066?v=3","gravatar_id":"","url":"https://api.github.com/users/salkinium","html_url":"https://github.com/salkinium","followers_url":"https://api.github.com/users/salkinium/followers","following_url":"https://api.github.com/users/salkinium/following{/other_user}","gists_url":"https://api.github.com/users/salkinium/gists{/gist_id}","starred_url":"https://api.github.com/users/salkinium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salkinium/subscriptions","organizations_url":"https://api.github.com/users/salkinium/orgs","repos_url":"https://api.github.com/users/salkinium/repos","events_url":"https://api.github.com/users/salkinium/events{/privacy}","received_events_url":"https://api.github.com/users/salkinium/received_events","type":"User","site_admin":false},"body":"General: If an error occurs, no state of the SPI module is changed!\r\n\r\n- adds return codes to HAL functions:\r\nin one enum to avoid declaration of too many enum types. Downside is the `@return` doxygen documentation\r\n- removes redundant arguments: Reusing the buffers in `spi_t`. We can then transparently add more information to the `buffer_s` struct without changing the interface.\r\n- removes event masking: This is common code and should be done by the upper layers. Why should the HAL care which events the user actually wants?\r\n- removes DMA hint: The user cannot enforce DMA usage anyway.\r\n- adds proper enums for SPI bitorder, bits and mode: because SPI modes and bit order are random values at best and number of bits aren't negative (what's this obsession with `int` anyway).\r\n- adds return of the generated frequency: this gives the user some idea of the error and hopefully leads to some better prescaler calculation algorithms in the future.\r\n\r\nPlease note that the upper layers must first confirm that the SPI module\r\nis _not_ busy, before calling any of its functions.\r\nThere is no explicit check for this in the HAL layers!\r\nNote that the synchronous APIs are not safe either!\r\n\r\nThere is another interesting discussion here:\r\nI initially wanted to have a `SPI_RC_TRANSFER_WITHOUT_DMA = 1` enum type, before concluding that this information is not useful.\r\nWhat is the stand on having multiple positive success return codes in our C API?\r\n\r\n@bremoran @0xc0170 @bogdanm @hugovincent ","created_at":"2015-09-21T16:03:08Z","updated_at":"2015-09-22T13:16:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"611edd3c6196d937446597ff35fcf7e38a232aa3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ARMmbed/mbed-hal/pulls/22/commits","review_comments_url":"https://api.github.com/repos/ARMmbed/mbed-hal/pulls/22/comments","review_comment_url":"https://api.github.com/repos/ARMmbed/mbed-hal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-hal/issues/22/comments","statuses_url":"https://api.github.com/repos/ARMmbed/mbed-hal/statuses/92a841a5a0240cda7bdca4516861c361de76a330","head":{"label":"salkinium:feature/spi_hal","ref":"feature/spi_hal","sha":"92a841a5a0240cda7bdca4516861c361de76a330","user":{"login":"salkinium","id":163066,"avatar_url":"https://avatars.githubusercontent.com/u/163066?v=3","gravatar_id":"","url":"https://api.github.com/users/salkinium","html_url":"https://github.com/salkinium","followers_url":"https://api.github.com/users/salkinium/followers","following_url":"https://api.github.com/users/salkinium/following{/other_user}","gists_url":"https://api.github.com/users/salkinium/gists{/gist_id}","starred_url":"https://api.github.com/users/salkinium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salkinium/subscriptions","organizations_url":"https://api.github.com/users/salkinium/orgs","repos_url":"https://api.github.com/users/salkinium/repos","events_url":"https://api.github.com/users/salkinium/events{/privacy}","received_events_url":"https://api.github.com/users/salkinium/received_events","type":"User","site_admin":false},"repo":{"id":42731114,"name":"mbed-hal","full_name":"salkinium/mbed-hal","owner":{"login":"salkinium","id":163066,"avatar_url":"https://avatars.githubusercontent.com/u/163066?v=3","gravatar_id":"","url":"https://api.github.com/users/salkinium","html_url":"https://github.com/salkinium","followers_url":"https://api.github.com/users/salkinium/followers","following_url":"https://api.github.com/users/salkinium/following{/other_user}","gists_url":"https://api.github.com/users/salkinium/gists{/gist_id}","starred_url":"https://api.github.com/users/salkinium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/salkinium/subscriptions","organizations_url":"https://api.github.com/users/salkinium/orgs","repos_url":"https://api.github.com/users/salkinium/repos","events_url":"https://api.github.com/users/salkinium/events{/privacy}","received_events_url":"https://api.github.com/users/salkinium/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/salkinium/mbed-hal","description":"mbed low-level HAL API","fork":true,"url":"https://api.github.com/repos/salkinium/mbed-hal","forks_url":"https://api.github.com/repos/salkinium/mbed-hal/forks","keys_url":"https://api.github.com/repos/salkinium/mbed-hal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/salkinium/mbed-hal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/salkinium/mbed-hal/teams","hooks_url":"https://api.github.com/repos/salkinium/mbed-hal/hooks","issue_events_url":"https://api.github.com/repos/salkinium/mbed-hal/issues/events{/number}","events_url":"https://api.github.com/repos/salkinium/mbed-hal/events","assignees_url":"https://api.github.com/repos/salkinium/mbed-hal/assignees{/user}","branches_url":"https://api.github.com/repos/salkinium/mbed-hal/branches{/branch}","tags_url":"https://api.github.com/repos/salkinium/mbed-hal/tags","blobs_url":"https://api.github.com/repos/salkinium/mbed-hal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/salkinium/mbed-hal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/salkinium/mbed-hal/git/refs{/sha}","trees_url":"https://api.github.com/repos/salkinium/mbed-hal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/salkinium/mbed-hal/statuses/{sha}","languages_url":"https://api.github.com/repos/salkinium/mbed-hal/languages","stargazers_url":"https://api.github.com/repos/salkinium/mbed-hal/stargazers","contributors_url":"https://api.github.com/repos/salkinium/mbed-hal/contributors","subscribers_url":"https://api.github.com/repos/salkinium/mbed-hal/subscribers","subscription_url":"https://api.github.com/repos/salkinium/mbed-hal/subscription","commits_url":"https://api.github.com/repos/salkinium/mbed-hal/commits{/sha}","git_commits_url":"https://api.github.com/repos/salkinium/mbed-hal/git/commits{/sha}","comments_url":"https://api.github.com/repos/salkinium/mbed-hal/comments{/number}","issue_comment_url":"https://api.github.com/repos/salkinium/mbed-hal/issues/comments{/number}","contents_url":"https://api.github.com/repos/salkinium/mbed-hal/contents/{+path}","compare_url":"https://api.github.com/repos/salkinium/mbed-hal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/salkinium/mbed-hal/merges","archive_url":"https://api.github.com/repos/salkinium/mbed-hal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/salkinium/mbed-hal/downloads","issues_url":"https://api.github.com/repos/salkinium/mbed-hal/issues{/number}","pulls_url":"https://api.github.com/repos/salkinium/mbed-hal/pulls{/number}","milestones_url":"https://api.github.com/repos/salkinium/mbed-hal/milestones{/number}","notifications_url":"https://api.github.com/repos/salkinium/mbed-hal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/salkinium/mbed-hal/labels{/name}","releases_url":"https://api.github.com/repos/salkinium/mbed-hal/releases{/id}","created_at":"2015-09-18T15:39:20Z","updated_at":"2015-09-18T15:39:21Z","pushed_at":"2015-09-22T08:39:48Z","git_url":"git://github.com/salkinium/mbed-hal.git","ssh_url":"git@github.com:salkinium/mbed-hal.git","clone_url":"https://github.com/salkinium/mbed-hal.git","svn_url":"https://github.com/salkinium/mbed-hal","homepage":null,"size":417,"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":"ARMmbed:master","ref":"master","sha":"98eb545df5e150e138070a76e91cfbfda1b6453d","user":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars.githubusercontent.com/u/8916057?v=3","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"repo":{"id":27869498,"name":"mbed-hal","full_name":"ARMmbed/mbed-hal","owner":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars.githubusercontent.com/u/8916057?v=3","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ARMmbed/mbed-hal","description":"mbed low-level HAL API","fork":false,"url":"https://api.github.com/repos/ARMmbed/mbed-hal","forks_url":"https://api.github.com/repos/ARMmbed/mbed-hal/forks","keys_url":"https://api.github.com/repos/ARMmbed/mbed-hal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARMmbed/mbed-hal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARMmbed/mbed-hal/teams","hooks_url":"https://api.github.com/repos/ARMmbed/mbed-hal/hooks","issue_events_url":"https://api.github.com/repos/ARMmbed/mbed-hal/issues/events{/number}","events_url":"https://api.github.com/repos/ARMmbed/mbed-hal/events","assignees_url":"https://api.github.com/repos/ARMmbed/mbed-hal/assignees{/user}","branches_url":"https://api.github.com/repos/ARMmbed/mbed-hal/branches{/branch}","tags_url":"https://api.github.com/repos/ARMmbed/mbed-hal/tags","blobs_url":"https://api.github.com/repos/ARMmbed/mbed-hal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARMmbed/mbed-hal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARMmbed/mbed-hal/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARMmbed/mbed-hal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARMmbed/mbed-hal/statuses/{sha}","languages_url":"https://api.github.com/repos/ARMmbed/mbed-hal/languages","stargazers_url":"https://api.github.com/repos/ARMmbed/mbed-hal/stargazers","contributors_url":"https://api.github.com/repos/ARMmbed/mbed-hal/contributors","subscribers_url":"https://api.github.com/repos/ARMmbed/mbed-hal/subscribers","subscription_url":"https://api.github.com/repos/ARMmbed/mbed-hal/subscription","commits_url":"https://api.github.com/repos/ARMmbed/mbed-hal/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARMmbed/mbed-hal/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-hal/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARMmbed/mbed-hal/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARMmbed/mbed-hal/contents/{+path}","compare_url":"https://api.github.com/repos/ARMmbed/mbed-hal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARMmbed/mbed-hal/merges","archive_url":"https://api.github.com/repos/ARMmbed/mbed-hal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARMmbed/mbed-hal/downloads","issues_url":"https://api.github.com/repos/ARMmbed/mbed-hal/issues{/number}","pulls_url":"https://api.github.com/repos/ARMmbed/mbed-hal/pulls{/number}","milestones_url":"https://api.github.com/repos/ARMmbed/mbed-hal/milestones{/number}","notifications_url":"https://api.github.com/repos/ARMmbed/mbed-hal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARMmbed/mbed-hal/labels{/name}","releases_url":"https://api.github.com/repos/ARMmbed/mbed-hal/releases{/id}","created_at":"2014-12-11T11:59:35Z","updated_at":"2015-09-04T15:56:13Z","pushed_at":"2015-09-22T08:39:48Z","git_url":"git://github.com/ARMmbed/mbed-hal.git","ssh_url":"git@github.com:ARMmbed/mbed-hal.git","clone_url":"https://github.com/ARMmbed/mbed-hal.git","svn_url":"https://github.com/ARMmbed/mbed-hal","homepage":null,"size":417,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/mbed-hal/pulls/22"},"html":{"href":"https://github.com/ARMmbed/mbed-hal/pull/22"},"issue":{"href":"https://api.github.com/repos/ARMmbed/mbed-hal/issues/22"},"comments":{"href":"https://api.github.com/repos/ARMmbed/mbed-hal/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/ARMmbed/mbed-hal/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/ARMmbed/mbed-hal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ARMmbed/mbed-hal/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/ARMmbed/mbed-hal/statuses/92a841a5a0240cda7bdca4516861c361de76a330"}}}}