From 58a0b5fd115d9687a1292e5e82e6b9fa8454b930 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 19 May 2026 01:44:11 +0530 Subject: Dynamic layout for WiFi setup: landscape rotation, responsive render, highlight feedback - Render functions use axs15231b_get_width/height() instead of hardcoded coords - render_wifi_setup_list: dynamic item widths, screen-relative cancel button - render_wifi_setup_password: dynamic field/eye/keyboard from kb_get_layout() - render_wifi_setup_result: centered on screen, dynamic button placement - handle_wifi_setup_touch: matching dynamic hit areas, highlight_rect() feedback - Rotation lifecycle: enter_wifi_setup_rotation/exit wired into all entry/exit paths - display_enter_wifi_setup + READY/ERROR touch + SUCCESS auto-return + LIST cancel - Added kb_result_t typedef to keyboard.h (was only in .c) - Fixed test_keyboard.c: use computed offsets from kb_layout_t defaults - All 101 unit tests pass (touch:19, keyboard:46, wifi_setup:36) --- components/axs15231b/axs15231b.c | 32 ++++++++++++++++++++++++++++++++ components/axs15231b/include/axs15231b.h | 1 + 2 files changed, 33 insertions(+) (limited to 'components') diff --git a/components/axs15231b/axs15231b.c b/components/axs15231b/axs15231b.c index 7424a20..77708dd 100644 --- a/components/axs15231b/axs15231b.c +++ b/components/axs15231b/axs15231b.c @@ -37,6 +37,7 @@ static spi_device_handle_t s_spi = NULL; static uint16_t *s_fb = NULL; static int s_width = AXS15231B_WIDTH; static int s_height = AXS15231B_HEIGHT; +static int s_rotation = 0; static uint8_t *s_swap_buf = NULL; #define SWAP_BUF_PIXELS 2048 @@ -354,3 +355,34 @@ void axs15231b_flush(void) { int axs15231b_get_width(void) { return s_width; } int axs15231b_get_height(void) { return s_height; } + +void axs15231b_set_rotation(int rotation) { + uint8_t madctl = MADCTL_RGB; + switch (rotation) { + case 0: + madctl = MADCTL_RGB; + s_width = AXS15231B_WIDTH; + s_height = AXS15231B_HEIGHT; + break; + case 1: + madctl = MADCTL_MX | MADCTL_MV; + s_width = AXS15231B_HEIGHT; + s_height = AXS15231B_WIDTH; + break; + case 2: + madctl = MADCTL_MX | MADCTL_MY; + s_width = AXS15231B_WIDTH; + s_height = AXS15231B_HEIGHT; + break; + case 3: + madctl = MADCTL_MY | MADCTL_MV; + s_width = AXS15231B_HEIGHT; + s_height = AXS15231B_WIDTH; + break; + default: + return; + } + s_rotation = rotation; + qspi_write_cmd_data8(MADCTL, madctl); + ESP_LOGI(TAG, "Rotation set to %d (%dx%d)", rotation, s_width, s_height); +} diff --git a/components/axs15231b/include/axs15231b.h b/components/axs15231b/include/axs15231b.h index cddea98..a8c1a37 100644 --- a/components/axs15231b/include/axs15231b.h +++ b/components/axs15231b/include/axs15231b.h @@ -23,5 +23,6 @@ void axs15231b_fill_rect(int x, int y, int w, int h, uint16_t color); void axs15231b_flush(void); int axs15231b_get_width(void); int axs15231b_get_height(void); +void axs15231b_set_rotation(int rotation); #endif -- cgit v1.2.3