Can't read from gpio

Trying to read button 3 on the npm1300-ek, which is gpio 1 according to the schematic. The following #defines represent the gpio related registers on the npm1300:

#define GPIOS_MSB         0x06                     // GPIO registers MSB=0x600, individual registers below are added to this 
#define GPIO_MODE1      0x01                     // mode for gpio one (pin)
#define GPIO_STATUS_LOWER    0x1e       // gpio status (all five pins)

I verified that gpio 1 is set to an input using the following:

uint8_t regsy[] = {GPIOS_MSB, GPIO_MODE1};                            
ret = i2c_write_read_dt(&dev_i2c_pmic, regsy, 2, &valRead, 1); 
valRead came back zero indicating to me that the pin is an input
But when I press the button and read the inputs with the following:
uint8_t regsy[] = {GPIOS_MSB, GPIO_STATUS_LOWER};                            
ret = i2c_write_read_dt(&dev_i2c_pmicregsy2&valRead1); 
valRead comes back zero, indicating that the button hasn't affected the pin (it's also zero when the button isn't pressed)
Note that I can perform a write/read to an adc register and get the correct value back, so i2c should be working.
What am I missing?
Parents Reply Children
No Data
Related