Hello,
I am a new user of the C6748 StarterWare libraries, and I have just stated using some libraries to test a custom board.
I have done a lot of reading so as to undertand well the StarterWare structure.
When I want to configure a generic format for the SPI peripheral, I came across with a configuration that I do not understand well, and it makes me think there is an issue in the {StarterwareRoot}/Drivers/spi.c driver.
The function SPIDat1Config says that the parameter "cs is the value to driven on CS pin(line)."
Similarly, the function SPIDefaultCSSet says "dcsval is the value written to SPIDEF register to set default value on CS pin(line)".
Thus, my understanding is that if I want to configure a negative active CS pulse when sending a single message, I should configure cs=0, and dcs=1. The reference manual SPRUH79A seems to corroborate that idea (registers SPIDAT1 and SPIDEF)
However, I do not get that behaviour. Then, I realized in the fucntion SPIDat1Config in spi.c, it read:
*(ptr+2) = cs ^ dcs;
I think to have seen corroborated that the XOR function really change the behaviour to what I think is not correct. I sould have expected simply:
*(ptr+2) = cs;
ptr points to the lower bytre of the register SPIDAT1, and "dcs" is the reading of the lower byte of the register SPIDEF.
What I wonder is, is that a "characteristic" of the fucntion that must be interpreted with another logic of working that i do not understand? or is it a bug?.
At least for me, like it is currently makes no sense. By the way, I am using the las versión available C6748_StarterWare_1_20_04_01
http://software-dl.ti.com/dsps/dsps_public_sw/c6000/starterware/01_20_04_01/index_FDS.html
I hope to made myself undertood.
Gonzalo.