How can I use two SPI displays?

Hello,

I have two SPI displays (ILI9341 and ILI9163). Both are working fine alone but I can’t use them simultaneously :frowning:

I think that it is because the OnFlush event is a static event in the Graphics class. So there can’t be two instances of it :

ILI9163 = new ILI9163Controller(Hardware.SocketThree);
ILI9341 = new ILI9341Controller(Hardware.SocketTwo);
ILI9341.SetOrientation(180);

var d1 = Graphics.FromImage(new Bitmap(240, 320));
var d2 = Graphics.FromImage(new Bitmap(128, 128));

Graphics.OnFlushEvent += ????;

d1.Clear();
d1.Flush();
d2.Clear();
d2.Flush();

There is no parameter in the OnFlush event that can tell which buffer is drawn or which “screen” needs a flush.

Any idea to solve this ?

Btw, the hdc parameter is always 0. Is it expected ?

Check the length of buffer in your code now. We will pass sender in next release.

That would work with different display sizes but not with two identical ones. But that’s better than nothing.

When you say “next release”, does it mean preview 3 or next one ?

Since what you found is important so we are working on it right now.

“That would work with different display sizes but not with two identical ones” Yes, we see. But that way you can move to next step in your project while we are working on it.

1 Like
7 Likes

Next release you will have an option that full screen on the big one without increasing memory.

2 Likes

Will it also allow more than 65.535 bytes at once on SPI ?

Yes, it is.

2 Likes

You are keeping us busy!

I thought you were going to get bored :stuck_out_tongue:

3 Likes