|
|
|
@ -40,6 +40,9 @@ void common_hal_displayio_fourwire_construct(displayio_fourwire_obj_t* self,
|
|
|
|
|
|
|
|
|
|
self->bus = spi;
|
|
|
|
|
common_hal_busio_spi_never_reset(self->bus);
|
|
|
|
|
self->frequency = common_hal_busio_spi_get_frequency(spi);
|
|
|
|
|
self->polarity = common_hal_busio_spi_get_polarity(spi);
|
|
|
|
|
self->phase = common_hal_busio_spi_get_phase(spi);
|
|
|
|
|
|
|
|
|
|
common_hal_digitalio_digitalinout_construct(&self->command, command);
|
|
|
|
|
common_hal_digitalio_digitalinout_switch_to_output(&self->command, true, DRIVE_MODE_PUSH_PULL);
|
|
|
|
@ -71,8 +74,8 @@ bool common_hal_displayio_fourwire_begin_transaction(mp_obj_t obj) {
|
|
|
|
|
if (!common_hal_busio_spi_try_lock(self->bus)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
// TODO(tannewt): Stop hardcoding SPI frequency, polarity and phase.
|
|
|
|
|
common_hal_busio_spi_configure(self->bus, 12000000, 0, 0, 8);
|
|
|
|
|
common_hal_busio_spi_configure(self->bus, self->frequency, self->polarity,
|
|
|
|
|
self->phase, 8);
|
|
|
|
|
common_hal_digitalio_digitalinout_set_value(&self->chip_select, false);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|