     case BOTH="both"
 }
 
+public enum GPIOPull: UInt {
+    case neither = 0
+    case down    = 1
+    case up      = 2
+}
+
 public enum ByteOrder {
     case MSBFIRST
     case LSBFIRST

        }
    }

    public override func isMemoryMapped() -> Bool {
        return true
    }

        let ptr = gpioBasePointer.advanced(by: id/10)       // GPFSELn 0..5
        let d = (ptr.pointee & (7<<((UInt(id)%10)*3)))
        return (d == 0) ? .IN : .OUT
    }

    func setGpioPull(_ value: GPIOPull){
        let gpioGPPUDPointer = gpioBasePointer.advanced(by: 37)
        gpioGPPUDPointer.pointee = value.rawValue   // Configure GPPUD
        usleep(10);                                 // 150 cycles or more
        let gpioGPPUDCLK0Pointer = gpioBasePointer.advanced(by: 38)
        gpioGPPUDCLK0Pointer.pointee = setGetId     // Configure GPPUDCLK0 for specific gpio (Ids always lower than 31, no GPPUDCLK1 needed)
        usleep(10);                                 // 150 cycles or more
        gpioGPPUDPointer.pointee = 0                // Reset GPPUD
        usleep(10);                                 // 150 cycles or more
        gpioGPPUDCLK0Pointer.pointee = 0            // Reset GPPUDCLK0/1 for specific gpio
        usleep(10);                                 // 150 cycles or more
    }

    private func gpioGet() -> Int {
