summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTom Soulanille <soul@prama.com>2016-07-16 18:20:08 -0700
committerDamien George <damien.p.george@gmail.com>2016-09-09 14:51:00 +1000
commitd89de18f4035996ba2e1f244d6c4e1e2c8f0cc98 (patch)
tree4d42e7e4fd83670c215993da1450c6ca6fafbd19
parentf3b19ef6347f41b073b27c7a83a12cfc1c7267b8 (diff)
downloadmicropython-d89de18f4035996ba2e1f244d6c4e1e2c8f0cc98.tar.gz
micropython-d89de18f4035996ba2e1f244d6c4e1e2c8f0cc98.zip
stmhal/lcd: De-assert chip select after completing SPI transmission.
The LCD interface library fails to deassert the chip select of the LCD after an SPI transmission. Consequently using the SPI with other peripherals disturbs the state of the LCD. This patch changes lcd.lcd_out() to deassert CS after each transmission to the LCD.
-rw-r--r--stmhal/lcd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/stmhal/lcd.c b/stmhal/lcd.c
index 143ef9bbd7..74a29a151f 100644
--- a/stmhal/lcd.c
+++ b/stmhal/lcd.c
@@ -121,6 +121,8 @@ STATIC void lcd_out(pyb_lcd_obj_t *lcd, int instr_data, uint8_t i) {
}
lcd_delay();
HAL_SPI_Transmit(lcd->spi, &i, 1, 1000);
+ lcd_delay();
+ lcd->pin_cs1->gpio->BSRRL = lcd->pin_cs1->pin_mask; // CS=1; disable
}
// write a string to the LCD at the current cursor location