| 404 | } |
| 405 | |
| 406 | lv_display_rotation_t EpdiyDisplay::epdRotationToLvgl(enum EpdRotation epdRotation) { |
| 407 | // Static lookup table for EPD -> LVGL rotation mapping |
| 408 | // EPDiy: LANDSCAPE = 0°, PORTRAIT = 90° CW, INVERTED_LANDSCAPE = 180°, INVERTED_PORTRAIT = 270° CW |
| 409 | // LVGL: 0 = 0°, 90 = 90° CW, 180 = 180°, 270 = 270° CW |
| 410 | static const lv_display_rotation_t rotationMap[] = { |
| 411 | LV_DISPLAY_ROTATION_0, // EPD_ROT_LANDSCAPE (0) |
| 412 | LV_DISPLAY_ROTATION_270, // EPD_ROT_PORTRAIT (1) - 90° CW in EPD is 270° in LVGL |
| 413 | LV_DISPLAY_ROTATION_180, // EPD_ROT_INVERTED_LANDSCAPE (2) |
| 414 | LV_DISPLAY_ROTATION_90 // EPD_ROT_INVERTED_PORTRAIT (3) - 270° CW in EPD is 90° in LVGL |
| 415 | }; |
| 416 | |
| 417 | // Validate input and return mapped value |
| 418 | if (epdRotation >= 0 && epdRotation < 4) { |
| 419 | return rotationMap[epdRotation]; |
| 420 | } |
| 421 | |
| 422 | // Default to landscape if invalid |
| 423 | return LV_DISPLAY_ROTATION_0; |
| 424 | } |
| 425 | |
| 426 | enum EpdRotation EpdiyDisplay::lvglRotationToEpd(lv_display_rotation_t lvglRotation) { |
| 427 | // Static lookup table for LVGL -> EPD rotation mapping |
nothing calls this directly
no outgoing calls
no test coverage detected