stm32f4-sdio/main.c

42 lines
728 B
C

/*
* main.c
*
* Created on: Apr 25, 2015
* Author: mari
*/
#include <stm32f4xx.h>
#include <cmsis/arm_math.h>
#include <fatfs/ff.h>
#define OUTPUT(pin) (0b01 << (pin * 2))
FATFS SDfs;
FIL file;
volatile int w;
void SDIO_wait_cmd_sent();
int SDIO_switch_appmode_CMD55();
int SDIO_send_all_send_cid_CMD2();
int SDIO_send_relative_address_CMD3(uint16_t* rca);
int SDIO_send_go_idle_CMD0();
int SDIO_send_block_length_CMD16(uint32_t blocklen);
int SDIO_send_bus_width_ACMD6(uint8_t bus_width);
int main() {
RCC->AHB1ENR |= RCC_AHB1ENR_GPIODEN;
__DSB();
GPIOD->MODER |= OUTPUT(12);
SysTick_Config(8*1680000);
// f_mount(&SDfs, "0:/", 1);
while(1);
}
void SysTick_Handler()
{
GPIOD->ODR ^= (1<<12);
w++;
}