20170908

Dependencies:   Hexi_OLED_SSD1351 W25Q64FVSSIG

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "W25Q64FV.h"
00003 #include "Hexi_OLED_SSD1351.h"
00004 #include "string.h"
00005 
00006 DigitalOut led1(LED1);
00007 
00008 Serial pc(USBTX, USBRX);
00009 
00010 /* Instantiate the SSD1351 OLED Driver */
00011 /* (MOSI,SCLK,POWER,CS,RST,DC) */
00012 SSD1351 oled(PTB22,PTB21,PTC13,PTB20,PTE6, PTD15);
00013 
00014 /**
00015 
00016     MOSI: PTD6
00017     MISO: PTD7
00018     SCL : PTD5
00019     CS : PTD4
00020     FREQ : 1000 000 HZ
00021 
00022 **/
00023 W25Q64FV flash(PTD6, PTD7, PTD5, PTD4, 8000000);
00024 
00025 // main() runs in its own thread in the OS
00026 int main()
00027 {
00028     uint8_t buf[256] = {};
00029 
00030     uint16_t mau_id = 0;
00031     unsigned tesing_type = 0;
00032 //    mau_id = flash.Id();
00033 //    pc.printf("%d\n",mau_id);
00034 //    pc.printf("%x\n",mau_id);
00035 
00036     flash.W25Q64_readManufacturer(buf);
00037     pc.printf("JEDEC ID : ");
00038     for (uint8_t i=0; i<5; i++) {
00039         pc.printf("%x", buf[i]);
00040         pc.printf(" ");
00041     }
00042     pc.printf("\n");
00043 
00044     while (true) {
00045 
00046         led1 = !led1;
00047         wait(0.5);
00048     }
00049 }