<?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: Timer Function implimentation in S32k</title>
    <link>https://community.nxp.com/t5/S32K/Timer-Function-implimentation-in-S32k/m-p/1809469#M31732</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/203425"&gt;@akhilranga&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;For Use Case 1, you can look into this example:&amp;nbsp;&lt;A href="https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/Example-S32K148-GPIO-Interrupt/ta-p/1107231" target="_blank"&gt;Example: S32K148 GPIO Interrupt - NXP Community&lt;/A&gt;, p&lt;SPAN&gt;ressing SW4 invoke interrupt and Interrupt handler toggles Green LED. If you need some specific time after the interruption, an implementation of the LPIT is possible:&amp;nbsp;&lt;A href="https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/S32K-SDK-Example-Function-call-on-configurable-period-using-LPIT/ta-p/1123702" target="_blank"&gt;S32K SDK Example - Function call on configurable period using LPIT timer. - NXP Community.&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However, I haven't seen an example for the S32K which implements the time for a button pressed. There are some examples implemented for the KW45EVB (kw45b41zevk_temperature_collector_freertos), which implement the &lt;STRONG&gt;fsl_component_button&lt;/STRONG&gt; driver, including the different types of button events, measured by time thresholds with SW timer in FreeRTOS:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;/*! @brief The event type of button */
typedef enum _button_event
{
    kBUTTON_EventOneClick = 0x01U, /*!&amp;lt; One click with short time, the duration of key down and key up is less than
                                      #BUTTON_SHORT_PRESS_THRESHOLD. */
    kBUTTON_EventDoubleClick,      /*!&amp;lt; Double click with short time, the duration of key down and key up is less than
                                      #BUTTON_SHORT_PRESS_THRESHOLD.      And the duration of the two button actions does not
                                      exceed #BUTTON_DOUBLE_CLICK_THRESHOLD. */
    kBUTTON_EventShortPress,       /*!&amp;lt; Press with short time, the duration of key down and key up is no less than
                                      #BUTTON_SHORT_PRESS_THRESHOLD       and less than #BUTTON_LONG_PRESS_THRESHOLD. */
    kBUTTON_EventLongPress,        /*!&amp;lt; Press with long time, the duration of key down and key up is no less than
                                      #BUTTON_LONG_PRESS_THRESHOLD. */
    kBUTTON_EventError,            /*!&amp;lt; Error event if the button actions cannot be identified. */
} button_event_t;&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;This, however, is implemented in the KW45EVB and MCUXpresso, just for you information in case you find it useful. You can implement parts of this example into the first ones I shared.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;BR /&gt;Julián&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Feb 2024 20:32:23 GMT</pubDate>
    <dc:creator>Julián_AragónM</dc:creator>
    <dc:date>2024-02-15T20:32:23Z</dc:date>
    <item>
      <title>Timer Function implimentation in S32k</title>
      <link>https://community.nxp.com/t5/S32K/Timer-Function-implimentation-in-S32k/m-p/1809079#M31724</link>
      <description>&lt;DIV&gt;Hi there,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am trying to build an Automotive application using S32k14x EAR SDK. In this i have few use cases which i want to acheive, but i belive i require a timer module to acheive them.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;Mentionoing couple of use cases.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Use Case 1: Want to change the state of&amp;nbsp; an Output pin High or Low after some milliseconds.&amp;nbsp; when i receive a high signal from an Input Pin.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Use Case 2 : I want detect the duration of the pressed Push Button Input. i.e i want to apply a function to a push button upon pressing it for "x" milliseconds i need to get a confirmation/acknowledgement signal.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;i belive these can be acheived using FTM OC component. But it would be helpful if any example codes are available for reference to acheive the above functions&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 15 Feb 2024 11:57:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Timer-Function-implimentation-in-S32k/m-p/1809079#M31724</guid>
      <dc:creator>akhilranga</dc:creator>
      <dc:date>2024-02-15T11:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Timer Function implimentation in S32k</title>
      <link>https://community.nxp.com/t5/S32K/Timer-Function-implimentation-in-S32k/m-p/1809469#M31732</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/203425"&gt;@akhilranga&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;For Use Case 1, you can look into this example:&amp;nbsp;&lt;A href="https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/Example-S32K148-GPIO-Interrupt/ta-p/1107231" target="_blank"&gt;Example: S32K148 GPIO Interrupt - NXP Community&lt;/A&gt;, p&lt;SPAN&gt;ressing SW4 invoke interrupt and Interrupt handler toggles Green LED. If you need some specific time after the interruption, an implementation of the LPIT is possible:&amp;nbsp;&lt;A href="https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/S32K-SDK-Example-Function-call-on-configurable-period-using-LPIT/ta-p/1123702" target="_blank"&gt;S32K SDK Example - Function call on configurable period using LPIT timer. - NXP Community.&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However, I haven't seen an example for the S32K which implements the time for a button pressed. There are some examples implemented for the KW45EVB (kw45b41zevk_temperature_collector_freertos), which implement the &lt;STRONG&gt;fsl_component_button&lt;/STRONG&gt; driver, including the different types of button events, measured by time thresholds with SW timer in FreeRTOS:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;/*! @brief The event type of button */
typedef enum _button_event
{
    kBUTTON_EventOneClick = 0x01U, /*!&amp;lt; One click with short time, the duration of key down and key up is less than
                                      #BUTTON_SHORT_PRESS_THRESHOLD. */
    kBUTTON_EventDoubleClick,      /*!&amp;lt; Double click with short time, the duration of key down and key up is less than
                                      #BUTTON_SHORT_PRESS_THRESHOLD.      And the duration of the two button actions does not
                                      exceed #BUTTON_DOUBLE_CLICK_THRESHOLD. */
    kBUTTON_EventShortPress,       /*!&amp;lt; Press with short time, the duration of key down and key up is no less than
                                      #BUTTON_SHORT_PRESS_THRESHOLD       and less than #BUTTON_LONG_PRESS_THRESHOLD. */
    kBUTTON_EventLongPress,        /*!&amp;lt; Press with long time, the duration of key down and key up is no less than
                                      #BUTTON_LONG_PRESS_THRESHOLD. */
    kBUTTON_EventError,            /*!&amp;lt; Error event if the button actions cannot be identified. */
} button_event_t;&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;This, however, is implemented in the KW45EVB and MCUXpresso, just for you information in case you find it useful. You can implement parts of this example into the first ones I shared.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;BR /&gt;Julián&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2024 20:32:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Timer-Function-implimentation-in-S32k/m-p/1809469#M31732</guid>
      <dc:creator>Julián_AragónM</dc:creator>
      <dc:date>2024-02-15T20:32:23Z</dc:date>
    </item>
  </channel>
</rss>

