{"action":"created","comment":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments/188693977","pull_request_review_id":120724494,"id":188693977,"diff_hunk":"@@ -19,220 +18,346 @@\n #ifndef MBED_SPI_API_H\n #define MBED_SPI_API_H\n \n+#include <stdbool.h>\n+#include <stdint.h>\n #include \"device.h\"\n-#include \"hal/dma_api.h\"\n-#include \"hal/buffer.h\"\n \n #if DEVICE_SPI\n+/**\n+ * \\defgroup hal_spi SPI: Serial peripheral interface HAL API.\n+ * Low level interface to the serial peripheral interface of a target.\n+ *\n+ * ## Programming model\n+ * This is an OOP like API. spi_t is used a \"this\".<br/>\n+ * Methods not having this type as their first parameter are **class** methods.<br/>\n+ * Methods with an spi_t object as their first parameter are **instance** methods.<br/>\n+ * `spi_init()` acts as the \"constructor\"(/initialiser) of this *class*.<br/>\n+ * `spi_free()` acts as the \"destructor\"(/deinitialiser) of this *class*.<br/>\n+ *\n+ * ## General requirements\n+ * - Multiple instances can share pins such as MISO/MOSI/MCLK but not their SS pin. This pin is used\n+ *   to distinguish communication channels (master or slaves).\n+ * - As the instance allocation is at the user's responsibility, the hal implementation cannot keep\n+ *   a copy of the pointer (keep an alias to the object) as it may be stack allocated and/or moved.\n+ * - All method must be thread safe at HAL level.\n+ * - The hal implementation must support both clock phases.\n+ * - The hal implementation must support both clock polarities.\n+ * - The hal implementation must support either master or slave or both modes.\n+ * - The hal implementation must support either lsb first or msb first or both bit ordering.\n+ * - The hal implementation must support either continuous or noncontinuous or both modes.\n+ * - The hal implementation must support at least 1 word length in the range 4 to 32.\n+ * - The hal implementation must support the simplex and full duplex modes.\n+ * - The hal implementation may or may not support the half-duplex, dual and/or quad-io modes.\n+ * - The accuracy of the clock generated in master mode by the hal implementation must be within +/-\n+ *   0.1% of the user requested frequency.\n+ *\n+ * # Defined behaviours\n+ * - spi_get_capabilities(..)","path":"hal/spi_api.h","position":51,"original_position":51,"commit_id":"5ce387c681c065752469905c9f3d8a40473ad3f9","original_commit_id":"5ce387c681c065752469905c9f3d8a40473ad3f9","user":{"login":"ithinuel","id":4605303,"avatar_url":"https://avatars3.githubusercontent.com/u/4605303?v=4","gravatar_id":"","url":"https://api.github.com/users/ithinuel","html_url":"https://github.com/ithinuel","followers_url":"https://api.github.com/users/ithinuel/followers","following_url":"https://api.github.com/users/ithinuel/following{/other_user}","gists_url":"https://api.github.com/users/ithinuel/gists{/gist_id}","starred_url":"https://api.github.com/users/ithinuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ithinuel/subscriptions","organizations_url":"https://api.github.com/users/ithinuel/orgs","repos_url":"https://api.github.com/users/ithinuel/repos","events_url":"https://api.github.com/users/ithinuel/events{/privacy}","received_events_url":"https://api.github.com/users/ithinuel/received_events","type":"User","site_admin":false},"body":"These functions are not yet defined. @mprse and @jamesbeyond are working on this.","created_at":"2018-05-16T16:40:21Z","updated_at":"2018-05-16T16:40:22Z","html_url":"https://github.com/ARMmbed/mbed-os/pull/6782#discussion_r188693977","pull_request_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6782","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments/188693977"},"html":{"href":"https://github.com/ARMmbed/mbed-os/pull/6782#discussion_r188693977"},"pull_request":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6782"}},"in_reply_to_id":188682389},"pull_request":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6782","id":185163381,"html_url":"https://github.com/ARMmbed/mbed-os/pull/6782","diff_url":"https://github.com/ARMmbed/mbed-os/pull/6782.diff","patch_url":"https://github.com/ARMmbed/mbed-os/pull/6782.patch","issue_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/6782","number":6782,"state":"open","locked":false,"title":"Update SPI hal API","user":{"login":"ithinuel","id":4605303,"avatar_url":"https://avatars3.githubusercontent.com/u/4605303?v=4","gravatar_id":"","url":"https://api.github.com/users/ithinuel","html_url":"https://github.com/ithinuel","followers_url":"https://api.github.com/users/ithinuel/followers","following_url":"https://api.github.com/users/ithinuel/following{/other_user}","gists_url":"https://api.github.com/users/ithinuel/gists{/gist_id}","starred_url":"https://api.github.com/users/ithinuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ithinuel/subscriptions","organizations_url":"https://api.github.com/users/ithinuel/orgs","repos_url":"https://api.github.com/users/ithinuel/repos","events_url":"https://api.github.com/users/ithinuel/events{/privacy}","received_events_url":"https://api.github.com/users/ithinuel/received_events","type":"User","site_admin":false},"body":"### Description\r\n\r\nThis PR bring a new and *well defined* SPI api at HAL level.\r\n\r\nThis disables SPI for all targets as tests needs to be added & all low-level drivers needs to be re-qualified against these tests.\r\n\r\n### Pull request type\r\n\r\n    [ ] Fix\r\n    [ ] Refactor\r\n    [ ] New target\r\n    [x] Feature\r\n    [ ] Breaking change\r\n\r\n","created_at":"2018-05-01T11:35:52Z","updated_at":"2018-05-16T16:40:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5578a1c1efdb7be6368304ed0a0f52188fc49392","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":144902129,"url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/needs:%20work","name":"needs: work","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6782/commits","review_comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6782/comments","review_comment_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/6782/comments","statuses_url":"https://api.github.com/repos/ARMmbed/mbed-os/statuses/5ce387c681c065752469905c9f3d8a40473ad3f9","head":{"label":"ithinuel:feature-hal-spec-spi","ref":"feature-hal-spec-spi","sha":"5ce387c681c065752469905c9f3d8a40473ad3f9","user":{"login":"ithinuel","id":4605303,"avatar_url":"https://avatars3.githubusercontent.com/u/4605303?v=4","gravatar_id":"","url":"https://api.github.com/users/ithinuel","html_url":"https://github.com/ithinuel","followers_url":"https://api.github.com/users/ithinuel/followers","following_url":"https://api.github.com/users/ithinuel/following{/other_user}","gists_url":"https://api.github.com/users/ithinuel/gists{/gist_id}","starred_url":"https://api.github.com/users/ithinuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ithinuel/subscriptions","organizations_url":"https://api.github.com/users/ithinuel/orgs","repos_url":"https://api.github.com/users/ithinuel/repos","events_url":"https://api.github.com/users/ithinuel/events{/privacy}","received_events_url":"https://api.github.com/users/ithinuel/received_events","type":"User","site_admin":false},"repo":{"id":116013876,"name":"mbed-os","full_name":"ithinuel/mbed-os","owner":{"login":"ithinuel","id":4605303,"avatar_url":"https://avatars3.githubusercontent.com/u/4605303?v=4","gravatar_id":"","url":"https://api.github.com/users/ithinuel","html_url":"https://github.com/ithinuel","followers_url":"https://api.github.com/users/ithinuel/followers","following_url":"https://api.github.com/users/ithinuel/following{/other_user}","gists_url":"https://api.github.com/users/ithinuel/gists{/gist_id}","starred_url":"https://api.github.com/users/ithinuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ithinuel/subscriptions","organizations_url":"https://api.github.com/users/ithinuel/orgs","repos_url":"https://api.github.com/users/ithinuel/repos","events_url":"https://api.github.com/users/ithinuel/events{/privacy}","received_events_url":"https://api.github.com/users/ithinuel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ithinuel/mbed-os","description":"ARM mbed OS is a platform operating system designed for the internet of things","fork":true,"url":"https://api.github.com/repos/ithinuel/mbed-os","forks_url":"https://api.github.com/repos/ithinuel/mbed-os/forks","keys_url":"https://api.github.com/repos/ithinuel/mbed-os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ithinuel/mbed-os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ithinuel/mbed-os/teams","hooks_url":"https://api.github.com/repos/ithinuel/mbed-os/hooks","issue_events_url":"https://api.github.com/repos/ithinuel/mbed-os/issues/events{/number}","events_url":"https://api.github.com/repos/ithinuel/mbed-os/events","assignees_url":"https://api.github.com/repos/ithinuel/mbed-os/assignees{/user}","branches_url":"https://api.github.com/repos/ithinuel/mbed-os/branches{/branch}","tags_url":"https://api.github.com/repos/ithinuel/mbed-os/tags","blobs_url":"https://api.github.com/repos/ithinuel/mbed-os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ithinuel/mbed-os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ithinuel/mbed-os/git/refs{/sha}","trees_url":"https://api.github.com/repos/ithinuel/mbed-os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ithinuel/mbed-os/statuses/{sha}","languages_url":"https://api.github.com/repos/ithinuel/mbed-os/languages","stargazers_url":"https://api.github.com/repos/ithinuel/mbed-os/stargazers","contributors_url":"https://api.github.com/repos/ithinuel/mbed-os/contributors","subscribers_url":"https://api.github.com/repos/ithinuel/mbed-os/subscribers","subscription_url":"https://api.github.com/repos/ithinuel/mbed-os/subscription","commits_url":"https://api.github.com/repos/ithinuel/mbed-os/commits{/sha}","git_commits_url":"https://api.github.com/repos/ithinuel/mbed-os/git/commits{/sha}","comments_url":"https://api.github.com/repos/ithinuel/mbed-os/comments{/number}","issue_comment_url":"https://api.github.com/repos/ithinuel/mbed-os/issues/comments{/number}","contents_url":"https://api.github.com/repos/ithinuel/mbed-os/contents/{+path}","compare_url":"https://api.github.com/repos/ithinuel/mbed-os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ithinuel/mbed-os/merges","archive_url":"https://api.github.com/repos/ithinuel/mbed-os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ithinuel/mbed-os/downloads","issues_url":"https://api.github.com/repos/ithinuel/mbed-os/issues{/number}","pulls_url":"https://api.github.com/repos/ithinuel/mbed-os/pulls{/number}","milestones_url":"https://api.github.com/repos/ithinuel/mbed-os/milestones{/number}","notifications_url":"https://api.github.com/repos/ithinuel/mbed-os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ithinuel/mbed-os/labels{/name}","releases_url":"https://api.github.com/repos/ithinuel/mbed-os/releases{/id}","deployments_url":"https://api.github.com/repos/ithinuel/mbed-os/deployments","created_at":"2018-01-02T12:39:52Z","updated_at":"2018-01-02T12:41:14Z","pushed_at":"2018-05-16T15:33:20Z","git_url":"git://github.com/ithinuel/mbed-os.git","ssh_url":"git@github.com:ithinuel/mbed-os.git","clone_url":"https://github.com/ithinuel/mbed-os.git","svn_url":"https://github.com/ithinuel/mbed-os","homepage":"https://mbed.com","size":203129,"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"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ARMmbed:feature-hal-spec-spi","ref":"feature-hal-spec-spi","sha":"d08c8198306859156425773e1fc3fd8cf7521549","user":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars3.githubusercontent.com/u/8916057?v=4","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":8270972,"name":"mbed-os","full_name":"ARMmbed/mbed-os","owner":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars3.githubusercontent.com/u/8916057?v=4","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-os","description":"ARM Mbed OS is a platform operating system designed for the internet of things","fork":false,"url":"https://api.github.com/repos/ARMmbed/mbed-os","forks_url":"https://api.github.com/repos/ARMmbed/mbed-os/forks","keys_url":"https://api.github.com/repos/ARMmbed/mbed-os/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARMmbed/mbed-os/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARMmbed/mbed-os/teams","hooks_url":"https://api.github.com/repos/ARMmbed/mbed-os/hooks","issue_events_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/events{/number}","events_url":"https://api.github.com/repos/ARMmbed/mbed-os/events","assignees_url":"https://api.github.com/repos/ARMmbed/mbed-os/assignees{/user}","branches_url":"https://api.github.com/repos/ARMmbed/mbed-os/branches{/branch}","tags_url":"https://api.github.com/repos/ARMmbed/mbed-os/tags","blobs_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARMmbed/mbed-os/statuses/{sha}","languages_url":"https://api.github.com/repos/ARMmbed/mbed-os/languages","stargazers_url":"https://api.github.com/repos/ARMmbed/mbed-os/stargazers","contributors_url":"https://api.github.com/repos/ARMmbed/mbed-os/contributors","subscribers_url":"https://api.github.com/repos/ARMmbed/mbed-os/subscribers","subscription_url":"https://api.github.com/repos/ARMmbed/mbed-os/subscription","commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARMmbed/mbed-os/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARMmbed/mbed-os/contents/{+path}","compare_url":"https://api.github.com/repos/ARMmbed/mbed-os/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARMmbed/mbed-os/merges","archive_url":"https://api.github.com/repos/ARMmbed/mbed-os/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARMmbed/mbed-os/downloads","issues_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues{/number}","pulls_url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls{/number}","milestones_url":"https://api.github.com/repos/ARMmbed/mbed-os/milestones{/number}","notifications_url":"https://api.github.com/repos/ARMmbed/mbed-os/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARMmbed/mbed-os/labels{/name}","releases_url":"https://api.github.com/repos/ARMmbed/mbed-os/releases{/id}","deployments_url":"https://api.github.com/repos/ARMmbed/mbed-os/deployments","created_at":"2013-02-18T15:23:11Z","updated_at":"2018-05-16T05:56:40Z","pushed_at":"2018-05-16T16:24:28Z","git_url":"git://github.com/ARMmbed/mbed-os.git","ssh_url":"git@github.com:ARMmbed/mbed-os.git","clone_url":"https://github.com/ARMmbed/mbed-os.git","svn_url":"https://github.com/ARMmbed/mbed-os","homepage":"https://mbed.com","size":206688,"stargazers_count":1653,"watchers_count":1653,"language":"C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1451,"mirror_url":null,"archived":false,"open_issues_count":504,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1451,"open_issues":504,"watchers":1653,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6782"},"html":{"href":"https://github.com/ARMmbed/mbed-os/pull/6782"},"issue":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/issues/6782"},"comments":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/issues/6782/comments"},"review_comments":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6782/comments"},"review_comment":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/6782/commits"},"statuses":{"href":"https://api.github.com/repos/ARMmbed/mbed-os/statuses/5ce387c681c065752469905c9f3d8a40473ad3f9"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ithinuel"}}