[LPC1549] Fixed SPI frequency issue

Fixed SPI frequency issue when new frequency is not divided by system
clock.
Optimized power/clock setting code.
Some code refactoring.
Merge pull request #408 from toyowata/master

[LPC1549] Fixed SPI frequency issue