Skip to content

Commit f4cede4

Browse files
author
Melissa LeBlanc-Williams
committed
Removed parameter so CS is always toggled
2 parents 5f0e71c + b2ad16f commit f4cede4

File tree

7 files changed

+5
-14
lines changed

7 files changed

+5
-14
lines changed

ports/atmel-samd/boards/hallowing_m0_express/board.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ void board_init(void) {
9494
display_init_sequence,
9595
sizeof(display_init_sequence),
9696
&pin_PA00,
97-
true, // init_cs_toggle
9897
false); // single_byte_bounds
9998
common_hal_displayio_display_set_auto_brightness(display, true);
10099
}

ports/atmel-samd/boards/pybadge/board.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ void board_init(void) {
100100
display_init_sequence,
101101
sizeof(display_init_sequence),
102102
&pin_PA00,
103-
true, // init_cs_toggle
104103
false); // single_byte_bounds
105104
common_hal_displayio_display_set_auto_brightness(display, true);
106105
}

ports/atmel-samd/boards/pyportal/board.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ void board_init(void) {
9191
display_init_sequence,
9292
sizeof(display_init_sequence),
9393
&pin_PB31,
94-
true, // init_cs_toggle
9594
false); // single_byte_bounds
9695

9796
common_hal_displayio_display_set_auto_brightness(display, true);

shared-bindings/displayio/Display.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
//| Most people should not use this class directly. Use a specific display driver instead that will
5151
//| contain the initialization sequence at minimum.
5252
//|
53-
//| .. class:: Display(display_bus, init_sequence, *, width, height, colstart=0, rowstart=0, rotation=0, color_depth=16, set_column_command=0x2a, set_row_command=0x2b, write_ram_command=0x2c, set_vertical_scroll=0, backlight_pin=None, init_cs_toggle=True, single_byte_bounds=False)
53+
//| .. class:: Display(display_bus, init_sequence, *, width, height, colstart=0, rowstart=0, rotation=0, color_depth=16, set_column_command=0x2a, set_row_command=0x2b, write_ram_command=0x2c, set_vertical_scroll=0, backlight_pin=None, single_byte_bounds=False)
5454
//|
5555
//| Create a Display object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`).
5656
//|
@@ -91,11 +91,10 @@
9191
//| :param int write_ram_command: Command used to write pixels values into the update region
9292
//| :param int set_vertical_scroll: Command used to set the first row to show
9393
//| :param microcontroller.Pin backlight_pin: Pin connected to the display's backlight
94-
//| :param bool init_cs_toggle: Toggle the Chip Select between each initialization command
9594
//| :param bool single_byte_bounds: Display column and row commands use single bytes
9695
//|
9796
STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
98-
enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, ARG_set_vertical_scroll, ARG_backlight_pin, ARG_init_cs_toggle, ARG_single_byte_bounds };
97+
enum { ARG_display_bus, ARG_init_sequence, ARG_width, ARG_height, ARG_colstart, ARG_rowstart, ARG_rotation, ARG_color_depth, ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, ARG_set_vertical_scroll, ARG_backlight_pin, ARG_single_byte_bounds };
9998
static const mp_arg_t allowed_args[] = {
10099
{ MP_QSTR_display_bus, MP_ARG_REQUIRED | MP_ARG_OBJ },
101100
{ MP_QSTR_init_sequence, MP_ARG_REQUIRED | MP_ARG_OBJ },
@@ -110,7 +109,6 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a
110109
{ MP_QSTR_write_ram_command, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0x2c} },
111110
{ MP_QSTR_set_vertical_scroll, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0x0} },
112111
{ MP_QSTR_backlight_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} },
113-
{ MP_QSTR_init_cs_toggle, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} },
114112
{ MP_QSTR_single_byte_bounds, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} },
115113
};
116114
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
@@ -151,7 +149,6 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a
151149
args[ARG_write_ram_command].u_int,
152150
args[ARG_set_vertical_scroll].u_int,
153151
bufinfo.buf, bufinfo.len, MP_OBJ_TO_PTR(backlight_pin),
154-
args[ARG_init_cs_toggle].u_bool,
155152
args[ARG_single_byte_bounds].u_bool);
156153

157154
return self;

shared-bindings/displayio/Display.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self,
4040
mp_obj_t bus, uint16_t width, uint16_t height,
4141
int16_t colstart, int16_t rowstart, uint16_t rotation, uint16_t color_depth,
4242
uint8_t set_column_command, uint8_t set_row_command, uint8_t write_ram_command, uint8_t set_vertical_scroll,
43-
uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin, bool init_cs_toggle,
44-
bool single_byte_bounds);
43+
uint8_t* init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t* backlight_pin, bool single_byte_bounds);
4544

4645
int32_t common_hal_displayio_display_wait_for_frame(displayio_display_obj_t* self);
4746

shared-module/displayio/Display.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self,
4444
mp_obj_t bus, uint16_t width, uint16_t height, int16_t colstart, int16_t rowstart, uint16_t rotation,
4545
uint16_t color_depth, uint8_t set_column_command, uint8_t set_row_command,
4646
uint8_t write_ram_command, uint8_t set_vertical_scroll, uint8_t* init_sequence, uint16_t init_sequence_len,
47-
const mcu_pin_obj_t* backlight_pin, bool init_cs_toggle, bool single_byte_bounds) {
47+
const mcu_pin_obj_t* backlight_pin, bool single_byte_bounds) {
4848
self->color_depth = color_depth;
4949
self->set_column_command = set_column_command;
5050
self->set_row_command = set_row_command;
@@ -54,7 +54,6 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self,
5454
self->colstart = colstart;
5555
self->rowstart = rowstart;
5656
self->auto_brightness = false;
57-
self->init_cs_toggle = init_cs_toggle;
5857
self->single_byte_bounds = single_byte_bounds;
5958

6059
if (MP_OBJ_IS_TYPE(bus, &displayio_parallelbus_type)) {
@@ -84,7 +83,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self,
8483
bool delay = (data_size & DELAY) != 0;
8584
data_size &= ~DELAY;
8685
uint8_t *data = cmd + 2;
87-
if (self->init_cs_toggle && self->set_cs != NULL) {
86+
if (self->set_cs != NULL) {
8887
self->set_cs(self->bus, true);
8988
common_hal_time_delay_ms(1);
9089
self->set_cs(self->bus, false);

shared-module/displayio/Display.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ typedef struct {
5050
uint64_t last_refresh;
5151
int16_t colstart;
5252
int16_t rowstart;
53-
bool init_cs_toggle;
5453
bool single_byte_bounds;
5554
display_bus_begin_transaction begin_transaction;
5655
display_bus_send send;

0 commit comments

Comments
 (0)