Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:iot-open:practical:hardware:sut:stm32:emb6_1 [2024/04/20 13:30] – [Steps] ktokarzen:iot-open:practical:hardware:sut:stm32:emb6_1 [2024/04/20 13:34] (current) ktokarz
Line 72: Line 72:
 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
-}; 
- 
-// Total bytes used to store images in PROGMEM = 496 
-const int epd_bitmap_allArray_LEN = 1; 
-const unsigned char* epd_bitmap_allArray[1] = { 
- epd_bitmap_logo_64 
 }; };
 </code> </code>
Line 143: Line 137:
 Declare GPIOs and some configurations needed to handle the ePaper display properly: Declare GPIOs and some configurations needed to handle the ePaper display properly:
 <code c> <code c>
-#define GxEPD2_DRIVER_CLASS GxEPD2_213_BN+// The epaper display's model is selected 
 +#define GxEPD2_DRIVER_CLASS GxEPD2_213_BN 
 #define GxEPD2_DISPLAY_CLASS GxEPD2_BW #define GxEPD2_DISPLAY_CLASS GxEPD2_BW
  
 +// Definition of GPIOs except SPI pins
 #define EPAPER_DC_PIN D4 #define EPAPER_DC_PIN D4
 #define EPAPER_CS_PIN D1 #define EPAPER_CS_PIN D1
Line 151: Line 147:
 #define EPAPER_BUSY_PIN D7 #define EPAPER_BUSY_PIN D7
  
 +// Definition of the size of the buffer
 #define MAX_DISPLAY_BUFFER_SIZE 65536ul  #define MAX_DISPLAY_BUFFER_SIZE 65536ul 
 #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8))
Line 163: Line 160:
 You can also declare a message to display as an array of characters: You can also declare a message to display as an array of characters:
 <code c> <code c>
-static const char HelloWorld[] = "Hello IoT World!";+static const char HelloWorldMsg[] = "Hello IoT World!";
 </code> </code>
  
Line 194: Line 191:
 <code c> <code c>
 int16_t tbx, tby; uint16_t tbw, tbh; int16_t tbx, tby; uint16_t tbw, tbh;
-display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);+display.getTextBounds(HelloWorldMsg, 0, 0, &tbx, &tby, &tbw, &tbh);
  
 uint16_t x = ((display.width() - tbw) / 2) - tbx;  //center in x arrow uint16_t x = ((display.width() - tbw) / 2) - tbx;  //center in x arrow
Line 206: Line 203:
 display.fillScreen(GxEPD_WHITE); display.fillScreen(GxEPD_WHITE);
 display.setCursor(x, y); display.setCursor(x, y);
-display.print(pEpaperText);+display.print(HelloWorldMsg);
 display.display(true); display.display(true);
 display.drawImage((uint8_t*)epd_bitmap_logo_64,0,0,64,64); display.drawImage((uint8_t*)epd_bitmap_logo_64,0,0,64,64);
en/iot-open/practical/hardware/sut/stm32/emb6_1.1713619810.txt.gz · Last modified: 2024/04/20 13:30 by ktokarz
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0