Other Parts Discussed in Thread: HALCOGEN
Hi again everyone.
I'm continuing to write my Road Test review on the TMS570LS04 LaunchPad. It's a great bit of kit, by the way! I'm currently trying to do the most basic SPI bus communication -- simply writing values to an SPI EEPROM. I've used HALCoGen to set up SPI2 with all the correct values. I've imported all the code it generated into CCS, and I've started to write sys_main.c. I've found all the functions pre-written for SPI in spi.c. So I've called spiInit() and now I want to send a bunch of 8-bit values down the line to my EEPROM.
I clearly want to use the polling method (at least I think so) so the function is spiTransmitData() but I'm unclear on what the parameters are supposed to be. I'm fairly good with C but I've never programmed for an ARM (or any 32-bit micro, so far) so some of the code feels a bit foreign so far. I'm assuming I just create an array (it seems uint32 is the right format for the variable?) for all the bytes I want to send, and then call spiTransitData and plug in the array that I want to send.
I've tried to find a tutorial or any info at all, really, on SPI with this micro. Perhaps I'm looking in the wrong direction? I read the whole SPI section in the Technical Manual but that only helps if I'm writing my own functions for a custom header file, which I will probably do -- but at this point I just want to get it working with the HALCoGen functions.
Also, after sending the write enable bit to the EEPROM I need to latch the CS pin (pull it high and then low). Is there a simple way to do this?
It seems my learning curve with CCS and Hercules is quite steep... Thanks!