I haven't looked at it that well, I can do that later, but you are doing a lot of this stuff:
//---disabling fixed pins
LPC_SWM->PINENABLE0 = (1 << 0);//disable SWM_FIXED_ACMP_I1
LPC_SWM->PINENABLE0 = (1 << 1);//disable SWM_FIXED_ACMP_I2
LPC_SWM->PINENABLE0 = (1 << 2);//disable SWM_FIXED_SWDIO
LPC_SWM->PINENABLE0 = (1 << 3);//disable SWM_FIXED_SWCLK
You are overwriting the value in LPC_SWM->PINENABLE0 every time you do an assign. Every line undoes what the line before it has done. You need to do bit manipulation if you want to set/clear specific bits, otherwise you are assigning a whole new value to this register every time you write to it.
Again with this:
LPC_SWM->PINASSIGN[3] = (clkPin << 24); //spi clock pins
You are setting the spi clock pin and assigning every other pin in this register to pin 0. 0xFF means unassigned and you need to set those. The example was in the code given by lane and me.
LPC_SWM->PINASSIGN3 = (GPIO_BIT_SCK << 24) | // SCK
(0xff << 16) |
(0xff <<
|
(0xff << 0);