<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to read SPI TX &amp;amp; RX data register status full or empty..?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82620/how-to-read-spi-tx-rx-data-register-status-full-or-empty</link><description>Hi, 
 
 I want to get the SPI data register status regarding if they are full or empty.! Kindly guide me with relevant APIs i can use. 
 
 Thanks,</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Jan 2022 06:52:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82620/how-to-read-spi-tx-rx-data-register-status-full-or-empty" /><item><title>RE: How to read SPI TX &amp; RX data register status full or empty..?</title><link>https://devzone.nordicsemi.com/thread/345566?ContentTypeID=1</link><pubDate>Mon, 03 Jan 2022 06:52:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cefb8d31-351d-4397-bcbb-8076007f6d60</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;To check your TX buffer for instance, you will need to use the p_tx_buffer which is the pointer to the TX buffer (or ctx-&amp;gt;tx_buf) in the spi_nrfx files in the nRFConnect SDK. YOu then have to read the memory from this pointer to check whether the buffer is empty or filled. I&amp;#39;m afraid there&amp;#39;s no specific &amp;quot;buffer status&amp;quot; check in the API.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read SPI TX &amp; RX data register status full or empty..?</title><link>https://devzone.nordicsemi.com/thread/345424?ContentTypeID=1</link><pubDate>Thu, 30 Dec 2021 08:06:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49d7803c-5eaa-4199-abb4-49da45f6fbe6</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/simonr"&gt;Simonr&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I think my question is not right,&lt;br /&gt;Rather, If i need to &lt;span style="text-decoration:underline;"&gt;get say nordic board SPI tx data address from device binding or device tree&lt;/span&gt;, so that i can check if buffer empty or full,&lt;br /&gt;What can I do..?&lt;br /&gt;&lt;br /&gt;Kindly suggest&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read SPI TX &amp; RX data register status full or empty..?</title><link>https://devzone.nordicsemi.com/thread/345330?ContentTypeID=1</link><pubDate>Wed, 29 Dec 2021 09:47:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b11eadf-e461-48a5-8d57-24512b77eb1e</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Hello Simon,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the info, I am using nCS as in zephyr driver model,&lt;br /&gt;So can I use something specific to zephyr..?&lt;br /&gt;&lt;br /&gt;For example in spi_context.h, I noticed APIs like:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;bool spi_context_tx_on(struct spi_context *ctx)
{
return !!(ctx-&amp;gt;tx_len);
}

bool spi_context_rx_on(struct spi_context *ctx)
{
return !!(ctx-&amp;gt;rx_len);
}

bool spi_context_rx_buf_on(struct spi_context *ctx)
{
return !!(ctx-&amp;gt;rx_buf &amp;amp;&amp;amp; ctx-&amp;gt;rx_len);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Is this SPI Context already pointing to&amp;nbsp;&lt;/strong&gt;&lt;span&gt;&lt;strong&gt;RXD.PTR and TXD.PTR for nordic board..?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Can i use above APIs..?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read SPI TX &amp; RX data register status full or empty..?</title><link>https://devzone.nordicsemi.com/thread/343861?ContentTypeID=1</link><pubDate>Thu, 16 Dec 2021 11:16:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ed1541d-597d-4c3e-9081-6f904e22a8cc</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fspis.html&amp;amp;anchor=concept_abk_lbf_wr"&gt;SPI slave periphera&lt;/a&gt;l for instance uses two memory pointers RXD.PTR and TXD.PTR, that point to the RXD buffer and TXD buffer respectively. Since these buffers are located in RAM, it can be accessed by both the SPI slave and the CPU.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m afraid we don&amp;#39;t have a specific code example doing this already, but you should be able to implement it by referring to the SPI slave operation description and registers in the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fspis.html"&gt;product specification.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read SPI TX &amp; RX data register status full or empty..?</title><link>https://devzone.nordicsemi.com/thread/343573?ContentTypeID=1</link><pubDate>Wed, 15 Dec 2021 09:41:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d370ba93-bebf-4b19-b438-37e3302b9089</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Hello Simon,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I kind of was figuring that out, on usage of SPI context structure to read the TX/RX registers/buffer status.&lt;/p&gt;
&lt;p&gt;can you kindly point me on how i can use the same..?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read SPI TX &amp; RX data register status full or empty..?</title><link>https://devzone.nordicsemi.com/thread/343446?ContentTypeID=1</link><pubDate>Tue, 14 Dec 2021 14:54:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75afc225-b95f-4ade-a999-01f3781d3806</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Sorry, there aren&amp;#39;t APIs specifically for this, but the SPI peripheral has a STATUS register you can read to check the status of the last transaction for example.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read SPI TX &amp; RX data register status full or empty..?</title><link>https://devzone.nordicsemi.com/thread/343298?ContentTypeID=1</link><pubDate>Tue, 14 Dec 2021 05:11:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9fd7ef8-0838-4c14-a7dc-8bbabe94b502</guid><dc:creator>Ubaid_M</dc:creator><description>&lt;p&gt;Hello Simon,&lt;br /&gt;&lt;br /&gt;Yep to check buffer status like TX/RX Data Reg is Full or empty.&lt;br /&gt;I couldn&amp;#39;t find any APIs that i can use to check the buffer status, hence the query&lt;br /&gt;Kindly help me understand&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to read SPI TX &amp; RX data register status full or empty..?</title><link>https://devzone.nordicsemi.com/thread/343051?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 06:46:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9730053d-bccc-4e9b-84b8-80299dae1a85</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;By register status, do you mean the SPI buffer? I would suggest checking out the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.1.0%2Fgroup__nrf__spi.html"&gt;SPI peripheral driver&amp;#39;s API here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>