Now I am reading the register map document to learn how to do self testing. I will do gyro first and only X direction first.
After reading the following pages, I know the procedure to start self test for X axis is to put the value 0x98 into the gygo config register 0x1b.
Summary of registers
gyro config = 0x1b
factory trim values = 0x13, 0x14, 0x15
gyro output X, Y, Z = 0x43, 0x44, 0x45, 0x46, 0x47, 0x48
sample rate = 0x19 (oxff = /256 = 8k/2^8 = 8 * 2^10 / 2^8 = 32cps)
external sync/low pass filter = 0x1a (0x05 = no ext sync, low pass freq = 10Hz)
temperature = 0x41, 0x42
pwr_mgmt1 = 0x6b
pwr_mgmt2 = 0x6c