Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaa82540

Browse files
committed
working on the global rotate
1 parente147c52 commitaa82540

File tree

54 files changed

+3086
-3497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3086
-3497
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifndef__LCD_BUS_UTILS_H__
2+
#define__LCD_BUS_UTILS_H__
3+
4+
mp_lcd_err_tmp_lcd_verify_frame_buffers(mp_lcd_framebuf_t*fb1,mp_lcd_framebuf_t*fb2);
5+
mp_lcd_err_tmp_lcd_allocate_rotation_buffers(mp_lcd_bus_obj_t*self);
6+
voidmp_lcd_free_rotation_buffers(mp_lcd_bus_obj_tself);
7+
8+
#endif/* __LCD_BUS_UTILS_H__ */
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Copyright (c) 2024 - 2025 Kevin G. Schlosser
2+
3+
4+
// micropython includes
5+
#include"py/obj.h"
6+
7+
8+
#ifndef_COMMON_LCD_TYPES_H_
9+
#define_COMMON_LCD_TYPES_H_
10+
11+
#include"lcd_framebuf.h"
12+
#include"lcd_types.h"
13+
14+
#defineLCD_UNUSED(x) ((void)x)
15+
16+
#ifCONFIG_LCD_ENABLE_DEBUG_LOG
17+
#defineLCD_DEBUG_PRINT(...) mp_printf(&mp_plat_print, __VA_ARGS__);
18+
#else
19+
#defineLCD_DEBUG_PRINT(...)
20+
#endif
21+
22+
23+
externconstmp_obj_type_tmp_lcd_i2c_bus_type;
24+
externconstmp_obj_type_tmp_lcd_i80_bus_type;
25+
externconstmp_obj_type_tmp_lcd_rgb_bus_type;
26+
externconstmp_obj_type_tmp_lcd_spi_bus_type;
27+
28+
typedefstruct_mp_lcd_i2c_bus_obj_tmp_lcd_i2c_bus_obj_t;
29+
typedefstruct_mp_lcd_i80_bus_obj_tmp_lcd_i80_bus_obj_t;
30+
typedefstruct_mp_lcd_rgb_bus_obj_tmp_lcd_rgb_bus_obj_t;
31+
typedefstruct_mp_lcd_spi_bus_obj_tmp_lcd_spi_bus_obj_t;
32+
33+
typedefstruct_lcd_panel_io_tlcd_panel_io_t;
34+
35+
36+
typedefenum {
37+
LCD_OK=0,
38+
LCD_FAIL=-1,
39+
LCD_ERR_NO_MEM=0x101,
40+
LCD_ERR_INVALID_ARG=0x102,
41+
LCD_ERR_INVALID_STATE=0x103,
42+
LCD_ERR_INVALID_SIZE=0x104,
43+
LCD_ERR_NOT_SUPPORTED=0x106
44+
}mp_lcd_err_t;
45+
46+
47+
typedefstruct_mp_lcd_bus_obj_t {
48+
mp_obj_base_tbase;
49+
lcd_panel_io_tpanel_io_handle;
50+
51+
mp_obj_tcallback;
52+
53+
mp_lcd_framebuf_t*fb1;
54+
mp_lcd_framebuf_t*fb2;
55+
56+
uint8_ttrans_done:1;
57+
uint8_trgb565_byte_swap:1;
58+
uint8_tsw_rotate:1;
59+
uint8_tlanes:5;
60+
61+
mp_lcd_sw_rotation_tsw_rot;
62+
}mp_lcd_bus_obj_t;
63+
64+
65+
voidmp_lcd_flush_ready_cb(mp_obj_tcb);
66+
67+
#endif/* _COMMON_LCD_TYPES_H_ */

‎ext_mod/lcd_bus/include/common/lcd_types.h‎

Lines changed: 0 additions & 97 deletions
This file was deleted.

‎ext_mod/lcd_bus/include/common/modlcd_bus.h‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
// Copyright (c) 2024 - 2025 Kevin G. Schlosser
22

3+
#include"py/obj.h"
4+
35
#ifndef_MODLCD_BUS_H_
46
#define_MODLCD_BUS_H_
57

6-
#include"lcd_types.h"
7-
8-
// micropython includes
9-
#include"py/obj.h"
10-
#include"py/runtime.h"
11-
#include"py/objarray.h"
12-
138
externconstmp_obj_fun_builtin_var_tmp_lcd_bus_init_obj;
149
externconstmp_obj_fun_builtin_var_tmp_lcd_bus_get_lane_count_obj;
1510
externconstmp_obj_fun_builtin_var_tmp_lcd_bus_tx_param_obj;

‎ext_mod/lcd_bus/include/common/rgb565_dither.h‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,20 @@
77
#ifndef__RGB565_DITHER_H__
88
#define__RGB565_DITHER_H__
99

10-
#defineCALC_THRESHOLD(x,y) (uint8_t)((y & 7) << 3) + (x & 7)
10+
#defineCALC_THRESHOLD(x,y) (uint8_t)(((y & 7) << 3) + (x & 7))
1111

1212
externuint8_t*red_thresh;
1313
externuint8_t*green_thresh;
1414
externuint8_t*blue_thresh;
1515

1616
boolrgb565_dither_init(void);
17+
voidrgb565_dither_free(void);
1718

18-
staticinlinevoidrgb565_dither_pixel(uint8_ttreshold_id,uint16_t*pixel)
19+
staticinlinevoidrgb565_dither_pixel(uint8_ttreshold_id,uint16_t*src,uint16_t*dst)
1920
{
20-
*pixel= (((((*pixel >>8)&0xF8)+red_thresh[treshold_id]) <<8) |
21-
((((*pixel >>3)&0xFC)+green_thresh[treshold_id]) <<3) |
22-
((((*pixel&0x1F) <<3)+blue_thresh[treshold_id]) >>3));
21+
*dst= (((((*src >>8)&0xF8)+red_thresh[treshold_id]) <<8) |
22+
((((*src >>3)&0xFC)+green_thresh[treshold_id]) <<3) |
23+
((((*src&0x1F) <<3)+blue_thresh[treshold_id]) >>3));
2324
}
2425

2526
#endif

‎ext_mod/lcd_bus/include/common/sw_rotate.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
#ifndef__SW_ROTATE_H__
99
#define__SW_ROTATE_H__
1010

11+
12+
#defineLCD_ROTATION_0 (0)
13+
#defineLCD_ROTATION_90 (1)
14+
#defineLCD_ROTATION_180 (2)
15+
#defineLCD_ROTATION_270 (3)
16+
1117
typedefstruct_mp_lcd_sw_rotation_data_t {
1218
uint32_tx_start:16;
1319
uint32_ty_start:16;
@@ -19,6 +25,7 @@
1925
uint8_trotation:3;
2026
uint8_tlast_update:1;
2127
uint8_trgb565_dither:1;
28+
intcmd;
2229
}mp_lcd_sw_rotation_data_t;
2330

2431

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
#ifdefESP_IDF_VERSION
2-
#include"esp32/sw_rotate_task.h"
3-
#elif defined(MP_PORT_UNIX)
4-
#include"posix/sw_rotate_task.h"
5-
#else
6-
#include"other_mcus/sw_rotate_task.h"
1+
#include"sw_rotate_task.h"
72

3+
#ifndef__SW_ROTATE_TASK_COMMON_H__
4+
#define__SW_ROTATE_TASK_COMMON_H__
85

9-
#ifndef__SW_ROTATE_TASK_H__
10-
#define__SW_ROTATE_TASK_H__
6+
typedefstruct_mp_lcd_lock_tmp_lcd_lock_t;
7+
typedefstruct_mp_lcd_event_tmp_lcd_event_t;
118

129
/* event */
1310
voidmp_lcd_event_init(mp_lcd_event_t*event);
@@ -21,13 +18,13 @@
2118
voidmp_lcd_event_wait(mp_lcd_event_t*event);
2219

2320
/* lock */
24-
boolmp_lcd_lock_acquire(mp_lcd_lock_t*lock,int32_twait_ms);
21+
boolmp_lcd_lock_acquire(mp_lcd_lock_t*lock);
2522
voidmp_lcd_lock_release(mp_lcd_lock_t*lock);
2623
voidmp_lcd_lock_init(mp_lcd_lock_t*lock);
2724
voidmp_lcd_lock_delete(mp_lcd_lock_t*lock);
2825
voidmp_lcd_lock_release_from_isr(mp_lcd_lock_t*lock);
2926

3027

31-
voidmp_lcd_sw_rotate_task(void*self_in);
28+
boolmp_lcd_start_rotate_task(void*self_in);
3229

33-
#endif/*__SW_ROTATE_TASK_H__ */
30+
#endif/*__SW_ROTATE_TASK_COMMON_H__ */

‎ext_mod/lcd_bus/include/esp32/dsi_bus.h‎

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
#define_ESP32_DSI_BUS_H_
66

77
//local_includes
8-
#include"common/lcd_types.h"
9-
#include"common/lcd_framebuf.h"
8+
#include"common/lcd_common_types.h"
109
#include"common/sw_rotate.h"
1110

1211
// micropython includes
@@ -27,19 +26,7 @@
2726

2827

2928
typedefstruct_mp_lcd_dsi_bus_obj_t {
30-
mp_obj_base_tbase;
31-
lcd_panel_io_tpanel_io_handle;
32-
33-
mp_obj_tcallback;
34-
35-
mp_lcd_framebuf_t*fb1;
36-
mp_lcd_framebuf_t*fb2;
37-
38-
uint8_ttrans_done:1;
39-
uint8_trgb565_byte_swap:1;
40-
uint8_tsw_rotate:1;
41-
42-
mp_lcd_sw_rotation_t*sw_rot;
29+
struct_mp_lcd_bus_obj_t;
4330

4431
esp_lcd_dbi_io_config_t*panel_io_config;
4532
esp_lcd_dsi_bus_config_t*bus_config;
Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,20 @@
11
// Copyright (c) 2024 - 2025 Kevin G. Schlosser
22

3-
#ifndef_ESP32_I2C_BUS_H_
4-
#define_ESP32_I2C_BUS_H_
53

6-
//local_includes
7-
#include"common/lcd_types.h"
8-
#include"common/lcd_framebuf.h"
9-
#include"common/sw_rotate.h"
4+
#include"py/obj.h"
105

11-
// esp-idf includes
12-
#include"esp_lcd_panel_io.h"
13-
#include"driver/i2c.h"
14-
15-
// micropython includes
16-
#include"mphalport.h"
17-
#include"py/obj.h"
18-
#include"py/objarray.h"
196

20-
typedefstruct_mp_lcd_i2c_bus_obj_t {
21-
mp_obj_base_tbase;
22-
lcd_panel_io_tpanel_io_handle;
7+
#ifndef_I2C_BUS_H_
8+
#define_I2C_BUS_H_
239

24-
mp_obj_tcallback;
10+
#include"esp_lcd_panel_io.h"
11+
#include"driver/i2c.h"
2512

26-
mp_lcd_framebuf_t*fb1;
27-
mp_lcd_framebuf_t*fb2;
13+
#include"common/lcd_common_types.h"
2814

29-
uint8_ttrans_done:1;
30-
uint8_trgb565_byte_swap:1;
31-
uint8_tsw_rotate:1;
3215

33-
mp_lcd_sw_rotation_t*sw_rot;
16+
struct_mp_lcd_i2c_bus_obj_t {
17+
struct_mp_lcd_bus_obj_t;
3418

3519
esp_lcd_panel_io_i2c_config_t*panel_io_config;
3620
i2c_config_t*bus_config;
@@ -40,10 +24,8 @@
4024

4125
inthost;
4226

43-
}mp_lcd_i2c_bus_obj_t;
44-
45-
externconstmp_obj_type_tmp_lcd_i2c_bus_type;
27+
};
4628

4729
externvoidmp_lcd_i2c_bus_deinit_all(void);
4830

49-
#endif/*_ESP32_I2C_BUS_H_ */
31+
#endif/*_I2C_BUS_H_ */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp