Refactor project structure and update display logic
Reorganized source files into new directories for config, drivers, sensors, emotion engine, and UI. Removed legacy assets and code related to previous eye animation implementation. Added new display and touch drivers, emotion manager, shake detector, and UI components. Updated CMake project name to 'irobot_display'.
This commit is contained in:
84
main/emotion-engine/emotion_manager.h
Normal file
84
main/emotion-engine/emotion_manager.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* @file emotion_manager.h
|
||||
* @brief Central emotion coordination system
|
||||
*
|
||||
* This module manages all emotion-related animations and coordinates
|
||||
* transitions between emotional states. It provides a unified interface
|
||||
* for triggering emotions from various sources (shake, touch, etc.).
|
||||
*/
|
||||
|
||||
#ifndef EMOTION_MANAGER_H
|
||||
#define EMOTION_MANAGER_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Type Definitions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Supported emotion types
|
||||
*/
|
||||
typedef enum {
|
||||
EMOTION_IDLE = 0, // Default idle state with blink
|
||||
EMOTION_BLINK, // Single blink animation
|
||||
EMOTION_SURPRISED, // Surprised expression
|
||||
EMOTION_SAD, // Sad expression
|
||||
EMOTION_ANGRY, // Angry expression
|
||||
EMOTION_COUNT
|
||||
} EmotionType;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Public API
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @brief Initialize the emotion engine
|
||||
*
|
||||
* Sets up all emotion animations and prepares the system.
|
||||
* Must be called after display driver initialization.
|
||||
*
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
bool emotionManagerInit(void);
|
||||
|
||||
/**
|
||||
* @brief Start the emotion engine with default state
|
||||
*
|
||||
* Begins the idle animation with natural blinking.
|
||||
* Call this after splash screen is complete.
|
||||
*/
|
||||
void emotionManagerStart(void);
|
||||
|
||||
/**
|
||||
* @brief Trigger a specific emotion
|
||||
*
|
||||
* Plays the specified emotion animation. The system will
|
||||
* automatically return to idle state after the animation completes.
|
||||
*
|
||||
* @param emotion The emotion to trigger
|
||||
*/
|
||||
void emotionManagerSetEmotion(EmotionType emotion);
|
||||
|
||||
/**
|
||||
* @brief Get the currently active emotion
|
||||
*
|
||||
* @return The current emotion type
|
||||
*/
|
||||
EmotionType emotionManagerGetCurrent(void);
|
||||
|
||||
/**
|
||||
* @brief Stop all emotions and cleanup
|
||||
*/
|
||||
void emotionManagerStop(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // EMOTION_MANAGER_H
|
||||
Reference in New Issue
Block a user