Commit d89de18f authored by Tom Soulanille's avatar Tom Soulanille Committed by Damien George
Browse files

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.
parent f3b19ef6
...@@ -121,6 +121,8 @@ STATIC void lcd_out(pyb_lcd_obj_t *lcd, int instr_data, uint8_t i) { ...@@ -121,6 +121,8 @@ STATIC void lcd_out(pyb_lcd_obj_t *lcd, int instr_data, uint8_t i) {
} }
lcd_delay(); lcd_delay();
HAL_SPI_Transmit(lcd->spi, &i, 1, 1000); 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 // write a string to the LCD at the current cursor location
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment