Touch XPT2046 SPI Uninitialise

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
Post Reply
Oscar_T
Posts: 89
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:06 am
Location: Italy
Has thanked: 37 times
Been thanked: 10 times

Touch XPT2046 SPI Uninitialise

Post 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

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: Touch XPT2046 SPI Uninitialise

Post 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,

Oscar_T
Posts: 89
Joined: Wed Dec 02, 2020 10:06 am
Location: Italy
Has thanked: 37 times
Been thanked: 10 times

Re: Touch XPT2046 SPI Uninitialise

Post by Oscar_T »

Hi Ben

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

Regards

Post Reply