upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-19 04:21:14 +0530
committerYour Name <you@example.com>2026-05-19 04:21:14 +0530
commitaa58b47996083f36e3587b8e10f9bbb681610491 (patch)
tree4c845da2ee4b217a2c77deea3b10dd8d288d1b09 /components
parent9f7dd94029c8dc12117494548f5f32221a729307 (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.c37
-rw-r--r--components/axs15231b/include/axs15231b.h2
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;
37static uint16_t *s_fb = NULL; 37static uint16_t *s_fb = NULL;
38static int s_width = AXS15231B_WIDTH; 38static int s_width = AXS15231B_WIDTH;
39static int s_height = AXS15231B_HEIGHT; 39static int s_height = AXS15231B_HEIGHT;
40static int s_rotation = 0; 40static int s_stride = AXS15231B_WIDTH;
41static int s_stride = 480;
42static uint8_t *s_swap_buf = NULL; 41static 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
360int axs15231b_get_width(void) { return s_width; } 358int axs15231b_get_width(void) { return s_width; }
361int axs15231b_get_height(void) { return s_height; } 359int axs15231b_get_height(void) { return s_height; }
362
363void 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);
23void axs15231b_flush(void); 23void axs15231b_flush(void);
24int axs15231b_get_width(void); 24int axs15231b_get_width(void);
25int axs15231b_get_height(void); 25int axs15231b_get_height(void);
26void axs15231b_set_rotation(int rotation);
27
28#endif 26#endif