mcu: K70FX512VMJ12
I'm trying to get a new LCD screen going but i need to send 9 bit spi packets (see image). On the K70, I tried to change the framesize to 9 but the LCD still does not communicate. I don't want to write a bit-bang SPI driver, so can the framesize be set to 9? I send the data as a uint16, but im not sure if the SPI is sending the extra zeros. I might need to hook up a scope.

See code below. I want to make sure this is the proper way to send 9 bit packets.
In my initialize function I change the frame size to 9bits (along with other spi init):
// 9bit frame size
param = 9;
if (SPI_OK != ioctl(spiFileHandle, IO_IOCTL_SPI_SET_FRAMESIZE, ¶m))
{
printf ("Error: unable to set LCD SPI interface\n");
}
Here is my spi write function:
static void SPI_Write(uint16_t i)
{
int_32 result = 0;
uint_16 retryCount = SPI_RETRY_COUNT;
uint_32 param = 0;
// Toggle CS1 Low
SetOutput(nSPI0_PCS1_OUTPUT, FALSE);
// Write Command/Data to SPI
retryCount = SPI_RETRY_COUNT;
do
{
result = fwrite((void *)&i, 2, 1, spiFileHandle);
retryCount--;
}
while ((result < 1) && (retryCount > 0));
// Toggle CS1 High
SetOutput(nSPI0_PCS1_OUTPUT, TRUE);
}