STHS34PF80, how to set active LOW interrupt

I’m using a SparkFun Mini Human Presence and Motion Sensor - STHS34PF80 (Qwiic) board in much the same way as the “Cat Presence Detector” by Madaroni And Cheese.
I’m using the STHS34PF80 to generate an interrupt that wakes an ESP8266 from deep sleep. The ESP8266 that switches on a MOSFET to power an RFID reader that reads the cat’s implanted RFID tag. Once the cats identity is confirmed, the ESP8266 drives a servo that opens the cats feeder.

My problem is that the RESET pin that wakes the ESP8266 from deep sleep has a pullup resistor to the 3.3v rail. This means that the interrupt signal from the STHS34PF80 must be active LOW. The default value is 0, active HIGH.
I have the EXAMPLE_2_Interrupts working on another pin (active high) but I cannot work out how to set the INT_H_L bit of the CTRL3 register.

Here is the function from EXAMPLE_2_Interrupts
mySensor.setInterruptMode(sths34pf80_int_mode_t val);

and the struct from the STHS34PF80_reg.h

typedef struct
{
  enum {
    STHS34PF80_PUSH_PULL = 0x0,
    STHS34PF80_OPEN_DRAIN = 0x1,
  } pin;

  enum {
    STHS34PF80_ACTIVE_HIGH = 0x0,
    STHS34PF80_ACTIVE_LOW = 0x1,
  } polarity;
} sths34pf80_int_mode_t;
int32_t sths34pf80_int_mode_set(stmdev_ctx_t *ctx, sths34pf80_int_mode_t val);
int32_t sths34pf80_int_mode_get(stmdev_ctx_t *ctx, sths34pf80_int_mode_t *val);

I just can’t figure out how it goes together…
Any help or suggestions gratefully accepted.

  1. Create an instance of the sths34pf80_int_mode_t struct
  2. Set the polarity to ACTIVE_LOW
  3. Set the pin mode (push-pull or open-drain, depending on your needs)
  4. Use the setInterruptMode function to apply

Here’s a simple example of those 4 steps:

sths34pf80_int_mode_t interruptMode;
interruptMode.polarity = STHS34PF80_ACTIVE_LOW;
interruptMode.pin = STHS34PF80_PUSH_PULL;  // or STHS34PF80_OPEN_DRAIN, depending on your needs

mySensor.setInterruptMode(interruptMode);

See if that gets ya goin

Thank you for your reply. I also posed the same question on the Arduino forum and received something very similar from gfvalvo
#include “SparkFun_STHS34PF80_Arduino_Library.h”
#include <Wire.h>

STHS34PF80_I2C mySensor;

void setup() {
  sths34pf80_int_mode_t myMode;

  myMode.pin = sths34pf80_int_mode_t::STHS34PF80_PUSH_PULL; // or sths34pf80_int_mode_t::STHS34PF80_OPEN_DRAIN
  myMode.polarity = sths34pf80_int_mode_t::STHS34PF80_ACTIVE_LOW;
  mySensor.setInterruptMode(myMode);
}

void loop() {
}