Hi,
Okay, I'm very new here, but I'm happy to say I've accomplished quite a
lot already - due entirely to all the hard work that you all have done
before me!
Here's what's up: I have the Freescale/LogicPD M5329EVB board, and I've
got uClinux up and running on it. Pretty straightforward, given all the
complexities involved. I've even figured out how to get my application
to show up in the 'make menuconfig' menus, and a rudimentary Makefile.
Cool! My first (simple) question: once I put my app in ../user/myApp,
what is the best (i.e. quickest) way to build it, and if successful, the
new image? Simply calling "make" from the distro root seems awfully
heavy, if all I've changed is an app file or two...
So now I want to start testing my FPGA that will be interfaced via the
MCF5329's QSPI controller. I found some details under the kernel
(linux-2.6.x/Documentation/spi/spi-summary). But, how do I get
started? I found somewhere a very simple example:
#include <linux/spi/spi.h>
#define DEV_SPI "/dev/spi0" /* Create device with 'mknod /dev/spi0 c 228 0' */
#define LEN 10
/* Trasfer one message via SPI */
int spi_xfer(char addr, char offset, char *buf, int len) {
struct spi_msg msgs[] = {
{ addr: addr, flags: SPI_M_RD| SPI_M_WR, len: len, buf: buf }
};
struct spi_rdwr_ioctl_data data = { msgs: msgs, nmsgs: 1 };
int fd;
if ((fd = open(DEV_SPI, O_RDWR)) < 0) {
perror(DEV_SPI " open");
return -1;
}
if (ioctl(fd, SPI_RDWR, &data) < 0) {
perror(DEV_SPI " ioctl");
return -1;
}
close(fd);
return 0;
}
But of course, this won't even compile. I get an error early on in the
spi.h file - undefined "device" structure. I tried including
linux/device.h, but then even more errors occur. Now, I suppose I could
traipse through all this mess, but it occurred to me that someone,
somewhere out there must know better, and could point me in the right
direction. Anyone got a simple "hello world"-style example on using the
spi drivers?
Thanks!
-Bob
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev