 ;; Board objects carry with them information about what pins are available, what modes are available for those
 ;; pins, and the current mode settings for those pins.
 
-
-(defrecord Board [state-atom impl-board])
 
 (declare board? board-dispatch board-apply chan?)
 

  ([type]
   (create-board type {}))
  ([type config]
   (Board. (atom {}) (impl/instantiate type config))))

;; What follows then are a suite of simple tools for dealing with the boards.

(defn get-config
  "Get board configuration."
  [board]
  (p/get-config board))

(defn update-config
  "Reset board configuration."
  [board f & args]
  (p/update-config board (fn [current-conf] (apply f current-conf args))))


(defmulti pin-modes
  "Returns a map of pin numbers to possible modes for the entire board, or the available modes of a specific pin.


;; Nothing to see here...

(defn- board?
  [obj]
  (satisfies? p/PBoard obj))

(defn- board-dispatch
  [x & args] (board? x))
