diff options
Diffstat (limited to 'src/linux/internal.h')
-rw-r--r-- | src/linux/internal.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/linux/internal.h b/src/linux/internal.h index 592c4588..ac4f3f13 100644 --- a/src/linux/internal.h +++ b/src/linux/internal.h @@ -5,6 +5,12 @@ #include <time.h> // struct timespec #include "autoconf.h" // CONFIG_CLOCK_FREQ +#define MAX_GPIO_LINES 256 +#define GPIO(PORT, NUM) ((PORT) * MAX_GPIO_LINES + (NUM)) +#define GPIO2PORT(PIN) ((PIN) / MAX_GPIO_LINES) +#define GPIO2PIN(PIN) ((PIN) % MAX_GPIO_LINES) + + #define NSECS 1000000000 #define NSECS_PER_TICK (NSECS / CONFIG_CLOCK_FREQ) |