8000 Merge pull request #1685 from makermelissa/master · unixjazz/circuitpython@9ff54fd · GitHub
[go: up one dir, main page]

Skip to content

Commit 9ff54fd

Browse files
authored
Merge pull request adafruit#1685 from makermelissa/master
Added option to enable toggling CS between init commands
2 parents c6e3b17 + f3ec051 commit 9ff54fd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

shared-module/displayio/FourWire.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#include "shared-bindings/busio/SPI.h"
3232
#include "shared-bindings/digitalio/DigitalInOut.h"
33+
#include "shared-bindings/time/__init__.h"
3334

3435
#include "tick.h"
3536

@@ -78,6 +79,11 @@ bool common_hal_displayio_fourwire_begin_transaction(mp_obj_t obj) {
7879

7980
void common_hal_displayio_fourwire_send(mp_obj_t obj, bool command, uint8_t *data, uint32_t data_length) {
8081
displayio_fourwire_obj_t* self = MP_OBJ_TO_PTR(obj);
82+
if (command) {
83+
common_hal_digitalio_digitalinout_set_value(&self->chip_select, true);
84+
common_hal_time_delay_ms(1);
85+
common_hal_digitalio_digitalinout_set_value(&self->chip_select, false);
86+
}
8187
common_hal_digitalio_digitalinout_set_value(&self->command, !command);
8288
common_hal_busio_spi_write(self->bus, data, data_length);
8389
}

0 commit comments

Comments
 (0)
0