lpcware

Two SPI Channels on LPC812 LPCXpresso

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Rorrik on Wed Jul 16 10:06:17 MST 2014
I haven't been able to find any example code or code snippets using both of the SPI channels possible on the LPC812. I am using the LPC812 as a buffer between two parts for backwards compatibility and need to have it be slave to a part on one side, and master to the other part on the other. I've initialized the two channels like so:
Chip_SWM_DisableFixedPin(SWM_FIXED_VDDCMP);
Chip_SWM_MovablePinAssign(SWM_SPI1_SCK_IO, 12);
Chip_SWM_MovablePinAssign(SWM_SPI1_MOSI_IO, 14);
#if defined(BOARD_LPC812MAX)
Chip_SWM_MovablePinAssign(SWM_SPI1_MISO_IO, 15);
#else
Chip_SWM_MovablePinAssign(SWM_SPI1_MISO_IO, 6);
#endif
Chip_SWM_MovablePinAssign(SWM_SPI1_SSEL_IO, 13);

Chip_SWM_MovablePinAssign(SWM_SPI0_SCK_IO, 15);
Chip_SWM_MovablePinAssign(SWM_SPI0_MOSI_IO, 11);
#if defined(BOARD_LPC812MAX)
Chip_SWM_MovablePinAssign(SWM_SPI0_MISO_IO, 7);
#else
Chip_SWM_MovablePinAssign(SWM_SPI0_MISO_IO, 16);
#endif
Chip_SWM_MovablePinAssign(SWM_SPI0_SSEL_IO, 17);

but I can't find anywhere in the SPI code I've seen where you define which channel (SPI1 or SPI0) to receive or transmit on. The receive and transmit functions seem to have no input for it.

Outcomes