Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
lampda::physical::imu::Wrapper Class Reference

IMU wrapper class. More...

#include <imu_wrapper.h>

Public Types

enum class  InterruptType { FreeFall , BigMotion , Step , AngleChange }
 Interrupt type for the event callbacks. More...
 

Public Member Functions

bool init () const
 Initialize the component.
 
bool shutdown () const
 Gracefully shutdown the component.
 
Reading get_reading () const
 get the latest accelerometer/gyroscope measurment
 
bool enable_free_fall_detection () const
 Enable free fall events detection.
 
bool disable_free_fall_detection () const
 Disable free fall events detection.
 
bool enable_big_motion_detection () const
 Enable big motion events detection.
 
bool disable_big_motion_detection () const
 Disable big motion events detection.
 
bool enable_step_detection () const
 Enable step motion event detection.
 
bool disable_step_detection () const
 Disable step motion event detection.
 
bool enable_tilt_detection () const
 Enable tilt detection.
 
bool disable_tilt_detection () const
 Disable tilt detection.
 
void disable_detection (const InterruptType interr) const
 disable event detection
 
bool enable_interrupt1 (const InterruptType interr) const
 Enable the interrupt 1 signal, with the given interrupt type.
 
void disable_interrupt1 () const
 Disable the interrupt 1 events.
 
bool enable_interrupt2 (const InterruptType interr) const
 Enable the interrupt 2 signal, with the given interrupt type.
 
void disable_interrupt2 () const
 Disable the interrupt 2 events.
 
uint16_t get_step_count () const
 Return the step count, only available with the interrupt 2.
 
bool is_event_detected (const InterruptType interr) const
 return true if the interrupt is raised, do not depend on physical interrupt pins
 

Detailed Description

IMU wrapper class.

Member Enumeration Documentation

◆ InterruptType

Interrupt type for the event callbacks.

Enumerator
FreeFall 

raised during a free fall event

BigMotion 

raised with a >6g acceleration

Step 

raised on a step event

AngleChange 

raised on portrait to landscape (or inverse) rotation

Member Function Documentation

◆ disable_detection()

void lampda::physical::imu::Wrapper::disable_detection ( const InterruptType  interr) const

disable event detection

Warning
WILL ALSO DISABLE THE ASSOCIATED INTERRUPTS

◆ enable_interrupt1()

bool lampda::physical::imu::Wrapper::enable_interrupt1 ( const InterruptType  interr) const

Enable the interrupt 1 signal, with the given interrupt type.

Parameters
[in]interrThe desired interrupt type
Returns
true if the interrupt gets enabled

◆ enable_interrupt2()

bool lampda::physical::imu::Wrapper::enable_interrupt2 ( const InterruptType  interr) const

Enable the interrupt 2 signal, with the given interrupt type.

Parameters
[in]interrThe desired interrupt type
Returns
true if the interrupt gets enabled

◆ init()

bool lampda::physical::imu::Wrapper::init ( ) const

Initialize the component.

Returns
True if the initialisation succeeded

◆ shutdown()

bool lampda::physical::imu::Wrapper::shutdown ( ) const

Gracefully shutdown the component.

Returns
True if the shutdown succeeded

The documentation for this class was generated from the following files: