32 write_OR(MPU_address,INT_PIN_CFG,(1<<5));
36 write_AND(MPU_address,INT_PIN_CFG,~(1<<5));
46 read(MPU_address,INT_STATUS);
55 switch (selected_mode)
58 write_OR(MPU_address,INT_PIN_CFG,(1<<7));
62 write_AND(MPU_address,INT_PIN_CFG,~(1<<7));
73 switch (selected_mode)
76 write_OR(MPU_address,INT_PIN_CFG,(1<<6));
80 write_AND(MPU_address,INT_PIN_CFG,~(1<<6));
91 switch(selected_interrupt)
93 case motion_interrupt:
94 write_OR(MPU_address,INT_ENABLE,(1<<6));
97 case FIFO_overflow_interrupt:
98 write_OR(MPU_address,INT_ENABLE,(1<<4));
101 case Fsync_interrupt:
102 write_OR(MPU_address,INT_ENABLE,(1<<3));
105 case raw_rdy_interrupt:
106 write_OR(MPU_address,INT_ENABLE,(1<<0));
117 switch(selected_interrupt)
119 case motion_interrupt:
120 write_OR(MPU_address,INT_ENABLE,~(1<<6));
123 case FIFO_overflow_interrupt:
124 write_OR(MPU_address,INT_ENABLE,~(1<<4));
127 case Fsync_interrupt:
128 write_OR(MPU_address,INT_ENABLE,~(1<<3));
131 case raw_rdy_interrupt:
132 write_OR(MPU_address,INT_ENABLE,~(1<<0));
143 write(MPU_address,WOM_THR,threshold);
151 write(MPU_address,MOT_DETECT_CTRL,(1<<7)|(1<<7));
159 write(MPU_address,MOT_DETECT_CTRL,~((1<<7)|(1<<7)));
void disable_interrupt_output(interrupts selected_interrupt)
Disable interrupt.
void set_INT_signal_mode(interrupt_pin selected_mode)
Set interrupt signal mode.
void enable_motion_interrupt()
Enable motion detector interrupt.
void set_INT_active_state(interrupt_pin selected_mode)
Set interrupt pin active state.
void disable_motion_interrput()
Disable motion detector interrupt.
void enable_interrupt_output(interrupts selected_interrupt)
Enable interrupt.
void clear_interrupt()
Clear interrupt flag (this also clears interrupt pin).
void set_INT_pin_mode(interrupt_pin selected_mode)
Set interrupt pin mode.
void set_motion_threshold_level(uint8_t threshold)
Set motion detector threeshold level.
Main header of the library.