When I set the SPI framesize to 32-bit throught the MQX SPI driver, it gets set to 16-bits.
Here is the code:
param = 32; /* Set framesize to 32 bits for QLX SPI Slave*/
printf("Setting framesize to %d for QLX SPI Slave", param);
if (SPI_OK == ioctl(spi2File, IO_IOCTL_SPI_SET_FRAMESIZE, ¶m)) {
printf("OK\n");
} else {
printf("ERROR\n");
}
printf("Getting framesize ... "); /* Get transfer mode */
if (SPI_OK == ioctl(spi2File, IO_IOCTL_SPI_GET_FRAMESIZE, ¶m)) {
printf("%d\n", param);
} else {
printf("ERROR\n");
}
The result is this: Getting framesize ... 16
It should be 32.
Has anyone seen this and is there a work around?
Cheers,
Tom
Is param a 32 bit integer type?
Yes
uint_32 param;
Hi,
The value is set to CTAR FMSZ bits:
case IO_IOCTL_SPI_SET_FRAMESIZE:
...
dspi_ptr->CTAR[0] &= (~ (DSPI_CTAR_FMSZ(0x0F)));
dspi_ptr->CTAR[0] |= DSPI_CTAR_FMSZ(*param_ptr - 1);
There are only four bits for the value, so the max. value is 0x0f +1.
~Mark