<?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 Re: Bit set and bit clear driver functions in chip in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Bit-set-and-bit-clear-driver-functions-in-chip/m-p/634302#M25007</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using&amp;nbsp;LPCXpresso824-MAX evaluation board.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Apr 2017 05:26:23 GMT</pubDate>
    <dc:creator>hmyoong</dc:creator>
    <dc:date>2017-04-25T05:26:23Z</dc:date>
    <item>
      <title>Bit set and bit clear driver functions in chip</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Bit-set-and-bit-clear-driver-functions-in-chip/m-p/634300#M25005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I noticed that some of the driver functions like to read the register again during bit set or bit clear of any bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STATIC INLINE void Chip_SYSCTL_EnablePeriphWakeup(uint32_t periphmask)&lt;BR /&gt;{&lt;BR /&gt; LPC_SYSCTL-&amp;gt;STARTERP1 = periphmask | (LPC_SYSCTL-&amp;gt;STARTERP0 &amp;amp; ~SYSCTL_STARTERP0_RESERVED);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&amp;gt; There is a bug here, should the code be?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #000000;"&gt;STATIC INLINE void Chip_SYSCTL_EnablePeriphWakeup(uint32_t periphmask)&lt;/SPAN&gt;
&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;
&lt;SPAN style="color: #000000;"&gt;LPC_SYSCTL-&amp;gt;STARTERP1 = periphmask | (LPC_SYSCTL-&amp;gt;STARTERP&lt;STRONG style="color: #ff0000;"&gt;1&lt;/STRONG&gt; &amp;amp; ~SYSCTL_STARTERP&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;_RESERVED);&lt;/SPAN&gt;
&lt;SPAN style="color: #000000;"&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Can this be done like this?&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #3366ff;"&gt;STATIC INLINE void Chip_SYSCTL_EnablePeriphWakeup(uint32_t periphmask)&lt;/SPAN&gt;
&lt;SPAN style="color: #3366ff;"&gt;{&lt;/SPAN&gt;
&lt;SPAN style="color: #3366ff;"&gt; LPC_SYSCTL-&amp;gt;STARTERP1 |= periphmask;&lt;/SPAN&gt;
&lt;SPAN style="color: #3366ff;"&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Another example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;#define WKT_CTRL_RESERVED (~7)
#define WKT_CTRL_ALARMFLAG ((uint32_t) (1 &amp;lt;&amp;lt; 1)) /*!&amp;lt; Wake-up or alarm timer flag */

STATIC INLINE void Chip_WKT_ClearIntStatus(LPC_WKT_T *pWKT)
{
 pWKT-&amp;gt;CTRL = WKT_CTRL_ALARMFLAG | (pWKT-&amp;gt;CTRL &amp;amp; ~WKT_CTRL_RESERVED);
}&lt;/PRE&gt;&lt;P&gt;Be changed to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #3366ff;"&gt;STATIC INLINE void Chip_WKT_ClearIntStatus(LPC_WKT_T *pWKT)&lt;/SPAN&gt;
&lt;SPAN style="color: #3366ff;"&gt;{&lt;/SPAN&gt;
&lt;SPAN style="color: #3366ff;"&gt; pWKT-&amp;gt;CTRL &amp;amp;= ~WKT_CTRL_ALARMFLAG;&lt;/SPAN&gt;
&lt;SPAN style="color: #3366ff;"&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Apr 2017 17:50:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Bit-set-and-bit-clear-driver-functions-in-chip/m-p/634300#M25005</guid>
      <dc:creator>hmyoong</dc:creator>
      <dc:date>2017-04-22T17:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Bit set and bit clear driver functions in chip</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Bit-set-and-bit-clear-driver-functions-in-chip/m-p/634301#M25006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="228832" data-username="hmyoong" href="https://community.nxp.com/people/hmyoong"&gt;HM Yoong&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Thank you for your interest in NXP Semiconductor products and the opportunity to serve you.&lt;/P&gt;&lt;P&gt;I was wondering if you can tell me the name of&amp;nbsp; MCU and its correlated LPCopen library you use.&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 01:27:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Bit-set-and-bit-clear-driver-functions-in-chip/m-p/634301#M25006</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2017-04-25T01:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Bit set and bit clear driver functions in chip</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Bit-set-and-bit-clear-driver-functions-in-chip/m-p/634302#M25007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using&amp;nbsp;LPCXpresso824-MAX evaluation board.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 05:26:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Bit-set-and-bit-clear-driver-functions-in-chip/m-p/634302#M25007</guid>
      <dc:creator>hmyoong</dc:creator>
      <dc:date>2017-04-25T05:26:23Z</dc:date>
    </item>
  </channel>
</rss>

