summaryrefslogtreecommitdiff
path: root/shared-module
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2020-03-25 11:22:46 -0700
committerScott Shawcroft <scott@tannewt.org>2020-03-25 11:22:46 -0700
commit6b7acc65b655dd203b08b2d53f08ad56c7da1041 (patch)
treeb4a4c946f66de2884514135bcbfaf31eabb7f5e3 /shared-module
parent59eb35da30c0141ce0b2eb5b9718d2a655f988ba (diff)
Add polarity and phase to FourWire.
It was fixed as 0/0 even though it used to get it from the current SPI state. This makes it more explicit with kwargs. Thanks to magpie_lark and kmatocha on the Adafruit Support forum for finding the issue: https://forums.adafruit.com/viewtopic.php?f=60&t=162515
Diffstat (limited to 'shared-module')
-rw-r--r--shared-module/displayio/FourWire.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/shared-module/displayio/FourWire.c b/shared-module/displayio/FourWire.c
index 256c29642..fe7234aa7 100644
--- a/shared-module/displayio/FourWire.c
+++ b/shared-module/displayio/FourWire.c
@@ -40,7 +40,8 @@
void common_hal_displayio_fourwire_construct(displayio_fourwire_obj_t* self,
busio_spi_obj_t* spi, const mcu_pin_obj_t* command,
- const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* reset, uint32_t baudrate) {
+ const mcu_pin_obj_t* chip_select, const mcu_pin_obj_t* reset, uint32_t baudrate,
+ uint8_t polarity, uint8_t phase) {
self->bus = spi;
common_hal_busio_spi_never_reset(self->bus);
@@ -49,8 +50,8 @@ void common_hal_displayio_fourwire_construct(displayio_fourwire_obj_t* self,
gc_never_free(self->bus);
self->frequency = baudrate;
- self->polarity = 0;
- self->phase = 0;
+ self->polarity = polarity;
+ self->phase = phase;
common_hal_digitalio_digitalinout_construct(&self->command, command);
common_hal_digitalio_digitalinout_switch_to_output(&self->command, true, DRIVE_MODE_PUSH_PULL);