Skip to content

Commit d754e47

Browse files
committed
components/M5Unified: UserDisplay adds sip_mode parameter.
Signed-off-by: lbuque <[email protected]>
1 parent 7ab5923 commit d754e47

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

m5stack/components/M5Unified/mpy_user_lcd.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ public:
4545

4646
void user_spi_panel_setup(user_panel_t panel_type, int16_t width, int16_t height,
4747
int16_t offset_x, int16_t offset_y, bool invert, bool rgb_order,
48-
uint8_t spi_host, uint32_t spi_freq = 40, int16_t pin_sclk = -1,
48+
uint8_t spi_host, uint32_t spi_freq = 40, int spi_mode = 0, int16_t pin_sclk = -1,
4949
int16_t pin_mosi = -1, int16_t pin_miso = -1, int16_t pin_dc = -1,
5050
int16_t pin_cs = -1, int16_t pin_rst = -1, int16_t pin_busy = -1) {
5151

5252
{
5353
auto cfg = _spi_bus_instance.config();
5454

5555
cfg.spi_host = (spi_host_device_t)spi_host;
56-
cfg.spi_mode = 0;
56+
cfg.spi_mode = spi_mode;
5757
cfg.freq_write = spi_freq * 1000000;
5858
cfg.freq_read = spi_freq * 1000000;
5959
cfg.spi_3wire = true;
@@ -198,7 +198,7 @@ mp_obj_t user_panel_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_
198198
// panel commom setting
199199
ARG_w, ARG_h, ARG_ox, ARG_oy, ARG_invert, ARG_rgb,
200200
// spi display panel setting
201-
ARG_spi_host, ARG_spi_freq, ARG_sclk, ARG_mosi, ARG_miso,
201+
ARG_spi_host, ARG_spi_freq, ARG_spi_mode, ARG_sclk, ARG_mosi, ARG_miso,
202202
ARG_dc, ARG_cs, ARG_rst, ARG_busy,
203203
// i2c display panel setting
204204
ARG_i2c_host, ARG_i2c_addr, ARG_i2c_freq, ARG_sda, ARG_scl,
@@ -223,6 +223,7 @@ mp_obj_t user_panel_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_
223223
// spi display panel setting
224224
{ MP_QSTR_spi_host, MP_ARG_INT , {.u_int = 2 } },
225225
{ MP_QSTR_spi_freq, MP_ARG_INT , {.u_int = 40 } },
226+
{ MP_QSTR_spi_mode, MP_ARG_INT , {.u_int = 0 } },
226227
{ MP_QSTR_sclk, MP_ARG_INT , {.u_int = -1 } },
227228
{ MP_QSTR_mosi, MP_ARG_INT , {.u_int = -1 } },
228229
{ MP_QSTR_miso, MP_ARG_INT , {.u_int = -1 } },
@@ -277,7 +278,7 @@ mp_obj_t user_panel_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_
277278
(user_panel_t)panel_type, args[ARG_w].u_int, args[ARG_h].u_int,
278279
args[ARG_ox].u_int, args[ARG_oy].u_int,
279280
args[ARG_invert].u_bool, args[ARG_rgb].u_bool,
280-
args[ARG_spi_host].u_int, args[ARG_spi_freq].u_int,
281+
args[ARG_spi_host].u_int, args[ARG_spi_freq].u_int, args[ARG_spi_mode].u_int,
281282
args[ARG_sclk].u_int, args[ARG_mosi].u_int,
282283
args[ARG_miso].u_int, args[ARG_dc].u_int,
283284
args[ARG_cs].u_int, args[ARG_rst].u_int,

0 commit comments

Comments
 (0)