NHS3100 Demo PCB interrupt only on falling edge

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

NHS3100 Demo PCB interrupt only on falling edge

1,118件の閲覧回数
Ben3094
Contributor I

Hello,

I struggle to use the NHS3100 Demo PCB to raise an interrupt on high level... Besides the setup was configured with the library, it seems to only react to falling edge.

Can you help me ?

Thank you in advance,

Here is an exemple of my code:

#include <stdlib.h>
#include "board.h"

#define BUTTON_PIN 2
#define ALWAYS_HIGH_PIN 6

bool buttonClicked = false;

void PIO0_2_IRQHandler(void)
{
    buttonClicked = true;
    Chip_SysCon_StartLogic_ClearStatus(SYSCON_STARTSOURCE_PIO0_2);
}

int main(void)
{
    // Init
    Chip_IOCON_Init(NSS_IOCON);
    Chip_GPIO_Init(NSS_GPIO);
    Chip_RTC_Init(NSS_RTC);
    Chip_EEPROM_Init(NSS_EEPROM);

    Chip_IOCON_SetPinConfig(NSS_IOCON, BUTTON_PIN, IOCON_FUNC_0 | IOCON_RMODE_INACT);
    Chip_IOCON_SetPinConfig(NSS_IOCON, ALWAYS_HIGH_PIN, IOCON_FUNC_0 | IOCON_RMODE_PULLUP);

    Chip_SysCon_StartLogic_SetEnabledMask(SYSCON_STARTSOURCE_PIO0_2 | SYSCON_STARTSOURCE_PIO0_6);

    // Init the detection pin
    NVIC_EnableIRQ(PIO0_2_IRQn);
    Chip_GPIO_SetPinDIRInput(NSS_GPIO, 0, BUTTON_PIN);
    Chip_GPIO_SetModeHigh(NSS_GPIO, 0, NSS_GPIOn_PINMASK(BUTTON_PIN));
    Chip_GPIO_SetPinModeLevel(NSS_GPIO, 0, NSS_GPIOn_PINMASK(BUTTON_PIN));

    while (1)
    {
        while (!buttonClicked) { }

        buttonClicked = false;
    }

    return 0;
}
0 件の賞賛
返信
2 返答(返信)

1,070件の閲覧回数
Ben3094
Contributor I

tenor.gif

0 件の賞賛
返信

1,081件の閲覧回数
fangfang
NXP TechSupport
NXP TechSupport

Hello @Ben3094 .

Please kindly refer to the SDK

NHS3100 SDK - v12.5 .

 

Have a nice day.

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------

0 件の賞賛
返信