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:
83
main/config/display_config.h
Normal file
83
main/config/display_config.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/**
|
||||
* @file display_config.h
|
||||
* @brief Display configuration constants for the iroBot display system
|
||||
*
|
||||
* This header centralizes all LCD and LVGL configuration parameters.
|
||||
* Modify these values to adapt to different display hardware.
|
||||
*/
|
||||
|
||||
#ifndef DISPLAY_CONFIG_H
|
||||
#define DISPLAY_CONFIG_H
|
||||
|
||||
#include "driver/gpio.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// LCD Resolution
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define DISPLAY_WIDTH 368
|
||||
#define DISPLAY_HEIGHT 448
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// LCD SPI Pin Configuration
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define LCD_PIN_CS (GPIO_NUM_12)
|
||||
#define LCD_PIN_PCLK (GPIO_NUM_11)
|
||||
#define LCD_PIN_DATA0 (GPIO_NUM_4)
|
||||
#define LCD_PIN_DATA1 (GPIO_NUM_5)
|
||||
#define LCD_PIN_DATA2 (GPIO_NUM_6)
|
||||
#define LCD_PIN_DATA3 (GPIO_NUM_7)
|
||||
#define LCD_PIN_RST (-1)
|
||||
#define LCD_PIN_BACKLIGHT (-1)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// LCD Backlight Control
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define LCD_BACKLIGHT_ON_LEVEL 1
|
||||
#define LCD_BACKLIGHT_OFF_LEVEL (!LCD_BACKLIGHT_ON_LEVEL)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// SPI Host Configuration
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define LCD_SPI_HOST SPI2_HOST
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Color Depth Configuration
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if CONFIG_LV_COLOR_DEPTH == 32
|
||||
#define LCD_BIT_PER_PIXEL 24
|
||||
#elif CONFIG_LV_COLOR_DEPTH == 16
|
||||
#define LCD_BIT_PER_PIXEL 16
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// LVGL Configuration
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Draw buffer height as a fraction of display height (1/4 of screen)
|
||||
#define LVGL_BUFFER_HEIGHT (DISPLAY_HEIGHT / 4)
|
||||
|
||||
// LVGL tick period in milliseconds
|
||||
#define LVGL_TICK_PERIOD_MS 2
|
||||
|
||||
// LVGL task timing constraints
|
||||
#define LVGL_TASK_MAX_DELAY_MS 500
|
||||
#define LVGL_TASK_MIN_DELAY_MS 1
|
||||
|
||||
// LVGL task configuration
|
||||
#define LVGL_TASK_STACK_SIZE (4 * 1024)
|
||||
#define LVGL_TASK_PRIORITY 2
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DISPLAY_CONFIG_H
|
||||
61
main/config/hardware_config.h
Normal file
61
main/config/hardware_config.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* @file hardware_config.h
|
||||
* @brief Hardware pin and peripheral configuration for the iroBot system
|
||||
*
|
||||
* This header centralizes all hardware-related configuration including
|
||||
* I2C buses, touch controller, IO expander, and sensor addresses.
|
||||
* Modify these values to adapt to different hardware configurations.
|
||||
*/
|
||||
|
||||
#ifndef HARDWARE_CONFIG_H
|
||||
#define HARDWARE_CONFIG_H
|
||||
|
||||
#include "driver/gpio.h"
|
||||
#include "driver/i2c.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// I2C Bus Configuration
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define I2C_MASTER_PORT I2C_NUM_0
|
||||
#define I2C_MASTER_SDA (GPIO_NUM_15)
|
||||
#define I2C_MASTER_SCL (GPIO_NUM_14)
|
||||
#define I2C_MASTER_FREQ_HZ (200 * 1000)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Touch Controller Configuration
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define TOUCH_PIN_SDA I2C_MASTER_SDA
|
||||
#define TOUCH_PIN_SCL I2C_MASTER_SCL
|
||||
#define TOUCH_PIN_RST (-1)
|
||||
#define TOUCH_PIN_INT (GPIO_NUM_21)
|
||||
|
||||
// Enable/disable touch functionality
|
||||
#define TOUCH_ENABLED 1
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// QMI8658 IMU Sensor Configuration
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define QMI8658_I2C_PORT I2C_MASTER_PORT
|
||||
#define QMI8658_I2C_ADDR 0x6B
|
||||
#define QMI8658_PIN_SDA I2C_MASTER_SDA
|
||||
#define QMI8658_PIN_SCL I2C_MASTER_SCL
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// IO Expander Configuration (TCA9554)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define IO_EXPANDER_I2C_PORT I2C_MASTER_PORT
|
||||
// Address is defined by ESP chip support library
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // HARDWARE_CONFIG_H
|
||||
Reference in New Issue
Block a user