Basic Example / test application for the on-board MICRON QSPI-Flash. Ported from DISCO_L476VG_QSPI. Added printing on serial output and LCD screen.
Dependencies: BSP_DISCO_F746NG LCD_DISCO_F746NG QSPI_DISCO_F746NG TS_DISCO_F746NG mbed
Diff: main.cpp
- Revision:
- 1:7bec6efe01d9
- Parent:
- 0:742b53764813
- Child:
- 2:a655d6640167
--- a/main.cpp Sat Oct 17 15:56:24 2015 +0000 +++ b/main.cpp Sun Oct 18 12:24:51 2015 +0000 @@ -35,6 +35,16 @@ lcd.SetFont(&Font12); lcd.SetBackColor(LCD_COLOR_BLUE); lcd.SetTextColor(LCD_COLOR_WHITE); + + lcd.DrawRect(10, 80, 50, 50); + lcd.DrawRect(10, 140, 50, 50); + lcd.DrawRect(10, 200, 50, 50); + lcd.DrawRect(70, 80, 50, 50); + lcd.DrawRect(130, 80, 50, 50); + lcd.DrawRect(190, 80, 50, 50); + lcd.DrawRect(250, 80, 50, 50); + lcd.DrawRect(310, 80, 50, 50); + lcd.DrawRect(370, 80, 50, 50); while(1) { @@ -58,16 +68,38 @@ y = TS_State.touchY[idx]; sprintf((char*)text, "Touch %d: x=%d y=%d ", idx+1, x, y); lcd.DisplayStringAt(0, LINE(idx+1), (uint8_t *)&text, LEFT_MODE); + + if ((x < 60) && (x > 10) && (y < 120) && (y > 70)) { + lcd.FillRect(10, 80, 50, 50); + } + else { + lcd.DrawRect(10, 80, 50, 50); + } + } lcd.DrawPixel(TS_State.touchX[0], TS_State.touchY[0], LCD_COLOR_ORANGE); + + } else { if (!cleared) { lcd.Clear(LCD_COLOR_BLUE); sprintf((char*)text, "Touches: 0"); lcd.DisplayStringAt(0, LINE(0), (uint8_t *)&text, LEFT_MODE); + + lcd.DrawRect(10, 80, 50, 50); + lcd.DrawRect(10, 140, 50, 50); + lcd.DrawRect(10, 200, 50, 50); + lcd.DrawRect(70, 80, 50, 50); + lcd.DrawRect(130, 80, 50, 50); + lcd.DrawRect(190, 80, 50, 50); + lcd.DrawRect(250, 80, 50, 50); + lcd.DrawRect(310, 80, 50, 50); + lcd.DrawRect(370, 80, 50, 50); + cleared = 1; } } } } +