Content originally posted in LPCWare by trichloramine on Tue Nov 04 13:23:48 MST 2014
I have written the code for a SPI interface that has support for multiple chip selects with microsecond control over transition times, and clock rates.
A straight forward initialization starts DMA transfer that chains blocks together of up to 4095 bytes apiece though an interrupt handler.
pSpi = new Spi(1, GPIO_16, SPI_CLK(5.32),0,100,8);
support for serial flash and shift registers is included as a derived class. Lots of working, SPI example code.
pFlash = new M25PxxFlash ( GPO_8 | GPO_16 );
polled mode example:
pFlash->CsLow();
pFlash->Send(data);
pFlash->CsHigh();
if you are interested in this part, any or all of the NXP library, please contact me.