<?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>Raw GPIO output without using API Functions?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49153/raw-gpio-output-without-using-api-functions</link><description>Probably frowned upon but like being able to work from raw datasheet, so I know that I can. So given that the datasheet would suggest that changing a GPIO pin to be an output is as simple as setting a bit, as a specific address, to 1. So I would expect</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 02 Jul 2019 20:34:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49153/raw-gpio-output-without-using-api-functions" /><item><title>RE: Raw GPIO output without using API Functions?</title><link>https://devzone.nordicsemi.com/thread/196080?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2019 20:34:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:192e1ffd-9cac-467b-8a62-35f2843c4c8e</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;you might want some &amp;#39;volatile&amp;#39; qualifiers in there ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Raw GPIO output without using API Functions?</title><link>https://devzone.nordicsemi.com/thread/196070?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2019 19:03:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ceaf67e-cdad-4de7-886e-82ed9c97d92c</guid><dc:creator>jwhitmore</dc:creator><description>&lt;p&gt;I found the source of problem if not the solution. The code I posted might not be agreeable to people&amp;#39;s taste but it does actually function as intended when compiled and linked with gcc compiler. However if you compile it in a main.cc with the g++ compiler whilst it does compile and link the code does not function as intended. So down to my toolchain.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Raw GPIO output without using API Functions?</title><link>https://devzone.nordicsemi.com/thread/195765?ContentTypeID=1</link><pubDate>Mon, 01 Jul 2019 20:13:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39e4e623-25ce-49de-8d9e-baba66b45357</guid><dc:creator>jwhitmore</dc:creator><description>&lt;p&gt;The purpose of this piece of code is to verify the build process and flashing of the target device. As soon as those stages have been verified the code will be dumped. So I&amp;#39;m not really going for human readable here. I want the compiler to be able to read it and the uC to be able to execute the resulting output hex file.&lt;/p&gt;
&lt;p&gt;Since nobody has pointed out any errors in the code, apart from no being to their individual taste and style I&amp;#39;ll assume that the code&amp;#39;s functionality is correct and the problem lies elsewhere.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Raw GPIO output without using API Functions?</title><link>https://devzone.nordicsemi.com/thread/195661?ContentTypeID=1</link><pubDate>Mon, 01 Jul 2019 13:10:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aed7ac78-02aa-4c56-8dec-2307765b42d5</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;I suggest you use the definitions of the HAL, you do not need to use any functions, but at least you code will be human-readable.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Raw GPIO output without using API Functions?</title><link>https://devzone.nordicsemi.com/thread/195490?ContentTypeID=1</link><pubDate>Sun, 30 Jun 2019 23:09:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:689c749e-3356-45e2-9506-052472e57bff</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;you might want to say which of the many chips and development boards you&amp;#39;re using, I&amp;#39;m guessing the nRF52836 dev board but it could be anything.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The declarations come in very handy when you switch from one chip to another. As long as the peripheral has the same behavior you don&amp;#39;t have to go edit all your code. I have stuff I wrote for the old nRF51 series and still use now. Those struct/entry type definitions for peripherals are followed by just about every manufacturer of anything using ARM, and it&amp;#39;s certainly not frowned upon to use them.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Raw GPIO output without using API Functions?</title><link>https://devzone.nordicsemi.com/thread/195484?ContentTypeID=1</link><pubDate>Sun, 30 Jun 2019 19:46:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0168ae7-263d-438e-afc6-18ff3a3d7af6</guid><dc:creator>jwhitmore</dc:creator><description>&lt;p&gt;Is it not working because of the Magic numbers? That&amp;#39;s impressive silicone!&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll try replacing the numbers with const declarations and see how it works out.. I&amp;#39;ll let you know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Raw GPIO output without using API Functions?</title><link>https://devzone.nordicsemi.com/thread/195466?ContentTypeID=1</link><pubDate>Sat, 29 Jun 2019 21:15:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6f04b6f-eebd-4f06-8bf4-c4ac7219a24d</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Waaay too many magic numbers.&lt;/p&gt;
&lt;p&gt;Directly manipluating reisters should lookr like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int PIN_NR= 3; // or use a define

NRF_GPIO-&amp;gt;PIN_CNF[PIN_NR] = 
    (NRF_GPIO_PIN_DIR_OUTPUT &amp;lt;&amp;lt; GPIO_PIN_CNF_DIR_Pos) 
  | (NRF_GPIO_PIN_S0S1 &amp;lt;&amp;lt; GPIO_PIN_CNF_DRIVE_Pos) ;
  
 NRF_GPIO-&amp;gt;DIRSET = (1&amp;lt;&amp;lt; PIN_NR);
 NRF_GPIO-&amp;gt;OUTSET = (1&amp;lt;&amp;lt; PIN_NR);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Note that on the bigger NRF52840 you&amp;#39;ll need to use NRF_P0 and NRF_P1 for the GPIO Ports.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>