<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How can I set the CS signal for spi with _io_ctl()? in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-set-the-CS-signal-for-spi-with-io-ctl/m-p/303567#M9755</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using a K60F120M Tower with MQX 4.0.2. I tried to set the CS signal for spi2 to SPI2_CS0/1 with the _io_ctl()-command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code looks like this:&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;MQX_FILE_PTR mcp23s17_SPI;&lt;/P&gt;&lt;P&gt;uint_32 mcp23s17_CS = SPI_PUSHR_PCS(1 &amp;lt;&amp;lt; 0);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Chip-Select-Mask for SPI2_CS0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mcp23s17_SPI = _io_fopen("spi2:", NULL);&lt;/P&gt;&lt;P&gt;_io_ioctl(mcp23s17_SPI, IO_IOCTL_SPI_SET_CS, &amp;amp;mcp23s17_CS);&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;_io_write(mcp23s17_SPI,...);&lt;/P&gt;&lt;P&gt;_io_fflush(mcp23s17_SPI);&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BSPCFG_ENABLE_SPI2 is set in user_config.h and the return value of _io_fopen isn't NULL. The return value of _io_ctl() is SPI_OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I measure the CS-signal it is always on high, although the MOSI and the CLK signals are OK.&lt;/P&gt;&lt;P&gt;If I don't try to change the standard settings the CS signal works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help on this problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Mar 2014 14:31:51 GMT</pubDate>
    <dc:creator>projektecarus</dc:creator>
    <dc:date>2014-03-25T14:31:51Z</dc:date>
    <item>
      <title>How can I set the CS signal for spi with _io_ctl()?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-set-the-CS-signal-for-spi-with-io-ctl/m-p/303567#M9755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using a K60F120M Tower with MQX 4.0.2. I tried to set the CS signal for spi2 to SPI2_CS0/1 with the _io_ctl()-command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code looks like this:&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;MQX_FILE_PTR mcp23s17_SPI;&lt;/P&gt;&lt;P&gt;uint_32 mcp23s17_CS = SPI_PUSHR_PCS(1 &amp;lt;&amp;lt; 0);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Chip-Select-Mask for SPI2_CS0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mcp23s17_SPI = _io_fopen("spi2:", NULL);&lt;/P&gt;&lt;P&gt;_io_ioctl(mcp23s17_SPI, IO_IOCTL_SPI_SET_CS, &amp;amp;mcp23s17_CS);&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;_io_write(mcp23s17_SPI,...);&lt;/P&gt;&lt;P&gt;_io_fflush(mcp23s17_SPI);&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The BSPCFG_ENABLE_SPI2 is set in user_config.h and the return value of _io_fopen isn't NULL. The return value of _io_ctl() is SPI_OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I measure the CS-signal it is always on high, although the MOSI and the CLK signals are OK.&lt;/P&gt;&lt;P&gt;If I don't try to change the standard settings the CS signal works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help on this problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2014 14:31:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-set-the-CS-signal-for-spi-with-io-ctl/m-p/303567#M9755</guid>
      <dc:creator>projektecarus</dc:creator>
      <dc:date>2014-03-25T14:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: How can I set the CS signal for spi with _io_ctl()?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-set-the-CS-signal-for-spi-with-io-ctl/m-p/303568#M9756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"&gt;Hi,&lt;/P&gt;&lt;P class="MsoNormal"&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"&gt;The Kinetis SPI driver was updatedto use the eDMA driver.&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"&gt;You need to pass the details using command IO_IOCTL_SPI_SET_CS_CALLBACK.&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"&gt;For more information, please check the MQXIOUG (chapter 9) that you can find at the next path:&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"&gt;C:\Freescale\Freescale_MQX_4_0\doc\mqx&lt;/P&gt;&lt;P class="MsoNormal"&gt;&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"&gt;Regards&lt;/P&gt;&lt;P class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal;"&gt;Sol&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Apr 2014 03:08:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/How-can-I-set-the-CS-signal-for-spi-with-io-ctl/m-p/303568#M9756</guid>
      <dc:creator>soledad</dc:creator>
      <dc:date>2014-04-05T03:08:33Z</dc:date>
    </item>
  </channel>
</rss>

