<?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>S32KのトピックRe: Interrupt priority bits</title>
    <link>https://community.nxp.com/t5/S32K/Interrupt-priority-bits/m-p/2088107#M48221</link>
    <description>&lt;P&gt;Pay attention to following thread:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S32K/S32K312-Nvic-subpriority-issue/m-p/1916798" target="_blank"&gt;https://community.nxp.com/t5/S32K/S32K312-Nvic-subpriority-issue/m-p/1916798&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Apr 2025 07:52:12 GMT</pubDate>
    <dc:creator>davidtosenovjan</dc:creator>
    <dc:date>2025-04-28T07:52:12Z</dc:date>
    <item>
      <title>Interrupt priority bits</title>
      <link>https://community.nxp.com/t5/S32K/Interrupt-priority-bits/m-p/2087940#M48206</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I am having some doubt with&amp;nbsp;NVIC_EncodePriority() function.&lt;/P&gt;&lt;P&gt;In my case implemented priority bits are&amp;nbsp;__NVIC_PRIO_BITS = 4.&lt;/P&gt;&lt;P&gt;If I need to implement 3 bits for preempt priority and 1 bit for sub priority, How this&amp;nbsp;&lt;SPAN&gt;NVIC_EncodePriority() going to help me with this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The below code returning 6, then 0b0110 means what is it helpful for me in any case how to use this function?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdint.h&amp;gt;&lt;BR /&gt;#define __NVIC_PRIO_BITS (4)&lt;/P&gt;&lt;P&gt;uint32_t NVIC_EncodePriority (uint32_t , uint32_t , uint32_t);&lt;BR /&gt;int main() {&lt;BR /&gt;// Write C code here&lt;BR /&gt;printf("%d",NVIC_EncodePriority(1,6,2));&lt;/P&gt;&lt;P&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)&lt;BR /&gt;{&lt;BR /&gt;uint32_t PriorityGroupTmp = (PriorityGroup &amp;amp; (uint32_t)0x07UL); /* only values 0..7 are used */&lt;BR /&gt;uint32_t PreemptPriorityBits;&lt;BR /&gt;uint32_t SubPriorityBits;&lt;/P&gt;&lt;P&gt;PreemptPriorityBits = ((7UL - PriorityGroupTmp) &amp;gt; (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);&lt;BR /&gt;SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) &amp;lt; (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));&lt;/P&gt;&lt;P&gt;return (&lt;BR /&gt;((PreemptPriority &amp;amp; (uint32_t)((1UL &amp;lt;&amp;lt; (PreemptPriorityBits)) - 1UL)) &amp;lt;&amp;lt; SubPriorityBits) |&lt;BR /&gt;((SubPriority &amp;amp; (uint32_t)((1UL &amp;lt;&amp;lt; (SubPriorityBits )) - 1UL)))&lt;BR /&gt;);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2025 05:27:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Interrupt-priority-bits/m-p/2087940#M48206</guid>
      <dc:creator>vignesh3</dc:creator>
      <dc:date>2025-04-28T05:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt priority bits</title>
      <link>https://community.nxp.com/t5/S32K/Interrupt-priority-bits/m-p/2088107#M48221</link>
      <description>&lt;P&gt;Pay attention to following thread:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S32K/S32K312-Nvic-subpriority-issue/m-p/1916798" target="_blank"&gt;https://community.nxp.com/t5/S32K/S32K312-Nvic-subpriority-issue/m-p/1916798&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2025 07:52:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Interrupt-priority-bits/m-p/2088107#M48221</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2025-04-28T07:52:12Z</dc:date>
    </item>
  </channel>
</rss>

