         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 {

    case BOTH="both"
}

public enum ByteOrder {
    case MSBFIRST
    case LSBFIRST

        get {
            if !exported {enableIO(id)}
            return getIntValue("gpio"+String(id)+"/active_low")==0
        }
    }

    public var pull: GPIOPull {
        set(dir) {
            fatalError("Unsupported parameter.")
        }
        get{
            fatalError("Parameter cannot be read.")
        }
    }

