diff options
| author | Your Name <you@example.com> | 2026-05-19 04:21:14 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-19 04:21:14 +0530 |
| commit | aa58b47996083f36e3587b8e10f9bbb681610491 (patch) | |
| tree | 4c845da2ee4b217a2c77deea3b10dd8d288d1b09 /components | |
| parent | 9f7dd94029c8dc12117494548f5f32221a729307 (diff) | |
feat: web-based WiFi setup via captive portal, portrait-only display
- Remove touchscreen WiFi setup (touch.c, keyboard.c, wifi_setup.c from build)
- Remove offscreen buffer and landscape rotation from axs15231b driver
- Add /setup HTML page with WiFi scan/connect via captive portal
- Add /wifi/scan, /wifi/connect, /wifi/status HTTP endpoints
- Display shows SETUP_PENDING (QR + SSID + setup URL) when unconfigured
- Display shows ERROR with setup URL when upstream is down
- All 101 unit tests pass, builds and flashes to Board C
Diffstat (limited to 'components')
| -rw-r--r-- | components/axs15231b/axs15231b.c | 37 | ||||
| -rw-r--r-- | components/axs15231b/include/axs15231b.h | 2 |
2 files changed, 2 insertions, 37 deletions
diff --git a/components/axs15231b/axs15231b.c b/components/axs15231b/axs15231b.c index ac05ba7..00e8467 100644 --- a/components/axs15231b/axs15231b.c +++ b/components/axs15231b/axs15231b.c | |||
| @@ -37,8 +37,7 @@ static spi_device_handle_t s_spi = NULL; | |||
| 37 | static uint16_t *s_fb = NULL; | 37 | static uint16_t *s_fb = NULL; |
| 38 | static int s_width = AXS15231B_WIDTH; | 38 | static int s_width = AXS15231B_WIDTH; |
| 39 | static int s_height = AXS15231B_HEIGHT; | 39 | static int s_height = AXS15231B_HEIGHT; |
| 40 | static int s_rotation = 0; | 40 | static int s_stride = AXS15231B_WIDTH; |
| 41 | static int s_stride = 480; | ||
| 42 | static uint8_t *s_swap_buf = NULL; | 41 | static uint8_t *s_swap_buf = NULL; |
| 43 | #define SWAP_BUF_PIXELS 2048 | 42 | #define SWAP_BUF_PIXELS 2048 |
| 44 | 43 | ||
| @@ -243,7 +242,7 @@ esp_err_t axs15231b_init(void) { | |||
| 243 | 242 | ||
| 244 | cs_init(); | 243 | cs_init(); |
| 245 | 244 | ||
| 246 | size_t fb_size = (size_t)480 * 480 * 2; | 245 | size_t fb_size = (size_t)s_width * s_height * 2; |
| 247 | s_fb = heap_caps_malloc(fb_size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT); | 246 | s_fb = heap_caps_malloc(fb_size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT); |
| 248 | if (!s_fb) { | 247 | if (!s_fb) { |
| 249 | ESP_LOGE(TAG, "Failed to allocate framebuffer (%zu bytes)", fb_size); | 248 | ESP_LOGE(TAG, "Failed to allocate framebuffer (%zu bytes)", fb_size); |
| @@ -322,7 +321,6 @@ void axs15231b_flush(void) { | |||
| 322 | qspi_write_command(RAMWR); | 321 | qspi_write_command(RAMWR); |
| 323 | 322 | ||
| 324 | bool first = true; | 323 | bool first = true; |
| 325 | |||
| 326 | cs_low(); | 324 | cs_low(); |
| 327 | for (int row = 0; row < s_height; row++) { | 325 | for (int row = 0; row < s_height; row++) { |
| 328 | int chunk_remaining = s_width; | 326 | int chunk_remaining = s_width; |
| @@ -359,34 +357,3 @@ void axs15231b_flush(void) { | |||
| 359 | 357 | ||
| 360 | int axs15231b_get_width(void) { return s_width; } | 358 | int axs15231b_get_width(void) { return s_width; } |
| 361 | int axs15231b_get_height(void) { return s_height; } | 359 | int axs15231b_get_height(void) { return s_height; } |
| 362 | |||
| 363 | void axs15231b_set_rotation(int rotation) { | ||
| 364 | uint8_t madctl = MADCTL_RGB; | ||
| 365 | switch (rotation) { | ||
| 366 | case 0: | ||
| 367 | madctl = MADCTL_RGB; | ||
| 368 | s_width = AXS15231B_WIDTH; | ||
| 369 | s_height = AXS15231B_HEIGHT; | ||
| 370 | break; | ||
| 371 | case 1: | ||
| 372 | madctl = MADCTL_MX | MADCTL_MV; | ||
| 373 | s_width = AXS15231B_HEIGHT; | ||
| 374 | s_height = AXS15231B_WIDTH; | ||
| 375 | break; | ||
| 376 | case 2: | ||
| 377 | madctl = MADCTL_MX | MADCTL_MY; | ||
| 378 | s_width = AXS15231B_WIDTH; | ||
| 379 | s_height = AXS15231B_HEIGHT; | ||
| 380 | break; | ||
| 381 | case 3: | ||
| 382 | madctl = MADCTL_MY | MADCTL_MV; | ||
| 383 | s_width = AXS15231B_HEIGHT; | ||
| 384 | s_height = AXS15231B_WIDTH; | ||
| 385 | break; | ||
| 386 | default: | ||
| 387 | return; | ||
| 388 | } | ||
| 389 | s_rotation = rotation; | ||
| 390 | qspi_write_cmd_data8(MADCTL, madctl); | ||
| 391 | ESP_LOGI(TAG, "Rotation set to %d (%dx%d)", rotation, s_width, s_height); | ||
| 392 | } | ||
diff --git a/components/axs15231b/include/axs15231b.h b/components/axs15231b/include/axs15231b.h index a8c1a37..32c489f 100644 --- a/components/axs15231b/include/axs15231b.h +++ b/components/axs15231b/include/axs15231b.h | |||
| @@ -23,6 +23,4 @@ void axs15231b_fill_rect(int x, int y, int w, int h, uint16_t color); | |||
| 23 | void axs15231b_flush(void); | 23 | void axs15231b_flush(void); |
| 24 | int axs15231b_get_width(void); | 24 | int axs15231b_get_width(void); |
| 25 | int axs15231b_get_height(void); | 25 | int axs15231b_get_height(void); |
| 26 | void axs15231b_set_rotation(int rotation); | ||
| 27 | |||
| 28 | #endif | 26 | #endif |