linux: Ability to use multiple GPIO chips (#2935)
Signed-off-by: Lucio Tarantino <lucio.tarantino@gmail.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user