How to set the rotation direction of acceleration, gyroscope and compass in hwdef.dat file

Hi! I have a problem, I designed a set of IMUs: ICM20602, ICM20689, MMC5983. When setting the Hwdef.dat file, I don’t understand the principle of setting the rotation direction. Do you have any friends who know? Hope to get your recovery ! Thanks!
The IMU facing down .The circuit board diagram is shown in the following figure.


Hwdef.dat define:(???)
SPIDEV icm20689 SPI1 DEVID4 MPU_CS MODE3 4MHZ 8MHZ
SPIDEV icm20602 SPI1 DEVID1 GYRO_EXT_CS MODE3 4MHZ 8MHZ
SPIDEV mmc5983 SPI1 DEVID5 MAG_CS MODE3 8MHZ 8MHZ

IMU Invensense SPI:icm20689 ROTATION_NONE (?)
IMU Invensense SPI:icm20602 ROTATION_NONE (?)

I think you can use MATEK H743 HWDEF.DAT for reference.
It is also upside down.
And it has ROTATION_ROLL_180_* prefix for all of the 2 IMUs.

thank you! The main reason is that I don’t understand the principle behind the rotation. I don’t understand it with reference to pixhawk hardware(MPU6000、L3GD20). I wonder if the principle of rotation behind this is related to the coordinate reference of the gyroscope

This depends on the board. For example, MATEK H743 has an arrow on its back so this is why it’s common to mount it upside down to see the arrow on the board and it is pointing front.
AFAIK, X-axis is front and Y-axis is sideways.

OK, I’m looking!Thanks