im trying to use this example as a starting point for my own project. I am using a Leopard Gecko STK and Simplicity Studio 3. When I am trying the compile the above code, it tells me that "READ_CMD_BIT" is undeclared (used in the readSpiByte() method above). What is it for and where do I set it?
Thanks in advance
I believe the "READ_CMD_BIT" as it is used in the readSpiByte() function above is a bit position in the address byte that the particular accelerometer in this example is expecting. In other words, the accelerometer is expecting you to first send an address, and depending on whether a particular bit in that address is set or cleared, it will know whether you intend to read or write to the device (and thus whether the accelerometer needs to transmit or receive on the next byte frame). Thus, the READ_CMD_BIT is not something on the EFM32 that you need to set, and this functionality will be dependent on the slave device communication protocol.
I hope this helps.