Skip to content

Commit 6f28051

Browse files
committed
esp32 and unix are compiling properly
1 parent 35913ce commit 6f28051

Some content is hidden

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

44 files changed

+604
-746
lines changed

api_drivers/common_api_drivers/display/st7789/st7789.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
BYTE_ORDER_RGB = display_driver_framework.BYTE_ORDER_RGB
1414
BYTE_ORDER_BGR = display_driver_framework.BYTE_ORDER_BGR
1515

16-
_MADCTL_MV = const(0x20) # 0=Normal, 1=Row/column exchange
17-
_MADCTL_MX = const(0x40) # 0=Left to Right, 1=Right to Left
18-
_MADCTL_MY = const(0x80) # 0=Top to Bottom, 1=Bottom to Top
16+
_MADCTL_MV = const(0x20) # X, Y = Y, X
17+
_MADCTL_MX = const(0x40) # Mirror X
18+
_MADCTL_MY = const(0x80) # Mirror Y
1919

2020

2121
class ST7789(display_driver_framework.DisplayDriver):
2222
_ORIENTATION_TABLE = (
2323
0x0,
24-
_MADCTL_MV | _MADCTL_MX,
25-
_MADCTL_MY | _MADCTL_MX,
26-
_MADCTL_MV | _MADCTL_MY
24+
_MADCTL_MV,
25+
_MADCTL_MX | _MADCTL_MY,
26+
_MADCTL_MV | _MADCTL_MX | _MADCTL_MY
2727
)

api_drivers/py_api_drivers/frozen/display/display_driver_framework.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ class DisplayDriver:
4646
_INVOFF = 0x20
4747

4848
_ORIENTATION_TABLE = (
49-
_MADCTL_MX,
49+
0x0,
5050
_MADCTL_MV,
51-
_MADCTL_MY,
52-
_MADCTL_MY | _MADCTL_MX | _MADCTL_MV
51+
_MADCTL_MX | _MADCTL_MY,
52+
_MADCTL_MV | _MADCTL_MX | _MADCTL_MY
5353
)
5454

5555
_displays = []

builder/unix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def update_mpconfigvariant_common():
396396
'#define MICROPY_MEM_STATS (0)'
397397
)
398398

399-
data += '\nn#define MICROPY_SCHEDULER_DEPTH (128)\n'
399+
data += '\n#define MICROPY_SCHEDULER_DEPTH (128)\n'
400400
data += '\n#define MICROPY_STACK_CHECK (0)\n'
401401

402402
write_file(MPCONFIGVARIANT_COMMON_PATH, data)
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#ifndef __LCD_BUS_UTILS_H__
22
#define __LCD_BUS_UTILS_H__
33

4+
#include "lcd_framebuf.h"
5+
#include "lcd_common_types.h"
6+
#include "lcd_types.h"
7+
48
mp_lcd_err_t mp_lcd_verify_frame_buffers(mp_lcd_framebuf_t *fb1, mp_lcd_framebuf_t *fb2);
59
mp_lcd_err_t mp_lcd_allocate_rotation_buffers(mp_lcd_bus_obj_t *self);
6-
void mp_lcd_free_rotation_buffers(mp_lcd_bus_obj_t self);
10+
void mp_lcd_free_rotation_buffers(mp_lcd_bus_obj_t *self);
711

812
#endif /* __LCD_BUS_UTILS_H__ */

ext_mod/lcd_bus/include/common/lcd_common_types.h

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,20 @@
88
#ifndef _COMMON_LCD_TYPES_H_
99
#define _COMMON_LCD_TYPES_H_
1010

11+
typedef enum {
12+
LCD_OK = 0,
13+
LCD_FAIL = -1,
14+
LCD_ERR_NO_MEM = 0x101,
15+
LCD_ERR_INVALID_ARG = 0x102,
16+
LCD_ERR_INVALID_STATE = 0x103,
17+
LCD_ERR_INVALID_SIZE = 0x104,
18+
LCD_ERR_NOT_SUPPORTED = 0x106
19+
} mp_lcd_err_t;
20+
1121
#include "lcd_framebuf.h"
1222
#include "lcd_types.h"
23+
#include "sw_rotate_task_common.h"
24+
#include "sw_rotate.h"
1325

1426
#define LCD_UNUSED(x) ((void)x)
1527

@@ -34,21 +46,9 @@
3446

3547
typedef struct _lcd_panel_io_t lcd_panel_io_t;
3648

37-
38-
typedef enum {
39-
LCD_OK = 0,
40-
LCD_FAIL = -1,
41-
LCD_ERR_NO_MEM = 0x101,
42-
LCD_ERR_INVALID_ARG = 0x102,
43-
LCD_ERR_INVALID_STATE = 0x103,
44-
LCD_ERR_INVALID_SIZE = 0x104,
45-
LCD_ERR_NOT_SUPPORTED = 0x106
46-
} mp_lcd_err_t;
47-
48-
4949
typedef struct _mp_lcd_bus_obj_t {
5050
mp_obj_base_t base;
51-
lcd_panel_io_t panel_io_handle;
51+
struct _lcd_panel_io_t panel_io_handle;
5252

5353
mp_obj_t callback;
5454

@@ -62,7 +62,4 @@
6262
mp_lcd_sw_rotation_t sw_rot;
6363
} mp_lcd_bus_obj_t;
6464

65-
66-
void mp_lcd_flush_ready_cb(mp_obj_t cb);
67-
6865
#endif /* _COMMON_LCD_TYPES_H_ */

ext_mod/lcd_bus/include/common/lcd_framebuf.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
} mp_lcd_framebuf_t;
1818

1919

20-
21-
2220
extern const mp_obj_type_t mp_lcd_framebuf_type;
2321

2422
#endif /* __LCD_FRAMEBUF_H__ */

ext_mod/lcd_bus/include/common/modlcd_bus.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,7 @@
55
#ifndef _MODLCD_BUS_H_
66
#define _MODLCD_BUS_H_
77

8-
extern const mp_obj_fun_builtin_var_t mp_lcd_bus_init_obj;
9-
extern const mp_obj_fun_builtin_var_t mp_lcd_bus_get_lane_count_obj;
10-
extern const mp_obj_fun_builtin_var_t mp_lcd_bus_tx_param_obj;
11-
extern const mp_obj_fun_builtin_var_t mp_lcd_bus_tx_color_obj;
12-
extern const mp_obj_fun_builtin_fixed_t mp_lcd_bus_deinit_obj;
13-
extern const mp_obj_fun_builtin_var_t mp_lcd_bus_rx_param_obj;
14-
extern const mp_obj_fun_builtin_var_t mp_lcd_bus_register_callback_obj;
15-
extern const mp_obj_fun_builtin_var_t mp_lcd_bus_free_framebuffer_obj;
16-
extern const mp_obj_fun_builtin_var_t mp_lcd_bus_allocate_framebuffer_obj;
17-
188
extern const mp_obj_dict_t mp_lcd_bus_locals_dict;
19-
209
void mp_lcd_bus_shutdown(void);
2110

2211
#endif /* _MODLCD_BUS_H_ */

ext_mod/lcd_bus/include/common/sw_rotate.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11

22
#include "sw_rotate_task_common.h"
33
#include "sw_rotate_task.h"
4+
#include "lcd_common_types.h"
5+
6+
#include "py/misc.h"
47

58

69
#ifndef __SW_ROTATE_H__
@@ -12,6 +15,9 @@
1215
#define LCD_ROTATION_180 (2)
1316
#define LCD_ROTATION_270 (3)
1417

18+
#define LCD_MIN(v1, v2) v1 <= v2 ? v1 : v2
19+
20+
1521
typedef struct _mp_lcd_sw_rotation_data_t {
1622
uint32_t x_start: 16;
1723
uint32_t y_start: 16;
@@ -59,11 +65,11 @@
5965
mp_lcd_sw_rotate_tx_param_t *params;
6066
uint8_t len;
6167
mp_lcd_lock_t lock;
62-
mp_lcd_tx_param_cb_t tx_param_cb;
68+
mp_lcd_tx_param_cb_t cb;
6369
} mp_lcd_sw_rotate_tx_params_t;
6470

6571

66-
typedef bool (*mp_lcd_sw_rotation_init_cb_t)(void *self_in)
72+
typedef bool (*mp_lcd_sw_rotation_init_cb_t)(void *self_in);
6773

6874
typedef struct _mp_lcd_sw_rotation_init_t {
6975
mp_lcd_err_t err;
@@ -72,7 +78,7 @@
7278
} mp_lcd_sw_rotation_init_t;
7379

7480

75-
typedef void (*mp_lcd_sw_rotate_flush_cb_t)(void *self_in, uint8_t last_update, uint8_t *idle_fb);
81+
typedef void (*mp_lcd_sw_rotate_flush_cb_t)(void *self_in, int cmd, uint8_t last_update, uint8_t *idle_fb);
7682

7783

7884
typedef struct _mp_lcd_sw_rotation_t {
@@ -85,6 +91,6 @@
8591
} mp_lcd_sw_rotation_t;
8692

8793

88-
static void mp_lcd_sw_rotation(void *dst, void *src, mp_lcd_sw_rotation_data_t *data);
94+
void mp_lcd_sw_rotate(void *dst, void *src, mp_lcd_sw_rotation_data_t *copy_data);
8995

9096
#endif /* __SW_ROTATE_H__ */

ext_mod/lcd_bus/include/common/sw_rotate_task_common.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#include "sw_rotate_task.h"
22

3+
#include "py/obj.h"
4+
5+
36
#ifndef __SW_ROTATE_TASK_COMMON_H__
47
#define __SW_ROTATE_TASK_COMMON_H__
58

@@ -26,6 +29,7 @@
2629

2730

2831
bool mp_lcd_start_rotate_task(void *self_in);
29-
void mp_lcd_sw_rotate_task(void *self_in)
32+
void mp_lcd_sw_rotate_task(void *self_in);
33+
void mp_lcd_flush_ready_cb(mp_obj_t callback, bool wake);
3034

3135
#endif /* __SW_ROTATE_TASK_COMMON_H__ */

ext_mod/lcd_bus/include/esp32/i2c_bus.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,25 @@
1111
#include "driver/i2c.h"
1212

1313
#include "common/lcd_common_types.h"
14+
#include "common/sw_rotate_task_common.h"
15+
#include "common/sw_rotate.h"
16+
#include "lcd_types.h"
1417

1518

1619
struct _mp_lcd_i2c_bus_obj_t {
17-
struct _mp_lcd_bus_obj_t;
20+
mp_obj_base_t base;
21+
lcd_panel_io_t panel_io_handle;
22+
23+
mp_obj_t callback;
24+
25+
mp_lcd_framebuf_t *fb1;
26+
mp_lcd_framebuf_t *fb2;
27+
28+
uint8_t trans_done: 1;
29+
uint8_t sw_rotate: 1;
30+
uint8_t lanes: 5;
31+
32+
mp_lcd_sw_rotation_t sw_rot;
1833

1934
esp_lcd_panel_io_i2c_config_t *panel_io_config;
2035
i2c_config_t *bus_config;

0 commit comments

Comments
 (0)