2015-04-26 17:54:51 +02:00
|
|
|
/*
|
|
|
|
* main.c
|
|
|
|
*
|
|
|
|
* Created on: Apr 25, 2015
|
|
|
|
* Author: mari
|
|
|
|
*/
|
|
|
|
#include <stm32f4xx.h>
|
2017-03-31 13:25:42 +02:00
|
|
|
#include <cmsis/arm_math.h>
|
|
|
|
#include <fatfs/ff.h>
|
2017-04-03 18:56:02 +02:00
|
|
|
#include <fatfs/diskio.h>
|
2015-04-26 17:54:51 +02:00
|
|
|
#define OUTPUT(pin) (0b01 << (pin * 2))
|
|
|
|
|
|
|
|
FATFS SDfs;
|
2015-04-30 11:59:37 +02:00
|
|
|
FIL file;
|
2017-04-03 01:35:20 +02:00
|
|
|
volatile int w;
|
|
|
|
|
2017-04-03 18:56:02 +02:00
|
|
|
DSTATUS SDIO_initialize();
|
2017-04-03 01:35:20 +02:00
|
|
|
|
2017-04-03 18:56:02 +02:00
|
|
|
int initreq = 0xFF;
|
2015-12-08 21:31:41 +01:00
|
|
|
|
2015-04-26 17:54:51 +02:00
|
|
|
int main() {
|
|
|
|
RCC->AHB1ENR |= RCC_AHB1ENR_GPIODEN;
|
|
|
|
__DSB();
|
2017-04-03 18:56:02 +02:00
|
|
|
GPIOD->MODER |= OUTPUT(12) | OUTPUT(13);
|
2015-04-26 17:54:51 +02:00
|
|
|
SysTick_Config(8*1680000);
|
2017-04-03 01:35:20 +02:00
|
|
|
// f_mount(&SDfs, "0:/", 1);
|
2017-04-03 18:56:02 +02:00
|
|
|
//SDIO_init_hw();
|
|
|
|
w = 0;
|
|
|
|
while(w<10);
|
|
|
|
initreq = SDIO_initialize();
|
2015-04-26 17:54:51 +02:00
|
|
|
while(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-12-08 21:31:41 +01:00
|
|
|
|
2015-04-26 17:54:51 +02:00
|
|
|
void SysTick_Handler()
|
|
|
|
{
|
|
|
|
GPIOD->ODR ^= (1<<12);
|
2017-04-03 01:35:20 +02:00
|
|
|
w++;
|
2015-04-26 17:54:51 +02:00
|
|
|
}
|