aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-05-11 21:14:55 +0200
committerHarald Welte <laforge@gnumonks.org>2019-05-16 23:05:21 +0200
commit08ea062daf94163b1f697056b9c7317b49d740f2 (patch)
treef40655a46d1559d84a179a904149353344971020
parentc7a58ba755f9ae47c6b1dd1cde662bd54850c968 (diff)
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
-rw-r--r--sysmoOCTSIM/ncn8025.c6
-rw-r--r--sysmoOCTSIM/ncn8025.h2
2 files changed, 4 insertions, 4 deletions
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 @@ static const uint8_t slot2int_pin(unsigned int slot)
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 @@ int ncn8025_get(uint8_t slot, struct ncn8025_settings *set)
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 @@ struct ncn8025_settings {
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);