Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: src/main.cpp
- Revision:
- 0:c9e2c597ca78
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main.cpp Tue Aug 23 18:06:39 2022 +0000 @@ -0,0 +1,133 @@ + +#include "mbed.h" +#include "stdio.h" +#include "PortOut.h" + +int main(){ + + SPI spi(PA_7, PA_6, PA_5); + DigitalOut sel(PA_15); + + sel = 1; + spi.format(8, 0); + spi.frequency(1000000); + + while(1) { + + sel = 0; + + spi.write(0xD3); + + spi.write(0xFF); + + sel = 1; + + wait(0.25); + + sel = 0; + + spi.write(0x93); + + int ccnum = spi.write(0x00); + + //spi.write(0xCE); + + //spi.write(0x00); + sel = 1; + printf("CC Num(1.1) = 0x%X\r\n", ccnum); + //printf("Another = 0x%X\r\n", num); + + wait(0.25); + + sel = 0; + + spi.write(0x93); + + ccnum = spi.write(0x00); + + //spi.write(0xCE); + + //spi.write(0x00); + sel = 1; + printf("CC Num(1.2) = 0x%X\r\n", ccnum); + //printf("Another = 0x%X\r\n", num); + + wait(0.25); + + sel = 0; + + spi.write(0xD3); + + spi.write(0x20); + + sel = 1; + + wait(0.25); + + sel = 0; + + spi.write(0x93); + + ccnum = spi.write(0x00); + + //spi.write(0x9D); + + //int versnum = spi.write(0x00); + sel = 1; + printf("CC Num(2.1) = 0x%X\r\n", ccnum); + //printf("Vers Num = 0x%X\r\n", versnum); + + wait(0.25); + + sel = 0; + + spi.write(0x93); + + ccnum = spi.write(0x00); + + //spi.write(0x9D); + + //int versnum = spi.write(0x00); + sel = 1; + printf("CC Num(2.2) = 0x%X\r\n", ccnum); + //printf("Vers Num = 0x%X\r\n", versnum); + + + + wait(0.25); + + /*sel = 0; + + spi.write(0x94); + + int ccband = spi.write(0x00); + + sel = 1; + printf("CC band = 0x%X\r\n", ccband); + + wait(1); + + sel = 0; + + spi.write(0xD4); + + spi.write(0x08); + + sel = 1; + + wait(1); + + sel = 0; + + spi.write(0x94); + + ccband = spi.write(0x00); + + sel = 1; + printf("CC band (2) = 0x%X\r\n", ccband); + + wait(1);*/ + } + + +}