spinix-hive/filetest/mount.c

38 lines
929 B
C

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <sys/sd.h>
void mount(int MISO, int CLK, int MOSI, int CS)
{
#if 0
uint32_t mountErr;
_SD_Params params;
if (MISO == 10 && CLK == 11 && MOSI == 9 && CS == 25)
{
params.AttachmentType = _SDA_SerialDeMUX;
params.pins.SerialDeMUX.MISO = MISO;
params.pins.SerialDeMUX.CLK = CLK;
params.pins.SerialDeMUX.MOSI = MOSI;
params.pins.SerialDeMUX.CLR = CS;
params.pins.SerialDeMUX.INC = 8;
params.pins.SerialDeMUX.ADDR = 5;
}
else
{
params.AttachmentType = _SDA_SingleSPI;
params.pins.SingleSPI.MISO = MISO;
params.pins.SingleSPI.CLK = CLK;
params.pins.SingleSPI.MOSI = MOSI;
params.pins.SingleSPI.CS = CS;
}
if ((mountErr = dfs_mount(&params)))
{
printf("Mount error: %d\n", mountErr);
exit(1);
}
#endif
}