ncn8025: ncn8025_interrupt_active -> ncn8025_interrupt_level
The IRQ output of the NCN8025 doesn't really have an "active" state
but it's slightly more intricate. To avoid confusion, let's just
provide a function to obtain the raw value (0=low / 1=high) and
let the user decide what to do with that
Change-Id: I752a84c67046b1d5f832cd1ef2070ec9b2489231
diff --git a/sysmoOCTSIM/ncn8025.c b/sysmoOCTSIM/ncn8025.c
index 711b082..540b166 100644
--- a/sysmoOCTSIM/ncn8025.c
+++ b/sysmoOCTSIM/ncn8025.c
@@ -95,10 +95,10 @@
return slot2pin[slot];
}
-bool ncn8025_interrupt_active(uint8_t slot)
+bool ncn8025_interrupt_level(uint8_t slot)
{
uint8_t pin = slot2int_pin(slot);
- return !gpio_get_pin_level(pin);
+ return gpio_get_pin_level(pin);
}
@@ -127,7 +127,7 @@
if (rc < 0)
return rc;
rc = ncn8025_decode(rc, set);
- set->interrupt = ncn8025_interrupt_active(slot);
+ set->interrupt = ncn8025_interrupt_level(slot);
return rc;
}
diff --git a/sysmoOCTSIM/ncn8025.h b/sysmoOCTSIM/ncn8025.h
index a2a6459..2e774a7 100644
--- a/sysmoOCTSIM/ncn8025.h
+++ b/sysmoOCTSIM/ncn8025.h
@@ -26,6 +26,6 @@
int ncn8025_set(uint8_t slot, const struct ncn8025_settings *set);
int ncn8025_get(uint8_t slot, struct ncn8025_settings *set);
-bool ncn8025_interrupt_active(uint8_t slot);
+bool ncn8025_interrupt_level(uint8_t slot);
int ncn8025_init(unsigned int slot);
void ncn8025_dump(const struct ncn8025_settings *set);