Hi All
First post! (be gentle!)
I'm developing on the nRF52840 and I am experiencing an issue using the led_softblink library.
I have the led_softblink configured to use P1.00. The LED on P1.00 blinks as desired.
Separately, I'm using P0.00 to sense a discrete input value (just boolean high/low). Without the led_softblink module this works as intended. Note that I'm using the internal RC and not the external XTAL, making P0.00 and P0.01 available for general GPIO.
The issue I'm having is that when I initialise the led_softblink module it is interfering with the pin configuration on P0.00 too, meaning that I can no longer sense the input on P0.00.
Config parameters for the led_softblink module:
#define M_LED_SOFTBLINK_PARAMS \
{ \
.active_high = true, \
.duty_cycle_max = 255, \
.duty_cycle_min = 0, \
.duty_cycle_step = 12, \
.off_time_ticks = 10500, \
.on_time_ticks = 10500, \
.leds_pin_bm = BIT_0, \
.p_leds_port = NRF_P1 \
}Snippet where I initialise the led_softblink module:
if (false == b_status_is_blinking)
{
APP_ERROR_CHECK(led_softblink_init(&led_sb_init_param));
APP_ERROR_CHECK(led_softblink_start(STATUS_LED_BITMASK));
b_status_is_blinking = true;
}
Initialisation of GPIO P0.00 is done via:
nrf_gpio_cfg_input(NRF_GPIO_PIN_MAP(0, 00), NRF_GPIO_PIN_NOPULL);
If I manually re-configure the GPIO on P0.00 immediately prior to reading it, I get the correct value.
If I do not initialise the led_softblink module then the GPIO on P0.00 works fine too.
The led_softblink module is configured to use P1.00 and, when initialised, it is modifying the configuration of P0.00 in some way. I do not expect this.
Is this possibly a defect in the led_softblink library? My suspicion is that there's possibly a function within either the led_softblink or low_power_pwm libraries that is not factoring the port number, which is working fine for P0 but not for P1.
Any help would be appreciated.