Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
imu.h
Go to the documentation of this file.
1
5#ifndef IMU_H
6#define IMU_H
7
9
10namespace lampda {
11namespace physical {
14namespace imu {
15
17extern void init();
18
20extern void shutdown();
21
25enum class EventType
26{
27 FreeFall,
28 BigMotion,
29 Step,
30 Tilt,
31};
32
34bool enable_event_detection(const EventType eventType);
36bool disable_event_detection(const EventType eventType);
37
39bool is_event_detected(const EventType eventType);
40
42extern bool link_event_to_interrupt1(const EventType eventType);
44extern void unlink_interrupt_1();
45
48extern bool link_event_to_interrupt2(const EventType eventType);
50extern void unlink_interrupt_2();
51
56
58Reading get_filtered_reading(const bool resetFilter);
59
60} // namespace imu
61} // namespace physical
62} // namespace lampda
63
64#endif
Interface for the physical components of the inertial motion unit.
EventType
Describe an IMU detection event.
Definition: imu.h:26
@ BigMotion
raised during a big acceleration
@ Step
raised during step detection
@ Tilt
raised event during orientation flip
@ FreeFall
raised during a free fall event
void unlink_interrupt_2()
Disable the interrupts 2.
Definition: imu.cpp:253
bool link_event_to_interrupt1(const EventType eventType)
Enable the interrupt 1 with an event type, wired to the interrupt pin 1 of IMU.
Definition: imu.cpp:159
bool disable_event_detection(const EventType eventType)
Disable a specific event.
Definition: imu.cpp:86
bool is_event_detected(const EventType eventType)
Read the event bit.
Definition: imu.cpp:110
bool is_interrupt1_enabled()
Read and reset the interrupt1 bit.
Definition: imu.cpp:139
bool is_interrupt2_enabled()
Read and reset the interrupt2 bit.
Definition: imu.cpp:151
bool link_event_to_interrupt2(const EventType eventType)
Enable the interrupt 2 with an event type, wired to the interrupt pin 2 of IMU EVENT BigMotion & Step...
Definition: imu.cpp:209
void unlink_interrupt_1()
Disable the interrupts 1.
Definition: imu.cpp:206
void shutdown()
Called once on program shutdown, to gracefully close the driver.
Definition: imu.cpp:53
Reading get_filtered_reading(const bool resetFilter)
get the filtered IMU readings
Definition: imu.cpp:255
bool enable_event_detection(const EventType eventType)
Enable a specific event.
Definition: imu.cpp:62
void init()
Called once on program start, initialize the driver.
Definition: imu.cpp:39
Program scope.
Definition: control_fixed_modes.hpp:12