{"id":296707,"date":"2020-01-03T15:00:21","date_gmt":"2020-01-03T15:00:21","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=296707"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=296707","title":{"rendered":"\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u0440\u0430\u043d\u0441\u0444\u043b\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 TFT \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u043d\u0430 SSD1283A \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e STM32"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/482610\/\">\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u041c\u043e\u0434\u0435\u043b\u044c \u0434\u0438\u0441\u043f\u043b\u0435\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f H016IT01. \u0414\u0430\u043d\u043d\u044b\u0439 \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0442\u0435\u043c, \u0447\u0442\u043e \u043e\u043d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0440\u0430\u043d\u0444\u043b\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c(transflective). \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432\u0438\u0434\u043d\u043e \u0434\u0430\u0436\u0435 \u043f\u043e\u0434 \u044f\u0440\u043a\u0438\u043c \u0441\u043e\u043b\u043d\u0446\u0435\u043c. \u0410 \u0442\u0430\u043a\u0436\u0435 \u044d\u0442\u043e \u0447\u0443\u0442\u044c \u043b\u0438 \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u044d\u0442\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u043c \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u043e\u043c \u0441\u0430\u0439\u0442\u0435.<\/p>\n<p>  \u0421\u0442\u0430\u0442\u044c\u044f \u0436\u0435 \u0443\u0432\u0438\u0434\u0435\u043b\u0430 \u0441\u0432\u0435\u0442 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443 SSD1283A \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e(\u043a\u0430\u043a \u0432 \u0440\u0443\u0441\u0441\u043a\u043e\u043c, \u0442\u0430\u043a \u0438 \u0437\u0430\u043f\u0430\u0434\u043d\u043e\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435 \u0441\u0435\u0442\u0438), \u0438 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u044f \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b. \u0412 \u0441\u0435\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0434\u0430\u0442\u0430\u0448\u0438\u0442, \u043e\u0434\u043d\u0430\u043a\u043e \u0442\u0430\u043c \u043d\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0434\u0438\u0441\u043f\u043b\u0435\u0435\u043c, \u0430 \u0438\u0437 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432. <\/p>\n<p>  \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u0442\u0438\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0438. \u042f \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u043b\u0438\u0448\u044c \u0441\u0432\u043e\u0439 \u043e\u043f\u044b\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e\u0441\u0442\u0430 \u2014 \u043f\u043e\u043c\u043e\u0447\u044c \u0432\u0441\u0435\u043c \u0442\u0435\u043c, \u043a\u0442\u043e \u0440\u0435\u0448\u0438\u043b, \u0445\u043e\u0447\u0435\u0442 \u0438\u043b\u0438 \u0437\u0430\u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u0434\u0438\u0441\u043f\u043b\u0435\u0435\u043c, \u043d\u0435 \u0431\u043e\u043b\u0435\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/p0\/gd\/1j\/p0gd1jufxnqryrfftzkjnqwaldk.png\" alt=\"image\"><br \/>  <a name=\"habracut\"><\/a><br \/>  \u0414\u0438\u0441\u043f\u043b\u0435\u0439 \u0438\u043c\u0435\u0435\u0442 8 \u0432\u044b\u0432\u043e\u0434\u043e\u0432:<\/p>\n<p>  1) GND<br \/>  2) VCC \u2014 5 \u0438\u043b\u0438 3.3V<br \/>  3) CS \u2014 SPI Chip Select<br \/>  4) RST \u2014 \u00ab0\u00bb \u2014 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0434\u0438\u0441\u043f\u043b\u0435\u0439, \u00ab1\u00bb \u2014 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442.<br \/>  5) A0\/DC \u2014 Data Command(\u00ab0\u00bb \u2014 \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u00ab1\u00bb \u2014 \u0434\u0430\u043d\u043d\u044b\u0435)<br \/>  6) SDA \u2014 SPI MOSI<br \/>  7) SCK \u2014 SPI SCK<br \/>  8) LED \u2014 \u0432\u044b\u0432\u043e\u0434 \u043f\u043e\u0434\u0446\u0432\u0435\u0442\u043a\u0438, \u043a\u0430\u043a \u0438 VCC, \u043e\u0442 3.3 \u0434\u043e 5V<\/p>\n<p>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u043f\u043e SPI, \u0432 \u044d\u0442\u043e\u043c \u043c\u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043f\u043b\u0430\u0442\u0430 discovery \u043d\u0430 stm32f407. <\/p>\n<h3>SPI<\/h3>\n<p>  \u0425\u043e\u0442\u044c \u044f \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0441 SSD1283A \u043f\u043e SPI, \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043d\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0438\u0441\u043f\u043b\u0435\u044f \u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442. SPI \u0443 \u043d\u0435\u0433\u043e \u0442\u043e\u0436\u0435 \u043d\u0435 \u043e\u0431\u044b\u0447\u043d\u044b\u0439, \u043d\u0430 \u043d\u0435\u043c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 \u043b\u0438\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 SDA. \u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u043e \u043b\u0438\u043d\u0438\u044f MOSI, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0441 \u0434\u0438\u0441\u043f\u043b\u0435\u044f \u043c\u044b \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0434\u0430\u0442\u0430\u0448\u0438\u0442.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/v1\/0r\/kj\/v10rkj930c35sxs3jaiyqrpuvsm.png\" alt=\"image\"><\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c SPI, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u0442\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c SPI1 \u0438 GPIO, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043d\u043e\u0433\u0438 SDA \u0438 SCK \u043a\u0430\u043a \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e(MISO \u044f \u0442\u043e\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e). \u0420\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043a\u0430\u043a \u043e\u0434\u043d\u043e\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0447\u0438\u043a \u043c\u0430\u0441\u0442\u0435\u0440.<\/p>\n<pre><code class=\"cpp\">BIT_BAND_PER(RCC-&gt;AHB1ENR ,RCC_AHB1ENR_GPIOAEN) = true;   if(SPI_NUM::_1 == spi)   {     \/*!&lt;-------------Enable spi clocking---------------&gt;!*\/      BIT_BAND_PER(RCC-&gt;APB2ENR, RCC_APB2ENR_SPI1EN) = true;            \/*!&lt;----PA5 - SCK, PA6 - MISO, PA7 - MOSI----&gt;!*\/      GPIOA-&gt;MODER |= (GPIO_MODER_MODE5_1 | GPIO_MODER_MODE6_1 | GPIO_MODER_MODE7_1);      GPIOA-&gt;OSPEEDR |= (GPIO_OSPEEDR_OSPEED5_1 | GPIO_OSPEEDR_OSPEED7_1);      GPIOA-&gt;AFR[0] |= (GPIO_AFRL_AFSEL5_0 | GPIO_AFRL_AFSEL5_2 | GPIO_AFRL_AFSEL6_0 | GPIO_AFRL_AFSEL6_2 | GPIO_AFRL_AFSEL7_0 | GPIO_AFRL_AFSEL7_2);            \/*!&lt;-----customize SPI------&gt;!*\/      SPI1-&gt;CR1 |= (SPI_CR1_BIDIMODE | SPI_CR1_BIDIOE | SPI_CR1_SSM | SPI_CR1_SSI \/*| SPI_CR1_DFF*\/ | SPI_CR1_MSTR);       BIT_BAND_PER(SPI1-&gt;CR1 ,SPI_CR1_SPE) = true;   }<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0431\u0430\u0439\u0442\u0430 \u043f\u043e SPI:  <\/p>\n<pre><code class=\"cpp\">void stm32f407_spi::stm32f407_spi_send(uint8_t data) {   SPI1-&gt;DR = data;   while((SPI1-&gt;SR &amp; SPI_SR_BSY)) continue; }<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0442\u043e\u0431\u044b SPI \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043d\u0430\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438.<\/p>\n<h3>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0438\u0441\u043f\u043b\u0435\u044f<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0438\u0441\u043f\u043b\u0435\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 3 \u0431\u0430\u0439\u0442, \u0433\u0434\u0435 \u043e\u0434\u0438\u043d \u0431\u0430\u0439\u0442 \u2014 \u043d\u043e\u043c\u0435\u0440 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0430 \u0434\u0432\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u2014 \u0434\u0430\u043d\u043d\u044b\u0435. \u0422\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043f\u0438\u043d A0 \u043f\u0440\u0438 \u043f\u043e\u0441\u044b\u043b\u043a\u0435 \u0431\u0430\u0439\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u00ab0\u00bb, \u0430 \u043f\u0440\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u00ab1\u00bb. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u044f \u0441\u0434\u0435\u043b\u0430\u043b inline \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u0438\u043d\u043e\u0432 RST, A0 \u0438 CS \u0434\u0438\u0441\u043f\u043b\u0435\u044f.<\/p>\n<pre><code class=\"cpp\">   enum class DC : uint8_t  {   COMMAND,   DATA };  #pragma inline=forced  inline void tft_lcd_rst(bool rst) {BIT_BAND_PER(GPIOA-&gt;ODR , GPIO_ODR_OD2) = rst;} #pragma inline=forced  inline void tft_lcd_dc(DC dc) {BIT_BAND_PER(GPIOA-&gt;ODR , GPIO_ODR_OD3) = static_cast&lt;bool&gt;(dc);} #pragma inline=forced  inline void tft_lcd_cs(bool cs) {BIT_BAND_PER(GPIOA-&gt;ODR , GPIO_ODR_OD4) = cs;}<\/code><\/pre>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u043f\u043e\u0441\u044b\u043b\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"cpp\"> void tft_lcd::tft_lcd_send(uint8_t addr, uint16_t data) {   this-&gt;tft_lcd_dc(DC::COMMAND);   stm32f407_spi_send(addr);   this-&gt;tft_lcd_dc(DC::DATA);   stm32f407_spi_send(static_cast&lt;uint8_t&gt;(data &gt;&gt; 8));   stm32f407_spi_send(static_cast&lt;uint8_t&gt;(data));  }<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043f\u043e\u0434\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0432 \u0430\u0440\u0434\u0443\u0438\u043d\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">static constexpr uint8_t TFT_DELAY = 0xFF;   static constexpr t_tft_regs tft_regs[]=   {     { 0x10, 0x2F8E },     { 0x11, 0x000C },     { 0x07, 0x0021 },     { 0x28, 0x0006 },     { 0x28, 0x0005 },     { 0x27, 0x057F },     { 0x29, 0x89A1 },     { 0x00, 0x0001 },     { TFT_DELAY, 100 },     { 0x29, 0x80B0 },     { TFT_DELAY, 30 },     { 0x29, 0xFFFE },     { 0x07, 0x0223 },     { TFT_DELAY, 30 },     { 0x07, 0x0233 },     { 0x01, 0x2183 },     { 0x03, 0x6830 },     { 0x2F, 0xFFFF },     { 0x2C, 0x8000 },     { 0x27, 0x0570 },     { 0x02, 0x0300 },     { 0x0B, 0x580C },     { 0x12, 0x0609 },     { 0x13, 0x3100 },   };<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0433\u0434\u0435 TFT_DELAY \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 Sleep \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e mS. \u0415\u0441\u043b\u0438 \u043f\u043e\u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0430\u0442\u0430\u0448\u0438\u0442\u0435, \u0442\u0430\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043f\u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u043c\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e \u043c\u043d\u043e\u0433\u0438\u043c \u0430\u0434\u0440\u0435\u0441\u0430\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u0434\u0451\u0442 \u0432 \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u0442\u044b. <\/p>\n<p>  \u0414\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0434\u0430\u0434\u0438\u043c \u00ab0\u00bb \u043d\u0430 CS, \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0434\u0438\u0441\u043f\u043b\u0435\u0439(\u043f\u0438\u043d RST), \u0438 \u043f\u0440\u043e\u0439\u0434\u0451\u043c\u0441\u044f \u043f\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043a\u043e\u043c\u0430\u043d\u0434.<\/p>\n<pre><code class=\"cpp\">  tft_lcd_rst(false);   delay(5, mS);   tft_lcd_rst(true);   delay(200, mS);        this-&gt;tft_lcd_cs(false);   delay(5, mS);   \/*!&lt;--------Init display----------&gt;!*\/     for(uint8_t i = 0; i &lt; sizeof(tft_regs)\/sizeof(tft_regs[0]) ;i++)   {     (TFT_DELAY != tft_regs[i].address) ? (this-&gt;tft_lcd_send(tft_regs[i].address, tft_regs[i].value)): (delay(tft_regs[i].value, mS));   }    delay(5, mS);   this-&gt;tft_lcd_cs(true); <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0430 \u0434\u0438\u0441\u043f\u043b\u0435\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u0431\u0435\u043b\u043e\u0433\u043e \u043d\u0430 \u0441\u0435\u0440\u044b\u0439 \u0446\u0432\u0435\u0442 \u0442\u0435\u043b\u0435\u0432\u0438\u0437\u0438\u043e\u043d\u043d\u044b\u0445 \u043f\u043e\u043c\u0435\u0445.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jf\/i5\/yk\/jfi5yk1wxjfkjgukmvf3al_xlz0.jpeg\" alt=\"image\"> <\/p>\n<h3>\u0420\u0438\u0441\u0443\u0435\u043c \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a<\/h3>\n<p>  \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 SSD1283A \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430\u043c\u0438, \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f 4 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 0x44 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u043a\u043e\u043d\u0446\u0430 \u0438 \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430 \u043f\u043e \u043e\u0441\u0438 \u0430\u0431\u0441\u0446\u0438\u0441\u0441 \u0432 \u0441\u0442\u0430\u0440\u0448\u0435\u043c \u0438 \u043c\u043b\u0430\u0434\u0448\u0435\u043c \u0431\u0430\u0439\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 0x45 \u0435\u0441\u0442\u044c \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0434\u043b\u044f \u043e\u0441\u0438 \u043e\u0440\u0434\u0438\u043d\u0430\u0442. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 0x21 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438, \u0432 \u0441\u0442\u0430\u0440\u0448\u0435\u043c \u0431\u0430\u0439\u0442\u0435 \u0434\u043b\u044f y, \u0432 \u043c\u043b\u0430\u0434\u0448\u0435\u043c \u0434\u043b\u044f x. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 0x22 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0446\u0432\u0435\u0442 \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u0435\u0451 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u0434\u043b\u044f <b>\u043a\u0430\u0436\u0434\u043e\u0433\u043e<\/b> \u043f\u0438\u043a\u0441\u0435\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430. \u0422\u0430\u043a\u0436\u0435 \u0443 \u0434\u0438\u0441\u043f\u043b\u0435\u044f \u0435\u0441\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u0445\u043e\u0442\u044c \u0441\u0430\u043c \u043e\u043d \u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c 130&#215;130, \u0435\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043d\u0430\u044f \u0441\u0435\u0442\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u044b 132&#215;132, \u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u043e\u0442\u0441\u0447\u0451\u0442 \u0441 \u0442\u043e\u0447\u043a\u0438 2&#215;2.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u043c\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0445\u043e\u0442\u0438\u043c \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442 \u0447\u0451\u0440\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430 20 \u043d\u0430 20, \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 (30, 45) \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434:<\/p>\n<p>  0x44 0x3320 (30+20+2-1, 30+2)<br \/>  0x45 0x422F (45+20+2-1, 45+2)<br \/>  0x21 0x2F20<br \/>  0x22 0x0000, \u043f\u0440\u0438\u0447\u0435\u043c \u044d\u0442\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c 400(20*20) \u0440\u0430\u0437.<\/p>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a(\u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0443\u0436\u0435 \u0441\u0434\u0432\u0438\u043d\u0443\u0442\u044b \u043d\u0430 2):<\/p>\n<pre><code class=\"cpp\"> void tft_lcd::draw_rect(const t_rect&amp; rec) {   this-&gt;tft_lcd_send(0x44, ((rec.x1 - 1) &lt;&lt; 8) | rec.x0);   this-&gt;tft_lcd_send(0x45, ((rec.y1 - 1) &lt;&lt; 8) | rec.y0);   this-&gt;tft_lcd_send(0x21, (rec.y0 &lt;&lt; 8) | rec.x0);      for(uint16_t i = 0; i &lt; ((rec.x1 - rec.x0) * (rec.y1 - rec.y0)); i++)   {     this-&gt;tft_lcd_send(0x22, rec.col);   } } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0435\u0433\u043e \u0443\u0433\u043b\u043e\u0432 \u0438 \u0446\u0432\u0435\u0442. \u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043b\u0438\u0432\u043a\u0438 \u0432\u0441\u0435\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430 \u0440\u043e\u0437\u043e\u0432\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\">   t_rect rect = {0x02, 0x02, 0x84, 0x84, static_cast&lt;uint16_t&gt;(COLOUR::MAGENTA)};   this-&gt;draw_rect(rect); <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ub\/w-\/l1\/ubw-l18pd4pkgsav5k07vmx_d60.jpeg\" alt=\"image\"><\/p>\n<h3>\u0420\u0438\u0441\u0443\u0435\u043c \u0431\u0443\u043a\u0432\u044b \u0438 \u0446\u0438\u0444\u0440\u044b<\/h3>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0435\u0440\u0435\u0447\u0435\u043d\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0441 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041c\u0430\u0441\u0441\u0438\u0432\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0431\u0443\u043a\u0432 \u0438 \u0446\u0438\u0444\u0440<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\"> namespace rect_coord_lit { const t_rect_coord comma[] = {{0, 20, 5, 25}, {3, 25, 5, 28}}; const t_rect_coord dot[] = {{0, 20, 5, 25}}; const t_rect_coord space[] = {{0, 0, 0, 0}}; const t_rect_coord _0[] = {{0, 0, 15, 5},{0, 5, 5, 25},{5, 20, 15, 25},{10, 5, 15, 20}}; const t_rect_coord _1[] = {{10, 0, 15, 25}}; const t_rect_coord _2[] = {{0, 0, 15, 5},{10, 5, 15, 15},{0, 10, 10, 15},{0, 15, 5, 25},{5, 20, 15, 25}}; const t_rect_coord _3[] = {{0, 0, 15, 5},{10, 5, 15, 25},{0, 10, 10, 15},{0, 20, 10, 25}}; const t_rect_coord _4[] = {{0, 0, 5, 15},{5, 10, 10, 15},{10, 0, 15, 25}}; const t_rect_coord _5[] = {{0, 0, 15, 5},{0, 5, 5, 15},{0, 10, 15, 15},{10, 15, 15, 25},{0, 20, 10, 25}}; const t_rect_coord _6[] = {{0, 0, 15, 5},{0, 5, 5, 25},{5, 10, 10, 15},{5, 20, 10, 25},{10, 10, 15, 25}}; const t_rect_coord _7[] = {{0, 0, 15, 5},{10, 5, 15, 25}}; const t_rect_coord _8[] = {{0, 0, 15, 5},{0, 5, 5, 25},{5, 20, 15, 25},{10, 5, 15, 20},{5, 10, 10, 15}}; const t_rect_coord _9[] = {{0, 0, 15, 5},{0, 5, 5, 15},{0, 20, 15, 25},{10, 5, 15, 20},{5, 10, 10, 15}}; const t_rect_coord a[] = {{0, 10, 5, 25},{5, 5, 10, 10},{5, 15, 10, 20},{10, 10, 15, 25}}; const t_rect_coord b[] = {{0, 0, 5, 25},{5, 10, 15, 15},{10, 15, 15, 20},{5, 20, 15, 25}}; const t_rect_coord c[] = {{0, 5, 15, 10},{0, 10, 5, 20},{0, 20, 15, 25}}; const t_rect_coord d[] = {{0, 10, 10, 15},{0, 15, 5, 20},{0, 20, 10, 25}, {10, 0, 15, 25}}; const t_rect_coord e[] = {{0, 5, 15, 8}, {0, 12, 15, 15}, {0, 8, 5, 25}, {10, 8, 15, 12}, {5, 20, 15, 25}}; const t_rect_coord f[] = {{5, 5, 10, 25},{5, 0, 15, 5},{0, 10, 15, 15}}; const t_rect_coord g[] = {{0, 5, 5, 20}, {5, 5, 10, 10}, {5, 15, 10, 20}, {10, 5, 15, 30}, {0, 25, 10, 30}}; const t_rect_coord h[] = {{0, 0, 5, 25},{5, 10, 15, 15},{10, 15, 15, 25}}; const t_rect_coord i[] = {{5, 3, 10, 8},{5, 10, 10, 25}}; const t_rect_coord j[] = {{5, 3, 10, 8},{5, 10, 10, 30}, {0, 25, 5, 30}}; const t_rect_coord k[] = {{0, 0, 5, 25},{5, 15, 10, 20}, {10, 10, 15, 15}, {10, 20 , 15, 25}}; const t_rect_coord l[] = {{5, 0, 10, 25}}; const t_rect_coord m[] = {{0, 10, 4, 25},{7, 10, 10, 25}, {13, 10, 17,25}, {0, 5 , 12, 10}}; const t_rect_coord n[] = {{0, 10, 5, 25},{10, 10, 15, 25}, {0, 5 , 10, 10}}; const t_rect_coord o[] = {{0, 5, 5, 25}, {10, 5, 15, 25}, {5, 5, 10, 10}, {5, 20, 10, 25}}; const t_rect_coord p[] = {{0, 5, 5, 30}, {5, 5, 15, 10}, {5, 15, 15, 20}, {10, 10, 15, 15}}; const t_rect_coord q[] = {{0, 5, 5, 20}, {5, 5, 15, 10}, {5, 15, 15, 20}, {10, 10, 15, 30}}; const t_rect_coord r[] = {{0, 10, 5, 25},{5, 5, 15, 10}}; const t_rect_coord s[] = {{3, 5, 15, 10}, {0, 8, 5, 13}, {3, 13, 12, 17}, {10, 17, 15, 22}, {0, 20, 12, 25}}; const t_rect_coord t[] = {{5, 0, 10, 25},{0, 5, 15, 10},{10, 20, 15, 25}}; const t_rect_coord u[] = {{0, 5, 5, 25},{10, 5, 15, 25},{5, 20, 10, 25}}; const t_rect_coord v[] = {{0, 5, 5, 15}, {10, 5, 15, 15}, {1, 15, 6, 20}, {9, 15, 14, 20}, {5, 20, 10, 25}}; const t_rect_coord w[] = {{0, 5, 4, 20},{7, 5, 10, 20}, {13, 5, 17, 20}, {4, 20 , 7, 25}, {10, 20 , 13, 25}}; const t_rect_coord x[] = {{0, 5, 5, 10},{10, 5, 15, 10}, {0, 20, 5, 25}, {10, 20 , 15, 25}, {5, 10 , 10, 20}}; const t_rect_coord y[] = {{0, 5, 5, 20}, {5, 15, 10, 20}, {10, 5, 15, 30}, {0, 25, 10, 30}}; const t_rect_coord z[] = {{0, 5, 15, 10}, {10, 10, 15, 13}, {5, 12, 10, 18}, {0, 17, 5, 20}, {0, 20, 15, 25}}; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u0433\u0434\u0435 \u0441\u043e\u043e\u0442\u043d\u0435\u0441\u0435\u043c \u0441\u0430\u043c \u0441\u0438\u043c\u0432\u043e\u043b(\u0432 ascii), \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0433\u043e \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u0438 \u0435\u0433\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\"> typedef struct { \tchar lit;         uint8_t size; \tconst t_rect_coord *rec_coord; }t_rect_coord_table;  #define LITERAL_COORD(x)  sizeof(x)\/ sizeof(x[0]), x    const t_rect_coord_table rect_coord_table[] =  {   {',', LITERAL_COORD(rect_coord_lit::comma)},   {'.', LITERAL_COORD(rect_coord_lit::dot)},   {'.', LITERAL_COORD(rect_coord_lit::dot)},   {' ', LITERAL_COORD(rect_coord_lit::space)},   {'0', LITERAL_COORD(rect_coord_lit::_0)},   {'1', LITERAL_COORD(rect_coord_lit::_1)},   {'2', LITERAL_COORD(rect_coord_lit::_2)},   {'3', LITERAL_COORD(rect_coord_lit::_3)},   {'4', LITERAL_COORD(rect_coord_lit::_4)},   {'5', LITERAL_COORD(rect_coord_lit::_5)},   {'6', LITERAL_COORD(rect_coord_lit::_6)},   {'7', LITERAL_COORD(rect_coord_lit::_7)},   {'8', LITERAL_COORD(rect_coord_lit::_8)},   {'9', LITERAL_COORD(rect_coord_lit::_9)},   {'a', LITERAL_COORD(rect_coord_lit::a)},    {'b', LITERAL_COORD(rect_coord_lit::b)},   {'c', LITERAL_COORD(rect_coord_lit::c)},   {'d', LITERAL_COORD(rect_coord_lit::d)},   {'e', LITERAL_COORD(rect_coord_lit::e)},   {'f', LITERAL_COORD(rect_coord_lit::f)},   {'g', LITERAL_COORD(rect_coord_lit::g)},   {'h', LITERAL_COORD(rect_coord_lit::h)},   {'i', LITERAL_COORD(rect_coord_lit::i)},   {'j', LITERAL_COORD(rect_coord_lit::j)},   {'k', LITERAL_COORD(rect_coord_lit::k)},   {'l', LITERAL_COORD(rect_coord_lit::l)},   {'m', LITERAL_COORD(rect_coord_lit::m)},   {'n', LITERAL_COORD(rect_coord_lit::n)},   {'o', LITERAL_COORD(rect_coord_lit::o)},   {'p', LITERAL_COORD(rect_coord_lit::p)},   {'q', LITERAL_COORD(rect_coord_lit::q)},   {'r', LITERAL_COORD(rect_coord_lit::r)},   {'s', LITERAL_COORD(rect_coord_lit::s)},   {'t', LITERAL_COORD(rect_coord_lit::t)},   {'u', LITERAL_COORD(rect_coord_lit::u)},   {'v', LITERAL_COORD(rect_coord_lit::v)},   {'w', LITERAL_COORD(rect_coord_lit::w)},   {'x', LITERAL_COORD(rect_coord_lit::x)},   {'y', LITERAL_COORD(rect_coord_lit::y)},   {'z', LITERAL_COORD(rect_coord_lit::z)} }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cpp\"> void tft_lcd::draw_lit(char ch, const t_rect_coord *rect_coord, uint16_t colour, uint16_t x0, uint16_t y0, uint8_t size) {   t_rect rec = {0};   rec.col = colour;   uint8_t ctr = size;   uint8_t i = 0;    while(ctr--)   {     rec.x0 = x0 + rect_coord[i].x0;     rec.y0 = y0 + rect_coord[i].y0;     rec.x1 = x0 + rect_coord[i].x1;     rec.y1 = y0 + rect_coord[i].y1;     i++;     this-&gt;draw_rect(rec);   }       }                          void tft_lcd::draw_char(char ch, uint16_t colour, uint16_t x0, uint16_t y0) {   x0 += 2;   y0 +=2;      for(const auto &amp;field : rect_coord_table)   {     if(field.lit == ch)     {       draw_lit(ch, field.rec_coord, colour, x0, y0, field.size);     }   } } <\/code><\/pre>\n<p>  \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 draw_char \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442, \u0433\u0434\u0435 \u0446\u0438\u043a\u043b for \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u043e\u043b\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442, \u0438 \u0438\u0449\u0435\u0442 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0443. \u041f\u0440\u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u043c \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e draw_lit, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c.<\/p>\n<p>  \u041e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"cpp\"> void tft_lcd::draw_string(char *ch, COLOUR colour, uint16_t x0, uint16_t y0) {   while(*ch)   {     this-&gt;draw_char(*ch, static_cast&lt;uint16_t&gt;(colour), x0, y0);     x0+= 20;     ch++;   } } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443, \u0435\u0451 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0446\u0432\u0435\u0442. \u0414\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0431\u0443\u043a\u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u043f\u043e \u043a\u043e\u0434\u0443:<\/p>\n<pre><code class=\"cpp\">   this-&gt;draw_string(\"123456\", COLOUR::GREEN, 5, 0);   this-&gt;draw_string(\"habr,.\", COLOUR::WHITE, 5, 30);   this-&gt;draw_string(\"abcdef\", COLOUR::RED, 5, 60);   this-&gt;draw_string(\"stwxyz\", COLOUR::YELLOW, 5, 90); <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wb\/dm\/bu\/wbdmbutkcu8_pd68fgq08sx5mjq.jpeg\" alt=\"image\"><\/p>\n<p>  \u0412 \u0442\u0430\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e, \u0433\u043b\u0430\u0437 \u043d\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438.<\/p>\n<p>  \u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0445\u0441\u044f, \u043f\u043e\u043b\u043d\u044b\u0439 <a href=\"https:\/\/bitbucket.org\/i_soba\/display_ssd1283\/src\/master\/\">\u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a>.<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d() } } }t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>      <br \/> \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\/482610\/\"> https:\/\/habr.com\/ru\/post\/482610\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/482610\/\">\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u041c\u043e\u0434\u0435\u043b\u044c \u0434\u0438\u0441\u043f\u043b\u0435\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f H016IT01. \u0414\u0430\u043d\u043d\u044b\u0439 \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e \u0442\u0435\u043c, \u0447\u0442\u043e \u043e\u043d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0440\u0430\u043d\u0444\u043b\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c(transflective). \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043d\u0435\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432\u0438\u0434\u043d\u043e \u0434\u0430\u0436\u0435 \u043f\u043e\u0434 \u044f\u0440\u043a\u0438\u043c \u0441\u043e\u043b\u043d\u0446\u0435\u043c. \u0410 \u0442\u0430\u043a\u0436\u0435 \u044d\u0442\u043e \u0447\u0443\u0442\u044c \u043b\u0438 \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0441 \u044d\u0442\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u043c \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u043e\u043c \u0441\u0430\u0439\u0442\u0435.<\/p>\n<p>  \u0421\u0442\u0430\u0442\u044c\u044f \u0436\u0435 \u0443\u0432\u0438\u0434\u0435\u043b\u0430 \u0441\u0432\u0435\u0442 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443 SSD1283A \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e(\u043a\u0430\u043a \u0432 \u0440\u0443\u0441\u0441\u043a\u043e\u043c, \u0442\u0430\u043a \u0438 \u0437\u0430\u043f\u0430\u0434\u043d\u043e\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435 \u0441\u0435\u0442\u0438), \u0438 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u044f \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b. \u0412 \u0441\u0435\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0434\u0430\u0442\u0430\u0448\u0438\u0442, \u043e\u0434\u043d\u0430\u043a\u043e \u0442\u0430\u043c \u043d\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0434\u0438\u0441\u043f\u043b\u0435\u0435\u043c, \u0430 \u0438\u0437 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432. <\/p>\n<p>  \u0425\u043e\u0447\u0443 \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u0442\u0438\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0438. \u042f \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u043b\u0438\u0448\u044c \u0441\u0432\u043e\u0439 \u043e\u043f\u044b\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u043c. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e\u0441\u0442\u0430 \u2014 \u043f\u043e\u043c\u043e\u0447\u044c \u0432\u0441\u0435\u043c \u0442\u0435\u043c, \u043a\u0442\u043e \u0440\u0435\u0448\u0438\u043b, \u0445\u043e\u0447\u0435\u0442 \u0438\u043b\u0438 \u0437\u0430\u0445\u043e\u0447\u0435\u0442 \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u0434\u0438\u0441\u043f\u043b\u0435\u0435\u043c, \u043d\u0435 \u0431\u043e\u043b\u0435\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/p0\/gd\/1j\/p0gd1jufxnqryrfftzkjnqwaldk.png\" alt=\"image\">  <\/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-296707","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296707","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=296707"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296707\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=296707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=296707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=296707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}