Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrfx_gpiote same pin register more than GPIOTE control?

I take the external PWM signal, I directly used the method of controlling the GPIOTE register to be successful. 

But I can't achieve the same effect using the program in the standard SDK.

An error occurs when I declare using the standard SDK. Is there a way to program using the standard SDK? 

PS: SDK version: nRF 16.0.0

there is successful

    NRF_GPIOTE->CONFIG[PWM_INPUT_GPIOTE_RISE_EDGE_CH] = GPIOTE_CONFIG_MODE_Event << GPIOTE_CONFIG_MODE_Pos | 
                                         GPIOTE_CONFIG_POLARITY_LoToHi << GPIOTE_CONFIG_POLARITY_Pos | 
                                         pin_number << GPIOTE_CONFIG_PSEL_Pos | 
                                         GPIOTE_CONFIG_OUTINIT_Low << GPIOTE_CONFIG_OUTINIT_Pos;    // ignored when gpio is set to event mode

    NRF_GPIOTE->CONFIG[PWM_INPUT_GPIOTE_FALL_EDGE_CH] = GPIOTE_CONFIG_MODE_Event << GPIOTE_CONFIG_MODE_Pos | 
                                         GPIOTE_CONFIG_POLARITY_HiToLo << GPIOTE_CONFIG_POLARITY_Pos | 
                                         pin_number << GPIOTE_CONFIG_PSEL_Pos | 
                                         GPIOTE_CONFIG_OUTINIT_High << GPIOTE_CONFIG_OUTINIT_Pos;    // ignored when gpio is set to event mode

there is failure

    err_code = nrfx_gpiote_in_init(pin_number, &gpiote_LoToHi_cfg, PWM_emtpy_handler); //Low to High edge
    APP_ERROR_CHECK(err_code);

    err_code = nrfx_gpiote_in_init(pin_number, &gpiote_HiToLo_cfg, PWM_emtpy_handler); //High to low edge
    APP_ERROR_CHECK(err_code);

Parents Reply Children
No Data
Related