Commit 7d6595fd authored by Damien George's avatar Damien George
Browse files

stmhal: Make LCD initialiser use board pin names instead of cpu names.

parent 50ea86fe
......@@ -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
// TODO accept an SPI object and pin objects for full customisation
if ((lcd_id[0] | 0x20) == 'x' && lcd_id[1] == '\0') {
lcd->spi = &SPIHandle1;
lcd->pin_cs1 = &pin_A2; // X3
lcd->pin_rst = &pin_A3; // X4
lcd->pin_a0 = &pin_A4; // X5
lcd->pin_bl = &pin_C5; // X12
lcd->pin_cs1 = &pyb_pin_X3;
lcd->pin_rst = &pyb_pin_X4;
lcd->pin_a0 = &pyb_pin_X5;
lcd->pin_bl = &pyb_pin_X12;
} else if ((lcd_id[0] | 0x20) == 'y' && lcd_id[1] == '\0') {
lcd->spi = &SPIHandle2;
lcd->pin_cs1 = &pin_B8; // Y3
lcd->pin_rst = &pin_B9; // Y4
lcd->pin_a0 = &pin_B12; // Y5
lcd->pin_bl = &pin_B1; // Y12
lcd->pin_cs1 = &pyb_pin_Y3;
lcd->pin_rst = &pyb_pin_Y4;
lcd->pin_a0 = &pyb_pin_Y5;
lcd->pin_bl = &pyb_pin_Y12;
} else {
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "LCD bus '%s' does not exist", lcd_id));
}
......
Markdown is supported
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