Fixed SPI pin configuration problems.

Set SPI pins SCK and MOSI as outputs and MISO as input.
Added SPI speeds down to 1 KHz for testing.
Fixed inaccurate SPI speed configuration problem.
Added methods to read pin directions, largely for code testing use.
Fixed some comment typos.