7 years, 10 months ago.

Error: No instance of constructor "ILI9341::ILI9341"

Hello! I'm trying to implement the tft screen init, but get this error: Error: No instance of constructor "ILI9341::ILI9341" matches the argument list in "main.cpp", Line: 26, Col: 15

Code

BusOut dataBus( PA_5, PA_3, PA_2, PB_1, PB_2, PB_3, PB_4, PB_5, PB_6, PB_7, PB_10, PB_11, PB_12, PB_13, PB_14, PB_15 );

ILI9341 disp(BUS_16, &dataBus, PA_13, PA_14, PA_12, PA_11, PA_8, "WF28D");

Please help

You'll probably have to give more information like who's library you are trying to use and what platform you are compiling for.

posted by Oliver Broad 11 Jun 2016

There's UniGraphic library and nucleo f080 board.

posted by Anatoly Zimin 11 Jun 2016

1 Answer

7 years, 10 months ago.

https://developer.mbed.org/teams/GraphicsDisplay/code/UniGraphic/docs/9cd6227dc7a6/classILI9341.html#a657336f99ff63e16f1f8c8cccf3ea80b

Turns out the constructor has been declared in a different way, instead of accepting a "BusOut" object it accepts an array of pinnames.

I think something like this may work. Note there's no "&" before databus as an array is a pointer.

PinName[16] dataBus = { PA_5, PA_3, PA_2, PB_1, PB_2, PB_3, PB_4, PB_5, PB_6, PB_7, PB_10, PB_11, PB_12, PB_13, PB_14, PB_15 };

ILI9341 disp(BUS_16, dataBus, PA_13, PA_14, PA_12, PA_11, PA_8, "WF28D");

I expect that the array will need to be in RAM not ROM so it can't be "const" as the constructor declaration doesn't use const. It isn't a big loss on a MBED though.

PS I understand that BusOut is notoriously slow and you may actually get faster data transfer with SPI, especially as some versions of the library can use DMA transfers.

Accepted Answer

Thanks, but you have one error: PinName[16], thta's right: PinName dataBus[16]. It works!

posted by Anatoly Zimin 11 Jun 2016

OK yeah I got the array syntax wrong, oops. I'll correct it down here in case anyone wants to copy-paste.

PinName dataBus[16] = { PA_5, PA_3, PA_2, PB_1, PB_2, PB_3, PB_4, PB_5, PB_6, PB_7, PB_10, PB_11, PB_12, PB_13, PB_14, PB_15 };
 
ILI9341 disp(BUS_16, dataBus, PA_13, PA_14, PA_12, PA_11, PA_8, "WF28D");
posted by Oliver Broad 12 Jun 2016