Ynt: Baştan Sona STM32F0 Discovery Uygulamaları

Başlatan MrDarK, 08 Nisan 2015, 23:29:35

baran123

#30
Merhaba arkadaşlar,

Bugün SPI hakkında öğrendiklerimi paylaşacağım. :) Bir aksaklık oldu biraz geciktirdim bu sefer çünkü SPI

öğrenmişken OLED Display çalıştırayım dedim fakat aksaklıklar oldu sağ olsun Fırat ağabey biraz önce bir hatamı

düzeltti :) Bu arada OLED LCD diye de söyleniyor sanırım ama aslında şu şekildeymiş :

LCD  = Liquid Crystal Display(Sıvı Kristal Ekran)
OLED = Organik LED, Display benim gibi karıştırmamakta fayda var :)

SPI bildiğimiz üzere minimum 3 kablolu bir iletişim türüdür.Ama donanımsa olarak CS pini de  bulunuyor.Temelde 4 pin

Eğer tek cihaz var ise CS pini LOW da tutulabilir.Master ve Slave olarak inceleyelim bu örneği.STM32F0 Master, OLED

Display Slave konumunda.

SPI pinleri şu şekildedir :

MOSI = Master Out Slave In (Master çıkış slave giriş, masterdan data gönder slave al) TX
MISO = Master In Slave Out (Master giriş slave çıkış, master al slave gönder) RX gibi düşünülebilir
SCK  = Serial Clock

CS'den 0 seviyesine çekilir.Aktif kullanımı bu. Pull up la high konumundadır.SCK dan clock oluşur. Pinlerin çaışma

şeklini şöyle inceleyebiliriz.

0x85 = 0b 1000 0101 

CS   ----________________________________________-------   

SCK      _|-|__|-|__|-|__|-|__|-|__|-|__|-|__|-|__|-|__|-|__|-|__|-|__|-|__|-|__|-|__|-|_

MOSI --------____________________-----_____-----_________________________________________

MISO      - Geçersiz---------------------------| - Gelen Data Geçerlidir. ---------------|   

SPI data gönderme algoritması :
0101 0101

1 ise mosı 1
0 ise mosı 0
sck hıgh sonra low ver


Şimdi SPI hazırlama kısmına geçelim.
#include "stm32f0xx_conf.h"
#include "ssd1306.h"
#include "font.h"

int main(void)
{
    GPIO_InitTypeDef GPIO_InitStructure;
    SPI_InitTypeDef  SPI_InitStructure;

    RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA,ENABLE);
    RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOC,ENABLE);
    RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI1,ENABLE);

    GPIO_InitStructure.GPIO_Pin    = GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7; //5 = Sck,6 = mıso, = 7mosı
    GPIO_InitStructure.GPIO_Mode   = GPIO_Mode_AF;// Alternatif func.
    GPIO_InitStructure.GPIO_Speed  = GPIO_Speed_50MHz;
    GPIO_InitStructure.GPIO_OType  = GPIO_OType_PP;
    GPIO_InitStructure.GPIO_PuPd   = GPIO_PuPd_NOPULL;
    GPIO_Init(GPIOA,&GPIO_InitStructure);

    GPIO_PinAFConfig(GPIOA, GPIO_PinSource5, GPIO_AF_0);
    GPIO_PinAFConfig(GPIOA, GPIO_PinSource6, GPIO_AF_0); //af modda olduklarını belirtiyoruz.
    GPIO_PinAFConfig(GPIOA, GPIO_PinSource7, GPIO_AF_0);

    SPI_InitStructure.SPI_Direction         = SPI_Direction_Tx;// sadece gönder
    SPI_InitStructure.SPI_Mode              = SPI_Mode_Master;//master mod
    SPI_InitStructure.SPI_DataSize          = SPI_DataSize_8b;//datalar 8 bit şeklinde gidecek
    SPI_InitStructure.SPI_CPOL              = SPI_CPOL_High;
    SPI_InitStructure.SPI_CPHA              = SPI_CPHA_1Edge;
    SPI_InitStructure.SPI_NSS               = SPI_NSS_Soft;//yazılımsa ss(CS) chip select = slave select, ss
    SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_4; //spi bölme oranı 4
    SPI_InitStructure.SPI_FirstBit          = SPI_FirstBit_MSB; //ilk bit msb tarafından
    SPI_InitStructure.SPI_CRCPolynomial     = 7;
    SPI_Init(SPI1,&SPI_InitStructure); //spi ayarlarını yükle 
    SPI_Cmd(SPI1,ENABLE);//spi aktif 

    GPIO_InitStructure.GPIO_Mode   = GPIO_Mode_OUT; 
    GPIO_InitStructure.GPIO_OType  = GPIO_OType_PP;
    GPIO_InitStructure.GPIO_Pin    = GPIO_Pin_0 | GPIO_Pin_1;// C0 D/C pini (OLED'e özel) C1 ise CS pini
    GPIO_InitStructure.GPIO_PuPd   = GPIO_PuPd_NOPULL;
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_Init(GPIOC,&GPIO_InitStructure);

    Init_OLED();//

    Oled_SetFont(Font_6x8, 6, 8, 32, 127);

    Oled_ConstText("  [url=https://www.picproje.org]www.picproje.org[/url]", 0, 0);
    Oled_ConstText("Developer : Mr.EKREM", 0, 4);
    Oled_ConstText("  [url=https://www.picproje.org]www.picproje.org[/url]", 0, 7);

    while(1)
    {

    }
}


ssd1306.c
#include "stm32f0xx_conf.h"

#define LCD_CS_PORT                 GPIOC
#define LCD_CS_PIN                  GPIO_Pin_1
#define LCD_DC_PORT                 GPIOC
#define LCD_DC_PIN                  GPIO_Pin_0

#define PAGE0         0
#define PAGE1         1
#define PAGE2         2
#define PAGE3         3
#define PAGE4         4
#define PAGE5         5
#define PAGE6         6
#define PAGE7         7
#define FRAME_2       7
#define FRAME_3       4
#define FRAME_4       5
#define FRAME_5       0
#define FRAME_25      6
#define FRAME_64      1
#define FRAME_128     2
#define FRAME_256     3

const uint8_t *font, *font2;
uint8_t width, height, min, max;

void Init_OLED(void);
void Activate_Scroll(void);
void Deactivate_Scroll(void);
void Oled_Command(uint8_t cmd);
void Oled_WriteRam(uint8_t dat);
void Oled_Image(const uint8_t *buffer);
void Oled_FillScreen(uint8_t pattern);
void Oled_SetPointer(uint8_t seg, uint8_t pag);
void Oled_WriteChar(uint8_t c, uint8_t seg, uint8_t pag);
void Oled_Text(char *buffer, uint8_t seg, uint8_t pag);
void Oled_ConstText(const char *buffer, uint8_t seg, uint8_t pag);
void Left_HorizontalScroll(uint8_t start_page, uint8_t end_page, uint8_t set_time);
void Right_HorizontalScroll(uint8_t start_page, uint8_t end_page, uint8_t set_time);
void VerticalLeft_HorizontalScroll(uint8_t start_page, uint8_t end_page, uint8_t set_time);
void VerticalRight_HorizontalScroll(uint8_t start_page, uint8_t end_page, uint8_t set_time);
void Oled_SetFont(const uint8_t *_font, uint8_t _width, uint8_t _height, uint8_t _min, uint8_t _max);

void Init_OLED(void)
{
   Oled_Command(0xAE);
   Oled_Command(0x81);
   Oled_Command(0xCF);
   Oled_Command(0xA4);
   Oled_Command(0xA6);
   Oled_Command(0x20);
   Oled_Command(0x02);
   Oled_Command(0x00);
   Oled_Command(0x10);
   Oled_Command(0xB0);
   Oled_Command(0x40);
   Oled_Command(0xA1);
   Oled_Command(0xA8);
   Oled_Command(0x3F);
   Oled_Command(0xC8);
   Oled_Command(0xD3);
   Oled_Command(0x00);
   Oled_Command(0xDA);
   Oled_Command(0x12);
   Oled_Command(0xD5);
   Oled_Command(0x80);
   Oled_Command(0xD9);
   Oled_Command(0xF1);
   Oled_Command(0xDB);
   Oled_Command(0x40);
   Oled_Command(0x8D);
   Oled_Command(0x14);
   Oled_Command(0xAF);

   Oled_FillScreen(0x00);
}

void Oled_Command(uint8_t Command)
{
    GPIO_ResetBits(LCD_DC_PORT,LCD_DC_PIN);
    GPIO_ResetBits(LCD_CS_PORT,LCD_CS_PIN);

    SPI_SendData8(SPI1, Command);
    while (SPI1->SR & SPI_SR_BSY);

    GPIO_SetBits(LCD_CS_PORT,LCD_CS_PIN);
}

void Oled_WriteRam(uint8_t Data)
{
    GPIO_ResetBits(LCD_CS_PORT,LCD_CS_PIN);

    GPIO_SetBits(LCD_DC_PORT,LCD_DC_PIN);

    SPI_SendData8(SPI1, Data);
    while (SPI1->SR & SPI_SR_BSY);

    GPIO_SetBits(LCD_CS_PORT,LCD_CS_PIN);
}

void Oled_SetPointer(uint8_t seg, uint8_t pag)
{
   uint8_t low_column, hig_column;

   low_column = (seg & 0b00001111);
   hig_column = (seg & 0b11110000)>>4;
   hig_column = hig_column | 0b00010000;
   pag = (pag & 0b00000111);
   pag = (pag | 0b10110000);
   Oled_Command(low_column);
   Oled_Command(hig_column);
   Oled_Command(pag);
}

void Oled_SetFont(const uint8_t *_font, uint8_t _width, uint8_t _height, uint8_t _min, uint8_t _max)
{
   font2  = _font;
   width  = _width;
   height = _height / 8;
   min    = _min;
   max    = _max;
}

void Oled_WriteChar(uint8_t c, uint8_t seg, uint8_t pag)
{
   uint8_t i, j, k, l;
   uint8_t x_seg, y_pag;

   x_seg = seg;
   y_pag = pag;
   font = font2;
   k = c - min;
   l = (width * height);

   for(j = 0; j < k; j++)
   {
       for(i = 0; i < l; i++)
       {
          font++;
       }
   }

   for(i = 0; i < width; i++)
   {
      y_pag = pag;
      for(j = 0; j < height; j++)
      {
         if(x_seg < 128)
         {
            Oled_SetPointer(x_seg, y_pag);
            Oled_WriteRam(*font);
         }
         y_pag++;
         font++;
      }
      x_seg++;
   }
}

void Oled_ConstText(const char *buffer, uint8_t seg, uint8_t pag)
{
   uint8_t x_seg = seg;

   while(*buffer)
   {
      Oled_WriteChar(*buffer, x_seg, pag);
      x_seg = x_seg + width;
      buffer++;
   }
}

void Oled_Text(char *buffer, uint8_t seg, uint8_t pag)
{
   uint8_t x_seg = seg;

   while(*buffer)
   {
      Oled_WriteChar(*buffer, x_seg, pag);
      x_seg = x_seg + width;
      buffer++;
   }
}

void Oled_FillScreen(uint8_t pattern)
{
   unsigned char i, j;

   for(i = 0; i < 8; i++)
   {
      Oled_SetPointer(0, i);
      for(j = 0; j < 128; j++)
      {
         Oled_WriteRam(pattern);
      }
   }
}

void Oled_Image(const uint8_t *buffer)
{
   unsigned char i, j;

   for(i = 0; i < 8; i++)
   {
      Oled_SetPointer(0, i);
      for(j = 0; j < 128; j++)
      {
         Oled_WriteRam(*buffer);
         buffer++;
      }
   }
}

void Right_HorizontalScroll(uint8_t start_page, uint8_t end_page, uint8_t set_time)
{
   Deactivate_Scroll();
   Oled_Command(0x26);
   Oled_Command(0x00);
   Oled_Command(start_page);
   Oled_Command(set_time);
   Oled_Command(end_page);
   Oled_Command(0x00);
   Oled_Command(0xFF);
   Activate_Scroll();
}

void Left_HorizontalScroll(uint8_t start_page, uint8_t end_page, uint8_t set_time)
{
   Deactivate_Scroll();
   Oled_Command(0x27);
   Oled_Command(0x00);
   Oled_Command(start_page);
   Oled_Command(set_time);
   Oled_Command(end_page);
   Oled_Command(0x00);
   Oled_Command(0xFF);
   Activate_Scroll();
}

void VerticalRight_HorizontalScroll(uint8_t start_page, uint8_t end_page, uint8_t set_time)
{
   Deactivate_Scroll();
   Oled_Command(0x29);
   Oled_Command(0x00);
   Oled_Command(start_page);
   Oled_Command(set_time);
   Oled_Command(end_page);
   Oled_Command(0x01);
   Activate_Scroll();
}

void VerticalLeft_HorizontalScroll(uint8_t start_page, uint8_t end_page, uint8_t set_time)
{
   Deactivate_Scroll();
   Oled_Command(0x2A);
   Oled_Command(0x00);
   Oled_Command(start_page);
   Oled_Command(set_time);
   Oled_Command(end_page);
   Oled_Command(0x01);
   Activate_Scroll();
}

void Deactivate_Scroll(void)
{
   Oled_Command(0x2E);
}

void Activate_Scroll(void)
{
   Oled_Command(0x2F);
}


ssd1306.h
#ifndef SSD1306_H
#define SSD1306_H

void Init_OLED(void);
void Activate_Scroll(void);
void Deactivate_Scroll(void);
void Oled_Command(uint8_t cmd);
void Oled_WriteRam(uint8_t dat);
void Oled_Image(const uint8_t *buffer);
void Oled_FillScreen(uint8_t pattern);
void Oled_SetPointer(uint8_t seg, uint8_t pag);
void Oled_WriteChar(uint8_t c, uint8_t seg, uint8_t pag);
void Oled_Text(char *buffer, uint8_t seg, uint8_t pag);
void Oled_ConstText(const char *buffer, uint8_t seg, uint8_t pag);
void Left_HorizontalScroll(uint8_t start_page, uint8_t end_page, uint8_t set_time);
void Right_HorizontalScroll(uint8_t start_page, uint8_t end_page, uint8_t set_time);
void VerticalLeft_HorizontalScroll(uint8_t start_page, uint8_t end_page, uint8_t set_time);
void VerticalRight_HorizontalScroll(uint8_t start_page, uint8_t end_page, uint8_t set_time);
void Oled_SetFont(const uint8_t *_font, uint8_t _width, uint8_t _height, uint8_t _min, uint8_t _max);


#endif /* SSD1306_H_INCLUDED */


font.h
#ifndef FONT_H
#define FONT_H

const uint8_t Terminal12x16[2304] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // (space)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0xFE, 0x67, 0xFE, 0x67, 0xF8, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // !
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x3C, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // "
0x00, 0x00, 0x00, 0x04, 0x20, 0x3C, 0x20, 0x3F, 0xE0, 0x07, 0xFC, 0x04, 0x3C, 0x3C, 0x20, 0x3F, 0xE0, 0x07, 0xFC, 

0x04, 0x3C, 0x00, 0x20, 0x00, // #
0x00, 0x00, 0x00, 0x00, 0xF0, 0x08, 0xF8, 0x19, 0x98, 0x19, 0xFE, 0x7F, 0xFE, 0x7F, 0x98, 0x19, 0x98, 0x1F, 0x10, 

0x0F, 0x00, 0x00, 0x00, 0x00, // $
0x00, 0x00, 0x00, 0x30, 0x38, 0x38, 0x38, 0x1C, 0x38, 0x0E, 0x00, 0x07, 0x80, 0x03, 0xC0, 0x01, 0xE0, 0x38, 0x70, 

0x38, 0x38, 0x38, 0x00, 0x00, // %
0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xB8, 0x3F, 0xFC, 0x31, 0xC6, 0x21, 0xE2, 0x37, 0x3E, 0x1E, 0x1C, 0x1C, 0x00, 

0x36, 0x00, 0x22, 0x00, 0x00, // &
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x7E, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // '
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x07, 0xF8, 0x1F, 0xFC, 0x3F, 0x0E, 0x70, 0x02, 0x40, 0x02, 0x40, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // (
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x02, 0x40, 0x0E, 0x70, 0xFC, 0x3F, 0xF8, 0x1F, 0xE0, 0x07, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // )
0x00, 0x00, 0x00, 0x00, 0x98, 0x0C, 0xB8, 0x0E, 0xE0, 0x03, 0xF8, 0x0F, 0xF8, 0x0F, 0xE0, 0x03, 0xB8, 0x0E, 0x98, 

0x0C, 0x00, 0x00, 0x00, 0x00, // *
0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0xF0, 0x0F, 0xF0, 0x0F, 0x80, 0x01, 0x80, 0x01, 0x80, 

0x01, 0x00, 0x00, 0x00, 0x00, // +
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x7C, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // ,
0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 

0x01, 0x00, 0x00, 0x00, 0x00, // -
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // .
0x00, 0x00, 0x00, 0x18, 0x00, 0x1C, 0x00, 0x0E, 0x00, 0x07, 0x80, 0x03, 0xC0, 0x01, 0xE0, 0x00, 0x70, 0x00, 0x38, 

0x00, 0x1C, 0x00, 0x00, 0x00, // /
0x00, 0x00, 0xF0, 0x0F, 0xFC, 0x3F, 0x0C, 0x3C, 0x06, 0x66, 0x06, 0x63, 0x86, 0x61, 0xC6, 0x60, 0x66, 0x60, 0x3C, 

0x30, 0xFC, 0x3F, 0xF0, 0x0F, // 0
0x00, 0x00, 0x00, 0x00, 0x18, 0x60, 0x18, 0x60, 0x1C, 0x60, 0xFE, 0x7F, 0xFE, 0x7F, 0x00, 0x60, 0x00, 0x60, 0x00, 

0x60, 0x00, 0x00, 0x00, 0x00, // 1
0x00, 0x00, 0x38, 0x60, 0x3C, 0x70, 0x0E, 0x78, 0x06, 0x7C, 0x06, 0x6E, 0x06, 0x67, 0x86, 0x63, 0xC6, 0x61, 0xEE, 

0x60, 0x7C, 0x60, 0x38, 0x60, // 2
0x00, 0x00, 0x18, 0x18, 0x1C, 0x38, 0x0E, 0x70, 0x86, 0x61, 0x86, 0x61, 0x86, 0x61, 0x86, 0x61, 0x86, 0x61, 0xCE, 

0x73, 0xFC, 0x3E, 0x78, 0x1C, // 3
0x00, 0x00, 0x80, 0x07, 0xC0, 0x07, 0xE0, 0x06, 0x70, 0x06, 0x38, 0x06, 0x1C, 0x06, 0x0E, 0x06, 0xFE, 0x7F, 0xFE, 

0x7F, 0x00, 0x06, 0x00, 0x06, // 4
0x00, 0x00, 0x7E, 0x18, 0xFE, 0x38, 0xC6, 0x70, 0xC6, 0x60, 0xC6, 0x60, 0xC6, 0x60, 0xC6, 0x60, 0xC6, 0x60, 0xC6, 

0x71, 0x86, 0x3F, 0x06, 0x1F, // 5
0x00, 0x00, 0x80, 0x1F, 0xE0, 0x3F, 0xF0, 0x73, 0xB8, 0x61, 0x9C, 0x61, 0x8E, 0x61, 0x86, 0x61, 0x86, 0x61, 0x86, 

0x73, 0x00, 0x3F, 0x00, 0x1E, // 6
0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x60, 0x06, 0x78, 0x06, 0x1E, 0x86, 0x07, 0xE6, 0x01, 0x7E, 

0x00, 0x1E, 0x00, 0x06, 0x00, // 7
0x00, 0x00, 0x00, 0x1E, 0x78, 0x3F, 0xFC, 0x73, 0xCE, 0x61, 0x86, 0x61, 0x86, 0x61, 0x86, 0x61, 0xCE, 0x61, 0xFC, 

0x73, 0x78, 0x3F, 0x00, 0x1E, // C8
0x00, 0x00, 0x78, 0x00, 0xFC, 0x00, 0xCE, 0x61, 0x86, 0x61, 0x86, 0x61, 0x86, 0x71, 0x86, 0x39, 0x86, 0x1D, 0xCE, 

0x0F, 0xFC, 0x07, 0xF8, 0x01, // 9
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x1C, 0x70, 0x1C, 0x70, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // :
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x4E, 0x38, 0x7E, 0x38, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // ;
0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0xC0, 0x03, 0xE0, 0x07, 0x70, 0x0E, 0x38, 0x1C, 0x1C, 0x38, 0x0E, 0x70, 0x06, 

0x60, 0x00, 0x00, 0x00, 0x00, // <
0x00, 0x00, 0x00, 0x00, 0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 

0x06, 0x60, 0x06, 0x00, 0x00, // =
0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x0E, 0x70, 0x1C, 0x38, 0x38, 0x1C, 0x70, 0x0E, 0xE0, 0x07, 0xC0, 0x03, 0x80, 

0x01, 0x00, 0x00, 0x00, 0x00, // >
0x00, 0x00, 0x38, 0x00, 0x3C, 0x00, 0x0E, 0x00, 0x06, 0x00, 0x06, 0x6F, 0x86, 0x6F, 0xC6, 0x01, 0xEE, 0x00, 0x7C, 

0x00, 0x38, 0x00, 0x00, 0x00, // ?
0x00, 0x00, 0xF0, 0x1F, 0xFC, 0x3F, 0x0E, 0x30, 0xE6, 0x67, 0xF6, 0x6F, 0x36, 0x6C, 0xF6, 0x6F, 0xF6, 0x6F, 0x0E, 

0x6C, 0xFC, 0x07, 0xF0, 0x03, // @
0x00, 0x00, 0x00, 0x70, 0x00, 0x7E, 0xC0, 0x0F, 0xF8, 0x0D, 0x3E, 0x0C, 0x3E, 0x0C, 0xF8, 0x0D, 0xC0, 0x0F, 0x00, 

0x7E, 0x00, 0x70, 0x00, 0x00, // A
0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x86, 0x61, 0x86, 0x61, 0x86, 0x61, 0x86, 0x61, 0xCE, 0x61, 0xFC, 0x73, 0x78, 

0x3F, 0x00, 0x1E, 0x00, 0x00, // B
0x00, 0x00, 0xE0, 0x07, 0xF8, 0x1F, 0x1C, 0x38, 0x0E, 0x70, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x0E, 0x70, 0x1C, 

0x38, 0x18, 0x18, 0x00, 0x00, // C
0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x0E, 0x70, 0x1C, 0x38, 0xF8, 

0x1F, 0xE0, 0x07, 0x00, 0x00, // D
0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x86, 0x61, 0x86, 0x61, 0x86, 0x61, 0x86, 0x61, 0x86, 0x61, 0x86, 0x61, 0x06, 

0x60, 0x06, 0x60, 0x00, 0x00, // E
0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01, 0x06, 

0x00, 0x06, 0x00, 0x00, 0x00, // F
0x00, 0x00, 0xE0, 0x07, 0xF8, 0x1F, 0x1C, 0x38, 0x0E, 0x70, 0x06, 0x60, 0x86, 0x61, 0x86, 0x61, 0x86, 0x61, 0x8E, 

0x7F, 0x8C, 0x7F, 0x00, 0x00, // G
0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0xFE, 

0x7F, 0xFE, 0x7F, 0x00, 0x00, // H
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x06, 0x60, 0xFE, 0x7F, 0xFE, 0x7F, 0x06, 0x60, 0x06, 0x60, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // I
0x00, 0x00, 0x00, 0x1C, 0x00, 0x3C, 0x00, 0x70, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x70, 0xFE, 

0x3F, 0xFE, 0x0F, 0x00, 0x00, // J
0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x80, 0x01, 0xC0, 0x03, 0xE0, 0x07, 0x70, 0x0E, 0x38, 0x1C, 0x1C, 0x38, 0x0E, 

0x70, 0x06, 0x60, 0x00, 0x00, // K
0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 

0x60, 0x00, 0x60, 0x00, 0x00, // L
0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x3C, 0x00, 0xF0, 0x00, 0xC0, 0x03, 0xC0, 0x03, 0xF0, 0x00, 0x3C, 0x00, 0xFE, 

0x7F, 0xFE, 0x7F, 0x00, 0x00, // M
0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x1C, 0x00, 0x70, 0x00, 0xE0, 0x01, 0x80, 0x07, 0x00, 0x0E, 0x00, 0x38, 0xFE, 

0x7F, 0xFE, 0x7F, 0x00, 0x00, // N
0x00, 0x00, 0xE0, 0x07, 0xF8, 0x1F, 0x1C, 0x38, 0x0E, 0x70, 0x06, 0x60, 0x06, 0x60, 0x0E, 0x70, 0x1C, 0x38, 0xF8, 

0x1F, 0xE0, 0x07, 0x00, 0x00, // O
0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x8E, 0x03, 0xFC, 

0x01, 0xF8, 0x00, 0x00, 0x00, // P
0x00, 0x00, 0xE0, 0x07, 0xF8, 0x1F, 0x1C, 0x38, 0x0E, 0x70, 0x06, 0x60, 0x06, 0x6C, 0x0E, 0x7C, 0x1C, 0x38, 0xF8, 

0x7F, 0xE0, 0x67, 0x00, 0x00, // Q
0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x06, 0x03, 0x06, 0x03, 0x06, 0x07, 0x06, 0x0F, 0x06, 0x1F, 0x8E, 0x3B, 0xFC, 

0x71, 0xF8, 0x60, 0x00, 0x00, // R
0x00, 0x00, 0x78, 0x18, 0xFC, 0x38, 0xCE, 0x71, 0x86, 0x61, 0x86, 0x61, 0x86, 0x61, 0x86, 0x61, 0x8E, 0x73, 0x1C, 

0x3F, 0x18, 0x1E, 0x00, 0x00, // S
0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x06, 0x00, 0x06, 0x00, 0x06, 

0x00, 0x00, 0x00, 0x00, 0x00, // T
0x00, 0x00, 0xFE, 0x0F, 0xFE, 0x3F, 0x00, 0x70, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x70, 0xFE, 

0x3F, 0xFE, 0x0F, 0x00, 0x00, // U
0x00, 0x00, 0x0E, 0x00, 0x7E, 0x00, 0xF0, 0x03, 0x80, 0x1F, 0x00, 0x7C, 0x00, 0x7C, 0x80, 0x1F, 0xF0, 0x03, 0x7E, 

0x00, 0x0E, 0x00, 0x00, 0x00, // V
0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x00, 0x38, 0x00, 0x0C, 0x00, 0x07, 0x00, 0x07, 0x00, 0x0C, 0x00, 0x38, 0xFE, 

0x7F, 0xFE, 0x7F, 0x00, 0x00, // W
0x00, 0x00, 0x06, 0x60, 0x1E, 0x78, 0x38, 0x1C, 0x60, 0x06, 0xC0, 0x03, 0xC0, 0x03, 0x60, 0x06, 0x38, 0x1C, 0x1E, 

0x78, 0x06, 0x60, 0x00, 0x00, // X
0x00, 0x00, 0x06, 0x00, 0x1E, 0x00, 0x78, 0x00, 0xE0, 0x01, 0x80, 0x7F, 0x80, 0x7F, 0xE0, 0x01, 0x78, 0x00, 0x1E, 

0x00, 0x06, 0x00, 0x00, 0x00, // Y
0x00, 0x00, 0x06, 0x60, 0x06, 0x78, 0x06, 0x7C, 0x06, 0x66, 0x86, 0x63, 0xC6, 0x61, 0x66, 0x60, 0x3E, 0x60, 0x1E, 

0x60, 0x06, 0x60, 0x00, 0x00, // Z
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // [
0x00, 0x00, 0x1C, 0x00, 0x38, 0x00, 0x70, 0x00, 0xE0, 0x00, 0xC0, 0x01, 0x80, 0x03, 0x00, 0x07, 0x00, 0x0E, 0x00, 

0x1C, 0x00, 0x38, 0x00, 0x00, // BackSlash
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0x06, 0x60, 0xFE, 0x7F, 0xFE, 0x7F, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0xC0, 0x00, 0xE0, 0x00, 0x70, 0x00, 0x38, 0x00, 0x1C, 0x00, 0x0E, 0x00, 0x1C, 0x00, 0x38, 0x00, 0x70, 

0x00, 0xE0, 0x00, 0xC0, 0x00, //
0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 

0x60, 0x00, 0x60, 0x00, 0x00, // _
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x7E, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // `
0x00, 0x00, 0x00, 0x1C, 0x40, 0x3E, 0x60, 0x33, 0x60, 0x33, 0x60, 0x33, 0x60, 0x33, 0x60, 0x33, 0x60, 0x33, 0xE0, 

0x3F, 0xC0, 0x3F, 0x00, 0x00, // a
0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x80, 0x61, 0xC0, 0x60, 0xC0, 0x60, 0xC0, 0x60, 0xC0, 0x60, 0xC0, 0x71, 0x80, 

0x3F, 0x00, 0x1F, 0x00, 0x00, // b
0x00, 0x00, 0x80, 0x0F, 0xC0, 0x1F, 0xE0, 0x38, 0x60, 0x30, 0x60, 0x30, 0x60, 0x30, 0x60, 0x30, 0x60, 0x30, 0xC0, 

0x18, 0x80, 0x08, 0x00, 0x00, // c
0x00, 0x00, 0x00, 0x1F, 0x80, 0x3F, 0xC0, 0x71, 0xC0, 0x60, 0xC0, 0x60, 0xC0, 0x60, 0xC0, 0x61, 0x80, 0x61, 0xFE, 

0x7F, 0xFE, 0x7F, 0x00, 0x00, // d
0x00, 0x00, 0x80, 0x0F, 0xC0, 0x1F, 0xE0, 0x3B, 0x60, 0x33, 0x60, 0x33, 0x60, 0x33, 0x60, 0x33, 0x60, 0x33, 0xC0, 

0x13, 0x80, 0x01, 0x00, 0x00, // e
0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x80, 0x01, 0xF8, 0x7F, 0xFC, 0x7F, 0x8E, 0x01, 0x86, 0x01, 0x86, 0x01, 0x06, 

0x00, 0x00, 0x00, 0x00, 0x00, // f
0x00, 0x00, 0xC0, 0x01, 0xE0, 0x63, 0x70, 0x67, 0x30, 0x66, 0x30, 0x66, 0x30, 0x66, 0x30, 0x66, 0x30, 0x73, 0xF0, 

0x3F, 0xF0, 0x1F, 0x00, 0x00, // g
0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x80, 0x01, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0x80, 0x7F, 0x00, 

0x7F, 0x00, 0x00, 0x00, 0x00, // h
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0x30, 0xEC, 0x3F, 0xEC, 0x3F, 0x00, 0x30, 0x00, 0x30, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // i
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x70, 0x00, 0x60, 0x30, 0x60, 0xF6, 0x7F, 0xF6, 0x3F, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // j
0x00, 0x00, 0x00, 0x00, 0xFE, 0x7F, 0xFE, 0x7F, 0x00, 0x06, 0x00, 0x0F, 0x80, 0x1F, 0xC0, 0x39, 0xC0, 0x70, 0x00, 

0x60, 0x00, 0x00, 0x00, 0x00, // k
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x06, 0x60, 0xFE, 0x7F, 0xFE, 0x7F, 0x00, 0x60, 0x00, 0x60, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // l
0x00, 0x00, 0xE0, 0x3F, 0xC0, 0x3F, 0xE0, 0x00, 0xE0, 0x00, 0xC0, 0x3F, 0xC0, 0x3F, 0xE0, 0x00, 0xE0, 0x00, 0xC0, 

0x3F, 0x80, 0x3F, 0x00, 0x00, // m
0x00, 0x00, 0x00, 0x00, 0xE0, 0x3F, 0xE0, 0x3F, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0xE0, 0x00, 0xC0, 

0x3F, 0x80, 0x3F, 0x00, 0x00, // n
0x00, 0x00, 0x80, 0x0F, 0xC0, 0x1F, 0xE0, 0x38, 0x60, 0x30, 0x60, 0x30, 0x60, 0x30, 0x60, 0x30, 0xE0, 0x38, 0xC0, 

0x1F, 0x80, 0x0F, 0x00, 0x00, // o
0x00, 0x00, 0xF0, 0x7F, 0xF0, 0x7F, 0x30, 0x06, 0x30, 0x0C, 0x30, 0x0C, 0x30, 0x0C, 0x30, 0x0C, 0x70, 0x0E, 0xE0, 

0x07, 0xC0, 0x03, 0x00, 0x00, // p
0x00, 0x00, 0xC0, 0x03, 0xE0, 0x07, 0x70, 0x0E, 0x30, 0x0C, 0x30, 0x0C, 0x30, 0x0C, 0x30, 0x0C, 0x30, 0x06, 0xF0, 

0x7F, 0xF0, 0x7F, 0x00, 0x00, // q
0x00, 0x00, 0x00, 0x00, 0xE0, 0x3F, 0xE0, 0x3F, 0xC0, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0xE0, 

0x00, 0xC0, 0x00, 0x00, 0x00, // r
0x00, 0x00, 0x00, 0x00, 0xC0, 0x11, 0xE0, 0x33, 0x60, 0x33, 0x60, 0x33, 0x60, 0x33, 0x60, 0x33, 0x60, 0x3F, 0x40, 

0x1E, 0x00, 0x00, 0x00, 0x00, // s
0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0xFE, 0x1F, 0xFE, 0x3F, 0x60, 0x30, 0x60, 0x30, 0x60, 0x30, 0x00, 

0x30, 0x00, 0x00, 0x00, 0x00, // t
0x00, 0x00, 0xE0, 0x0F, 0xE0, 0x1F, 0x00, 0x38, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x18, 0xE0, 

0x3F, 0xE0, 0x3F, 0x00, 0x00, // u
0x00, 0x00, 0x60, 0x00, 0xE0, 0x01, 0x80, 0x07, 0x00, 0x1E, 0x00, 0x38, 0x00, 0x38, 0x00, 0x1E, 0x80, 0x07, 0xE0, 

0x01, 0x60, 0x00, 0x00, 0x00, // v
0x00, 0x00, 0xE0, 0x07, 0xE0, 0x1F, 0x00, 0x38, 0x00, 0x1C, 0xE0, 0x0F, 0xE0, 0x0F, 0x00, 0x1C, 0x00, 0x38, 0xE0, 

0x1F, 0xE0, 0x07, 0x00, 0x00, // w
0x00, 0x00, 0x60, 0x30, 0xE0, 0x38, 0xC0, 0x1D, 0x80, 0x0F, 0x00, 0x07, 0x80, 0x0F, 0xC0, 0x1D, 0xE0, 0x38, 0x60, 

0x30, 0x00, 0x00, 0x00, 0x00, // x
0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0xF0, 0x40, 0xC0, 0x73, 0x00, 0x3F, 0x00, 0x0F, 0xC0, 0x03, 0xF0, 0x00, 0x30, 

0x00, 0x00, 0x00, 0x00, 0x00, // y
0x00, 0x00, 0x60, 0x30, 0x60, 0x38, 0x60, 0x3C, 0x60, 0x36, 0x60, 0x33, 0xE0, 0x31, 0xE0, 0x30, 0x60, 0x30, 0x20, 

0x30, 0x00, 0x00, 0x00, 0x00, // z
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xC0, 0x01, 0xFC, 0x1F, 0x7E, 0x3F, 0x07, 0x70, 0x03, 0x60, 0x03, 0x60, 0x03, 

0x60, 0x00, 0x00, 0x00, 0x00, // {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x7F, 0x7E, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, // |
0x00, 0x00, 0x00, 0x00, 0x03, 0x60, 0x03, 0x60, 0x03, 0x60, 0x07, 0x70, 0x7E, 0x3F, 0xFC, 0x1F, 0xC0, 0x01, 0x80, 

0x00, 0x00, 0x00, 0x00, 0x00, // }
0x00, 0x00, 0x10, 0x00, 0x18, 0x00, 0x0C, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x18, 0x00, 0x10, 0x00, 0x18, 0x00, 0x0C, 

0x00, 0x04, 0x00, 0x00, 0x00, // ->
0x00, 0x00, 0x00, 0x0F, 0x80, 0x0F, 0xC0, 0x0C, 0x60, 0x0C, 0x30, 0x0C, 0x30, 0x0C, 0x60, 0x0C, 0xC0, 0x0C, 0x80, 

0x0F, 0x00, 0x0F, 0x00, 0x00  // <-
};

const uint8_t Font_6x8[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // (space)
0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, // !
0x00, 0x07, 0x00, 0x07, 0x00, 0x00, // "
0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, // #
0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, // $
0x23, 0x13, 0x08, 0x64, 0x62, 0x00, // %
0x36, 0x49, 0x55, 0x22, 0x50, 0x00, // &
0x00, 0x05, 0x03, 0x00, 0x00, 0x00, // '
0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, // (
0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, // )
0x08, 0x2A, 0x1C, 0x2A, 0x08, 0x00, // *
0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, // +
0x00, 0x50, 0x30, 0x00, 0x00, 0x00, // ,
0x08, 0x08, 0x08, 0x08, 0x08, 0x00, // -
0x00, 0x30, 0x30, 0x00, 0x00, 0x00, // .
0x20, 0x10, 0x08, 0x04, 0x02, 0x00, // /
0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, // 0
0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, // 1
0x42, 0x61, 0x51, 0x49, 0x46, 0x00, // 2
0x21, 0x41, 0x45, 0x4B, 0x31, 0x00, // 3
0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, // 4
0x27, 0x45, 0x45, 0x45, 0x39, 0x00, // 5
0x3C, 0x4A, 0x49, 0x49, 0x30, 0x00, // 6
0x01, 0x71, 0x09, 0x05, 0x03, 0x00, // 7
0x36, 0x49, 0x49, 0x49, 0x36, 0x00, // 8
0x06, 0x49, 0x49, 0x29, 0x1E, 0x00, // 9
0x00, 0x36, 0x36, 0x00, 0x00, 0x00, // :
0x00, 0x56, 0x36, 0x00, 0x00, 0x00, // ;
0x00, 0x08, 0x14, 0x22, 0x41, 0x00, // <
0x14, 0x14, 0x14, 0x14, 0x14, 0x00, // =
0x41, 0x22, 0x14, 0x08, 0x00, 0x00, // >
0x02, 0x01, 0x51, 0x09, 0x06, 0x00, // ?
0x32, 0x49, 0x79, 0x41, 0x3E, 0x00, // @
0x7E, 0x11, 0x11, 0x11, 0x7E, 0x00, // A
0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, // B
0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, // C
0x7F, 0x41, 0x41, 0x22, 0x1C, 0x00, // D
0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, // E
0x7F, 0x09, 0x09, 0x01, 0x01, 0x00, // F
0x3E, 0x41, 0x41, 0x51, 0x32, 0x00, // G
0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, // H
0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, // I
0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, // J
0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, // K
0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, // L
0x7F, 0x02, 0x04, 0x02, 0x7F, 0x00, // M
0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, // N
0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, // O
0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, // P
0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, // Q
0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, // R
0x46, 0x49, 0x49, 0x49, 0x31, 0x00, // S
0x01, 0x01, 0x7F, 0x01, 0x01, 0x00, // T
0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, // U
0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, // V
0x7F, 0x20, 0x18, 0x20, 0x7F, 0x00, // W
0x63, 0x14, 0x08, 0x14, 0x63, 0x00, // X
0x03, 0x04, 0x78, 0x04, 0x03, 0x00, // Y
0x61, 0x51, 0x49, 0x45, 0x43, 0x00, // Z
0x00, 0x00, 0x7F, 0x41, 0x41, 0x00, // [
0x02, 0x04, 0x08, 0x10, 0x20, 0x00, // "\"
0x41, 0x41, 0x7F, 0x00, 0x00, 0x00, // ]
0x04, 0x02, 0x01, 0x02, 0x04, 0x00, // ^
0x40, 0x40, 0x40, 0x40, 0x40, 0x00, // _
0x00, 0x01, 0x02, 0x04, 0x00, 0x00, // `
0x20, 0x54, 0x54, 0x54, 0x78, 0x00, // a
0x7F, 0x48, 0x44, 0x44, 0x38, 0x00, // b
0x38, 0x44, 0x44, 0x44, 0x20, 0x00, // c
0x38, 0x44, 0x44, 0x48, 0x7F, 0x00, // d
0x38, 0x54, 0x54, 0x54, 0x18, 0x00, // e
0x08, 0x7E, 0x09, 0x01, 0x02, 0x00, // f
0x08, 0x14, 0x54, 0x54, 0x3C, 0x00, // g
0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, // h
0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, // i
0x20, 0x40, 0x44, 0x3D, 0x00, 0x00, // j
0x00, 0x7F, 0x10, 0x28, 0x44, 0x00, // k
0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, // l
0x7C, 0x04, 0x18, 0x04, 0x78, 0x00, // m
0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, // n
0x38, 0x44, 0x44, 0x44, 0x38, 0x00, // o
0x7C, 0x14, 0x14, 0x14, 0x08, 0x00, // p
0x08, 0x14, 0x14, 0x18, 0x7C, 0x00, // q
0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, // r
0x48, 0x54, 0x54, 0x54, 0x20, 0x00, // s
0x04, 0x3F, 0x44, 0x40, 0x20, 0x00, // t
0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, // u
0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, // v
0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, // w
0x44, 0x28, 0x10, 0x28, 0x44, 0x00, // x
0x0C, 0x50, 0x50, 0x50, 0x3C, 0x00, // y
0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, // z
0x00, 0x08, 0x36, 0x41, 0x00, 0x00, // {
0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, // |
0x00, 0x41, 0x36, 0x08, 0x00, 0x00, // }
0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, // ->
0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, // <-
};

const uint8_t Segment_25x40[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 

0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 

0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char .
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char /
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xF7, 0xFF, 0x07, 0xE0, 0xFF, 0xE3, 0xFF, 

0x03, 0xC4, 0xFF, 0xC1, 0xFF, 0x11, 0x8C, 0xFF, 0x80, 0xFF, 0x18, 0x1C, 0x7F, 0x00, 0x7F, 0x1C, 0x3C, 0x00, 0x00, 

0x00, 0x1E, 0x7C, 0x00, 0x00, 0x00, 0x1F, 0x7C, 0x00, 0x00, 0x00, 0x1F, 0x7C, 0x00, 0x00, 0x00, 0x1F, 0x7C, 0x00, 

0x00, 0x00, 0x1F, 0x7C, 0x00, 0x00, 0x00, 0x1F, 0x7C, 0x00, 0x00, 0x00, 0x1F, 0x7C, 0x00, 0x00, 0x00, 0x1F, 0x7C, 

0x00, 0x00, 0x00, 0x1F, 0x7C, 0x00, 0x00, 0x00, 0x1F, 0x3C, 0x00, 0x00, 0x00, 0x1E, 0x1C, 0x7F, 0x00, 0x7F, 0x1C, 

0x8C, 0xFF, 0x80, 0xFF, 0x18, 0xC4, 0xFF, 0xC1, 0xFF, 0x11, 0xE0, 0xFF, 0xE3, 0xFF, 0x03, 0xF0, 0xFF, 0xF7, 0xFF, 

0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 0
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x7F, 0x00, 

0x80, 0xFF, 0x80, 0xFF, 0x00, 0xC0, 0xFF, 0xC1, 0xFF, 0x01, 0xE0, 0xFF, 0xE3, 0xFF, 0x03, 0xF0, 0xFF, 0xF7, 0xFF, 

0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 1
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 

0x03, 0x04, 0x00, 0xC0, 0xFF, 0x11, 0x0C, 0x00, 0x88, 0xFF, 0x18, 0x1C, 0x00, 0x1C, 0x7F, 0x1C, 0x3C, 0x00, 0x3E, 

0x00, 0x1E, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 

0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 

0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x3C, 0x00, 0x3E, 0x00, 0x1E, 0x1C, 0x7F, 0x1C, 0x00, 0x1C, 

0x8C, 0xFF, 0x08, 0x00, 0x18, 0xC4, 0xFF, 0x01, 0x00, 0x10, 0xE0, 0xFF, 0x03, 0x00, 0x00, 0xF0, 0xFF, 0x07, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 2
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x0C, 0x00, 0x08, 0x00, 0x18, 0x1C, 0x00, 0x1C, 0x00, 0x1C, 0x3C, 0x00, 0x3E, 

0x00, 0x1E, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 

0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 

0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x3C, 0x00, 0x3E, 0x00, 0x1E, 0x1C, 0x7F, 0x1C, 0x7F, 0x1C, 

0x8C, 0xFF, 0x88, 0xFF, 0x18, 0xC4, 0xFF, 0xC1, 0xFF, 0x11, 0xE0, 0xFF, 0xE3, 0xFF, 0x03, 0xF0, 0xFF, 0xF7, 0xFF, 

0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 3
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0x03, 0x00, 

0x00, 0xC0, 0xFF, 0x01, 0x00, 0x00, 0x80, 0xFF, 0x08, 0x00, 0x00, 0x00, 0x7F, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x3E, 

0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 

0x3E, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 

0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x7F, 0x1C, 0x7F, 0x00, 

0x80, 0xFF, 0x88, 0xFF, 0x00, 0xC0, 0xFF, 0xC1, 0xFF, 0x01, 0xE0, 0xFF, 0xE3, 0xFF, 0x03, 0xF0, 0xFF, 0xF7, 0xFF, 

0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 4
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0x03, 0x00, 

0x00, 0xC4, 0xFF, 0x01, 0x00, 0x10, 0x8C, 0xFF, 0x08, 0x00, 0x18, 0x1C, 0x7F, 0x1C, 0x00, 0x1C, 0x3C, 0x00, 0x3E, 

0x00, 0x1E, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 

0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 

0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x3C, 0x00, 0x3E, 0x00, 0x1E, 0x1C, 0x00, 0x1C, 0x7F, 0x1C, 

0x0C, 0x00, 0x88, 0xFF, 0x18, 0x04, 0x00, 0xC0, 0xFF, 0x11, 0x00, 0x00, 0xE0, 0xFF, 0x03, 0x00, 0x00, 0xF0, 0xFF, 

0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 5
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xF7, 0xFF, 0x07, 0xE0, 0xFF, 0xE3, 0xFF, 

0x03, 0xC0, 0xFF, 0xC1, 0xFF, 0x11, 0x80, 0xFF, 0x88, 0xFF, 0x18, 0x00, 0x7F, 0x1C, 0x7F, 0x1C, 0x00, 0x00, 0x3E, 

0x00, 0x1E, 0x00, 0x00, 0x3E, 0x00, 0x1F, 0x00, 0x00, 0x3E, 0x00, 0x1F, 0x00, 0x00, 0x3E, 0x00, 0x1F, 0x00, 0x00, 

0x3E, 0x00, 0x1F, 0x00, 0x00, 0x3E, 0x00, 0x1F, 0x00, 0x00, 0x3E, 0x00, 0x1F, 0x00, 0x00, 0x3E, 0x00, 0x1F, 0x00, 

0x00, 0x3E, 0x00, 0x1F, 0x00, 0x00, 0x3E, 0x00, 0x1F, 0x00, 0x00, 0x3E, 0x00, 0x1E, 0x00, 0x00, 0x1C, 0x7F, 0x1C, 

0x00, 0x00, 0x88, 0xFF, 0x18, 0x00, 0x00, 0xC0, 0xFF, 0x11, 0x00, 0x00, 0xE0, 0xFF, 0x03, 0x00, 0x00, 0xF0, 0xFF, 

0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 6
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 

0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 

0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7C, 

0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x7F, 0x00, 0x7F, 0x00, 

0x8C, 0xFF, 0x80, 0xFF, 0x00, 0xC4, 0xFF, 0xC1, 0xFF, 0x01, 0xE0, 0xFF, 0xE3, 0xFF, 0x03, 0xF0, 0xFF, 0xF7, 0xFF, 

0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 7
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xF7, 0xFF, 0x07, 0xE0, 0xFF, 0xE3, 0xFF, 

0x03, 0xC4, 0xFF, 0xC1, 0xFF, 0x11, 0x8C, 0xFF, 0x88, 0xFF, 0x18, 0x1C, 0x7F, 0x1C, 0x7F, 0x1C, 0x3C, 0x00, 0x3E, 

0x00, 0x1E, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 

0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x7C, 

0x00, 0x3E, 0x00, 0x1F, 0x7C, 0x00, 0x3E, 0x00, 0x1F, 0x3C, 0x00, 0x3E, 0x00, 0x1E, 0x1C, 0x7F, 0x1C, 0x7F, 0x1C, 

0x8C, 0xFF, 0x88, 0xFF, 0x18, 0xC4, 0xFF, 0xC1, 0xFF, 0x11, 0xE0, 0xFF, 0xE3, 0xFF, 0x03, 0xF0, 0xFF, 0xF7, 0xFF, 

0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 8
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0x03, 0x00, 

0x00, 0xC4, 0xFF, 0x01, 0x00, 0x00, 0x8C, 0xFF, 0x08, 0x00, 0x00, 0x1C, 0x7F, 0x1C, 0x00, 0x00, 0x3C, 0x00, 0x3E, 

0x00, 0x00, 0x7C, 0x00, 0x3E, 0x00, 0x00, 0x7C, 0x00, 0x3E, 0x00, 0x00, 0x7C, 0x00, 0x3E, 0x00, 0x00, 0x7C, 0x00, 

0x3E, 0x00, 0x00, 0x7C, 0x00, 0x3E, 0x00, 0x00, 0x7C, 0x00, 0x3E, 0x00, 0x00, 0x7C, 0x00, 0x3E, 0x00, 0x00, 0x7C, 

0x00, 0x3E, 0x00, 0x00, 0x7C, 0x00, 0x3E, 0x00, 0x00, 0x3C, 0x00, 0x3E, 0x00, 0x00, 0x1C, 0x7F, 0x1C, 0x7F, 0x00, 

0x8C, 0xFF, 0x88, 0xFF, 0x00, 0xC4, 0xFF, 0xC1, 0xFF, 0x01, 0xE0, 0xFF, 0xE3, 0xFF, 0x03, 0xF0, 0xFF, 0xF7, 0xFF, 

0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  // Code for char 9
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x0C, 0x00, 0x00, 0x00, 0x18, 0x1C, 0x00, 0x00, 0x00, 0x1C, 0x3C, 0x00, 0x00, 

0x00, 0x1E, 0x7C, 0x00, 0x00, 0x00, 0x1F, 0x7C, 0x00, 0x00, 0x00, 0x1F, 0x7C, 0x00, 0x00, 0x00, 0x1F, 0x7C, 0x00, 

0x00, 0x00, 0x1F, 0x7C, 0x00, 0x00, 0x00, 0x1F, 0x7C, 0x00, 0x00, 0x00, 0x1F, 0x7C, 0x00, 0x00, 0x00, 0x1F, 0x7C, 

0x00, 0x00, 0x00, 0x1F, 0x7C, 0x00, 0x00, 0x00, 0x1F, 0x3C, 0x00, 0x00, 0x00, 0x1E, 0x1C, 0x00, 0x00, 0x00, 0x1C, 

0x0C, 0x00, 0x00, 0x00, 0x18, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00   // Code for char :
};
#endif


Şimdiik bu kadar.
Kamera dandik olduğundan videoda bir şey gözükmez ama güzel kamera bulursam çekerim :D

mesaj birleştirme:: 03 Mayıs 2015, 19:27:51

Unutmadan SSD'nin datasheet'i : https://www.adafruit.com/datasheets/SSD1306.pdf

Bütün detaylar mevcut.Mesela sayfa 37 de

10.1.12 Set Display ON/OFF (AEh/AFh)
AEh : Display OFF
AFh : Display ON   demiş.

Oled_Command(0xAE); ile Displayi uyku moduna alabilirsiniz.

baran123

#31
Merhaba arkadaşlar bugün Usart notlarını paylaşacağım :) Örnek ve test amaçlı USB/Serial Çevirici vasıtasıyla

bilgisayar ile haberleştirdim.

Oldukça basit bir kullanımı var.Ben USART 1'i kullandım.Kod üzerinden açıkalyayım.Tabi öncelikle USART 1 pinlerini

STM32F0 da hangi pinlerde kullanabiliriz buna bir bakalım.Datasheet sayfa 34 de USART 1 'i PA9(TX), PA10(RX) olarak

kullanılabiliyormuş, ben böyle ayarladım.

#include "stm32f0xx_conf.h"
#include "main.h"

static void Init_USART(void);//Usart hazırama fonksiyon prototipi

int main(void)
{
    Init_USART();//usart hazırla

    while(1)
    {
        while(USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET);//gönderme bayrağı 0 da ise 
        USART_SendData(USART1, 'X'); // sürekli 'x' karakterini gönder
    }
}

static void Init_USART(void)
{
    USART_InitTypeDef USART_InitTypeDefStructure;//usart structure
    GPIO_InitTypeDef  GPIO_InitTypeDefStructure;
    NVIC_InitTypeDef  NVIC_InitStructure;

    RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);//a portu için clock
    RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE); //usart 1 clock

    GPIO_PinAFConfig(GPIOA, GPIO_PinSource9, GPIO_AF_1);
/* alternative func... AF_0 içinde usart 1 kullanılır demiş açıklamada ama ben denedim çalışmadı.
1 için de diyordu bu modda çalıştı ne hikmetse.*/
    GPIO_PinAFConfig(GPIOA, GPIO_PinSource10,GPIO_AF_1);

    GPIO_InitTypeDefStructure.GPIO_Mode  = GPIO_Mode_AF;
    GPIO_InitTypeDefStructure.GPIO_OType = GPIO_OType_PP;
    GPIO_InitTypeDefStructure.GPIO_Pin   = GPIO_Pin_9 | GPIO_Pin_10; //USART 1 : PA9 = TX, PA10 = RX
    GPIO_InitTypeDefStructure.GPIO_PuPd  = GPIO_PuPd_UP;//high seviyede tutulyor pull up
    GPIO_InitTypeDefStructure.GPIO_Speed = GPIO_Speed_50MHz; 
    GPIO_Init(GPIOA,&GPIO_InitTypeDefStructure);

    NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn;
    NVIC_InitStructure.NVIC_IRQChannelPriority = 0;//rx kesmesi için nvic ayarları 
    NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
    NVIC_Init(&NVIC_InitStructure);

    USART_InitTypeDefStructure.USART_BaudRate            = 9600;//baud rate 
    USART_InitTypeDefStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
    USART_InitTypeDefStructure.USART_Mode                = USART_Mode_Rx | USART_Mode_Tx;//alıcı ve verici modda 
    USART_InitTypeDefStructure.USART_Parity              = USART_Parity_No;//parity biti yok
    USART_InitTypeDefStructure.USART_StopBits            = USART_StopBits_1;//stop biti 1 
    USART_InitTypeDefStructure.USART_WordLength          = USART_WordLength_8b;//8 bitlik datalar gönderilecek
    USART_Init(USART1,&USART_InitTypeDefStructure);

    USART_Cmd(USART1,ENABLE);//usart 1 aktif

    USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);//USART 1 rx kesmesi aktif (veri geldiğin de düşülecek fonksiyon, 

stm32f00xx_it.c ve .h dosyalarını ekliyoruz projeye)

}



stm32f00xx_it.c
void USART1_IRQHandler(void)
{
    if (USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)// usart 1 rx bayrağı reset(0) değil se , veri geldi
    {
	if((char)USART_ReceiveData(USART1) == 'A')//veri alma fonskiyonu uint16 döndürüyor siz karakter kontrolü 

yapacaksanız char a çevirip sağlama alabilirsiniz
        {
            //gelen veri A karakteri ise işlem yap
        }
    }
}


Bu kadar :)

mesaj birleştirme:: 05 Mayıs 2015, 00:24:29

Dip not : stm32f00xx_it.h dosyasında isterseniz void USART1_IRQHandler(void); şeklinde prototipini tanımlayabilirsiniz.

eeburakdemir

@ Baran Ekrem hocam ben bu örneği stm32f4 disc. denemeye çalışıyorum da , 164 ün bacaklarından segmentlere sürme sırası nedir yada  bağlantılarını yazarmısınız ? pic de yaptığımız gibi 13 den itibaren a ile başlayıp sıralıyormusunuz ?
Asla pes etme...

baran123

Merhaba @eeburakdemir
Q0 - A
Q1 - B
Şeklinde bağlantı yapılıyor.

eeburakdemir

@Baran Ekrem teşekkürler , deneyeceğim ve en kısa süre içinde yazacağım. Çalıştığım için geç yazdım kusura bakma
Asla pes etme...

baran123

Estağfurullah. :) Zaten biraz ara verdik.En kısa zamanda yeni uygulamalar ve dersler ekleyeceğiz.İlgin için teşekkür ederim.

eeburakdemir

Asla pes etme...

baran123

kişisel ileti atabilirsin. :D

Sya

Hocam std library yerine stmcubemx in hal library kullansak daha kolay olmaz mı ?

baran123

Alıntı yapılan: Sya - 11 Eylül 2015, 21:46:28
Hocam std library yerine stmcubemx in hal library kullansak daha kolay olmaz mı ?
Bunu bir öğrenelim de onuda yaparız ;)

Sya


M_B

Merhabalar,
Burdaki tüm örnekleri keil ile yeniden düzenleyip derliyorum.
SPI örneğini derlerken şu şekilde hata alıyorum
Alıntı Yapssd1306.c(106): error:  #18: expected a ")"
     low_column = (seg & 0b00001111);
ssd1306.c(107): error:  #18: expected a ")"
     hig_column = (seg & 0b11110000)>>4;
ssd1306.c(108): error:  #65: expected a ";"
     hig_column = hig_column | 0b00010000;
ssd1306.c(109): error:  #18: expected a ")"
     pag = (pag & 0b00000111);
ssd1306.c(110): error:  #18: expected a ")"
     pag = (pag | 0b10110000);

Yukardaki hatada belirtilen fonksiyon ise
void Oled_SetPointer(uint8_t seg, uint8_t pag)
{
   uint8_t low_column, hig_column;

   low_column = (seg & 0b00001111);         // 106 nolu satır.
   hig_column = (seg & 0b11110000)>>4;    // 107 nolu satır.
   hig_column = hig_column | 0b00010000;
   pag = (pag & 0b00000111);
   pag = (pag | 0b10110000);                  // 110 nolu satır.
   Oled_Command(low_column);
   Oled_Command(hig_column);
   Oled_Command(pag);
}


Bu hatayı nasıl cözebilirim.
İmkanın sınırlarını görmek için imkansızı denemek lazım.                                                             Fatih Sultan Mehmet

M_B

Merhabalar;
Fonksiyonu aşağıdaki gibi düzenleyince hata mesajı gitti.
void Oled_SetPointer(uint8_t seg, uint8_t pag)
{
   uint8_t low_column, hig_column;

   low_column = (seg & 0x0F);
   hig_column = (seg & 0xF0)>>4;
   hig_column = hig_column | 0x10;
   pag = (pag & 0x07);
   pag = (pag | 0xB0);
   Oled_Command(low_column);
   Oled_Command(hig_column);
   Oled_Command(pag);
}


Peki değişen ne oldu ki
Birisinde Binary yazım diğerinde ise Hex 

İmkanın sınırlarını görmek için imkansızı denemek lazım.                                                             Fatih Sultan Mehmet

M_B

İmkanın sınırlarını görmek için imkansızı denemek lazım.                                                             Fatih Sultan Mehmet

baran123

Evet aynı derten bende muzdarip oldum hocam :)
Hex şeklinde yazınca düzeldi.

Benzer Konular (5)