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.
Thank you,
Belén.
Solved! Go to Solution.
Hello,
to deassert CS simply call fflush (spi_fd) or IO_IOCTL_FLUSH_OUTPUT command.
Regards,
PetrM
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).
Regards,
PetrM
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?
Regards,
Belén.
Hello,
to deassert CS simply call fflush (spi_fd) or IO_IOCTL_FLUSH_OUTPUT command.
Regards,
PetrM