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

NotImplemented
Damien George 2015-02-22 22:32:30 +00:00
parent 50ea86fe8b
commit 7d6595fd18
1 changed files with 8 additions and 8 deletions

View File

@ -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));
}