1 /*****************************************************************************\
2 * efs - General purpose Embedded Filesystem library *
3 * --------------------- ----------------------------------- *
5 * Filename : lpc2000_spi.c *
6 * Description : This contains the functions needed to use efs for *
7 * accessing files on an SD-card connected to an LPC2xxx. *
9 * This library is free software; you can redistribute it and/or *
10 * modify it under the terms of the GNU Lesser General Public *
11 * License as published by the Free Software Foundation; either *
12 * version 2.1 of the License, or (at your option) any later version. *
14 * This library is distributed in the hope that it will be useful, *
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
17 * Lesser General Public License for more details. *
19 * (c)2005 Martin Thomas *
21 \*****************************************************************************/
24 2006, Bertrik Sikken, modified for LPCUSB
32 #include "../fatfs/spi.h"
39 #define SELECT_CARD() do { GPIO0_IOCLR = GPIO_IO_P20; } while (0)
40 #define UNSELECT_CARD() do { GPIO0_IOSET = GPIO_IO_P20; } while (0)
45 void mscspiInit (void)
53 U8 mscspiTransferByte (U8 outgoing)
58 r = spiTransferByte (outgoing);
67 void mscspiSendBlock (U8 *pbBuf, int iLen)
70 spiSendBlock (pbBuf, iLen);
77 void mscspiReceiveBlock (U8 *pbBuf, int iLen)
80 spiReceiveBlock (pbBuf, iLen);