How to use SPI1

Discussion about writing software for VS1005 and the VSOS Operating System. Also posts about VS1005-related hardware design and device drivers should be posted here.
Post Reply
winwan
Senior User
Posts: 87
Joined: Fri 2014-07-04 15:51

How to use SPI1

Post by winwan »

I do not want to use UART SHELL to do instruction exchange interface, but want to change to SPI1, how to achieve
Hannu
VLSI Staff
Posts: 561
Joined: Mon 2016-05-30 11:54
Location: Finland
Contact:

Re: How to use SPI1

Post by Hannu »

Too bad :( The UART interface is quite nice and usable and there is even the ui_messages interface which is supported by many programs and libraries.

First design the message format you want to have. And keep VS1005 as master and resolution word based. Playing with bytes is road to frustration. Then import devHwSpi.c and .h to project. Call CreateDevHwSpi() correctly, and you get FILE* pointer. With that you can fread() and fwrite().

XCS is controlled with ioctl(fp, IOCTL_START_FRAME, 0) and ioctl(fp, IOCTL_END_FRAME)

If I had to reinvent this wheel, I would probably write a driver with some kind of interface which would provide some file pointer and a ioctl() interface.
winwan
Senior User
Posts: 87
Joined: Fri 2014-07-04 15:51

Re: How to use SPI1

Post by winwan »

I want to use SPI interrupt server call directly, do not want to use the driver way
Hannu
VLSI Staff
Posts: 561
Joined: Mon 2016-05-30 11:54
Location: Finland
Contact:

Re: How to use SPI1

Post by Hannu »

There is intdemo solution in roots and sources. It has template for SPI1 You can start with it.
Post Reply