display-interface icon indicating copy to clipboard operation
display-interface copied to clipboard

Allow use of DataSize of 16 bits

Open marco-silva0000 opened this issue 2 years ago • 4 comments

I'm trying to use this library for an embeded project with an LCD that uses an SPI with 16 bits of data as DataSize. I can create the SPI correctly width let spi = Spi::<_, _, 16>::new(pac.SPI1); (note the 16 there) but then I get some issues because it doesn't implement write 8 like this library requires.

I don't think there's a way to allow 16 bit datasize currently so this would be an extension, I can play with hacking away at an implementation but I don't think I can do it neatly without a bunch of code duplication.

marco-silva0000 avatar Feb 01 '23 00:02 marco-silva0000

The main reason why there's no 16bit interface is that I haven't come across a display which supports 16bit data. Would you mind pointing me to the datasheet for your LCD?

therealprof avatar Feb 02 '23 21:02 therealprof

I'm using the ILI9488 but the drivers for St7789 also work, I think. I've in the meanwhile found that it may support 8bit also, on page 69, but haven't tested it yet.

I'm using the Mipidsi crate as the driver

marco-silva0000 avatar Feb 03 '23 09:02 marco-silva0000

As far as I know those displays exclusively support 8bit (and sometimes 9bit) word size on SPI, hence my question. I checked the data sheet you pointed to but I couldn't find any mentioning of a 16bit word size for SPI. If you look at 4.2.1 in the ILI9488 datasheet you can see that the 3-wire mode uses 9bit word size and the 4-wire mode uses 8bit word size.

therealprof avatar Feb 03 '23 09:02 therealprof

Much time has passed so I doubt this is helpful @marco-silva0000 :

I didn't realise that I could have been using Mipidsi crate so I ended up making https://github.com/tommy-gilligan/ili9488-rs (based on https://github.com/yuri91/ili9341-rs). I'm not sure if I'm using display-interface correctly but maybe it's a moot point because I'll try to use Mipidsi now. Thank you for the comment for helping me figure out the right thing to be using!

tommy-gilligan avatar Nov 09 '23 05:11 tommy-gilligan