Skip to content

Commit d89de18

Browse files
pramasouldpgeorge
authored andcommitted
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.
1 parent f3b19ef commit d89de18

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎stmhal/lcd.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ STATIC void lcd_out(pyb_lcd_obj_t *lcd, int instr_data, uint8_t i) {
121121
}
122122
lcd_delay();
123123
HAL_SPI_Transmit(lcd->spi, &i, 1, 1000);
124+
lcd_delay();
125+
lcd->pin_cs1->gpio->BSRRL = lcd->pin_cs1->pin_mask; // CS=1; disable
124126
}
125127

126128
// write a string to the LCD at the current cursor location

0 commit comments

Comments
 (0)