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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy