{"action":"created","comment":{"url":"https://api.github.com/repos/vecnatechnologies/rtems/pulls/comments/39974551","id":39974551,"diff_hunk":"@@ -0,0 +1,507 @@\n+/**\n+ * @file hal-spi.c\n+ *\n+ * @ingroup spi\n+ *\n+ * @brief SPI driver for the STM32xxxx series processors. Provides a\n+ * SPI driver that registers with cpukit/dev/spi as a node in the\n+ * filesystem.\n+ *\n+ */\n+\n+/*\n+ * Copyright (c) 2015 Vecna Technologies, Inc.\n+ *\n+ * The license and distribution terms for this file may be\n+ * found in the file LICENSE in this distribution or at\n+ * http://www.rtems.com/license/LICENSE.\n+ */\n+\n+//================== STMF32 Support Functions =================================\n+#include <rtems.h>\n+#include <hal-utils.h>\n+#include <stm32f-processor-specific.h>\n+#include <bspopts.h>\n+\n+#include stm_processor_header(TARGET_STM_PROCESSOR_PREFIX)\n+#include stm_header(TARGET_STM_PROCESSOR_PREFIX, dma)\n+#include stm_header(TARGET_STM_PROCESSOR_PREFIX, spi)\n+#include stm_header(TARGET_STM_PROCESSOR_PREFIX, rcc)\n+#include stm_header(TARGET_STM_PROCESSOR_PREFIX, gpio)\n+\n+#include <hal-spi.h>\n+#include <dev/spi/spi.h>\n+\n+#include <math.h>\n+#include <rtems/irq-extension.h>\n+\n+/**\n+ * SPI Instance enabled / disabled\n+ */\n+bool SPI_Enable[MAX_SPI_INSTANCES] =\n+{\n+#ifndef STM32_ENABLE_SPI1\n+      false,\n+#else\n+      STM32_ENABLE_SPI1,\n+#endif\n+#ifndef STM32_ENABLE_SPI2\n+      false,\n+#else\n+      STM32_ENABLE_SPI2,\n+#endif\n+#ifndef STM32_ENABLE_SPI3\n+      false,\n+#else\n+      STM32_ENABLE_SPI3,\n+#endif\n+#ifndef STM32_ENABLE_SPI4\n+      false,\n+#else\n+      STM32_ENABLE_SPI4,\n+#endif\n+#ifndef STM32_ENABLE_SPI5\n+      false,\n+#else\n+      STM32_ENABLE_SPI5,\n+#endif\n+#ifndef STM32_ENABLE_SPI6\n+      false,\n+#else\n+      STM32_ENABLE_SPI6,\n+#endif\n+};\n+\n+/**\n+ * SPI pin configuration for each instances.\n+ * Pin and port details to be populated in configure.ac file\n+ */","path":"c/src/lib/libbsp/arm/shared/stm32fxxxx/spi/hal-spi.c","position":78,"original_position":78,"commit_id":"aa1cb3646b587ef634b1cbb551806bd778cdeda8","original_commit_id":"5e40dce59652e108b87135c3ee2d1c9d882296a0","user":{"login":"cwoodall","id":518124,"avatar_url":"https://avatars.githubusercontent.com/u/518124?v=3","gravatar_id":"","url":"https://api.github.com/users/cwoodall","html_url":"https://github.com/cwoodall","followers_url":"https://api.github.com/users/cwoodall/followers","following_url":"https://api.github.com/users/cwoodall/following{/other_user}","gists_url":"https://api.github.com/users/cwoodall/gists{/gist_id}","starred_url":"https://api.github.com/users/cwoodall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cwoodall/subscriptions","organizations_url":"https://api.github.com/users/cwoodall/orgs","repos_url":"https://api.github.com/users/cwoodall/repos","events_url":"https://api.github.com/users/cwoodall/events{/privacy}","received_events_url":"https://api.github.com/users/cwoodall/received_events","type":"User","site_admin":false},"body":"SO MANY IFDEFS!!!","created_at":"2015-09-21T14:13:58Z","updated_at":"2015-09-21T14:13:58Z","html_url":"https://github.com/vecnatechnologies/rtems/pull/4#discussion_r39974551","pull_request_url":"https://api.github.com/repos/vecnatechnologies/rtems/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/vecnatechnologies/rtems/pulls/comments/39974551"},"html":{"href":"https://github.com/vecnatechnologies/rtems/pull/4#discussion_r39974551"},"pull_request":{"href":"https://api.github.com/repos/vecnatechnologies/rtems/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/vecnatechnologies/rtems/pulls/4","id":45208791,"html_url":"https://github.com/vecnatechnologies/rtems/pull/4","diff_url":"https://github.com/vecnatechnologies/rtems/pull/4.diff","patch_url":"https://github.com/vecnatechnologies/rtems/pull/4.patch","issue_url":"https://api.github.com/repos/vecnatechnologies/rtems/issues/4","number":4,"state":"open","locked":false,"title":"Stm32 bsp rebase fixes","user":{"login":"igutekunst","id":657081,"avatar_url":"https://avatars.githubusercontent.com/u/657081?v=3","gravatar_id":"","url":"https://api.github.com/users/igutekunst","html_url":"https://github.com/igutekunst","followers_url":"https://api.github.com/users/igutekunst/followers","following_url":"https://api.github.com/users/igutekunst/following{/other_user}","gists_url":"https://api.github.com/users/igutekunst/gists{/gist_id}","starred_url":"https://api.github.com/users/igutekunst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igutekunst/subscriptions","organizations_url":"https://api.github.com/users/igutekunst/orgs","repos_url":"https://api.github.com/users/igutekunst/repos","events_url":"https://api.github.com/users/igutekunst/events{/privacy}","received_events_url":"https://api.github.com/users/igutekunst/received_events","type":"User","site_admin":false},"body":"This pull request includes the latest changes made by Vecna to master broken up into more reasonable commits for review.\r\n\r\nPlease ignore\r\n* Add STM32F4 HAL Files\r\n* Add STM32F7 HAL Files\r\n\r\nThis [Add STM32 Shared Files](https://github.com/vecnatechnologies/rtems/commit/c32676e4aea62f283eee7c8014a96b5b753c1da2) commit is the core of the BSP. It includes the implementation shared between the F4 and F7.\r\n\r\nThis commit: [Added STM32F7X and STM32F4X BSP ](https://github.com/vecnatechnologies/rtems/commit/da2c09cd582bc7995b3756119b39c1764efc02cd) creates two BSPs using the shared code and HAL code.\r\n\r\nThe Makefile.am files in both stm32f4x and stm32f7x directories list the files that are actually compiled into the BSP (in addition to the RTEMS core).\r\n\r\nThe later commits are addressing code review comments, adding I2C, and fixing additional errors. Code reviews will add new commits to this branch.\r\n\r\n","created_at":"2015-09-16T18:43:53Z","updated_at":"2015-09-21T14:13:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"694ac50ec2c86d7d478dbf7f5c84c82d2a5d6c68","assignee":{"login":"igutekunst","id":657081,"avatar_url":"https://avatars.githubusercontent.com/u/657081?v=3","gravatar_id":"","url":"https://api.github.com/users/igutekunst","html_url":"https://github.com/igutekunst","followers_url":"https://api.github.com/users/igutekunst/followers","following_url":"https://api.github.com/users/igutekunst/following{/other_user}","gists_url":"https://api.github.com/users/igutekunst/gists{/gist_id}","starred_url":"https://api.github.com/users/igutekunst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igutekunst/subscriptions","organizations_url":"https://api.github.com/users/igutekunst/orgs","repos_url":"https://api.github.com/users/igutekunst/repos","events_url":"https://api.github.com/users/igutekunst/events{/privacy}","received_events_url":"https://api.github.com/users/igutekunst/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/vecnatechnologies/rtems/milestones/1","html_url":"https://github.com/vecnatechnologies/rtems/milestones/RTEMS%20BSP%20Round%201","labels_url":"https://api.github.com/repos/vecnatechnologies/rtems/milestones/1/labels","id":1309059,"number":1,"title":"RTEMS BSP Round 1","description":"Complete working BSP tested with STM32F407 and STM32F7???.","creator":{"login":"igutekunst","id":657081,"avatar_url":"https://avatars.githubusercontent.com/u/657081?v=3","gravatar_id":"","url":"https://api.github.com/users/igutekunst","html_url":"https://github.com/igutekunst","followers_url":"https://api.github.com/users/igutekunst/followers","following_url":"https://api.github.com/users/igutekunst/following{/other_user}","gists_url":"https://api.github.com/users/igutekunst/gists{/gist_id}","starred_url":"https://api.github.com/users/igutekunst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igutekunst/subscriptions","organizations_url":"https://api.github.com/users/igutekunst/orgs","repos_url":"https://api.github.com/users/igutekunst/repos","events_url":"https://api.github.com/users/igutekunst/events{/privacy}","received_events_url":"https://api.github.com/users/igutekunst/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2015-09-16T18:54:33Z","updated_at":"2015-09-16T18:56:22Z","due_on":"2015-09-30T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/vecnatechnologies/rtems/pulls/4/commits","review_comments_url":"https://api.github.com/repos/vecnatechnologies/rtems/pulls/4/comments","review_comment_url":"https://api.github.com/repos/vecnatechnologies/rtems/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vecnatechnologies/rtems/issues/4/comments","statuses_url":"https://api.github.com/repos/vecnatechnologies/rtems/statuses/aa1cb3646b587ef634b1cbb551806bd778cdeda8","head":{"label":"vecnatechnologies:stm32-bsp-rebase-fixes","ref":"stm32-bsp-rebase-fixes","sha":"aa1cb3646b587ef634b1cbb551806bd778cdeda8","user":{"login":"vecnatechnologies","id":781589,"avatar_url":"https://avatars.githubusercontent.com/u/781589?v=3","gravatar_id":"","url":"https://api.github.com/users/vecnatechnologies","html_url":"https://github.com/vecnatechnologies","followers_url":"https://api.github.com/users/vecnatechnologies/followers","following_url":"https://api.github.com/users/vecnatechnologies/following{/other_user}","gists_url":"https://api.github.com/users/vecnatechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/vecnatechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vecnatechnologies/subscriptions","organizations_url":"https://api.github.com/users/vecnatechnologies/orgs","repos_url":"https://api.github.com/users/vecnatechnologies/repos","events_url":"https://api.github.com/users/vecnatechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/vecnatechnologies/received_events","type":"Organization","site_admin":false},"repo":{"id":42468300,"name":"rtems","full_name":"vecnatechnologies/rtems","owner":{"login":"vecnatechnologies","id":781589,"avatar_url":"https://avatars.githubusercontent.com/u/781589?v=3","gravatar_id":"","url":"https://api.github.com/users/vecnatechnologies","html_url":"https://github.com/vecnatechnologies","followers_url":"https://api.github.com/users/vecnatechnologies/followers","following_url":"https://api.github.com/users/vecnatechnologies/following{/other_user}","gists_url":"https://api.github.com/users/vecnatechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/vecnatechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vecnatechnologies/subscriptions","organizations_url":"https://api.github.com/users/vecnatechnologies/orgs","repos_url":"https://api.github.com/users/vecnatechnologies/repos","events_url":"https://api.github.com/users/vecnatechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/vecnatechnologies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vecnatechnologies/rtems","description":"Kernel, networking, file-systems, drivers, BSPs, samples, and testsuite.","fork":true,"url":"https://api.github.com/repos/vecnatechnologies/rtems","forks_url":"https://api.github.com/repos/vecnatechnologies/rtems/forks","keys_url":"https://api.github.com/repos/vecnatechnologies/rtems/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vecnatechnologies/rtems/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vecnatechnologies/rtems/teams","hooks_url":"https://api.github.com/repos/vecnatechnologies/rtems/hooks","issue_events_url":"https://api.github.com/repos/vecnatechnologies/rtems/issues/events{/number}","events_url":"https://api.github.com/repos/vecnatechnologies/rtems/events","assignees_url":"https://api.github.com/repos/vecnatechnologies/rtems/assignees{/user}","branches_url":"https://api.github.com/repos/vecnatechnologies/rtems/branches{/branch}","tags_url":"https://api.github.com/repos/vecnatechnologies/rtems/tags","blobs_url":"https://api.github.com/repos/vecnatechnologies/rtems/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vecnatechnologies/rtems/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vecnatechnologies/rtems/git/refs{/sha}","trees_url":"https://api.github.com/repos/vecnatechnologies/rtems/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vecnatechnologies/rtems/statuses/{sha}","languages_url":"https://api.github.com/repos/vecnatechnologies/rtems/languages","stargazers_url":"https://api.github.com/repos/vecnatechnologies/rtems/stargazers","contributors_url":"https://api.github.com/repos/vecnatechnologies/rtems/contributors","subscribers_url":"https://api.github.com/repos/vecnatechnologies/rtems/subscribers","subscription_url":"https://api.github.com/repos/vecnatechnologies/rtems/subscription","commits_url":"https://api.github.com/repos/vecnatechnologies/rtems/commits{/sha}","git_commits_url":"https://api.github.com/repos/vecnatechnologies/rtems/git/commits{/sha}","comments_url":"https://api.github.com/repos/vecnatechnologies/rtems/comments{/number}","issue_comment_url":"https://api.github.com/repos/vecnatechnologies/rtems/issues/comments{/number}","contents_url":"https://api.github.com/repos/vecnatechnologies/rtems/contents/{+path}","compare_url":"https://api.github.com/repos/vecnatechnologies/rtems/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vecnatechnologies/rtems/merges","archive_url":"https://api.github.com/repos/vecnatechnologies/rtems/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vecnatechnologies/rtems/downloads","issues_url":"https://api.github.com/repos/vecnatechnologies/rtems/issues{/number}","pulls_url":"https://api.github.com/repos/vecnatechnologies/rtems/pulls{/number}","milestones_url":"https://api.github.com/repos/vecnatechnologies/rtems/milestones{/number}","notifications_url":"https://api.github.com/repos/vecnatechnologies/rtems/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vecnatechnologies/rtems/labels{/name}","releases_url":"https://api.github.com/repos/vecnatechnologies/rtems/releases{/id}","created_at":"2015-09-14T18:22:36Z","updated_at":"2015-09-14T18:23:11Z","pushed_at":"2015-09-21T14:00:49Z","git_url":"git://github.com/vecnatechnologies/rtems.git","ssh_url":"git@github.com:vecnatechnologies/rtems.git","clone_url":"https://github.com/vecnatechnologies/rtems.git","svn_url":"https://github.com/vecnatechnologies/rtems","homepage":"http://git.rtems.org/rtems/","size":159557,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"vecnatechnologies:master","ref":"master","sha":"3df961c7f4fb5ad407171fc728bf586c7e856127","user":{"login":"vecnatechnologies","id":781589,"avatar_url":"https://avatars.githubusercontent.com/u/781589?v=3","gravatar_id":"","url":"https://api.github.com/users/vecnatechnologies","html_url":"https://github.com/vecnatechnologies","followers_url":"https://api.github.com/users/vecnatechnologies/followers","following_url":"https://api.github.com/users/vecnatechnologies/following{/other_user}","gists_url":"https://api.github.com/users/vecnatechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/vecnatechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vecnatechnologies/subscriptions","organizations_url":"https://api.github.com/users/vecnatechnologies/orgs","repos_url":"https://api.github.com/users/vecnatechnologies/repos","events_url":"https://api.github.com/users/vecnatechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/vecnatechnologies/received_events","type":"Organization","site_admin":false},"repo":{"id":42468300,"name":"rtems","full_name":"vecnatechnologies/rtems","owner":{"login":"vecnatechnologies","id":781589,"avatar_url":"https://avatars.githubusercontent.com/u/781589?v=3","gravatar_id":"","url":"https://api.github.com/users/vecnatechnologies","html_url":"https://github.com/vecnatechnologies","followers_url":"https://api.github.com/users/vecnatechnologies/followers","following_url":"https://api.github.com/users/vecnatechnologies/following{/other_user}","gists_url":"https://api.github.com/users/vecnatechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/vecnatechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vecnatechnologies/subscriptions","organizations_url":"https://api.github.com/users/vecnatechnologies/orgs","repos_url":"https://api.github.com/users/vecnatechnologies/repos","events_url":"https://api.github.com/users/vecnatechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/vecnatechnologies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vecnatechnologies/rtems","description":"Kernel, networking, file-systems, drivers, BSPs, samples, and testsuite.","fork":true,"url":"https://api.github.com/repos/vecnatechnologies/rtems","forks_url":"https://api.github.com/repos/vecnatechnologies/rtems/forks","keys_url":"https://api.github.com/repos/vecnatechnologies/rtems/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vecnatechnologies/rtems/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vecnatechnologies/rtems/teams","hooks_url":"https://api.github.com/repos/vecnatechnologies/rtems/hooks","issue_events_url":"https://api.github.com/repos/vecnatechnologies/rtems/issues/events{/number}","events_url":"https://api.github.com/repos/vecnatechnologies/rtems/events","assignees_url":"https://api.github.com/repos/vecnatechnologies/rtems/assignees{/user}","branches_url":"https://api.github.com/repos/vecnatechnologies/rtems/branches{/branch}","tags_url":"https://api.github.com/repos/vecnatechnologies/rtems/tags","blobs_url":"https://api.github.com/repos/vecnatechnologies/rtems/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vecnatechnologies/rtems/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vecnatechnologies/rtems/git/refs{/sha}","trees_url":"https://api.github.com/repos/vecnatechnologies/rtems/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vecnatechnologies/rtems/statuses/{sha}","languages_url":"https://api.github.com/repos/vecnatechnologies/rtems/languages","stargazers_url":"https://api.github.com/repos/vecnatechnologies/rtems/stargazers","contributors_url":"https://api.github.com/repos/vecnatechnologies/rtems/contributors","subscribers_url":"https://api.github.com/repos/vecnatechnologies/rtems/subscribers","subscription_url":"https://api.github.com/repos/vecnatechnologies/rtems/subscription","commits_url":"https://api.github.com/repos/vecnatechnologies/rtems/commits{/sha}","git_commits_url":"https://api.github.com/repos/vecnatechnologies/rtems/git/commits{/sha}","comments_url":"https://api.github.com/repos/vecnatechnologies/rtems/comments{/number}","issue_comment_url":"https://api.github.com/repos/vecnatechnologies/rtems/issues/comments{/number}","contents_url":"https://api.github.com/repos/vecnatechnologies/rtems/contents/{+path}","compare_url":"https://api.github.com/repos/vecnatechnologies/rtems/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vecnatechnologies/rtems/merges","archive_url":"https://api.github.com/repos/vecnatechnologies/rtems/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vecnatechnologies/rtems/downloads","issues_url":"https://api.github.com/repos/vecnatechnologies/rtems/issues{/number}","pulls_url":"https://api.github.com/repos/vecnatechnologies/rtems/pulls{/number}","milestones_url":"https://api.github.com/repos/vecnatechnologies/rtems/milestones{/number}","notifications_url":"https://api.github.com/repos/vecnatechnologies/rtems/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vecnatechnologies/rtems/labels{/name}","releases_url":"https://api.github.com/repos/vecnatechnologies/rtems/releases{/id}","created_at":"2015-09-14T18:22:36Z","updated_at":"2015-09-14T18:23:11Z","pushed_at":"2015-09-21T14:00:49Z","git_url":"git://github.com/vecnatechnologies/rtems.git","ssh_url":"git@github.com:vecnatechnologies/rtems.git","clone_url":"https://github.com/vecnatechnologies/rtems.git","svn_url":"https://github.com/vecnatechnologies/rtems","homepage":"http://git.rtems.org/rtems/","size":159557,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vecnatechnologies/rtems/pulls/4"},"html":{"href":"https://github.com/vecnatechnologies/rtems/pull/4"},"issue":{"href":"https://api.github.com/repos/vecnatechnologies/rtems/issues/4"},"comments":{"href":"https://api.github.com/repos/vecnatechnologies/rtems/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/vecnatechnologies/rtems/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/vecnatechnologies/rtems/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vecnatechnologies/rtems/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/vecnatechnologies/rtems/statuses/aa1cb3646b587ef634b1cbb551806bd778cdeda8"}}}}