This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can the Simple Hardware Abstraction Layer be used to control LEDs that are "active high"?

Hi,

I am playing around with the the Bluetooth Mesh SDK (`nrf5_SDK_for_Mesh_v2.1.1_src`), more precisely with the light-switch `proxy server` example. The nRF52 DK's LEDs are "active low", but my custom board has "active high" LEDs. The firmware works as expected with the nRF52 DK. It also works on my custom board, with the exception of the LEDs.

I have created a custom board in the associated nRF52 SDK and added it to "boards.h", and I have modified `c_preprocessor_definitions` (in my SES project file) to use that board. I my custom board file, I have set `#define LEDS_ACTIVE_STATE 1` (as opposed to "0" for the nRF52 DK), but I have kept `#define LEDS_INV_MASK LEDS_MASK`.

I have tried using, for instance, `hal_led_pin_set()`, which is defined in the Simple Hardware Abstraction Layer, but it doesn't work (i.e. the voltages on the pins are always low, regardless of whether the pins have been set "true" or "false").

So my questions are:

1. Can the Simple Hardware Abstraction Layer be used to control LEDs that are "active high"?

2. If so, what could I be doing wrong?

Thank you for your time and support. A+ Slight smile

Frank

Related