The code is located here...
**broken link removed**
Look at the functions, RegisterWrite and RegisterRead which are explained below.
The SPI::transfer function is defined in...
PX4 Autopilot Software. Contribute to Pskoog3/PX4-Autopilot development by creating an account on GitHub.
Following is the WRITE sequence which is a bit different from what I mentioned in my last reply.
1st byte sent: the first bit of the DIN sequence is a 1, followed by a 0 and finally the LOWER 6-bit address of the 16-bit target register.
2nd byte sent: the 8-bit data command containing [7:0] bits of the 16-bit data.
3rd byte sent: the first bit of the DIN sequence is a 1, followed by a 0 and finally the UPPER 6-bit address of the 16-bit target register.
4th byte sent: the 8-bit data command containing [15:8] bits of the 16-bit data.
Following READ sequence is used which is again a bit different from what I explained in my last reply.
1st byte sent: the first two bits in the DIN sequence are 0, followed by the LOWER byte address of the 16-bit register.
1st byte received: the DOUT sequence contains the register’s LOWER 8-bit data.
2nd byte sent: the first two bits in the DIN sequence are 0, followed by the UPPER byte address of the 16-bit register.
2nd byte received: the DOUT sequence contains the register’s UPPER 8-bit data.
Finally the UPPER and LOWER 8-bit data is combined into a 16-bit word.
The ADIS16354 IMU datasheet is located at...