Go to the source code of this file.
Defines | |
#define | XSPI_DATA *((volatile unsigned char *)0xf078) |
#define | XSPI_BITRATE *((volatile unsigned char *)0xf079) |
#define | XSPI_STATUS *((volatile unsigned char *)0xf07a) |
#define | XSPI_CONTROL *((volatile unsigned char *)0xf07b) |
#define | XSPI_NRFIFO *((volatile unsigned *)0xf07c) |
#define | XSPI_NTFIFO *((volatile unsigned *)0xf07e) |
#define | XSPI_CLOCK (50000000L) |
#define | XSPI_STATUS_TFIFOMT (0) |
#define | XSPI_STATUS_TFIFOFULL (1) |
#define | XSPI_STATUS_RFIFOMT (2) |
#define | XSPI_STATUS_RFIFOFULL (3) |
#define | XSPI_STATUS_IRQ (4) |
#define | XSPI_CTL_IRQEN (0) |
#define | XSPI_CTL_STARTPORT (1) |
#define | XSPI_CTL_CE (2) |
#define | XSPI_CLEAR_IRQ() XSPI_STATUS = BIT(XSPI_STATUS_IRQ) |
#define | XSPI_IRQEN() XSPI_CONTROL |= BIT(XSPI_CTL_IRQEN) |
#define | XSPI_STARTPORT() XSPI_CONTROL |= BIT(XSPI_CTL_STARTPORT) |
#define | XSPI_IRQDIS() XSPI_CONTROL &= ~(BIT(XSPI_CTL_IRQEN)) |
#define | XSPI_SET_CE() XSPI_CONTROL |= BIT(XSPI_CTL_CE) |
#define | XSPI_CLR_CE() XSPI_CONTROL &= ~(BIT(XSPI_CTL_CE)) |
Functions | |
void | InitXspi (void) |
void | XspiSetBitRate (unsigned long Rate) |
unsigned char | XspiTransferByte (unsigned char data) |
int | XspiTransfer (char *buff, int n) |
#define XSPI_BITRATE *((volatile unsigned char *)0xf079) |
#define XSPI_CLEAR_IRQ | ( | ) | XSPI_STATUS = BIT(XSPI_STATUS_IRQ) |
#define XSPI_CLOCK (50000000L) |
#define XSPI_CLR_CE | ( | ) | XSPI_CONTROL &= ~(BIT(XSPI_CTL_CE)) |
Definition at line 49 of file xspi.h.
Referenced by mmcInit(), mmcRead(), mmcReset(), mmcSendCommand(), mmcSendStatus(), and mmcWrite().
#define XSPI_DATA *((volatile unsigned char *)0xf078) |
#define XSPI_IRQDIS | ( | ) | XSPI_CONTROL &= ~(BIT(XSPI_CTL_IRQEN)) |
#define XSPI_IRQEN | ( | ) | XSPI_CONTROL |= BIT(XSPI_CTL_IRQEN) |
#define XSPI_SET_CE | ( | ) | XSPI_CONTROL |= BIT(XSPI_CTL_CE) |
Definition at line 48 of file xspi.h.
Referenced by mmcRead(), mmcReset(), mmcSendCommand(), mmcSendStatus(), and mmcWrite().
#define XSPI_STARTPORT | ( | ) | XSPI_CONTROL |= BIT(XSPI_CTL_STARTPORT) |
void InitXspi | ( | void | ) |
Definition at line 81 of file xspi.c.
References BIT, NewSemaphore(), SEMAPHORE_MODE_BLOCKING, XSPI_IRQEN, and XspiSetBitRate().
void XspiSetBitRate | ( | unsigned long | Rate | ) |
Definition at line 92 of file xspi.c.
References XSPI_BITRATE, and XSPI_CLOCK.
Referenced by InitXspi().
int XspiTransfer | ( | char * | buff, | |
int | n | |||
) |
Definition at line 35 of file xspi.c.
References PendSemaphore(), PostSemaphore(), XSPI_DATA, and XSPI_STARTPORT.
Referenced by mmcCommand(), mmcRead(), mmcReset(), and mmcWrite().
unsigned char XspiTransferByte | ( | unsigned char | data | ) |
Definition at line 102 of file xspi.c.
References Int7Count, PendSemaphore(), PostSemaphore(), XSPI_DATA, and XSPI_STARTPORT.
Referenced by mmcCommand(), mmcRead(), mmcReset(), mmcResponse(), mmcSendStatus(), and mmcWrite().