font6x8.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /**
  2. * SSD1306xLED - Library for the SSD1306 based OLED/PLED 128x64 displays
  3. *
  4. * @author Neven Boyanov
  5. *
  6. * This is part of the Tinusaur/SSD1306xLED project.
  7. *
  8. * Copyright (c) 2018 Neven Boyanov, The Tinusaur Team. All Rights Reserved.
  9. * Distributed as open source software under MIT License, see LICENSE.txt file.
  10. * Retain in your source code the link http://tinusaur.org to the Tinusaur project.
  11. *
  12. * Source code available at: https://bitbucket.org/tinusaur/ssd1306xled
  13. *
  14. */
  15. // ============================================================================
  16. #if defined(__GNUC__)
  17. #include <avr/pgmspace.h>
  18. #elif defined(__ICCAVR__)
  19. # include <ioavr.h>
  20. # include <intrinsics.h>
  21. # include <stdint.h>
  22. #define PROGMEM __flash
  23. #define pgm_read_byte(a) (*(unsigned char __flash *)(a))
  24. #define pgm_read_word(a) (*(unsigned __flash *)(a))
  25. #endif
  26. // ----------------------------------------------------------------------------
  27. /* Standard ASCII 6x8 font */
  28. const uint8_t PROGMEM ssd1306xled_font6x8data [] = {
  29. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // sp
  30. 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, // !
  31. 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, // "
  32. 0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14, // #
  33. 0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12, // $
  34. 0x00, 0x62, 0x64, 0x08, 0x13, 0x23, // %
  35. 0x00, 0x36, 0x49, 0x55, 0x22, 0x50, // &
  36. 0x00, 0x00, 0x05, 0x03, 0x00, 0x00, // '
  37. 0x00, 0x00, 0x1c, 0x22, 0x41, 0x00, // (
  38. 0x00, 0x00, 0x41, 0x22, 0x1c, 0x00, // )
  39. 0x00, 0x14, 0x08, 0x3E, 0x08, 0x14, // *
  40. 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, // +
  41. 0x00, 0x00, 0x00, 0xA0, 0x60, 0x00, // ,
  42. 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, // -
  43. 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, // .
  44. 0x00, 0x20, 0x10, 0x08, 0x04, 0x02, // /
  45. 0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E, // 0
  46. 0x00, 0x00, 0x42, 0x7F, 0x40, 0x00, // 1
  47. 0x00, 0x42, 0x61, 0x51, 0x49, 0x46, // 2
  48. 0x00, 0x21, 0x41, 0x45, 0x4B, 0x31, // 3
  49. 0x00, 0x18, 0x14, 0x12, 0x7F, 0x10, // 4
  50. 0x00, 0x27, 0x45, 0x45, 0x45, 0x39, // 5
  51. 0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30, // 6
  52. 0x00, 0x01, 0x71, 0x09, 0x05, 0x03, // 7
  53. 0x00, 0x36, 0x49, 0x49, 0x49, 0x36, // 8
  54. 0x00, 0x06, 0x49, 0x49, 0x29, 0x1E, // 9
  55. 0x00, 0x00, 0x36, 0x36, 0x00, 0x00, // :
  56. 0x00, 0x00, 0x56, 0x36, 0x00, 0x00, // ;
  57. 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, // <
  58. 0x00, 0x14, 0x14, 0x14, 0x14, 0x14, // =
  59. 0x00, 0x00, 0x41, 0x22, 0x14, 0x08, // >
  60. 0x00, 0x02, 0x01, 0x51, 0x09, 0x06, // ?
  61. 0x00, 0x32, 0x49, 0x59, 0x51, 0x3E, // @
  62. 0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C, // A
  63. 0x00, 0x7F, 0x49, 0x49, 0x49, 0x36, // B
  64. 0x00, 0x3E, 0x41, 0x41, 0x41, 0x22, // C
  65. 0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C, // D
  66. 0x00, 0x7F, 0x49, 0x49, 0x49, 0x41, // E
  67. 0x00, 0x7F, 0x09, 0x09, 0x09, 0x01, // F
  68. 0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A, // G
  69. 0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F, // H
  70. 0x00, 0x00, 0x41, 0x7F, 0x41, 0x00, // I
  71. 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01, // J
  72. 0x00, 0x7F, 0x08, 0x14, 0x22, 0x41, // K
  73. 0x00, 0x7F, 0x40, 0x40, 0x40, 0x40, // L
  74. 0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F, // M
  75. 0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F, // N
  76. 0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E, // O
  77. 0x00, 0x7F, 0x09, 0x09, 0x09, 0x06, // P
  78. 0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E, // Q
  79. 0x00, 0x7F, 0x09, 0x19, 0x29, 0x46, // R
  80. 0x00, 0x46, 0x49, 0x49, 0x49, 0x31, // S
  81. 0x00, 0x01, 0x01, 0x7F, 0x01, 0x01, // T
  82. 0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F, // U
  83. 0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F, // V
  84. 0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F, // W
  85. 0x00, 0x63, 0x14, 0x08, 0x14, 0x63, // X
  86. 0x00, 0x07, 0x08, 0x70, 0x08, 0x07, // Y
  87. 0x00, 0x61, 0x51, 0x49, 0x45, 0x43, // Z
  88. 0x00, 0x00, 0x7F, 0x41, 0x41, 0x00, // [
  89. 0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55, // 55
  90. 0x00, 0x00, 0x41, 0x41, 0x7F, 0x00, // ]
  91. 0x00, 0x04, 0x02, 0x01, 0x02, 0x04, // ^
  92. 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, // _
  93. 0x00, 0x00, 0x01, 0x02, 0x04, 0x00, // '
  94. 0x00, 0x20, 0x54, 0x54, 0x54, 0x78, // a
  95. 0x00, 0x7F, 0x48, 0x44, 0x44, 0x38, // b
  96. 0x00, 0x38, 0x44, 0x44, 0x44, 0x20, // c
  97. 0x00, 0x38, 0x44, 0x44, 0x48, 0x7F, // d
  98. 0x00, 0x38, 0x54, 0x54, 0x54, 0x18, // e
  99. 0x00, 0x08, 0x7E, 0x09, 0x01, 0x02, // f
  100. 0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C, // g
  101. 0x00, 0x7F, 0x08, 0x04, 0x04, 0x78, // h
  102. 0x00, 0x00, 0x44, 0x7D, 0x40, 0x00, // i
  103. 0x00, 0x40, 0x80, 0x84, 0x7D, 0x00, // j
  104. 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00, // k
  105. 0x00, 0x00, 0x41, 0x7F, 0x40, 0x00, // l
  106. 0x00, 0x7C, 0x04, 0x18, 0x04, 0x78, // m
  107. 0x00, 0x7C, 0x08, 0x04, 0x04, 0x78, // n
  108. 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, // o
  109. 0x00, 0xFC, 0x24, 0x24, 0x24, 0x18, // p
  110. 0x00, 0x18, 0x24, 0x24, 0x18, 0xFC, // q
  111. 0x00, 0x7C, 0x08, 0x04, 0x04, 0x08, // r
  112. 0x00, 0x48, 0x54, 0x54, 0x54, 0x20, // s
  113. 0x00, 0x04, 0x3F, 0x44, 0x40, 0x20, // t
  114. 0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C, // u
  115. 0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C, // v
  116. 0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C, // w
  117. 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, // x
  118. 0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C, // y
  119. 0x00, 0x44, 0x64, 0x54, 0x4C, 0x44, // z
  120. 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, // horiz lines
  121. };
  122. // ============================================================================