QSPI esp32s3 ESP-IDF (no ino) 320x480 3.5 inc - cant landscape

hello I have problem to landscape the screen

1.I tried to switch
#define TEST_LCD_SPI_H_RES (320)
#define TEST_LCD_SPI_V_RES (480)

// #define TEST_LCD_SPI_H_RES (480)
// #define TEST_LCD_SPI_V_RES (320)

  1. //{0x36, (uint8_t ){0x00}, 1, 0}, // Normal 0 degree
    //{0x36, (uint8_t ){0xC0}, 1, 0}, // 180
    //{0x36, (uint8_t ){0xA0}, 1, 0}, //-270 clockwise 90 counte rclockwise
    {0x36, (uint8_t ){0x60}, 1, 0}, // -90 clockwise

3.//ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(panel_handle, true)); - this make me black screen

THIS IS MY CODE

//lvgl_config.c file

#include “lvgl.h”
#include “lvgl_config.h”
#include “esp_lcd_panel_io.h”
#include “esp_lcd_panel_ops.h”
#include “esp_lcd_axs15231b.h”
#include “QSPI_config.h”
#include “esp_log.h”
#include “esp_err.h”
#include “esp_heap_caps.h”
#include “driver/spi_master.h”
#include “lvgl_tick.h”
#include “lvgl_port.h”
#include “ui_setup.h”
#include <math.h>
#include <sys/param.h>

//static const char *TAG = “lvgl_config”;

extern const axs15231b_lcd_init_cmd_t lcd_init_cmds;
extern const size_t lcd_init_cmds_size;

static lv_disp_draw_buf_t draw_buf;
static lv_color_t *buf1 = NULL;
static lv_color_t *buf2 = NULL;
static lv_disp_drv_t disp_drv;
static esp_lcd_panel_handle_t panel_handle = NULL;

static void flush_cb(lv_disp_drv_t *drv, const lv_area_t *area, lv_color_t *color_map)
{
esp_rom_delay_us(1000);

int width = area->x2 - area->x1 + 1;
int height = area->y2 - area->y1 + 1;
size_t len = width * height;

uint8_t *p = (uint8_t *)color_map;
for (size_t i = 0; i < len; i++, p += 2) {
    uint8_t tmp = p[0];
    p[0] = p[1];
    p[1] = tmp;
}

esp_lcd_panel_draw_bitmap(
panel_handle,
area->x1,
area->y1,
area->x2 + 1,
area->y2 + 1,
color_map);
lv_disp_flush_ready(drv);
}

static void btn_event_cb(lv_event_t *e)
{
printf(“cliccckcckckckck1111”);
lv_obj_t *label = lv_label_create(lv_scr_act());
lv_label_set_text(label, “CLICK”);
lv_obj_set_style_text_font(label, &lv_font_montserrat_14, 0);
//(label);
lv_obj_align(label, LV_ALIGN_CENTER, 0, -5); // fix: shift label 5px upward
printf(“cliccckcckckckck2222”);

lv_area_t coords;

lv_obj_get_coords(lv_event_get_target(e), &coords);
printf(“Button area: x1=%d y1=%d x2=%d y2=%d\n”, coords.x1, coords.y1, coords.x2, coords.y2);

}

void lvgl_driver_init(void)
{
lv_init();

size_t buffer_lines = 40; 

size_t buffer_size = TEST_LCD_SPI_H_RES * buffer_lines;
//size_t buffer_size = TEST_LCD_SPI_V_RES * buffer_lines; // fix: 480px line buffer for landscape

buf1 = (lv_color_t *)heap_caps_aligned_alloc(4, buffer_size * sizeof(lv_color_t), MALLOC_CAP_DMA);
buf2 = (lv_color_t *)heap_caps_aligned_alloc(4, buffer_size * sizeof(lv_color_t), MALLOC_CAP_DMA);
assert(buf1 && buf2);
//assert(buf1);
lv_disp_draw_buf_init(&draw_buf, buf1, buf2, buffer_size);

// buf1 = (lv_color_t *)heap_caps_aligned_alloc(4, buffer_size * sizeof(lv_color_t), MALLOC_CAP_DMA); // fix
// assert(buf1); // fix
//lv_disp_draw_buf_init(&draw_buf, buf1, NULL, buffer_size); // fix: single buffer test

const spi_bus_config_t buscfg = AXS15231B_PANEL_BUS_QSPI_CONFIG(TEST_PIN_NUM_SPI_PCLK,
                                                                TEST_PIN_NUM_SPI_DATA0,
                                                                TEST_PIN_NUM_SPI_DATA1,
                                                                TEST_PIN_NUM_SPI_DATA2,
                                                                TEST_PIN_NUM_SPI_DATA3,
                                                                TEST_LCD_SPI_H_RES * TEST_LCD_SPI_V_RES * TEST_LCD_BIT_PER_PIXEL / 8);
ESP_ERROR_CHECK(spi_bus_initialize(TEST_LCD_SPI_HOST, &buscfg, SPI_DMA_CH_AUTO));

esp_lcd_panel_io_handle_t io_handle = NULL;
const esp_lcd_panel_io_spi_config_t io_config = AXS15231B_PANEL_IO_QSPI_CONFIG(TEST_PIN_NUM_SPI_CS, NULL, NULL);
ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)TEST_LCD_SPI_HOST, &io_config, &io_handle));

const axs15231b_vendor_config_t vendor_config = {
    .init_cmds = lcd_init_cmds, 
    .init_cmds_size = lcd_init_cmds_size,
    .flags = {
        .use_qspi_interface = 1,
    },
};

const esp_lcd_panel_dev_config_t panel_config = {
    .reset_gpio_num = TEST_PIN_NUM_SPI_RST,
    //.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR ,
    .rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB ,
    .bits_per_pixel = TEST_LCD_BIT_PER_PIXEL,
    .vendor_config = (void *) &vendor_config,
};

ESP_ERROR_CHECK(esp_lcd_new_panel_axs15231b(io_handle, &panel_config, &panel_handle));
ESP_ERROR_CHECK(esp_lcd_panel_reset(panel_handle));
ESP_ERROR_CHECK(esp_lcd_panel_init(panel_handle));


//ESP_ERROR_CHECK(esp_lcd_panel_swap_xy(panel_handle, true));

// ESP_ERROR_CHECK(esp_lcd_panel_mirror(panel_handle, false, true));

lv_disp_drv_init(&disp_drv);

// disp_drv.hor_res = TEST_LCD_SPI_H_RES ;
// disp_drv.ver_res = TEST_LCD_SPI_V_RES;

disp_drv.hor_res = TEST_LCD_SPI_V_RES; // 320
disp_drv.ver_res = TEST_LCD_SPI_H_RES; // 480

disp_drv.flush_cb = flush_cb;
disp_drv.draw_buf = &draw_buf;
disp_drv.user_data = panel_handle;
lv_disp_drv_register(&disp_drv);

// lv_disp_t *disp = lv_disp_drv_register(&disp_drv);
// lv_disp_set_rotation(disp, LV_DISP_ROT_270);

gpio_config_t bl_gpio_config = {
.mode = GPIO_MODE_OUTPUT,
.pin_bit_mask = (1ULL << TEST_PIN_NUM_SPI_BL),

};
ESP_ERROR_CHECK(gpio_config(&bl_gpio_config));
gpio_set_level(TEST_PIN_NUM_SPI_BL, 1);

lvgl_tick_init();
lvgl_port_init();

lv_obj_t *scr = lv_scr_act();
lv_obj_set_style_bg_color(scr, lv_color_hex(0x00FF00), 0);

lv_obj_t *btn = lv_btn_create(scr);
lv_obj_center(btn);
lv_obj_t *label = lv_label_create(btn);
lv_label_set_text(label, “Test BTN”);
lv_obj_add_event_cb(btn, btn_event_cb, LV_EVENT_CLICKED, NULL); // fix: respond to touch click

printf(“=== Display Debug Info ===\n”);
printf(“LVGL resolution: %dx%d\n”, disp_drv.hor_res, disp_drv.ver_res);
printf(“Buffer size: %u colors\n”, (unsigned int)draw_buf.size);

}