summaryrefslogtreecommitdiff
path: root/bsp/renesas/ra4m2-eco/board/ports/mnt.c
blob: 0a6e6bc38bb1dda7db4775682b6418aa7d55bbbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <rtthread.h>
#include "hal_data.h"

#ifdef BSP_USING_FS

#include <dfs_fs.h>

#include <dev_spi_msd.h>
#include "drv_sci.h"

#define DBG_TAG "app.filesystem"
#define DBG_LVL DBG_INFO
#include <rtdbg.h>

void sd_mount(void)
{
    uint32_t cs_pin = BSP_IO_PORT_06_PIN_03;
    rt_hw_sci_spi_device_attach("sci9s", "scpi90", cs_pin);
    msd_init("sd0", "scpi90");
    if (dfs_mount("sd0", "/", "elm", 0, 0) == 0)
    {
        LOG_I("Mount \"/dev/sd0\" on \"/\"\n");
    }
    else
    {
        LOG_W("sd card mount to '/' failed!");
    }
    return 0;
}

int mount_init(void)
{
    sd_mount();
    return RT_EOK;
}
INIT_ENV_EXPORT(mount_init);

#endif  /* BSP_USING_FS */