Created
March 9, 2019 02:04
-
-
Save martinandrovich/8de7fabb1edd2e25e35a4d3569013317 to your computer and use it in GitHub Desktop.
Revisions
-
martinandrovich created this gist
Mar 9, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ // init SPI instance @ 8MHz ( // bps = SYSCLK / (CPSDVSR * (1 + SCR)) SPI* spi_test = spi.new(2); // send value '110' to PWM1 spi.send(spi_test, PWM1, 110); // send value '110' to PWM1 and validate if(!spi.send(spi_test, PWM1, 110)) { puts("Error!"); } // request data from ENC1 uint16_t enc1_dat; enc1_dat = spi.request(spi_test, ENC1);