Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Classes | Enumerations | Functions | Variables
lampda::physical::imu Namespace Reference

Contains the handling of the gyroscope and accelerometer. IMU is auto activated when used. More...

Classes

struct  Reading
 IMU reading. More...
 
class  Wrapper
 IMU wrapper class. More...
 

Enumerations

enum class  EventType { FreeFall , BigMotion , Step , Tilt }
 Describe an IMU detection event. More...
 

Functions

void init ()
 Called once on program start, initialize the driver.
 
void shutdown ()
 Called once on program shutdown, to gracefully close the driver.
 
bool enable_event_detection (const EventType eventType)
 Enable a specific event.
 
bool disable_event_detection (const EventType eventType)
 Disable a specific event.
 
bool is_event_detected (const EventType eventType)
 Read the event bit.
 
void interrupt1_callback ()
 callback for the interrupt1 signal
 
bool is_interrupt1_enabled ()
 Read and reset the interrupt1 bit.
 
void interrupt2_callback ()
 callback for the interrupt1 signal
 
bool is_interrupt2_enabled ()
 Read and reset the interrupt2 bit.
 
bool link_event_to_interrupt1 (const EventType eventType)
 Enable the interrupt 1 with an event type, wired to the interrupt pin 1 of IMU.
 
void unlink_interrupt_1 ()
 Disable the interrupts 1.
 
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 NOT SUPPORTED ON INTERRUPT 2.
 
void unlink_interrupt_2 ()
 Disable the interrupts 2.
 
Reading get_filtered_reading (const bool resetFilter)
 get the filtered IMU readings
 

Variables

Wrapper imuInstance
 instance of the IMU controler
 
platform::gpio::DigitalPin interrupt1Pin (platform::gpio::DigitalPin::GPIO::Signal_ImuInterrupt1)
 interrupt 1 pin
 
platform::gpio::DigitalPin interrupt2Pin (platform::gpio::DigitalPin::GPIO::Signal_ImuInterrupt2)
 interrupt 2 pin
 
bool isInitialized = false
 indicates if the driver is initialized
 
const utils::TransformationMatrix imuToBoardTransformation (utils::vec3d(imuToCircuitRotationX_rad, imuToCircuitRotationY_rad, imuToCircuitRotationZ_rad), utils::vec3d(imuToCircuitPositionX_m, imuToCircuitPositionY_m, imuToCircuitPositionZ_m))
 Transform imu coordinates to board coordinates.
 
const utils::TransformationMatrix boardToFirstPixelTransformation (utils::vec3d(circuitToLedZeroRotationX_degrees *c_degreesToRadians, circuitToLedZeroRotationY_degrees *c_degreesToRadians, circuitToLedZeroRotationZ_degrees *c_degreesToRadians), utils::vec3d(0, 0, 0))
 Transform board coordinates to first pixel.
 
bool isInterrupt1Enabled = false
 interrupt 1 result
 
bool isInterrupt2Enabled = false
 interrupt 2 result
 

Detailed Description

Contains the handling of the gyroscope and accelerometer. IMU is auto activated when used.

physical layer of the IMU.

Enumeration Type Documentation

◆ EventType

Describe an IMU detection event.

Enumerator
FreeFall 

raised during a free fall event

BigMotion 

raised during a big acceleration

Step 

raised during step detection

Tilt 

raised event during orientation flip