| Example |
/* SPI Device Driver Control Block */
SPI_DRV spi0_drv = {
Init,
UnInit,
Send,
SendBuf,
RecBuf,
BusSpeed,
SetSS,
CheckMedia
};
/* Enable/Disable SPI Chip Select (drive it high or low). */
static BOOL SetSS (U32 ss) {
if (ss) {
IOSET0 = 1<<20; /* SSEL is GPIO, output set to high. */
}
else {
IOCLR0 = 1<<20; /* SSEL is GPIO, output set to low. */
}
return (__TRUE);
}
|