summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/lcd.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-02-22 22:32:30 +0000
committerDamien George <damien.p.george@gmail.com>2015-04-18 21:40:58 +0100
commit7d6595fd188487670635d3e870b6cb6c67edd022 (patch)
treeea0cd51bd88700e2f04ee33794dc24fb48b86224 /stmhal/lcd.c
parent50ea86fe8b95ec8ce091061c34f449773ebe216a (diff)
downloadmicropython-7d6595fd188487670635d3e870b6cb6c67edd022.tar.gz
micropython-7d6595fd188487670635d3e870b6cb6c67edd022.zip
stmhal: Make LCD initialiser use board pin names instead of cpu names.
Diffstat (limited to 'stmhal/lcd.c')
-rw-r--r--stmhal/lcd.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/stmhal/lcd.c b/stmhal/lcd.c
index 22e11d9502..f0f7ae90f2 100644
--- a/stmhal/lcd.c
+++ b/stmhal/lcd.c
@@ -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));
}