*/ static uint8_t digits[32] = { 0x24, 0xAF, 0xE0, 0xA2, 0x2B, 0x32, 0x30, 0xA7, 0x20, 0x22, 0x21, 0x38, 0x74, 0xA8, 0x70, 0x71, 0x04, 0x8F, 0xC0, 0x82, 0x0B, 0x12, 0x10, 0x87, 0x00, 0x02, 0x01, 0x18, 0x54, 0x88, 0x50, 0x51 }; /* * SPI configuration (1MHz, CPHA=0, CPOL=0). */ static SPIConfig spicfg = { NULL, GPIO1, GPIO1_SPI0SEL, CR0_DSS8BIT | CR0_FRFSPI | CR0_CLOCKRATE(0), 72 }; /* * Red LED blinker thread, times are in milliseconds. */ static WORKING_AREA(waThread1, 128); static msg_t Thread1(void *arg) { (void)arg; chRegSetThreadName("blinker1"); while (TRUE) { palClearPad(GPIO0, GPIO0_LED2); chThdSleepMilliseconds(500); palSetPad(GPIO0, GPIO0_LED2);
(void)mmcp; return 0; // palReadPad(IOPORT2, PB_WP1); } // FatFs related FATFS MMC_FS; // FS object. MMCDriver MMCD1; // MMC driver instance. static bool_t fs_ready = FALSE; // FS mounted and ready /* Maximum speed SPI configuration (18MHz, CPHA=0, CPOL=0).*/ static SPIConfig hs_spicfg = { NULL, GPIO0, GPIO0_MMC_SSEL, CR0_DSS8BIT | CR0_FRFSPI | CR0_CLOCKRATE(2), 2 }; /* Low speed SPI configuration (281.250kHz, CPHA=0, CPOL=0).*/ static SPIConfig ls_spicfg = { NULL, GPIO0, GPIO0_MMC_SSEL, CR0_DSS8BIT | CR0_FRFSPI | CR0_CLOCKRATE(2), 254 }; /* MMC/SD over SPI driver configuration.*/ static MMCConfig mmccfg = {&SPID2, &ls_spicfg, &hs_spicfg};