SPIM_WriteTxData() Usage | Cypress Semiconductor
Hello, I am new to embedded code and PSoC Creator as well. I am embarrassed to ask such a basic question but I must as I am just not sure how to proceed. I am using the SPIM component from the library and I want to communicate over the SPI to a MPL115A Barometer.
The format of the write is address then data, such as (0x20, 0x00). Now the description for the SPIM write function is as follows:
SPIM_WriteTxData() Places a byte/word in the transmit buffer which will be sent at the next available bus time. So how do I perform an address then data write, would it be 2 writes such as, void SPIM_WriteTxData (uint8, 0x20) then void SPIM_WriteTxData (uint8, 0x00)? this seems like the long way to do something. I have some sample code for the adruino that shows: write (0x20, 0x00).
So I am sorta confused. Any suggestions/help would be appreciated. I hope my question made sense. Also one more question, do I have to declare a function prototype for each SPIM function I use?