anchor.diff:      gd2-spi-init
       gd2-unsel
   
  -    000 hostcmd     \ ACTIVE
  -    PCB_CRYSTAL if
  -        044 hostcmd     \ CLKEXT
  -    else
  -        062 hostcmd     \ CLK48M used for no-crystal parts like Gameduino2
  -    then
  -    068 hostcmd     \ CORERST
  -
  -    PCB_CRYSTAL 0= if
  -        tune
  -    then
  +    000 hostcmd         \ ACTIVE
  +
  +    custom @ execute
  +
  +    unstream
  +
  +    083 GD.REG_GPIO_DIR     GD.c!
  +    080 GD.REG_GPIO         GD.c!
  +    stream
  +;
  +
  +: common-init
  +    \ cr
  +    \ gd2-sel
  +    \     10 spix hex2.
  +    \     24 spix hex2.
  +    \     00 spix hex2.
  +    \     0 spix hex2.
  +    \     0 spix hex2.
  +    \     0 spix hex2.
  +    \ gd2-unsel
   
       0 wp !
       stream
  
positive.code:     
  : getspace  ( -- u )    \ u is the space in the command FIFO
      4092
      wp @ GD.REG_CMD_READ GD.@ -
      mod4K -
  ;
  
  : gostream
      GD.ram_cmd wp @ mod4K +
      GD.wa
  ;
  
  
negative.code: : GD.move   unstream GD.move stream ;
  
  DONEWORDS
  
  : GD.480x272
      1 GD.REG_PCLK_POL       GD.c!
      5 GD.REG_PCLK           GD.c!
  ;
  
  : gameduino2
      GD.nocrystal
      3 GD.REG_SWIZZLE GD.c!
      1 GD.REG_ROTATE  GD.c!
      GD.480x272
  ;
  
  : ftdi-eval
      GD.crystal
      GD.480x272
  ;
  
  ' gameduino2 GD.setcustom
  