{"id":509,"date":"2017-11-25T14:59:34","date_gmt":"2017-11-25T13:59:34","guid":{"rendered":"http:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=509"},"modified":"2017-12-30T19:40:11","modified_gmt":"2017-12-30T18:40:11","slug":"82-oled_ssd1331-library-stm32f4","status":"publish","type":"page","link":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=509","title":{"rendered":"82-OLED_SSD1331-Library (STM32F4)"},"content":{"rendered":"<p><div id=\"nav-below\" class=\"navigation\"><div class=\"nav-previous\"><a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=507\" title=\"81-LIN_Slave-Library (STM32F4)\"><span class=\"meta-nav\">\u2190<\/span> 81-LIN_Slave-Library (STM32F4)<\/a><\/div><\/div><!-- #nav-below --><div id=\"nav-below\" class=\"navigation\"><div class=\"nav-next\"><a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=511\" title=\"83-KeyMatrix-Library (STM32F4)\">83-KeyMatrix-Library (STM32F4) <span class=\"meta-nav\">&rarr;<\/span><\/a><\/div><\/div><!-- #nav-below --><\/p>\n<p>diese Library dient zum ansteuern eines Grafik OLed-Displays mit einem SSD1331-Chip.<br \/>\n(96 x 64 Pixel und 16bit Farbe)<\/p>\n<p>Das Display hat nur eine Diagonale von 0,96 Zoll und gibts z.B.<br \/>\nbei \u201cWatterott\u201d f\u00fcr ca. 28 EUR zu kaufen.<\/p>\n<p>das Display wird per SPI angesteuert (aus dem Grund wird auch noch die SPI-Library ben\u00f6tigt)<\/p>\n<p>weil das ganze nur \u00fcber SPI angesteuert wird, ist es nicht gerade sehr schnell aber daf\u00fcr braucht man nur 4 Leitungen.<\/p>\n<p>MISO wird nicht ben\u00f6tigt, Reset habe ich in meinem Beispiel benutzt, kann man aber<br \/>\nwahrscheinlich auch an Vcc h\u00e4ngen.<\/p>\n<p>in der Library ist das l\u00f6schen vom Bildschirm und das setzen von Punkten, zeichnen von Linien und Kreisen dabei. Die Unterst\u00fctzung f\u00fcr 16bit Fonts ist auch vorhanden.<\/p>\n<p><strong>Hinweis zur Benutzung der Textausgabe :<br \/>\n<\/strong>Es k\u00f6nnen die Zeichens\u00e4tze der Font-Library benutzt werden, allerdings muss der Include Pfad in den Font.c Files angepasst werden.<\/p>\n<p>Weil das Display so klein ist, habe ich einen extra Font (6\u00d78) dazugepackt damit passen<br \/>\n16 Zeichen x 8 Zeilen auf das Display.<\/p>\n<p><strong>Bild vom Display :<\/strong><\/p>\n<p><a href=\"http:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-content\/uploads\/2014\/05\/ssd1331_b.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-3919\" src=\"http:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-content\/uploads\/2014\/05\/ssd1331_b-300x254.jpg\" alt=\"ssd1331_b\" width=\"300\" height=\"254\" \/><\/a><\/p>\n<p><strong>Benutzte Pins :<\/strong><\/p>\n<pre lang=\"c\" line=\"1\">PB8  : R (Reset)\r\nPB11 : CS   (ChipSelect)\r\nPB12 : D\/C  (DATA\/CMD)\r\nPB13 : SPI_CLK\r\nPB14 : SPI_MISO (MISO \/ SDO) [nicht notwendig]\r\nPB15 : SPI_MOSI (MOSI \/ SDI)<\/pre>\n<p><strong>Funktionen :<\/strong><\/p>\n<pre lang=\"c\" line=\"1\">void UB_LCD_Init(void);                                                                             \/\/ zum init vom Display\r\nvoid UB_LCD_SetCursor2Draw(uint8_t xpos, uint8_t ypos);                                             \/\/ zum setzen vom Cursor\r\nvoid UB_LCD_SetPixel(uint16_t color);                                                               \/\/ zum setzen eines Pixels\r\nvoid UB_LCD_DrawPixel(uint8_t xpos, uint8_t ypos, uint16_t color);                                  \/\/ zum zeichnen eines Pixels\r\nvoid UB_LCD_FillScreen(uint16_t color);                                                             \/\/ zum loeschen vom Screen\r\nvoid UB_LCD_DrawLine(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint16_t color);               \/\/ zum zeichnen einer Linie\r\nvoid UB_LCD_DrawCircle(uint8_t x0, uint8_t y0, uint8_t radius, uint16_t color);                     \/\/ zum zeichnen eines Kreises\r\nvoid UB_LCD_DrawChar(uint8_t x, uint8_t y, uint8_t ascii, UB_Font *font, uint16_t vg, uint16_t bg); \/\/ zum schreiben eines Zeichens\r\nvoid UB_LCD_DrawString(uint8_t x, uint8_t y,char *ptr, UB_Font *font, uint16_t vg, uint16_t bg);    \/\/ zum schreiben eines Strings<\/pre>\n<p><strong>Beispiel :<\/strong><\/p>\n<pre lang=\"c\" line=\"1\">\/\/--------------------------------------------------------------\r\n\/\/ File     : main.c\r\n\/\/ Datum    : 10.05.2014\r\n\/\/ Version  : 1.0\r\n\/\/ Autor    : UB\r\n\/\/ EMail    : mc-4u(@)t-online.de\r\n\/\/ Web      : www.mikrocontroller-4u.de\r\n\/\/ CPU      : STM32F4\r\n\/\/ IDE      : CooCox CoIDE 1.7.4\r\n\/\/ GCC      : 4.7 2012q4\r\n\/\/ Module   : CMSIS_BOOT, M4_CMSIS_CORE\r\n\/\/ Funktion : Demo der SSD1331-Library\r\n\/\/ Hinweis  : Diese zwei Files muessen auf 8MHz stehen\r\n\/\/              \"cmsis_boot\/stm32f4xx.h\"\r\n\/\/              \"cmsis_boot\/system_stm32f4xx.c\"\r\n\/\/--------------------------------------------------------------\r\n\r\n#include \"main.h\"\r\n#include \"stm32_ub_lcd_ssd1331.h\"\r\n\r\nint main(void)\r\n{\r\n  SystemInit(); \/\/ Quarz Einstellungen aktivieren\r\n\r\n  \/\/ init vom Display\r\n  UB_LCD_Init();\r\n\r\n  \/\/ Screen mit gruen f\u00fcllen\r\n  UB_LCD_FillScreen(RGB_COL_GREEN);\r\n\r\n  \/\/ rote Linie zeichnen\r\n  UB_LCD_DrawLine(10,20,50,60,RGB_COL_RED);\r\n\r\n  \/\/ blauen Kreis zeichnen\r\n  UB_LCD_DrawCircle(50,30,25,RGB_COL_BLUE);\r\n\r\n  while(1)\r\n  {\r\n\r\n  }\r\n}\r\n<\/pre>\n<p>Hier die Library zum\u00a0<strong>Download :<\/strong><\/p>\n<p><a href=\"http:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-content\/uploads\/2014\/05\/ub_stm32f4_lcd_ssd1331_v100.zip\">ub_stm32f4_lcd_ssd1331_v100<\/a><\/p>\n<p>Hier der komplette CooCox-Projektordner zum\u00a0<strong>Download :<\/strong><\/p>\n<p><a href=\"http:\/\/mikrocontroller.bplaced.net\/wordpress\/wp-content\/uploads\/2014\/05\/Demo_82_LCD_SSD1331.zip\">Demo_82_LCD_SSD1331<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>diese Library dient zum ansteuern eines Grafik OLed-Displays mit einem SSD1331-Chip. (96 x 64 Pixel und 16bit Farbe) Das Display hat nur eine Diagonale von 0,96 Zoll und gibts z.B. bei \u201cWatterott\u201d f\u00fcr ca. 28 EUR zu kaufen. das Display &hellip; <a href=\"https:\/\/mikrocontroller.bplaced.net\/wordpress\/?page_id=509\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":144,"menu_order":82,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[128],"tags":[9,239,240,7],"class_list":["post-509","page","type-page","status-publish","hentry","category-stm32f4","tag-library","tag-oled","tag-ssd1331","tag-stm32f4"],"_links":{"self":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/509","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=509"}],"version-history":[{"count":3,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/509\/revisions"}],"predecessor-version":[{"id":1621,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/509\/revisions\/1621"}],"up":[{"embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=\/wp\/v2\/pages\/144"}],"wp:attachment":[{"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mikrocontroller.bplaced.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}