24 void MPU9255::Hreset()
26 write_OR(MPU_address,PWR_MGMT_1,1<<7);
30 void MPU9255::sleep_enable()
32 write_OR(MPU_address,PWR_MGMT_1, 1<<6);
36 void MPU9255::sleep_disable()
38 write_AND(MPU_address,PWR_MGMT_1, ~(1<<6));
44 void MPU9255::reset(
modules selected_module)
46 switch(selected_module)
49 write_OR(MPU_address,SIGNAL_PATH_RESET, 1<<1);
53 write_OR(MPU_address,SIGNAL_PATH_RESET, 1<<2);
57 write_OR(MPU_address,SIGNAL_PATH_RESET, 1<<0);
61 write_OR(MPU_address,USER_CTRL, 1<<0);
65 write_OR(MAG_address,CNTL2, 1<<0);
73 void MPU9255::disable(
modules selected_module)
75 switch (selected_module)
78 write_OR(MPU_address,PWR_MGMT_2, 1<<5);
82 write_OR(MPU_address,PWR_MGMT_2, 1<<4);
86 write_OR(MPU_address,PWR_MGMT_2, 1<<3);
90 write_OR(MPU_address,PWR_MGMT_2, 1<<2);
94 write_OR(MPU_address,PWR_MGMT_2, 1<<1);
98 write_OR(MPU_address,PWR_MGMT_2, 1<<0);
102 write(MAG_address,CNTL, 0x00);
110 void MPU9255::enable(
modules selected_module)
112 switch (selected_module)
115 write_AND(MPU_address,PWR_MGMT_2, ~(1<<5));
119 write_AND(MPU_address,PWR_MGMT_2, ~(1<<4));
123 write_AND(MPU_address,PWR_MGMT_2, ~(1<<3));
127 write_AND(MPU_address,PWR_MGMT_2, ~(1<<2));
131 write_AND(MPU_address,PWR_MGMT_2, ~(1<<1));
135 write_AND(MPU_address,PWR_MGMT_2, ~(1<<0));
139 write(MAG_address,CNTL, 0x16);
modules
modules (for enable / disable / reset functions)
Main header of the library.