Skip to content

Commit 7d6595f

Browse files
committed
stmhal: Make LCD initialiser use board pin names instead of cpu names.
1 parent 50ea86f commit 7d6595f

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

stmhal/lcd.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,16 +207,16 @@ STATIC mp_obj_t pyb_lcd_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n
207207
// TODO accept an SPI object and pin objects for full customisation
208208
if ((lcd_id[0] | 0x20) == 'x' && lcd_id[1] == '\0') {
209209
lcd->spi = &SPIHandle1;
210-
lcd->pin_cs1 = &pin_A2; // X3
211-
lcd->pin_rst = &pin_A3; // X4
212-
lcd->pin_a0 = &pin_A4; // X5
213-
lcd->pin_bl = &pin_C5; // X12
210+
lcd->pin_cs1 = &pyb_pin_X3;
211+
lcd->pin_rst = &pyb_pin_X4;
212+
lcd->pin_a0 = &pyb_pin_X5;
213+
lcd->pin_bl = &pyb_pin_X12;
214214
} else if ((lcd_id[0] | 0x20) == 'y' && lcd_id[1] == '\0') {
215215
lcd->spi = &SPIHandle2;
216-
lcd->pin_cs1 = &pin_B8; // Y3
217-
lcd->pin_rst = &pin_B9; // Y4
218-
lcd->pin_a0 = &pin_B12; // Y5
219-
lcd->pin_bl = &pin_B1; // Y12
216+
lcd->pin_cs1 = &pyb_pin_Y3;
217+
lcd->pin_rst = &pyb_pin_Y4;
218+
lcd->pin_a0 = &pyb_pin_Y5;
219+
lcd->pin_bl = &pyb_pin_Y12;
220220
} else {
221221
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "LCD bus '%s' does not exist", lcd_id));
222222
}

0 commit comments

Comments
 (0)