Page 1 of 1

Touch XPT2046 SPI Uninitialise

Posted: Wed Dec 23, 2020 3:11 pm
by Oscar_T
Hi
I am using the xpt2046 touch component successfully. Now I am forced to add a new spi peripheral on the same spi bus I use with the XPT2046 controller.

The new peripheral will be controlled via the master SPI component. The Spi master component has both the initialization and Uninitialise macro and also allows the control of the chipselect pin.

I've done some tests like this before but I want to make sure I'm doing things right.

The question is, is it possible to add a macro that unilitializes the touch?
Alternatively what is the best solution so that the resources do not conflict (I am using the software mode on both)

I am currently doing this

I start witch macro ininitialise touch
when I have to send a message in spi, I initialize the peripheral, I send the message and unitialize it.

Then I have to ininitialise again the touch again for it to work

It's ok?

Kind Regards

Re: Touch XPT2046 SPI Uninitialise

Posted: Wed Dec 23, 2020 3:41 pm
by BenR
Hello,

As long as both SPI device have their own unique CS pin then it should be possible to just initialise both components and then talk to them both one after the other without uninitalising and reinitialising.

Let us know how you get on,

Re: Touch XPT2046 SPI Uninitialise

Posted: Wed Dec 23, 2020 3:46 pm
by Oscar_T
Hi Ben

Yes, the physical components have 2 distinct cs; after the holidays I will let you know the progress

Regards