Differences

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

Link to this comparison view

Next revision
Previous revision
en:iot-open:practical:hardware:sut:stm32:emb6_1 [2024/04/20 11:43] – created ktokarzen:iot-open:practical:hardware:sut:stm32:emb6_1 [2024/04/20 13:34] (current) ktokarz
Line 27: Line 27:
 Check if you can see a full ePaper Display in your video stream. Book a device and create a dummy Arduino file with ''void setup()...'' and ''void loop()...''. Check if you can see a full ePaper Display in your video stream. Book a device and create a dummy Arduino file with ''void setup()...'' and ''void loop()...''.
  
-Prepare a small bitmap (e.g. 60x60 pixels) and convert it to the byte array with b/w settings.\\+Prepare a small bitmap (e.g. 64x64 pixels) and convert it to the byte array with b/w settings.\\
 Sample project favicon you can use is present in Figure {{ref>iotopenfavicon}}: Sample project favicon you can use is present in Figure {{ref>iotopenfavicon}}:
 <figure iotopenfavicon> <figure iotopenfavicon>
-{{ :en:iot-open:practical:hardware:sut:esp32:logo_60.jpg?60 |}} +{{ :en:iot-open:practical:hardware:sut:stm32:logo64.png?64 |}} 
-<caption>IOT-OPEN.EU Reloaded favicon 60px 60px</caption>+<caption>IOT-OPEN.EU Reloaded favicon 64px 64px</caption>
 </figure> </figure>
  
Line 38: Line 38:
 The corresponding generated C array for the logo in Figure {{ref>iotopenfavicon}} (horizontal 1 bit per pixel, as suitable for ePaper Display) is present below: The corresponding generated C array for the logo in Figure {{ref>iotopenfavicon}} (horizontal 1 bit per pixel, as suitable for ePaper Display) is present below:
 <code c> <code c>
-// 'logo 60', 60x60px +// 'logo64', 64x64px 
-const unsigned char epd_bitmap_logo_60 [] PROGMEM = { +const unsigned char epd_bitmap_logo_64 [] PROGMEM = { 
-0xff, 0xff, 0xff, 0x800x1f, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xf8, 0x00, 0x010xff, 0xff, 0xf0,  +0xff, 0xff, 0xff, 0xf00x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x000x1f, 0xff, 0xff,  
-0xff, 0xff, 0xc0, 0x00, 0x00, 0x3f, 0xff, 0xf0, 0xff, 0xff, 0x01, 0xff, 0xf8, 0x0f, 0xff, 0xf0,  +0xff, 0xff, 0xfc, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x1f, 0xff, 0x80, 0xff, 0xff,  
-0xff, 0xfc0x0f, 0xff, 0xff, 0x03, 0xff, 0xf0, 0xff, 0xf8, 0x3f, 0xff, 0xff, 0xc1, 0xff, 0xf0,  +0xff, 0xff0xc0, 0xff, 0xff, 0xf0, 0x3f, 0xff, 0xff, 0xff, 0x83, 0xff, 0xff, 0xfc, 0x1f, 0xff,  
-0xff, 0xe0, 0xff, 0xff, 0xff, 0xf00x7f, 0xf0, 0xff, 0xc3, 0xff, 0xff, 0xff, 0xfc0x3f, 0xf0,  +0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0x070xff, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xc30xff,  
-0xff, 0x87, 0xff, 0xf0, 0xff, 0xfe0x1f, 0xf0, 0xff, 0x0f0xfe0x000x07, 0xff, 0x0f0xf0 +0xff, 0xf8, 0x7f, 0xff, 0xef, 0xff, 0xe10xff, 0xff, 0xf0, 0xff, 0xff0xe80xff0xf0, 0xff,  
-0xfe, 0x1f, 0xf8, 0x7f, 0xe1, 0xff, 0x870xf00xfc0x3f0xe3, 0xff, 0xfc, 0x7f, 0xc3, 0xf0,  +0xff0xe1, 0xff, 0xff, 0xfe, 0x5f, 0xf8, 0x7f, 0xff, 0xc30xff0xff0xff0xf7, 0xfc, 0x3f,  
-0xfc0x7f0x8f, 0xff, 0xff, 0x1f0xe30xf0, 0xf8, 0xff, 0x3f, 0xff, 0xff, 0xcf0xf10xf0,  +0xff0xc70xff, 0xff, 0xff, 0xf30xfe0x3f, 0xff, 0x8f, 0xff, 0xff, 0xff0xfe0xff, 0x1f,  
-0xf10xfe0x7f, 0xff, 0xff, 0xe70xf80xf00xf10xfc, 0xff, 0xff, 0xff, 0xf30xf80xf0,  +0xff0x1f0xff, 0xff, 0xff, 0xfe0xff0x8f0xff0x1f, 0xff, 0xff, 0xff, 0xff0x7f0x8f,  
-0xe30xf9, 0xff, 0xfc0x7f0xf90xfc0x700xe30xf3, 0xff, 0xfc0x0f0xfc0xfc0x70,  +0xfe0x3f, 0xff, 0xff0xff0xff0xbf0xc70xfe0x3f, 0xff, 0xff0xff0xff0xdf0xc7,  
-0xc70xf7, 0xff, 0xff, 0xc30xfe0xfe0x300xc70xe7, 0xff, 0xff, 0xf10xfe0x7e0x30,  +0xfc0x7f, 0xff, 0xff, 0xff0xff0xcf0xe30xfc0x7f, 0xff, 0xff, 0xff0xff0xf70xe3,  
-0xcf0xef, 0xff, 0xff, 0xfc, 0xff, 0x7f0x300x8f0xcf, 0xff, 0xff, 0xfe0x7f0x3f0x10,  +0xf80xff, 0xff, 0xff, 0xff, 0xff, 0xff0xf30xf80xff, 0xff, 0xff, 0xff0xff0xfb0xf1,  
-0x8f0xdf, 0xff, 0xff, 0xff, 0x3f0xbf0x100x9f0x9f, 0xff, 0xff, 0xff, 0x3f0x9f0x90,  +0xf80xff, 0xff, 0xff, 0xff, 0xff0xfb0xf10xf90xff, 0xff, 0xff, 0xff, 0xff0xfb0xf9,  
-0x9f0x9f, 0xff, 0xff, 0xff, 0x9f0x9f0x900x1f0xbf, 0xff, 0xff, 0xff, 0x9f0xdf0x80,  +0xf10xff, 0xff, 0xff, 0xff, 0xff0xf90xf90xf10xff, 0xff, 0xff, 0xff, 0xff0xfd0xf8,  
-0x1f0xbf, 0xff, 0xf9, 0xff, 0xdf0xdf0x800x1f0xbf, 0xff, 0xe00x7f0xcf0xdf0x80,  +0xf10xff, 0xff, 0xff, 0x9f0xff0xfd0xf80xf1, 0xff, 0xff0xfe0x070xff0xfd, 0xf8,  
-0x1f0x3f, 0xff, 0xe00x7f0xcf0xcf0x800x1f0x3f0xff0xc00x3f0xcf0xcf0x80,  +0xf10xff, 0xff, 0xfe0x070xff0xfd0xf80xf10xfc0x000x1c0x030xff0xfc0xf8,  
-0x1f0xff0xff0xc00x3f0xff0xff0xf00x1f, 0xff, 0xff, 0xe00x7f0xff, 0xff, 0xf0,  +0xf10xfc0x000x1c0x030xfe0xfe0xf80xf1, 0xff, 0xff, 0xfe0x070xfe, 0xff, 0xf8,  
-0x1f, 0xff, 0xff, 0xe00x7f0xff0xff0xf00x1f, 0xff, 0xff, 0xf9, 0xff, 0xff0xff0xf0,  +0xf1, 0xff, 0xff, 0xfe0x070xfd0xfd0xf80xf1, 0xff, 0xff, 0xff, 0x9f0xfd0xfd, 0xf8,  
-0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xf00x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xf0,  +0xf1, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xfd, 0xf80xf1, 0xff, 0xe1, 0xff, 0xff, 0xfb, 0xfd, 0xf9,  
-0x9f, 0xff, 0xff0xff, 0xff, 0xff, 0xf9, 0xf00x8f, 0xff, 0xff0xf90xfc0x030xf00x10,  +0xf1, 0xff, 0x800x7f, 0xff, 0xfb, 0xf9, 0xf90xf1, 0xff, 0x000x3f0xff0xf70xfb0xf1,  
-0x8f0xff, 0xff, 0xf90xf80x010xe00x100xcf0xff, 0xff, 0xf90xf00xf00xf90xf0 +0xf10xfe, 0x3f, 0x3f, 0xff, 0xef0xf30xf10xf10xfe0x7f0x1f, 0xff, 0xcf0xff0xf3 
-0xc70xff, 0xff, 0xf90xf30xfc0xf90xf00xc70xff0xff0xf9, 0xe3, 0xfc, 0x790xf0 +0xf10xfc0x7f0x9f, 0xff, 0x5f0xef0xe30xf10xfc0x7f0x9f0xfe0xbf, 0xcf, 0xe3,  
-0xe3, 0xff, 0xff0xf90xe3, 0xfc, 0x790xf00xe3, 0xff, 0xff0xf90xe30xfc0x790xf0,  +0xf1, 0xfc, 0xff0x9f0xe9, 0xff, 0xef0xc70xf1, 0xfc, 0x7f0x9f0xef, 0xff, 0xbf0xc7 
-0xf1, 0xff, 0xff, 0xf90xe30xfc0x790xf00xf1, 0xff, 0xff, 0xf90xf30xfc0x790xf0,  +0xf10xfe0x7f0x9f, 0xff, 0xff, 0x3f0x8f0xf10xfe0x3f0x1f, 0xff, 0xfe, 0xff, 0x8f 
-0xf8, 0xff, 0xff, 0xf9, 0xf1, 0xf80xf9, 0xf0, 0xfc, 0x7f, 0xff, 0xf9, 0xf80x610xf80xc0 +0xf10xff0x000x3f, 0xff, 0xfe, 0xff, 0x1f, 0xf1, 0xff0x80, 0x7f, 0xff, 0xf9, 0xfe0x3f 
-0xfc0x3f, 0xff, 0xf9, 0xfc, 0x030xf80x00, 0xfe, 0x1f, 0xff, 0xf9, 0xff, 0x0f, 0xfe, 0x10 +0xf10xff0xc10xff, 0xff, 0xe7, 0xfc, 0x7f0xf10xff, 0xff, 0xff, 0xfe, 0x9f0xf80x7f 
-0xff0x0f0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0x87, 0xff, 0xff, 0xff0xff, 0xff, 0xf0 +0xf1, 0xff, 0xff, 0xff, 0xe8, 0xff, 0xf0, 0xff, 0xf1, 0xff, 0xff, 0xbf0xef, 0xff, 0xe1, 0xff,  
-0xff, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0 +0xf1, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xc3, 0xff, 0xf1, 0xfe, 0x00, 0x0f, 0xff, 0xff, 0x07, 0xff,  
-0xff, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xfc, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf0,  +0xf1, 0xfe, 0x00, 0x03, 0xff, 0xfc, 0x1f, 0xff, 0xf1, 0xfc, 0x7f, 0x9f, 0xff, 0xf0, 0x3f, 0xff,  
-0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xc00x000x000x000x000x00,  +0xf1, 0xfc, 0xff, 0x9f, 0xff, 0x80, 0xff, 0xff, 0xf1, 0xfc, 0xff, 0x9f, 0xc0, 0x03, 0xff, 0xff,  
-0xff, 0xff, 0xf80x000x000x000x000x00, 0xff, 0xff, 0xff, 0x800x000x000x000x00 +0xf1, 0xfc, 0x7f, 0x9f, 0xc0, 0x1f, 0xff, 0xff, 0xf1, 0xfe, 0x7f, 0xff, 0xc0, 0xff, 0xff, 0xff,  
-}; +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff0xff0xff0xff0xff0xff,  
- +0xff, 0xff, 0xff0xff0xff0xff0xff0xff, 0xff, 0xff, 0xff, 0xff0xff0xff0xff0xff
-// 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_60+
 }; };
 </code> </code>
Line 141: 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 149: 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 161: 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 192: 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; +uint16_t x = ((display.width() - tbw) / 2) - tbx;  //center in x arrow 
-uint16_t y = ((display.height() - tbh) / 2) - tby;+uint16_t y = ((display.height() - tbh) / 4) - tby; //one fourth from the top
 </code> </code>
  
Line 202: Line 201:
 <code c> <code c>
 display.setFullWindow(); display.setFullWindow();
-display.firstPage(); +display.fillScreen(GxEPD_WHITE); 
-do +display.setCursor(xy); 
-  { +display.print(HelloWorldMsg); 
-    display.drawImage((uint8_t*)epd_bitmap_logo_60,0,0,60,60); +display.display(true); 
-    display.setCursor(x, y); +display.drawImage((uint8_t*)epd_bitmap_logo_64,0,0,64,64);
-    display.print(HelloWorld); +
-  } +
-while (display.nextPage());+
 digitalWrite(EPAPER_SPI_CS_PIN,HIGH); digitalWrite(EPAPER_SPI_CS_PIN,HIGH);
 </code> </code>
en/iot-open/practical/hardware/sut/stm32/emb6_1.1713613386.txt.gz · Last modified: 2024/04/20 11:43 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