Does anybody know how I can set SPI CS1 (PTD15 for Kinetis K60)?
I am using IO_IOCTL_SPI_SET_CS but I don't know the correct value for the param.
to deassert CS simply call fflush (spi_fd) or IO_IOCTL_FLUSH_OUTPUT command.
Hello, this should do it:
param = SPI_PUSHR_PCS(1 << 1);
ioctl (spi_fd, IO_IOCTL_SPI_SET_CS, ¶m);
The parameter type of this IOCTL command always corresponds to the one in the BSP SPI init structure (init_spi.c).
Thank you very much.
It works but my problem now is that I can't unset CS. I tried with:
param = SPI_PUSHR_PCS(1 << 1); ioctl (spifd, IO_IOCTL_SPI_FLUSH_DEASSERT_CS, ¶m);
but it doesn't work. Any suggestions?
Retrieving data ...