void rt_platform_init(void) { #ifdef RT_USING_SPI rt_hw_spi_init(); #if defined(RT_USING_DFS) && defined(RT_USING_DFS_ELMFAT) /* init sdcard driver */ { extern void rt_hw_msd_init(void); GPIO_InitTypeDef GPIO_InitStructure; /* PC4 : SD Power */ RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_Init(GPIOC, &GPIO_InitStructure); /* SD card power on. */ GPIO_ResetBits(GPIOC, GPIO_Pin_4); rt_thread_delay(2); msd_init("sd0", "spi10"); } #endif /* RT_USING_DFS && RT_USING_DFS_ELMFAT */ #endif // RT_USING_SPI #ifdef RT_USING_LWIP /* initialize eth interface */ rt_hw_stm32_eth_init(); #endif /* RT_USING_LWIP */ }
int mnt_init(void) { msd_init("sd0", "spi10"); if (dfs_mount("sd0", "/", "elm", 0, 0) == 0) { rt_kprintf("Mount \"/dev/sd0\" on \"/\"\n"); } return 0; }