stm32f4-sdio/main.c

41 lines
605 B
C
Raw Permalink Normal View History

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>
#include <fatfs/diskio.h>
2015-04-26 17:54:51 +02:00
#define OUTPUT(pin) (0b01 << (pin * 2))
FATFS SDfs;
FIL file;
volatile int w;
DSTATUS SDIO_initialize();
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();
GPIOD->MODER |= OUTPUT(12) | OUTPUT(13);
2015-04-26 17:54:51 +02:00
SysTick_Config(8*1680000);
// f_mount(&SDfs, "0:/", 1);
//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);
w++;
2015-04-26 17:54:51 +02:00
}