Hi,
I´m trying to send-receive with the SPI dirver (MQX 3.4).
I´m using following code:
--- start ---
/*init*/
SPI_HW_st.SPI_fd = fopen ("spi0:", NULL);
param = SPI_DEVICE_BIG_ENDIAN;
error = ioctl (SPI_HW_st.SPI_fd, IO_IOCTL_SPI_SET_ENDIAN, ¶m);
param = (SPI_DEVICE_MASTER_MODE);
error = ioctl(SPI_HW_st.SPI_fd, IO_IOCTL_SPI_SET_TRANSFER_MODE, ¶m);
param = SPI_CLK_POL_PHA_MODE1;
error = ioctl (SPI_HW_st.SPI_fd, IO_IOCTL_SPI_SET_MODE, ¶m);
param = 200000;
error = ioctl(SPI_HW_st.SPI_fd, IO_IOCTL_SPI_SET_BAUD, ¶m);
/*code*/
UINT8 i [100];
write(SPI_HW_st.SPI_fd , i, 100);
-- end ---
There is no result in i.
At the beginning of the programm I don´t know exactly the length of the SPI chain. Therefore I have to detect it and compare the written results with the received.
How can I manage, that the result will written to i?
Does anybody knows where´s the QSPI driver from MQX 3.3 is gone?
The data are sent to the chain and also received at the QSPI-DIN pin. The chip-select signals are managed by GPIO pins.
Thanks for any hint.
Stefan