GPIO_MODE_BITS
unsigned int mask = (1L << GPIO_MODE_BITS) - 1;
mask <<= (GPIO_MODE_BITS * bit);
val = (mode << (GPIO_MODE_BITS * bit));