Two SPI Channels on LPC812 LPCXpresso

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Two SPI Channels on LPC812 LPCXpresso

760 次查看
lpcware
NXP Employee
NXP Employee
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.
0 项奖励
回复
1 回复

701 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rorrik on Wed Jul 16 15:39:45 MST 2014
Oh, so an actual question, I suppose. Where can I find the SPI library functions? I think I could figure it out from there. Do any of them take a parameter defining which SPI to use?

EDIT: Actually, I've figured out the two channel problem, I think. Now I'm just trying to figure out the buffer clear, read, and write functions. The ones I've seen in other example code draw errors. Is there some library I need to import?
0 项奖励
回复