{"action":"created","comment":{"url":"https://api.github.com/repos/PaulStoffregen/SPI/pulls/comments/68870308","id":68870308,"diff_hunk":"@@ -308,6 +309,132 @@ uint8_t SPIClass::setCS(uint8_t pin)\n }\n \n \n+\n+/**********************************************************/\n+/*     32 bit Teensy-3.4/3.5                              */\n+/**********************************************************/\n+#if defined(__MK64FX512__) || defined(__MK66FX1M0__)\n+SPI1Class SPI1;\n+\n+uint8_t SPI1Class::interruptMasksUsed = 0;\n+uint32_t SPI1Class::interruptMask[(NVIC_NUM_INTERRUPTS+31)/32];\n+uint32_t SPI1Class::interruptSave[(NVIC_NUM_INTERRUPTS+31)/32];\n+#ifdef SPI_TRANSACTION_MISMATCH_LED\n+uint8_t SPI1Class::inTransactionFlag = 0;\n+#endif\n+\n+void SPI1Class::begin()\n+{\n+\tSIM_SCGC6 |= SIM_SCGC6_SPI1;\n+\tSPI1_MCR = SPI_MCR_MDIS | SPI_MCR_HALT | SPI_MCR_PCSIS(0x1F);\n+\tSPI1_CTAR0 = SPI_CTAR_FMSZ(7) | SPI_CTAR_PBR(0) | SPI_CTAR_BR(1) | SPI_CTAR_CSSCK(1);\n+\tSPI1_CTAR1 = SPI_CTAR_FMSZ(15) | SPI_CTAR_PBR(0) | SPI_CTAR_BR(1) | SPI_CTAR_CSSCK(1);\n+\tSPI1_MCR = SPI_MCR_MSTR | SPI_MCR_PCSIS(0x1F);\n+\tSPCR1.enable_pins(); // pins managed by SPCRemulation in avr_emulation.h\n+}\n+\n+void SPI1Class::end() {\n+\tSPCR1.disable_pins();\n+\tSPI1_MCR = SPI_MCR_MDIS | SPI_MCR_HALT | SPI_MCR_PCSIS(0x1F);\n+}\n+\n+void SPI1Class::usingInterrupt(IRQ_NUMBER_t interruptName)\n+{\n+\tuint32_t n = (uint32_t)interruptName;\n+\n+\tif (n >= NVIC_NUM_INTERRUPTS) return;\n+\n+\t//Serial.print(\"usingInterrupt \");\n+\t//Serial.println(n);\n+\tinterruptMasksUsed |= (1 << (n >> 5));\n+\tinterruptMask[n >> 5] |= (1 << (n & 0x1F));\n+\t//Serial.printf(\"interruptMasksUsed = %d\\n\", interruptMasksUsed);\n+\t//Serial.printf(\"interruptMask[0] = %08X\\n\", interruptMask[0]);\n+\t//Serial.printf(\"interruptMask[1] = %08X\\n\", interruptMask[1]);\n+\t//Serial.printf(\"interruptMask[2] = %08X\\n\", interruptMask[2]);\n+}\n+\n+void SPI1Class::notUsingInterrupt(IRQ_NUMBER_t interruptName)\n+{\n+\tuint32_t n = (uint32_t)interruptName;\n+\tif (n >= NVIC_NUM_INTERRUPTS) return;\n+\tinterruptMask[n >> 5] &= ~(1 << (n & 0x1F));\n+\tif (interruptMask[n >> 5] == 0) {\n+\t\tinterruptMasksUsed &= ~(1 << (n >> 5));\n+\t}\n+}\n+\n+\n+static void updateCTAR1(uint32_t ctar)\n+{\n+\tif (SPI1_CTAR0 != ctar) {\n+\t\tuint32_t mcr = SPI1_MCR;\n+\t\tif (mcr & SPI_MCR_MDIS) {\n+\t\t\tSPI1_CTAR0 = ctar;\n+\t\t\tSPI1_CTAR1 = ctar | SPI_CTAR_FMSZ(8);\n+\t\t} else {\n+\t\t\tSPI1_MCR = SPI_MCR_MDIS | SPI_MCR_HALT | SPI_MCR_PCSIS(0x1F);\n+\t\t\tSPI1_CTAR0 = ctar;\n+\t\t\tSPI1_CTAR1 = ctar | SPI_CTAR_FMSZ(8);\n+\t\t\tSPI1_MCR = mcr;\n+\t\t}\n+\t}\n+}\n+\n+void SPI1Class::setBitOrder(uint8_t bitOrder)\n+{\n+\tSIM_SCGC6 |= SIM_SCGC6_SPI0;\n+\tuint32_t ctar = SPI1_CTAR0;\n+\tif (bitOrder == LSBFIRST) {\n+\t\tctar |= SPI_CTAR_LSBFE;\n+\t} else {\n+\t\tctar &= ~SPI_CTAR_LSBFE;\n+\t}\n+\tupdateCTAR1(ctar);\n+}\n+\n+void SPI1Class::setDataMode(uint8_t dataMode)\n+{\n+\tSIM_SCGC6 |= SIM_SCGC6_SPI0;","path":"SPI.cpp","position":107,"original_position":107,"commit_id":"4f1327354617ade18529e4254f15c8c850f02886","original_commit_id":"4f1327354617ade18529e4254f15c8c850f02886","user":{"login":"sumotoy","id":1028096,"avatar_url":"https://avatars.githubusercontent.com/u/1028096?v=3","gravatar_id":"","url":"https://api.github.com/users/sumotoy","html_url":"https://github.com/sumotoy","followers_url":"https://api.github.com/users/sumotoy/followers","following_url":"https://api.github.com/users/sumotoy/following{/other_user}","gists_url":"https://api.github.com/users/sumotoy/gists{/gist_id}","starred_url":"https://api.github.com/users/sumotoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sumotoy/subscriptions","organizations_url":"https://api.github.com/users/sumotoy/orgs","repos_url":"https://api.github.com/users/sumotoy/repos","events_url":"https://api.github.com/users/sumotoy/events{/privacy}","received_events_url":"https://api.github.com/users/sumotoy/received_events","type":"User","site_admin":false},"body":"SIM_SCGC6 |= SIM_SCGC6_SPI1;","created_at":"2016-06-29T01:01:02Z","updated_at":"2016-06-29T01:01:02Z","html_url":"https://github.com/PaulStoffregen/SPI/pull/11#discussion_r68870308","pull_request_url":"https://api.github.com/repos/PaulStoffregen/SPI/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/PaulStoffregen/SPI/pulls/comments/68870308"},"html":{"href":"https://github.com/PaulStoffregen/SPI/pull/11#discussion_r68870308"},"pull_request":{"href":"https://api.github.com/repos/PaulStoffregen/SPI/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/PaulStoffregen/SPI/pulls/11","id":74794173,"html_url":"https://github.com/PaulStoffregen/SPI/pull/11","diff_url":"https://github.com/PaulStoffregen/SPI/pull/11.diff","patch_url":"https://github.com/PaulStoffregen/SPI/pull/11.patch","issue_url":"https://api.github.com/repos/PaulStoffregen/SPI/issues/11","number":11,"state":"open","locked":false,"title":"Added SPI1 object for Teensy 3.5 test board","user":{"login":"KurtE","id":1558080,"avatar_url":"https://avatars.githubusercontent.com/u/1558080?v=3","gravatar_id":"","url":"https://api.github.com/users/KurtE","html_url":"https://github.com/KurtE","followers_url":"https://api.github.com/users/KurtE/followers","following_url":"https://api.github.com/users/KurtE/following{/other_user}","gists_url":"https://api.github.com/users/KurtE/gists{/gist_id}","starred_url":"https://api.github.com/users/KurtE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KurtE/subscriptions","organizations_url":"https://api.github.com/users/KurtE/orgs","repos_url":"https://api.github.com/users/KurtE/repos","events_url":"https://api.github.com/users/KurtE/events{/privacy}","received_events_url":"https://api.github.com/users/KurtE/received_events","type":"User","site_admin":false},"body":"These changes plus some changes in core (added register defines, plus\r\nadded logical SPCR1 register), allowed me to do quick hack to\r\nserialFlash library and test and initialize flash memory using 3.5 test\r\nboard connected to prop shield using pins 0, 1, 20 and 6","created_at":"2016-06-22T14:29:01Z","updated_at":"2016-06-29T01:01:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76a1bfebe69c902a71629029b13bdc476ddcbd00","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/PaulStoffregen/SPI/pulls/11/commits","review_comments_url":"https://api.github.com/repos/PaulStoffregen/SPI/pulls/11/comments","review_comment_url":"https://api.github.com/repos/PaulStoffregen/SPI/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PaulStoffregen/SPI/issues/11/comments","statuses_url":"https://api.github.com/repos/PaulStoffregen/SPI/statuses/4f1327354617ade18529e4254f15c8c850f02886","head":{"label":"KurtE:SPI1-for-3.4/3.5","ref":"SPI1-for-3.4/3.5","sha":"4f1327354617ade18529e4254f15c8c850f02886","user":{"login":"KurtE","id":1558080,"avatar_url":"https://avatars.githubusercontent.com/u/1558080?v=3","gravatar_id":"","url":"https://api.github.com/users/KurtE","html_url":"https://github.com/KurtE","followers_url":"https://api.github.com/users/KurtE/followers","following_url":"https://api.github.com/users/KurtE/following{/other_user}","gists_url":"https://api.github.com/users/KurtE/gists{/gist_id}","starred_url":"https://api.github.com/users/KurtE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KurtE/subscriptions","organizations_url":"https://api.github.com/users/KurtE/orgs","repos_url":"https://api.github.com/users/KurtE/repos","events_url":"https://api.github.com/users/KurtE/events{/privacy}","received_events_url":"https://api.github.com/users/KurtE/received_events","type":"User","site_admin":false},"repo":{"id":31746331,"name":"SPI","full_name":"KurtE/SPI","owner":{"login":"KurtE","id":1558080,"avatar_url":"https://avatars.githubusercontent.com/u/1558080?v=3","gravatar_id":"","url":"https://api.github.com/users/KurtE","html_url":"https://github.com/KurtE","followers_url":"https://api.github.com/users/KurtE/followers","following_url":"https://api.github.com/users/KurtE/following{/other_user}","gists_url":"https://api.github.com/users/KurtE/gists{/gist_id}","starred_url":"https://api.github.com/users/KurtE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KurtE/subscriptions","organizations_url":"https://api.github.com/users/KurtE/orgs","repos_url":"https://api.github.com/users/KurtE/repos","events_url":"https://api.github.com/users/KurtE/events{/privacy}","received_events_url":"https://api.github.com/users/KurtE/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KurtE/SPI","description":"SPI library for Teensy & Arduino IDE","fork":true,"url":"https://api.github.com/repos/KurtE/SPI","forks_url":"https://api.github.com/repos/KurtE/SPI/forks","keys_url":"https://api.github.com/repos/KurtE/SPI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KurtE/SPI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KurtE/SPI/teams","hooks_url":"https://api.github.com/repos/KurtE/SPI/hooks","issue_events_url":"https://api.github.com/repos/KurtE/SPI/issues/events{/number}","events_url":"https://api.github.com/repos/KurtE/SPI/events","assignees_url":"https://api.github.com/repos/KurtE/SPI/assignees{/user}","branches_url":"https://api.github.com/repos/KurtE/SPI/branches{/branch}","tags_url":"https://api.github.com/repos/KurtE/SPI/tags","blobs_url":"https://api.github.com/repos/KurtE/SPI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KurtE/SPI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KurtE/SPI/git/refs{/sha}","trees_url":"https://api.github.com/repos/KurtE/SPI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KurtE/SPI/statuses/{sha}","languages_url":"https://api.github.com/repos/KurtE/SPI/languages","stargazers_url":"https://api.github.com/repos/KurtE/SPI/stargazers","contributors_url":"https://api.github.com/repos/KurtE/SPI/contributors","subscribers_url":"https://api.github.com/repos/KurtE/SPI/subscribers","subscription_url":"https://api.github.com/repos/KurtE/SPI/subscription","commits_url":"https://api.github.com/repos/KurtE/SPI/commits{/sha}","git_commits_url":"https://api.github.com/repos/KurtE/SPI/git/commits{/sha}","comments_url":"https://api.github.com/repos/KurtE/SPI/comments{/number}","issue_comment_url":"https://api.github.com/repos/KurtE/SPI/issues/comments{/number}","contents_url":"https://api.github.com/repos/KurtE/SPI/contents/{+path}","compare_url":"https://api.github.com/repos/KurtE/SPI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KurtE/SPI/merges","archive_url":"https://api.github.com/repos/KurtE/SPI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KurtE/SPI/downloads","issues_url":"https://api.github.com/repos/KurtE/SPI/issues{/number}","pulls_url":"https://api.github.com/repos/KurtE/SPI/pulls{/number}","milestones_url":"https://api.github.com/repos/KurtE/SPI/milestones{/number}","notifications_url":"https://api.github.com/repos/KurtE/SPI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KurtE/SPI/labels{/name}","releases_url":"https://api.github.com/repos/KurtE/SPI/releases{/id}","deployments_url":"https://api.github.com/repos/KurtE/SPI/deployments","created_at":"2015-03-06T01:28:44Z","updated_at":"2015-04-24T15:56:37Z","pushed_at":"2016-06-22T14:28:52Z","git_url":"git://github.com/KurtE/SPI.git","ssh_url":"git@github.com:KurtE/SPI.git","clone_url":"https://github.com/KurtE/SPI.git","svn_url":"https://github.com/KurtE/SPI","homepage":"http://www.pjrc.com/teensy/td_libs_SPI.html","size":51,"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":"PaulStoffregen:master","ref":"master","sha":"c593e4bd11366bda4265f21f78204482fa7759e7","user":{"login":"PaulStoffregen","id":965463,"avatar_url":"https://avatars.githubusercontent.com/u/965463?v=3","gravatar_id":"","url":"https://api.github.com/users/PaulStoffregen","html_url":"https://github.com/PaulStoffregen","followers_url":"https://api.github.com/users/PaulStoffregen/followers","following_url":"https://api.github.com/users/PaulStoffregen/following{/other_user}","gists_url":"https://api.github.com/users/PaulStoffregen/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulStoffregen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulStoffregen/subscriptions","organizations_url":"https://api.github.com/users/PaulStoffregen/orgs","repos_url":"https://api.github.com/users/PaulStoffregen/repos","events_url":"https://api.github.com/users/PaulStoffregen/events{/privacy}","received_events_url":"https://api.github.com/users/PaulStoffregen/received_events","type":"User","site_admin":false},"repo":{"id":21990267,"name":"SPI","full_name":"PaulStoffregen/SPI","owner":{"login":"PaulStoffregen","id":965463,"avatar_url":"https://avatars.githubusercontent.com/u/965463?v=3","gravatar_id":"","url":"https://api.github.com/users/PaulStoffregen","html_url":"https://github.com/PaulStoffregen","followers_url":"https://api.github.com/users/PaulStoffregen/followers","following_url":"https://api.github.com/users/PaulStoffregen/following{/other_user}","gists_url":"https://api.github.com/users/PaulStoffregen/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulStoffregen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulStoffregen/subscriptions","organizations_url":"https://api.github.com/users/PaulStoffregen/orgs","repos_url":"https://api.github.com/users/PaulStoffregen/repos","events_url":"https://api.github.com/users/PaulStoffregen/events{/privacy}","received_events_url":"https://api.github.com/users/PaulStoffregen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PaulStoffregen/SPI","description":"SPI library for Teensy & Arduino IDE","fork":false,"url":"https://api.github.com/repos/PaulStoffregen/SPI","forks_url":"https://api.github.com/repos/PaulStoffregen/SPI/forks","keys_url":"https://api.github.com/repos/PaulStoffregen/SPI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PaulStoffregen/SPI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PaulStoffregen/SPI/teams","hooks_url":"https://api.github.com/repos/PaulStoffregen/SPI/hooks","issue_events_url":"https://api.github.com/repos/PaulStoffregen/SPI/issues/events{/number}","events_url":"https://api.github.com/repos/PaulStoffregen/SPI/events","assignees_url":"https://api.github.com/repos/PaulStoffregen/SPI/assignees{/user}","branches_url":"https://api.github.com/repos/PaulStoffregen/SPI/branches{/branch}","tags_url":"https://api.github.com/repos/PaulStoffregen/SPI/tags","blobs_url":"https://api.github.com/repos/PaulStoffregen/SPI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PaulStoffregen/SPI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PaulStoffregen/SPI/git/refs{/sha}","trees_url":"https://api.github.com/repos/PaulStoffregen/SPI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PaulStoffregen/SPI/statuses/{sha}","languages_url":"https://api.github.com/repos/PaulStoffregen/SPI/languages","stargazers_url":"https://api.github.com/repos/PaulStoffregen/SPI/stargazers","contributors_url":"https://api.github.com/repos/PaulStoffregen/SPI/contributors","subscribers_url":"https://api.github.com/repos/PaulStoffregen/SPI/subscribers","subscription_url":"https://api.github.com/repos/PaulStoffregen/SPI/subscription","commits_url":"https://api.github.com/repos/PaulStoffregen/SPI/commits{/sha}","git_commits_url":"https://api.github.com/repos/PaulStoffregen/SPI/git/commits{/sha}","comments_url":"https://api.github.com/repos/PaulStoffregen/SPI/comments{/number}","issue_comment_url":"https://api.github.com/repos/PaulStoffregen/SPI/issues/comments{/number}","contents_url":"https://api.github.com/repos/PaulStoffregen/SPI/contents/{+path}","compare_url":"https://api.github.com/repos/PaulStoffregen/SPI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PaulStoffregen/SPI/merges","archive_url":"https://api.github.com/repos/PaulStoffregen/SPI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PaulStoffregen/SPI/downloads","issues_url":"https://api.github.com/repos/PaulStoffregen/SPI/issues{/number}","pulls_url":"https://api.github.com/repos/PaulStoffregen/SPI/pulls{/number}","milestones_url":"https://api.github.com/repos/PaulStoffregen/SPI/milestones{/number}","notifications_url":"https://api.github.com/repos/PaulStoffregen/SPI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PaulStoffregen/SPI/labels{/name}","releases_url":"https://api.github.com/repos/PaulStoffregen/SPI/releases{/id}","deployments_url":"https://api.github.com/repos/PaulStoffregen/SPI/deployments","created_at":"2014-07-18T18:31:05Z","updated_at":"2016-04-21T16:31:06Z","pushed_at":"2016-06-22T14:29:01Z","git_url":"git://github.com/PaulStoffregen/SPI.git","ssh_url":"git@github.com:PaulStoffregen/SPI.git","clone_url":"https://github.com/PaulStoffregen/SPI.git","svn_url":"https://github.com/PaulStoffregen/SPI","homepage":"http://www.pjrc.com/teensy/td_libs_SPI.html","size":53,"stargazers_count":13,"watchers_count":13,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":6,"forks":15,"open_issues":6,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PaulStoffregen/SPI/pulls/11"},"html":{"href":"https://github.com/PaulStoffregen/SPI/pull/11"},"issue":{"href":"https://api.github.com/repos/PaulStoffregen/SPI/issues/11"},"comments":{"href":"https://api.github.com/repos/PaulStoffregen/SPI/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/PaulStoffregen/SPI/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/PaulStoffregen/SPI/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PaulStoffregen/SPI/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/PaulStoffregen/SPI/statuses/4f1327354617ade18529e4254f15c8c850f02886"}}}}
{"actor":{"display_login":"sumotoy"}}