anchor.diff:  map_attr([default]) ->
       0.
   
  +index(gpio1) ->
  +    0;
  +index(gpio2) ->
  +    4;
  +index(led1_r) ->
  +    8;
  +index(led1_g) ->
  +    9;
  +index(led1_b) ->
  +    10;
  +index(led2_r) ->
  +    11;
  +index(led2_g) ->
  +    12;
  +index(led2_b) ->
  +    13;
  +index(jumper_1) ->
  +    14;
  +index(jumper_2) ->
  +    15;
  +index(jumper_3) ->
  +    16;
  +index(jumper_4) ->
  +    17;
  +index(jumper_5) ->
  +    18;
  +index(spi1_pin9) ->
  +    19;
  +index(spi1_pin10) ->
  +    20;
  +index(ss1) ->
  +    21;
  +index(ss2) ->
  +    22;
  +index(Any) when is_integer(Any) ->
  +    Any.
  +
  
positive.code: 
  % API
  -export([open/0, configure/3, configure/4,
  	 configure_gpio/3, get/2, clear/2, set/2, set/3, clear/3]).
  
  %--- API -----------------------------------------------------------------------
  
  
negative.code:     configure(Port, 7, T4).
  
  get(Port, Pin_index) ->
      Port ! {self(), {command, <<(index(Pin_index)):8, 2:8>>}}.
  
  clear(Port, Pin_index) ->
      Port ! {self(), {command, <<(index(Pin_index)):8, 3:8>>}}.
  
  set(Port, Pin_index) ->
      Port ! {self(), {command, <<(index(Pin_index)):8, 4:8>>}}.
  
  set(Port, gpio1, Pin) when 1 =< Pin, Pin =< 4 ->    
      set(Port, Pin - 1 + index(gpio1));          % 0 .. 3     
  set(Port, gpio2, Pin) when 1 =< Pin, Pin =< 4 ->    
      set(Port, Pin - 1 + index(gpio2)).          % 4 .. 7     
  
  clear(Port, gpio1, Pin) when 1 =< Pin, Pin =< 4 ->    
      clear(Port, Pin - 1 + index(gpio1));	% 0 .. 3     
  clear(Port, gpio2, Pin) when 1 =< Pin, Pin =< 4 ->    
      clear(Port, Pin - 1 + index(gpio2)).	% 4 .. 7     
  
  disable_spi_ss1(Port) ->
      configure(Port, ss1, output_1).
  
  enable_spi_ss1(Port) ->
      configure(Port, ss1, periph_c).
  
  map_type(periph_a) ->
      0;
  map_type(periph_b) ->
      1;
  map_type(periph_c) ->
      2;
  map_type(periph_d) ->
      3;
  map_type(input) ->
      4;
  map_type(output_0) ->				% default value 0
  