anchor.diff:      configure(Port, 7, T4).
   
   get(Port, Pin_index) ->
  -    Port ! {self(), {command, <<Pin_index:8, 2:8>>}}.
  +    Port ! {self(), {command, <<(index(Pin_index)):8, 2:8>>}}.
   
   clear(Port, Pin_index) ->
  -    Port ! {self(), {command, <<Pin_index:8, 3:8>>}}.
  +    Port ! {self(), {command, <<(index(Pin_index)):8, 3:8>>}}.
   
   set(Port, Pin_index) ->
  -    Port ! {self(), {command, <<Pin_index:8, 4:8>>}}.
  +    Port ! {self(), {command, <<(index(Pin_index)):8, 4:8>>}}.
   
   set(Port, gpio1, Pin) when 1 =< Pin, Pin =< 4 ->    
  -    set(Port, Pin - 1);	% 0 .. 3     
  +    set(Port, Pin - 1 + index(gpio1));          % 0 .. 3     
   set(Port, gpio2, Pin) when 1 =< Pin, Pin =< 4 ->    
  -    set(Port, Pin + 3).	% 4 .. 7     
  +    set(Port, Pin - 1 + index(gpio2)).          % 4 .. 7     
   
   clear(Port, gpio1, Pin) when 1 =< Pin, Pin =< 4 ->    
  -    clear(Port, Pin - 1);	% 0 .. 3     
  +    clear(Port, Pin - 1 + index(gpio1));	% 0 .. 3     
   clear(Port, gpio2, Pin) when 1 =< Pin, Pin =< 4 ->    
  -    clear(Port, Pin + 3).	% 4 .. 7     
  +    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
  
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, Pin_index, Type, [default]).
  
  configure(Port, Pin_index, Type, Attr) ->
      Port ! {self(), {command, <<(index(Pin_index)):8, 1:8, 
  				(map_type(Type)):8, (map_attr(Attr)):8>>}}.
  
  configure_gpio(Port, gpio1, {T1, T2, T3, T4}) ->
  