How can I program the inactive polarity of PCS0 (CS0 for SPI channel) from within MQX?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I program the inactive polarity of PCS0 (CS0 for SPI channel) from within MQX?

807 Views
alfredolopez
Contributor II
I have a TWR-K60F120M . I am using the SPI port and it works fine but I need to change the polarity of PCS0. I need it as inactive 
at low level.
How can I program this option from within MQX?
5 Replies

597 Views
soledad
NXP Employee
NXP Employee

Hi Alfredo,

What MQX version are you using???

Are you using the MQX SPI drivers???


Have a great day,
Regards
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

597 Views
alfredolopez
Contributor II

Hi Soledad,

I am using MQX 4.0 version.

Yes I am using MQX SPI drivers.

Regards.

Alfredo

El 08/05/2014 15:18, soledad escribió:

>

Freescale Community <https://community.freescale.com/>

<https://community.freescale.com/>

>

How can I program the inactive polarity of PCS0 (CS0 for SPI

channel) from within MQX?

reply from soledad

<https://community.freescale.com/people/soledad?et=watches.email.thread>

in /MQX Software Solutions/ - View the full discussion

<https://community.freescale.com/message/401676?et=watches.email.thread#401676>

>

0 Kudos

597 Views
soledad
NXP Employee
NXP Employee

Hi,

You need to modify the Driver, please check the SPI.h and SPI.c files that are located at the path  C:\Freescale\Freescale_MQX_4_0\mqx\source\io\spi

You can modify this files according your needs.

Have a great day,
Regards
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

597 Views
alfredolopez
Contributor II

Thank you, Soledad.

I should prefer not to have to modify the Driver, but I think that it

will be the only option.

Regards.

Alfredo

El 08/05/2014 20:53, soledad escribió:

>

Freescale Community <https://community.freescale.com/>

<https://community.freescale.com/>

>

How can I program the inactive polarity of PCS0 (CS0 for SPI

channel) from within MQX?

reply from soledad

<https://community.freescale.com/people/soledad?et=watches.email.thread>

in /MQX Software Solutions/ - View the full discussion

<https://community.freescale.com/message/401768?et=watches.email.thread#401768>

>

0 Kudos

597 Views
pbanta
Contributor IV

Hi Alfredo,

I'm not sure about MQX 4.0, but in MQX 4.1 there is an option to install a callback function for managing the CS line from your application.  The example (Freescale_MQX_4_1/mqx/examples/spi) shows how to do this.  I used this technique to successfully change the polarity and I didn't have to change the driver code.  In my callback function I used lwgpio to change the state of the CS pin.

0 Kudos