rough sketch of pins with latch and SPI switch(untested)