 ///   - ports: The ports to configure as output
 ///   - board: The board name
 /// - Returns: The output ports
-public func setupOUT(ports: [GPIOName], for board: SupportedBoard) -> [GPIOName: GPIO] {
-    let gpios = GPIOs(for: board)
-    var result: [GPIOName: GPIO] = [:]
-    for key in ports {
-        if let gpio = gpios[key] {
-            gpio.direction = .OUT
-            gpio.value = 0
-            result[key] = gpio
-        }
+public func setupOUT(ports: Ports, for board: SupportedBoard) -> [GPIOName: GPIO] {
+  let gpios = GPIOs(for: board)
+  var result: [GPIOName: GPIO] = [:]
+  for key in ports {
+    if let gpio = gpios[key] {
+      gpio.direction = .OUT
+      gpio.value = 0
+      result[key] = gpio
     }
+  }
 
-    return result
+  return result
 }
 
 /// Returns a list of GPIOs configured as input

#if os(Linux)
    import Glibc
#else
    import Darwin.C
#endif

import SwiftyGPIO

/// Returns a list of GPIOs configured as output
///

///   - ports: The ports to configure as input
///   - board: The board name
/// - Returns: The input ports
public func setupIN(ports: Ports, for board: SupportedBoard) -> [GPIOName: GPIO] {
  let gpios = GPIOs(for: board)
  var result: [GPIOName: GPIO] = [:]
  for key in ports {
    if let gpio = gpios[key] {
      gpio.direction = .IN
      result[key] = gpio
    }
  }

  return result
}

public func switchOn(ports: Ports, for board: SupportedBoard) {
  let gpios = GPIOs(for: board)
  for key in ports {
    if let gpio = gpios[key] {
      gpio.value = 1
    }
  }
}
/// Waiting an amount of milliseconds before continue with the process
///
/// - Parameter milliseconds: How many milliseconds wait
public func waiting(for milliseconds: UInt32) {
  usleep(milliseconds * Constant.milliseconds)
}

private struct Constant {
  static let milliseconds: UInt32 = 1000
}

private func GPIOs(for board: SupportedBoard) -> [GPIOName: GPIO] {
  return SwiftyGPIO.GPIOs(for: board)
}
