{"id":311290,"date":"2020-10-11T15:00:47","date_gmt":"2020-10-11T15:00:47","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=311290"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=311290","title":{"rendered":"STM32 \u0438 LCD2004A \u0431\u0435\u0437 I2C \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/522938\/\">\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c STM32 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 LCD \u0434\u0438\u0441\u043f\u043b\u0435\u0435\u043c. \u0418\u0437 \u0434\u0438\u0441\u043f\u043b\u0435\u0435\u0432 \u043d\u0430\u0448\u0435\u043b \u0443 \u0441\u0435\u0431\u044f \u0442\u043e\u043b\u044c\u043a\u043e 2004A, \u043f\u0440\u0438\u0447\u0435\u043c \u0431\u0435\u0437 I2C \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u041e \u043d\u0435\u043c \u0438 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043e \u0441\u0445\u0435\u043c\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mx\/dm\/5m\/mxdm5mirxtyr8w-og4g_wd9tppo.png\" alt=\"image\"\/><\/p>\n<p>  PB0 \u2014 PB7 \u2014 \u0432\u044b\u0432\u043e\u0434\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u043e\u0432 \u0434\u0438\u0441\u043f\u043b\u0435\u044f :<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<td>\u041d\u043e\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430<\/td>\n<td>\u0421\u0438\u0433\u043d\u0430\u043b<\/td>\n<td>\u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>GND<\/td>\n<td>\u0417\u0435\u043c\u043b\u044f (\u043e\u0431\u0449\u0438\u0439 \u043f\u0440\u043e\u0432\u043e\u0434)<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>VCC<\/td>\n<td>\u041f\u0438\u0442\u0430\u043d\u0438\u0435 + 5 \u0412<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>VEE<\/td>\n<td>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u0438\u0441\u043f\u043b\u0435\u044f. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u043d\u0438\u0439 \u0432\u044b\u0432\u043e\u0434 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044f \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f. \u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u0435\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 10-20 \u043a\u041e\u043c, \u043d\u043e \u044f \u0440\u0430\u0441\u043f\u0430\u044f\u043b \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 \u0434\u0438\u0441\u043f\u043b\u0435\u044f \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440\u044b.<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>RS<\/td>\n<td>\u0412\u044b\u0431\u043e\u0440 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430: 0 \u2013 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u043a\u043e\u043c\u0430\u043d\u0434; 1 \u2013 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0434\u0430\u043d\u043d\u044b\u0445.<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>R\/W<\/td>\n<td>\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445:<br \/>  0 \u2013 \u0437\u0430\u043f\u0438\u0441\u044c;<br \/>  1 \u2013 \u0447\u0442\u0435\u043d\u0438\u0435.<br \/>  \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0447\u0442\u0435\u043d\u0438\u0435 \u0438\u0437 \u0434\u0438\u0441\u043f\u043b\u0435\u044f \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0430\u0436\u0430\u0435\u043c \u0432\u044b\u0432\u043e\u0434 \u043d\u0430 \u0437\u0435\u043c\u043b\u044e.  <\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>EN<\/td>\n<td>\u0421\u0442\u0440\u043e\u0431 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0448\u0438\u043d\u044b. \u041f\u0440\u0438 \u0441\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u043c \u0444\u0440\u043e\u043d\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u043d\u0430 \u0448\u0438\u043d\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u00ab\u0437\u0430\u0449\u0435\u043b\u043a\u0438\u0432\u0430\u044e\u0442\u0441\u044f\u00bb \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440.<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>DB0<\/td>\n<td rowspan=\"4\">\u041c\u043b\u0430\u0434\u0448\u0438\u0435 \u0431\u0438\u0442\u044b \u0432\u043e\u0441\u044c\u043c\u0438 \u0431\u0438\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430. \u041f\u0440\u0438 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0431\u0438\u0442\u043d\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0437\u0435\u043c\u043b\u044e.<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>DB1<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>9<\/td>\n<td>DB2<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>DB3<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>11<\/td>\n<td>DB4<\/td>\n<td rowspan=\"4\">\u0421\u0442\u0430\u0440\u0448\u0438\u0435 \u0431\u0438\u0442\u044b \u0432\u043e\u0441\u044c\u043c\u0438 \u0431\u0438\u0442\u043d\u043e\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430 \u0438\u043b\u0438 \u0431\u0438\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0431\u0438\u0442\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/td>\n<\/tr>\n<tr>\n<td>12<\/td>\n<td>DB5<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>13<\/td>\n<td>DB6<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>14<\/td>\n<td>DB7<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>15<\/td>\n<td>A<\/td>\n<td>\u0410\u043d\u043e\u0434 \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0438 (+)<\/td>\n<\/tr>\n<tr>\n<td>16<\/td>\n<td>K<\/td>\n<td>\u041a\u0430\u0442\u043e\u0434 \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0438 (-). \u0422\u043e\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d.<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0418\u0442\u0430\u043a, \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438. \u0421\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0443\u0447\u0438\u0442\u044c \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c. \u042f \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u041e\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u2014 lcd_20x4.h \u0438 lcd_20x4.c<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430.<\/p>\n<pre><code class=\"cpp\">#ifndef LCD_LCD_20X4_2004A_LCD_20X4_H_ #define LCD_LCD_20X4_2004A_LCD_20X4_H_  #include &quot;stm32f1xx.h&quot; #include &quot;delay.h&quot;<\/code><\/pre>\n<p>  \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 CMSIS stm32f1xx.h \u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u043c\u0435\u043d\u044f \u043a\u0430\u043c\u0435\u043d\u044c STM32F103C8T6. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u0430\u0439\u043b delay.h \u2014 \u044d\u0442\u043e \u043c\u043e\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430\u043c\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u0430. \u0417\u0434\u0435\u0441\u044c \u0435\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443, \u0432\u043e\u0442 \u0435\u0435 \u043a\u043e\u0434:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0424\u0430\u0439\u043b delay.h<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\"> #ifndef DELAY_DELAY_H_ #define DELAY_DELAY_H_  #include &quot;stm32f1xx.h&quot;  #define F_CPU 72000000UL #define US F_CPU\/1000000 #define MS F_CPU\/1000 #define SYSTICK_MAX_VALUE 16777215 #define US_MAX_VALUE SYSTICK_MAX_VALUE\/(US) #define MS_MAX_VALUE SYSTICK_MAX_VALUE\/(MS)   void delay_us(uint32_t us); \/\/ \u0434\u043e 233 \u043c\u043a\u0441 void delay_ms(uint32_t ms); \/\/ \u0434\u043e 233 \u043c\u0441 void delay_s(uint32_t s);  #endif \/* DELAY_DELAY_H_ *\/ <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0424\u0430\u0439\u043b delay.\u0441<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\"> #include &quot;delay.h&quot;   \/* \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u0435\u043a \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u044b \u0438 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u044b*\/  void delay_us(uint32_t us){ \/\/ \u0434\u043e 233\u00a0016 \u043c\u043a\u0441  \tif (us &gt; US_MAX_VALUE || us == 0) \t\treturn;  \tSysTick-&gt;CTRL &= ~SysTick_CTRL_TICKINT_Msk; \/\/ \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438 0 \tSysTick-&gt;CTRL |= SysTick_CTRL_CLKSOURCE_Msk; \/\/ \u0441\u0442\u0430\u0432\u0438\u043c \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \tSysTick-&gt;LOAD = (US * us-1); \/\/ \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0447\u0438\u0441\u043b\u043e \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \tSysTick-&gt;VAL = 0; \/\/ \u043e\u0431\u043d\u0443\u043b\u044f\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 SYST_CVR \tSysTick-&gt;CTRL |= SysTick_CTRL_ENABLE_Msk; \/\/ \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0447\u0435\u0442\u0447\u0438\u043a  \twhile(!(SysTick-&gt;CTRL & SysTick_CTRL_COUNTFLAG_Msk)); \/\/ \u0436\u0434\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0444\u043b\u0430\u0433\u0430 COUNFLAG \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 SYST_CSR  \tSysTick-&gt;CTRL &= ~SysTick_CTRL_COUNTFLAG_Msk;\t\/\/ \u0441\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u043c \u0431\u0438\u0442 COUNTFLAG \tSysTick-&gt;CTRL &= ~SysTick_CTRL_ENABLE_Msk; \/\/ \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0441\u0447\u0435\u0442\u0447\u0438\u043a  }  void delay_ms(uint32_t ms){ \/\/ \u0434\u043e 233 \u043c\u0441  \tif(ms &gt; MS_MAX_VALUE || ms ==0) \t\treturn;  \tSysTick-&gt;CTRL &= ~SysTick_CTRL_TICKINT_Msk; \tSysTick-&gt;CTRL |= SysTick_CTRL_CLKSOURCE_Msk; \tSysTick-&gt;LOAD = (MS * ms); \tSysTick-&gt;VAL = 0; \tSysTick-&gt;CTRL |= SysTick_CTRL_ENABLE_Msk;  \twhile(!(SysTick-&gt;CTRL & SysTick_CTRL_COUNTFLAG_Msk));  \tSysTick-&gt;CTRL &= ~SysTick_CTRL_COUNTFLAG_Msk; \tSysTick-&gt;CTRL &= ~SysTick_CTRL_ENABLE_Msk;   }  void delay_s(uint32_t s){  \tfor(int i=0; i&lt;s*5;i++) delay_ms(200); }  <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0414\u0438\u0441\u043f\u043b\u0435\u0439 2004A \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0444\u0438\u0440\u043c\u044b HITACHI HD44780. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u0432 \u0434\u0430\u0442\u0430\u0448\u0438\u0442 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440. \u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 6 \u0435\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043a\u043e\u043c\u0430\u043d\u0434, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0442\u0430\u0439\u043c\u0438\u043d\u0433\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ba\/lp\/v9\/balpv9k9qcbl0zrzsluvlwfnf4k.png\" alt=\"image\"\/><\/p>\n<p>  \u041f\u0435\u0440\u0435\u043f\u0438\u0448\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u043c\u0430\u043a\u0440\u043e\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435:<\/p>\n<pre><code class=\"cpp\"> \/\/ display commands  #define CLEAR_DISPLAY 0x1 #define RETURN_HOME 0x2 #define ENTRY_MODE_SET 0x6 \/\/ mode cursor shift rihgt, display non shift #define DISPLAY_ON 0xC \/\/ non cursor #define DISPLAY_OFF 0x8 #define CURSOR_SHIFT_LEFT 0x10 #define CURSOR_SHIFT_RIGHT 0x14 #define DISPLAY_SHIFT_LEFT 0x18 #define DISPLAY_SHIFT_RIGHT 0x1C #define DATA_BUS_4BIT_PAGE0 0x28 #define DATA_BUS_4BIT_PAGE1 0x2A #define DATA_BUS_8BIT_PAGE0 0x38 #define SET_CGRAM_ADDRESS 0x40 \/\/ usage address |= SET_CGRAM_ADDRESS #define SET_DDRAM_ADDRESS 0x80 <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u044b\u0432\u043e\u0434\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0438\u0441\u043f\u043b\u0435\u0435\u043c. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0438\u0442\u043e\u0432 \u0432 \u043f\u043e\u0440\u0442\u0435 ODR \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 PIN_D4. \u0423 \u043c\u0435\u043d\u044f \u0442\u0430\u043c \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d 10-\u0439 \u0431\u0438\u0442 \u0432\u043c\u0435\u0441\u0442\u043e 4. \u041d\u0430 \u043c\u043e\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 4-\u0439 \u0432\u044b\u0432\u043e\u0434. \u041d\u0435 \u0437\u043d\u0430\u044e \u0441 \u0447\u0435\u043c \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e, \u043d\u043e \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 ODR \u044d\u0442\u043e\u0442 \u0431\u0438\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0430, \u0434\u0430\u0436\u0435 \u0434\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u041d\u0435 \u0437\u043d\u0430\u044e \u0441 \u0447\u0435\u043c \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u0430\u043c\u0435\u043d\u044c \u043d\u0435 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439.<\/p>\n<pre><code class=\"cpp\"> \/\/ \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0438\u0442\u043e\u0432 \u0432 \u043f\u043e\u0440\u0442\u0435 ODR #define PIN_RS 0x1 #define PIN_EN 0x2 #define PIN_D7 0x80 #define PIN_D6 0x40 #define PIN_D5 0x20 #define PIN_D4 0x400 <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u044b \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u043e\u0432. \u042f \u0440\u0435\u0448\u0438\u043b \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430:<\/p>\n<pre><code class=\"cpp\"> #define     LCD_PORT               \tGPIOB #define\tLCD_ODR \t\t\t\tLCD_PORT-&gt;ODR  #define     LCD_PIN_RS()     \t\tLCD_PORT-&gt;CRL &= ~GPIO_CRL_CNF0; \\ \t\t\t\t\t\t\tLCD_PORT-&gt;CRL |= GPIO_CRL_MODE0;    \/\/ PB0  \u0432\u044b\u0445\u043e\u0434 \u0442\u044f\u043d\u0438-\u0442\u043e\u043b\u043a\u0430\u0439, \u0447\u0430\u0441\u0442\u043e\u0442\u0430 50 \u041c\u0433\u0446  #define     LCD_PIN_EN()            LCD_PORT-&gt;CRL &= ~GPIO_CRL_CNF1;\\ \t\t\t\t\t\t LCD_PORT-&gt;CRL |= GPIO_CRL_MODE1;        \/\/ PB1  #define     LCD_PIN_D7()            LCD_PORT-&gt;CRL &= ~GPIO_CRL_CNF7;\\ \t\t\t\t\t\t LCD_PORT-&gt;CRL |= GPIO_CRL_MODE7;          \/\/ PB7  #define     LCD_PIN_D6()            LCD_PORT-&gt;CRL &= ~GPIO_CRL_CNF6;\\ \t\t\t\t\t\t LCD_PORT-&gt;CRL |= GPIO_CRL_MODE6;       \/\/ PB6  #define     LCD_PIN_D5()            LCD_PORT-&gt;CRL &= ~GPIO_CRL_CNF5;\\ \t\t\t\t\t\t LCD_PORT-&gt;CRL |= GPIO_CRL_MODE5;         \/\/ PB5  #define     LCD_PIN_D4()            LCD_PORT-&gt;CRH &= ~GPIO_CRH_CNF10;\\ \t\t\t\t\t\t LCD_PORT-&gt;CRH |= GPIO_CRH_MODE10;         \/\/ PB10  #define     LCD_PIN_MASK   (PIN_RS | PIN_EN | PIN_D7 | PIN_D6 | PIN_D5 | PIN_D4) \/\/ 0b0000000011110011 \u043c\u0430\u0441\u043a\u0430 \u043f\u0438\u043d\u043e\u0432 \u0434\u043b\u044f \u044d\u043a\u0440\u0430\u043d\u0430 <\/code><\/pre>\n<p>  \u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0438\u0441\u043f\u043b\u0435\u0435\u043c:<\/p>\n<pre><code class=\"cpp\"> void portInit(void); \/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u043e\u0436\u0435\u043a \u043f\u043e\u0440\u0442\u0430 \u043f\u043e\u0434 \u044d\u043a\u0440\u0430\u043d void sendByte(char byte, int isData); void lcdInit(void); \/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0438\u0441\u043f\u043b\u0435\u044f void sendStr(char *str, int row ); \/\/ \u0432\u044b\u0432\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438  #endif \/* LCD_LCD_20X4_2004A_LCD_20X4_H_ *\/ <\/code><\/pre>\n<p>  \u0421 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u0444\u0430\u0439\u043b\u0435 lcd_20x4.c<br \/>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u044b\u0432\u043e\u0434\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0438\u0441\u043f\u043b\u0435\u0435\u043c. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f void portInit(void):<\/p>\n<pre><code class=\"cpp\"> void portInit(void){ \/\/----------------------\u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0440\u0442\u0430----------------------------------------------------  \tif(LCD_PORT == GPIOB) RCC-&gt;APB2ENR |= RCC_APB2ENR_IOPBEN; \telse if (LCD_PORT == GPIOA) RCC-&gt;APB2ENR |= RCC_APB2ENR_IOPAEN; \telse return;  \/\/--------------------- \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0438\u043d\u043e\u0432 \u0434\u043b\u044f LCD-----------------------------------------------------  \t\tLCD_PIN_RS();\/\/ \u043c\u0430\u043a\u0440\u043e\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \t\tLCD_PIN_EN(); \t\tLCD_PIN_D7(); \t\tLCD_PIN_D6(); \t\tLCD_PIN_D5(); \t\tLCD_PIN_D4();  \t\tlcdInit(); \/\/ \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0438\u0441\u043f\u043b\u0435\u044f  \treturn ; } <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 lcdInit() \u2014 \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0438\u0441\u043f\u043b\u0435\u044f. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0438 \u0435\u0435. \u041e\u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0431\u043b\u043e\u043a-\u0441\u0445\u0435\u043c\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0438\u0441\u043f\u043b\u0435\u044f \u0438\u0437 \u0434\u0430\u0442\u0430\u0448\u0438\u0442\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/k5\/za\/tu\/k5zatu2mwsfgwhnemxtobwkuji8.png\" alt=\"image\"\/><\/p>\n<pre><code class=\"cpp\"> \/\/--------------------- \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0438\u0441\u043f\u043b\u0435\u044f----------------------------------------------------------- void lcdInit(void){    \t\t\tdelay_ms(15); \/\/ \u0436\u0434\u0435\u043c \u043f\u043e\u043a\u0430 \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0438\u0442\u0430\u043d\u0438\u0435  \t\t\tsendByte(0x33, 0); \/\/ \u0448\u043b\u0435\u043c \u0432 \u043e\u0434\u043d\u043e\u043c \u0431\u0430\u0439\u0442\u0435 \u0434\u0432\u0430 0011 \t\t\tdelay_us(100);  \t\t\tsendByte(0x32, 0); \/\/ \u0448\u043b\u0435\u043c \u0432 \u043e\u0434\u043d\u043e\u043c \u0431\u0430\u0439\u0442\u0435  00110010 \t\t\tdelay_us(40);  \t\t\tsendByte(DATA_BUS_4BIT_PAGE0, 0); \/\/ \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0440\u0435\u0436\u0438\u043c 4 \u0431\u0438\u0442 \t\t\tdelay_us(40); \t\t\tsendByte(DISPLAY_OFF, 0); \/\/ \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \t\t\tdelay_us(40); \t\t\tsendByte(CLEAR_DISPLAY, 0); \/\/ \u043e\u0447\u0438\u0449\u0430\u0435\u043c \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \t\t\tdelay_ms(2); \t\t\tsendByte(ENTRY_MODE_SET, 0); \/\/\u0441\u0442\u0430\u0432\u0438\u043c \u0440\u0435\u0436\u0438\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u044d\u043a\u0440\u0430\u043d \u043d\u0435 \u0441\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \t\t\tdelay_us(40); \t\t\tsendByte(DISPLAY_ON, 0);\/\/ \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u0438 \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u043a\u0443\u0440\u0441\u043e\u0440 \t\t\tdelay_us(40);   \treturn ; } <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e void sendByte(char byte, int isData). \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. \u041e\u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435 \u0438\u0437 \u0434\u0430\u0442\u0430\u0448\u0438\u0442\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fd\/dm\/tw\/fddmtw0k0yriy6b3_gs0imb1xno.png\" alt=\"image\"\/><\/p>\n<pre><code class=\"cpp\"> void sendByte(char byte, int isData){  \t\/\/\u043e\u0431\u043d\u0443\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u043f\u0438\u043d\u044b \u0434\u0438\u0441\u043f\u043b\u0435\u044f \tLCD_ODR &= ~LCD_PIN_MASK;  \tif(isData == 1) LCD_ODR |= PIN_RS; \/\/ \u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c RS \t\telse LCD_ODR &= ~(PIN_RS);\t\t   \/\/ \u0438\u043d\u0430\u0447\u0435 \u0441\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u043c RS        \tLCD_ODR |= PIN_EN; \/\/ \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c \u043f\u0438\u043d E  \t\/\/ \u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0442\u0430\u0440\u0448\u0443\u044e \u0442\u0435\u0442\u0440\u0430\u0434\u0443 \u043d\u0430 \u043f\u043e\u0440\u0442  \tif(byte & 0x80) LCD_ODR |= PIN_D7; \tif(byte & 0x40) LCD_ODR |= PIN_D6; \tif(byte & 0x20) LCD_ODR |= PIN_D5; \tif(byte & 0x10) LCD_ODR |= PIN_D4; \t \tLCD_ODR &= ~PIN_EN; \/\/ \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0438\u043d \u0415  \tLCD_ODR &= ~(LCD_PIN_MASK & ~PIN_RS);\/\/\u043e\u0431\u043d\u0443\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u043f\u0438\u043d\u044b \u0434\u0438\u0441\u043f\u043b\u0435\u044f \u043a\u0440\u043e\u043c\u0435 RS       \tLCD_ODR |= PIN_EN;\/\/ \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c \u043f\u0438\u043d E  \t\/\/ \u0441\u0442\u0430\u0432\u0438\u043c \u043c\u043b\u0430\u0434\u0448\u0443\u044e \u0442\u0435\u0442\u0440\u0430\u0434\u0443 \u043d\u0430 \u043f\u043e\u0440\u0442 \tif(byte & 0x8) LCD_ODR |= PIN_D7; \tif(byte & 0x4) LCD_ODR |= PIN_D6; \tif(byte & 0x2) LCD_ODR |= PIN_D5; \tif(byte & 0x1) LCD_ODR |= PIN_D4; \t \tLCD_ODR &= ~(PIN_EN);\/\/ \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0438\u043d \u0415 \tdelay_us(40);   \treturn; } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0443\u043c\u0435\u0435\u043c \u043e\u0442\u0441\u044b\u043b\u0430\u0442\u044c \u0431\u0430\u0439\u0442 \u043d\u0430 \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u043f\u043e 4-\u0431\u0438\u0442\u043d\u043e\u0439 \u0448\u0438\u043d\u0435. \u042d\u0442\u0438\u043c \u0431\u0430\u0439\u0442\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0442\u0430\u043a \u0438 \u0441\u0438\u043c\u0432\u043e\u043b. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 isData. \u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<p>  \u0414\u0438\u0441\u043f\u043b\u0435\u0439 2004A \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 4 \u0441\u0442\u0440\u043e\u043a \u043f\u043e 20 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0447\u0442\u043e \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438. \u0414\u0430\u0431\u044b \u043d\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0435\u0437\u043a\u0443 \u0441\u0442\u0440\u043e\u043a \u0434\u043e 20 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0435\u0435 \u0432\u044b\u0432\u0435\u0441\u0442\u0438. <\/p>\n<p>  \u0414\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043f\u0430\u043c\u044f\u0442\u044c DDRAM. \u0410\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044f DDRAM \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/7j\/z4\/na\/7jz4nal-vf-3o2gp4yfl9mjdr2q.png\" alt=\"image\"\/><\/p>\n<pre><code class=\"cpp\"> void sendStr(char *str, int row ){  \tchar start_address;  \tswitch (row) {  \tcase 1: \t\tstart_address = 0x0; \/\/ 1 \u0441\u0442\u0440\u043e\u043a\u0430 \t\tbreak;  \tcase 2: \t\tstart_address = 0x40; \/\/ 2 \u0441\u0442\u0440\u043e\u043a\u0430 \t\tbreak;  \tcase 3: \t\tstart_address = 0x14; \/\/ 3 \u0441\u0442\u0440\u043e\u043a\u0430 \t\tbreak;  \tcase 4: \t\tstart_address = 0x54; \/\/ 4 \u0441\u0442\u0440\u043e\u043a\u0430 \t\tbreak;  \t}  \tsendByte((start_address |= SET_DDRAM_ADDRESS), 0); \/\/ \u0441\u0442\u0430\u0432\u0438\u043c \u043a\u0443\u0440\u0441\u043e\u0440 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u043d\u0443\u0436\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438  \u0432 DDRAM  \tdelay_ms(4); \twhile(*str != '\\0'){\/\/ \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b\u0438 \u043a\u043e\u043d\u0435\u0446 \u0441\u0442\u0440\u043e\u043a\u0438  \t\tsendByte(*str, 1); \t\tstr++; \t\t  \t}\/\/ while } <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0434\u0438\u0441\u043f\u043b\u0435\u044f \u0433\u043e\u0442\u043e\u0432\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0430\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 main() \u043f\u0438\u0448\u0435\u043c:<\/p>\n<pre><code class=\"cpp\"> portInit();\/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0440\u0442\u043e\u0432 \u043f\u043e\u0434 \u0434\u0438\u0441\u043f\u043b\u0435\u0439  \tsendStr(&quot;    HELLO, HABR&quot;, 1); \tsendStr(&quot;     powered by&quot;, 2); \tsendStr(&quot;   STM32F103C8T6&quot;, 3); \tsendStr(&quot;Nibiru&quot;, 4); <\/code><\/pre>\n<p>  \u0418 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zb\/c4\/x6\/zbc4x64lhoytxyjrcmkrdsbldrk.jpeg\" alt=\"image\"\/><\/p>\n<p>  \u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u043e\u043b\u043d\u044b\u0439 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">lcd_20x4.h<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\"> #ifndef LCD_LCD_20X4_2004A_LCD_20X4_H_ #define LCD_LCD_20X4_2004A_LCD_20X4_H_  #include &quot;stm32f1xx.h&quot; #include &quot;delay.h&quot;  \/\/ display commands  #define CLEAR_DISPLAY 0x1 #define RETURN_HOME 0x2 #define ENTRY_MODE_SET 0x6 \/\/ mode cursor shift rihgt, display non shift #define DISPLAY_ON 0xC \/\/ non cursor #define DISPLAY_OFF 0x8 #define CURSOR_SHIFT_LEFT 0x10 #define CURSOR_SHIFT_RIGHT 0x14 #define DISPLAY_SHIFT_LEFT 0x18 #define DISPLAY_SHIFT_RIGHT 0x1C #define DATA_BUS_4BIT_PAGE0 0x28 #define DATA_BUS_4BIT_PAGE1 0x2A #define DATA_BUS_8BIT_PAGE0 0x38 #define SET_CGRAM_ADDRESS 0x40 \/\/ usage address |= SET_CGRAM_ADDRESS #define SET_DDRAM_ADDRESS 0x80   \/\/ \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0438\u0442\u043e\u0432 \u0432 \u043f\u043e\u0440\u0442\u0435 ODR #define PIN_RS 0x1 #define PIN_EN 0x2 #define PIN_D7 0x80 #define PIN_D6 0x40 #define PIN_D5 0x20 #define PIN_D4 0x400    #define     LCD_PORT               \tGPIOB #define\t\tLCD_ODR \t\t\t\tLCD_PORT-&gt;ODR  #define     LCD_PIN_RS()     \t\tLCD_PORT-&gt;CRL &= ~GPIO_CRL_CNF0; \\ \t\t\t\t\t\t\t\t\tLCD_PORT-&gt;CRL |= GPIO_CRL_MODE0;    \/\/ PB0  \u0432\u044b\u0445\u043e\u0434 \u0442\u044f\u043d\u0438-\u0442\u043e\u043b\u043a\u0430\u0439, \u0447\u0430\u0441\u0442\u043e\u0442\u0430 50 \u041c\u0433\u0446  #define     LCD_PIN_EN()            LCD_PORT-&gt;CRL &= ~GPIO_CRL_CNF1;\\ \t\t\t\t\t\t\t\t\tLCD_PORT-&gt;CRL |= GPIO_CRL_MODE1;        \/\/ PB1  #define     LCD_PIN_D7()            LCD_PORT-&gt;CRL &= ~GPIO_CRL_CNF7;\\ \t\t\t\t\t\t\t\t\tLCD_PORT-&gt;CRL |= GPIO_CRL_MODE7;          \/\/ PB7  #define     LCD_PIN_D6()            LCD_PORT-&gt;CRL &= ~GPIO_CRL_CNF6;\\ \t\t\t\t\t\t\t\t\tLCD_PORT-&gt;CRL |= GPIO_CRL_MODE6;       \/\/ PB6  #define     LCD_PIN_D5()            LCD_PORT-&gt;CRL &= ~GPIO_CRL_CNF5;\\ \t\t\t\t\t\t\t\t\tLCD_PORT-&gt;CRL |= GPIO_CRL_MODE5;         \/\/ PB5  #define     LCD_PIN_D4()            LCD_PORT-&gt;CRH &= ~GPIO_CRH_CNF10;\\ \t\t\t\t\t\t\t\t\tLCD_PORT-&gt;CRH |= GPIO_CRH_MODE10;         \/\/ PB10  #define     LCD_PIN_MASK   (PIN_RS | PIN_EN | PIN_D7 | PIN_D6 | PIN_D5 | PIN_D4) \/\/ 0b0000000011110011 \u043c\u0430\u0441\u043a\u0430 \u043f\u0438\u043d\u043e\u0432 \u0434\u043b\u044f \u044d\u043a\u0440\u0430\u043d\u0430  void portInit(void); \/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u043e\u0436\u0435\u043a \u043f\u043e\u0440\u0442\u0430 \u043f\u043e\u0434 \u044d\u043a\u0440\u0430\u043d void sendByte(char byte, int isData); void lcdInit(void); \/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0438\u0441\u043f\u043b\u0435\u044f void sendStr(char *str, int row ); \/\/ \u0432\u044b\u0432\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438  #endif \/* LCD_LCD_20X4_2004A_LCD_20X4_H_ *\/ <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">lcd_20x4.c<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\"> #include &quot;lcd_20x4.h&quot;  \/\/ \u043f\u043e\u0441\u044b\u043b\u043a\u0430 \u0431\u0430\u0439\u0442\u0430 \u0432 \u043f\u043e\u0440\u0442 LCD  void sendByte(char byte, int isData){  \t\/\/\u043e\u0431\u043d\u0443\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u043f\u0438\u043d\u044b \u0434\u0438\u0441\u043f\u043b\u0435\u044f \tLCD_ODR &= ~LCD_PIN_MASK;  \tif(isData == 1) LCD_ODR |= PIN_RS; \/\/ \u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0442\u0430\u0432\u043c\u0438\u043c RS \t\telse LCD_ODR &= ~(PIN_RS);\t\t   \/\/ \u0438\u043d\u0430\u0447\u0435 \u0441\u043a\u0438\u0434\u044b\u0432\u0430\u0435\u043c RS  \t\/\/ \u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0442\u0430\u0440\u0448\u0443\u044e \u0442\u0435\u0442\u0440\u0430\u0434\u0443 \u043d\u0430 \u043f\u043e\u0440\u0442 \tif(byte & 0x80) LCD_ODR |= PIN_D7; \tif(byte & 0x40) LCD_ODR |= PIN_D6; \tif(byte & 0x20) LCD_ODR |= PIN_D5; \tif(byte & 0x10) LCD_ODR |= PIN_D4;  \t\/\/ \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c \u043f\u0438\u043d E \tLCD_ODR |= PIN_EN; \tLCD_ODR &= ~PIN_EN; \/\/ \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0438\u043d \u0415  \t\/\/\u043e\u0431\u043d\u0443\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u043f\u0438\u043d\u044b \u0434\u0438\u0441\u043f\u043b\u0435\u044f \u043a\u0440\u043e\u043c\u0435 RS  \tLCD_ODR &= ~(LCD_PIN_MASK & ~PIN_RS);  \t\/\/ \u0441\u0442\u0430\u0432\u0438\u043c \u043c\u043b\u0430\u0434\u0448\u0443\u044e \u0442\u0435\u0442\u0440\u0430\u0434\u0443 \u043d\u0430 \u043f\u043e\u0440\u0442 \tif(byte & 0x8) LCD_ODR |= PIN_D7; \tif(byte & 0x4) LCD_ODR |= PIN_D6; \tif(byte & 0x2) LCD_ODR |= PIN_D5; \tif(byte & 0x1) LCD_ODR |= PIN_D4;  \t\/\/ \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c \u043f\u0438\u043d E  \tLCD_ODR |= PIN_EN; \t\/\/delay_us(10);  \t\/\/ \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0438\u043d \u0415  \tLCD_ODR &= ~(PIN_EN); \tdelay_us(40);   \treturn; }  \/\/ \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0442\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0440\u0442 \u043f\u043e\u0434 \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u0438 \u0437\u0430\u0434\u0430\u0435\u0442 \u043f\u0438\u043d\u044b \u043d\u0430 \u0432\u044b\u0445\u043e\u0434 \u0442\u044f\u043d\u0438 \u0442\u043e\u043b\u043a\u0430\u0439 \u0438 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 50 \u041c\u0433\u0446  void portInit(void){  \/\/----------------------\u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0442\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0440\u0442\u0430----------------------------------------------------  \tif(LCD_PORT == GPIOB) RCC-&gt;APB2ENR |= RCC_APB2ENR_IOPBEN; \telse if (LCD_PORT == GPIOA) RCC-&gt;APB2ENR |= RCC_APB2ENR_IOPAEN; \telse return;  \/\/--------------------- \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0438\u043d\u043e\u0432 \u0434\u043b\u044f LCD-----------------------------------------------------  \t\tLCD_PIN_RS(); \t\tLCD_PIN_EN(); \t\tLCD_PIN_D7(); \t\tLCD_PIN_D6(); \t\tLCD_PIN_D5(); \t\tLCD_PIN_D4();  \t\tlcdInit();  \treturn ; }  \/\/--------------------- \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0438\u0441\u043f\u043b\u0435\u044f----------------------------------------------------------- void lcdInit(void){  \t\t\tdelay_ms(15); \/\/ \u0436\u0434\u0435\u043c \u043f\u043e\u043a\u0430 \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0438\u0442\u0430\u043d\u0438\u0435  \t\t\tsendByte(0x33, 0); \/\/ \u0448\u043b\u0435\u043c \u0432 \u043e\u0434\u043d\u043e\u043c \u0431\u0430\u0439\u0442\u0435 \u0434\u0432\u0430 0011 \t\t\tdelay_us(100);  \t\t\tsendByte(0x32, 0); \/\/ \u0448\u043b\u0435\u043c \u0432 \u043e\u0434\u043d\u043e\u043c \u0431\u0430\u0439\u0442\u0435  00110010 \t\t\tdelay_us(40);  \t\t\tsendByte(DATA_BUS_4BIT_PAGE0, 0); \/\/ \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0440\u0435\u0436\u0438\u043c 4 \u0431\u0438\u0442 \t\t\tdelay_us(40); \t\t\tsendByte(DISPLAY_OFF, 0); \/\/ \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \t\t\tdelay_us(40); \t\t\tsendByte(CLEAR_DISPLAY, 0); \/\/ \u043e\u0447\u0438\u0449\u0430\u0435\u043c \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \t\t\tdelay_ms(2); \t\t\tsendByte(ENTRY_MODE_SET, 0); \/\/\u0441\u0442\u0430\u0432\u0438\u043c \u0440\u0435\u0436\u0438\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u044d\u043a\u0440\u0430\u043d \u043d\u0435 \u0441\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \t\t\tdelay_us(40); \t\t\tsendByte(DISPLAY_ON, 0);\/\/ \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u0438 \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u043a\u0443\u0440\u0441\u043e\u0440 \t\t\tdelay_us(40);   \treturn ; }  void sendStr(char *str, int row ){  \tchar start_address;  \tswitch (row) {  \tcase 1: \t\tstart_address = 0x0; \/\/ 1 \u0441\u0442\u0440\u043e\u043a\u0430 \t\tbreak;  \tcase 2: \t\tstart_address = 0x40; \/\/ 2 \u0441\u0442\u0440\u043e\u043a\u0430 \t\tbreak;  \tcase 3: \t\tstart_address = 0x14; \/\/ 3 \u0441\u0442\u0440\u043e\u043a\u0430 \t\tbreak;  \tcase 4: \t\tstart_address = 0x54; \/\/ 4 \u0441\u0442\u0440\u043e\u043a\u0430 \t\tbreak;  \t}  \tsendByte((start_address |= SET_DDRAM_ADDRESS), 0); \/\/ \u0441\u0442\u0430\u0432\u0438\u043c \u043a\u0443\u0440\u0441\u043e\u0440 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u043d\u0443\u0436\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438  \u0432 DDRAM  \tdelay_ms(4); \twhile(*str != '\\0'){  \t\tsendByte(*str, 1); \t\tstr++; \t\t\/\/delay_ms(100);  \t}\/\/ while }  <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/522938\/\"> https:\/\/habr.com\/ru\/post\/522938\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/522938\/\">\u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c STM32 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u044b \u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 LCD \u0434\u0438\u0441\u043f\u043b\u0435\u0435\u043c. \u0418\u0437 \u0434\u0438\u0441\u043f\u043b\u0435\u0435\u0432 \u043d\u0430\u0448\u0435\u043b \u0443 \u0441\u0435\u0431\u044f \u0442\u043e\u043b\u044c\u043a\u043e 2004A, \u043f\u0440\u0438\u0447\u0435\u043c \u0431\u0435\u0437 I2C \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u041e \u043d\u0435\u043c \u0438 \u043f\u043e\u0439\u0434\u0435\u0442 \u0440\u0435\u0447\u044c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043e \u0441\u0445\u0435\u043c\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mx\/dm\/5m\/mxdm5mirxtyr8w-og4g_wd9tppo.png\" alt=\"image\"\/><\/p>\n<p>  PB0 \u2014 PB7 \u2014 \u0432\u044b\u0432\u043e\u0434\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-311290","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/311290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=311290"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/311290\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=311290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=311290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=311290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}