ISO8859-1 Terminus fonts, typos fix, disable all fonts by default
This commit is contained in:
parent
8bce2d6d0b
commit
50453881e8
20 changed files with 84037 additions and 92 deletions
|
|
@ -1,3 +1,24 @@
|
|||
PROGRAM=SSD1306_fps
|
||||
PROGRAM = SSD1306_fps
|
||||
EXTRA_COMPONENTS = extras/ssd1306 extras/i2c extras/fonts
|
||||
|
||||
# include a lot of builtin fonts
|
||||
|
||||
FONTS_GLCD_5X7 = 1
|
||||
FONTS_BITOCRA_4X7 = 1
|
||||
FONTS_BITOCRA_6X11 = 1
|
||||
FONTS_BITOCRA_7X13 = 1
|
||||
FONTS_TERMINUS_6X12_ISO8859_1 = 1
|
||||
FONTS_TERMINUS_8X14_ISO8859_1 = 1
|
||||
FONTS_TERMINUS_BOLD_8X14_ISO8859_1 = 1
|
||||
FONTS_TERMINUS_10X18_ISO8859_1 = 1
|
||||
FONTS_TERMINUS_BOLD_10X18_ISO8859_1 = 1
|
||||
FONTS_TERMINUS_11X22_ISO8859_1 = 1
|
||||
FONTS_TERMINUS_BOLD_11X22_ISO8859_1 = 1
|
||||
FONTS_TERMINUS_12X24_ISO8859_1 = 1
|
||||
FONTS_TERMINUS_BOLD_12X24_ISO8859_1 = 1
|
||||
FONTS_TERMINUS_14X28_ISO8859_1 = 1
|
||||
FONTS_TERMINUS_BOLD_14X28_ISO8859_1 = 1
|
||||
FONTS_TERMINUS_16X32_ISO8859_1 = 1
|
||||
FONTS_TERMINUS_BOLD_16X32_ISO8859_1 = 1
|
||||
|
||||
include ../../common.mk
|
||||
|
|
|
|||
|
|
@ -18,6 +18,19 @@ fonts_CFLAGS = $(CFLAGS) \
|
|||
-DFONTS_BITOCRA_4X7=$(FONTS_BITOCRA_4X7) \
|
||||
-DFONTS_BITOCRA_6X11=$(FONTS_BITOCRA_6X11) \
|
||||
-DFONTS_BITOCRA_7X13=$(FONTS_BITOCRA_7X13) \
|
||||
-DFONTS_TERMINUS_6X12_ISO8859_1=$(FONTS_TERMINUS_6X12_ISO8859_1) \
|
||||
-DFONTS_TERMINUS_8X14_ISO8859_1=$(FONTS_TERMINUS_8X14_ISO8859_1) \
|
||||
-DFONTS_TERMINUS_BOLD_8X14_ISO8859_1=$(FONTS_TERMINUS_BOLD_8X14_ISO8859_1) \
|
||||
-DFONTS_TERMINUS_10X18_ISO8859_1=$(FONTS_TERMINUS_10X18_ISO8859_1) \
|
||||
-DFONTS_TERMINUS_BOLD_10X18_ISO8859_1=$(FONTS_TERMINUS_BOLD_10X18_ISO8859_1) \
|
||||
-DFONTS_TERMINUS_11X22_ISO8859_1=$(FONTS_TERMINUS_11X22_ISO8859_1) \
|
||||
-DFONTS_TERMINUS_BOLD_11X22_ISO8859_1=$(FONTS_TERMINUS_BOLD_11X22_ISO8859_1) \
|
||||
-DFONTS_TERMINUS_12X24_ISO8859_1=$(FONTS_TERMINUS_12X24_ISO8859_1) \
|
||||
-DFONTS_TERMINUS_BOLD_12X24_ISO8859_1=$(FONTS_TERMINUS_BOLD_12X24_ISO8859_1) \
|
||||
-DFONTS_TERMINUS_14X28_ISO8859_1=$(FONTS_TERMINUS_14X28_ISO8859_1) \
|
||||
-DFONTS_TERMINUS_BOLD_14X28_ISO8859_1=$(FONTS_TERMINUS_BOLD_14X28_ISO8859_1) \
|
||||
-DFONTS_TERMINUS_16X32_ISO8859_1=$(FONTS_TERMINUS_16X32_ISO8859_1) \
|
||||
-DFONTS_TERMINUS_BOLD_16X32_ISO8859_1=$(FONTS_TERMINUS_BOLD_16X32_ISO8859_1) \
|
||||
-DFONTS_TERMINUS_6X12_KOI8_R=$(FONTS_TERMINUS_6X12_KOI8_R) \
|
||||
-DFONTS_TERMINUS_8X14_KOI8_R=$(FONTS_TERMINUS_8X14_KOI8_R) \
|
||||
-DFONTS_TERMINUS_BOLD_8X14_KOI8_R=$(FONTS_TERMINUS_BOLD_8X14_KOI8_R) \
|
||||
|
|
|
|||
|
|
@ -1,57 +0,0 @@
|
|||
#ifndef _EXTRAS_FONTS_CONFIG_H_
|
||||
#define _EXTRAS_FONTS_CONFIG_H_
|
||||
|
||||
#ifndef FONTS_GLCD_5X7
|
||||
#define FONTS_GLCD_5X7 1
|
||||
#endif
|
||||
|
||||
// FIXME: Proportional fonts drawing is broken
|
||||
#ifndef FONTS_ROBOTO_8PT
|
||||
#define FONTS_ROBOTO_8PT 0
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_ROBOTO_10PT
|
||||
#define FONTS_ROBOTO_10PT 0
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_BITOCRA_4X7
|
||||
#define FONTS_BITOCRA_4X7 1
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_BITOCRA_6X11
|
||||
#define FONTS_BITOCRA_6X11 1
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_BITOCRA_7X13
|
||||
#define FONTS_BITOCRA_7X13 1
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_TERMINUS_6X12_KOI8_R
|
||||
#define FONTS_TERMINUS_6X12_KOI8_R 1
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_TERMINUS_8X14_KOI8_R
|
||||
#define FONTS_TERMINUS_8X14_KOI8_R 1
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_TERMINUS_BOLD_8X14_KOI8_R
|
||||
#define FONTS_TERMINUS_BOLD_8X14_KOI8_R 1
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_TERMINUS_14X28_KOI8_R
|
||||
#define FONTS_TERMINUS_14X28_KOI8_R 1
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_TERMINUS_BOLD_14X28_KOI8_R
|
||||
#define FONTS_TERMINUS_BOLD_14X28_KOI8_R 1
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_TERMINUS_16X32_KOI8_R
|
||||
#define FONTS_TERMINUS_16X32_KOI8_R 1
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_TERMINUS_BOLD_16X32_KOI8_R
|
||||
#define FONTS_TERMINUS_BOLD_16X32_KOI8_R 1
|
||||
#endif
|
||||
|
||||
#endif /* _EXTRAS_FONTS_CONFIG_H_ */
|
||||
5389
extras/fonts/data/font_terminus_10x18_iso8859_1.h
Normal file
5389
extras/fonts/data/font_terminus_10x18_iso8859_1.h
Normal file
File diff suppressed because it is too large
Load diff
6409
extras/fonts/data/font_terminus_11x22_iso8859_1.h
Normal file
6409
extras/fonts/data/font_terminus_11x22_iso8859_1.h
Normal file
File diff suppressed because it is too large
Load diff
6919
extras/fonts/data/font_terminus_12x24_iso8859_1.h
Normal file
6919
extras/fonts/data/font_terminus_12x24_iso8859_1.h
Normal file
File diff suppressed because it is too large
Load diff
7939
extras/fonts/data/font_terminus_14x28_iso8859_1.h
Normal file
7939
extras/fonts/data/font_terminus_14x28_iso8859_1.h
Normal file
File diff suppressed because it is too large
Load diff
8959
extras/fonts/data/font_terminus_16x32_iso8859_1.h
Normal file
8959
extras/fonts/data/font_terminus_16x32_iso8859_1.h
Normal file
File diff suppressed because it is too large
Load diff
3859
extras/fonts/data/font_terminus_6x12_iso8859_1.h
Normal file
3859
extras/fonts/data/font_terminus_6x12_iso8859_1.h
Normal file
File diff suppressed because it is too large
Load diff
4369
extras/fonts/data/font_terminus_8x14_iso8859_1.h
Normal file
4369
extras/fonts/data/font_terminus_8x14_iso8859_1.h
Normal file
File diff suppressed because it is too large
Load diff
5389
extras/fonts/data/font_terminus_bold_10x18_iso8859_1.h
Normal file
5389
extras/fonts/data/font_terminus_bold_10x18_iso8859_1.h
Normal file
File diff suppressed because it is too large
Load diff
6409
extras/fonts/data/font_terminus_bold_11x22_iso8859_1.h
Normal file
6409
extras/fonts/data/font_terminus_bold_11x22_iso8859_1.h
Normal file
File diff suppressed because it is too large
Load diff
6919
extras/fonts/data/font_terminus_bold_12x24_iso8859_1.h
Normal file
6919
extras/fonts/data/font_terminus_bold_12x24_iso8859_1.h
Normal file
File diff suppressed because it is too large
Load diff
7939
extras/fonts/data/font_terminus_bold_14x28_iso8859_1.h
Normal file
7939
extras/fonts/data/font_terminus_bold_14x28_iso8859_1.h
Normal file
File diff suppressed because it is too large
Load diff
8959
extras/fonts/data/font_terminus_bold_16x32_iso8859_1.h
Normal file
8959
extras/fonts/data/font_terminus_bold_16x32_iso8859_1.h
Normal file
File diff suppressed because it is too large
Load diff
4369
extras/fonts/data/font_terminus_bold_8x14_iso8859_1.h
Normal file
4369
extras/fonts/data/font_terminus_bold_8x14_iso8859_1.h
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -10,15 +10,30 @@ FONTS_ROBOTO_8PT ?= 0
|
|||
FONTS_ROBOTO_10PT ?= 0
|
||||
|
||||
# BitOCRA
|
||||
FONTS_BITOCRA_4X7 ?= 1
|
||||
FONTS_BITOCRA_6X11 ?= 1
|
||||
FONTS_BITOCRA_7X13 ?= 1
|
||||
FONTS_BITOCRA_4X7 ?= 0
|
||||
FONTS_BITOCRA_6X11 ?= 0
|
||||
FONTS_BITOCRA_7X13 ?= 0
|
||||
|
||||
# Terminus, ISO8859-1 (Latin-1)
|
||||
FONTS_TERMINUS_6X12_ISO8859_1 ?= 0
|
||||
FONTS_TERMINUS_8X14_ISO8859_1 ?= 0
|
||||
FONTS_TERMINUS_BOLD_8X14_ISO8859_1 ?= 0
|
||||
FONTS_TERMINUS_10X18_ISO8859_1 ?= 0
|
||||
FONTS_TERMINUS_BOLD_10X18_ISO8859_1 ?= 0
|
||||
FONTS_TERMINUS_11X22_ISO8859_1 ?= 0
|
||||
FONTS_TERMINUS_BOLD_11X22_ISO8859_1 ?= 0
|
||||
FONTS_TERMINUS_12X24_ISO8859_1 ?= 0
|
||||
FONTS_TERMINUS_BOLD_12X24_ISO8859_1 ?= 0
|
||||
FONTS_TERMINUS_14X28_ISO8859_1 ?= 0
|
||||
FONTS_TERMINUS_BOLD_14X28_ISO8859_1 ?= 0
|
||||
FONTS_TERMINUS_16X32_ISO8859_1 ?= 0
|
||||
FONTS_TERMINUS_BOLD_16X32_ISO8859_1 ?= 0
|
||||
|
||||
# Terminus, KOI8-R
|
||||
FONTS_TERMINUS_6X12_KOI8_R ?= 1
|
||||
FONTS_TERMINUS_8X14_KOI8_R ?= 1
|
||||
FONTS_TERMINUS_BOLD_8X14_KOI8_R ?= 1
|
||||
FONTS_TERMINUS_14X28_KOI8_R ?= 1
|
||||
FONTS_TERMINUS_BOLD_14X28_KOI8_R ?= 1
|
||||
FONTS_TERMINUS_16X32_KOI8_R ?= 1
|
||||
FONTS_TERMINUS_BOLD_16X32_KOI8_R ?= 1
|
||||
FONTS_TERMINUS_6X12_KOI8_R ?= 0
|
||||
FONTS_TERMINUS_8X14_KOI8_R ?= 0
|
||||
FONTS_TERMINUS_BOLD_8X14_KOI8_R ?= 0
|
||||
FONTS_TERMINUS_14X28_KOI8_R ?= 0
|
||||
FONTS_TERMINUS_BOLD_14X28_KOI8_R ?= 0
|
||||
FONTS_TERMINUS_16X32_KOI8_R ?= 0
|
||||
FONTS_TERMINUS_BOLD_16X32_KOI8_R ?= 0
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@
|
|||
*/
|
||||
#include "fonts.h"
|
||||
|
||||
#ifndef FONTS_GLCD_5X7
|
||||
#define FONTS_GLCD_5X7 1
|
||||
#endif
|
||||
|
||||
#if FONTS_GLCD_5X7
|
||||
#include "data/font_glcd_5x7.h"
|
||||
#endif
|
||||
|
|
@ -29,6 +33,46 @@
|
|||
#include "data/font_bitocra_7x13_iso8859_1.h"
|
||||
#endif
|
||||
|
||||
#if FONTS_TERMINUS_6X12_ISO8859_1
|
||||
#include "data/font_terminus_6x12_iso8859_1.h"
|
||||
#endif
|
||||
#if FONTS_TERMINUS_8X14_ISO8859_1
|
||||
#include "data/font_terminus_8x14_iso8859_1.h"
|
||||
#endif
|
||||
#if FONTS_TERMINUS_BOLD_8X14_ISO8859_1
|
||||
#include "data/font_terminus_bold_8x14_iso8859_1.h"
|
||||
#endif
|
||||
#if FONTS_TERMINUS_10X18_ISO8859_1
|
||||
#include "data/font_terminus_10x18_iso8859_1.h"
|
||||
#endif
|
||||
#if FONTS_TERMINUS_BOLD_10X18_ISO8859_1
|
||||
#include "data/font_terminus_bold_10x18_iso8859_1.h"
|
||||
#endif
|
||||
#if FONTS_TERMINUS_11X22_ISO8859_1
|
||||
#include "data/font_terminus_11x22_iso8859_1.h"
|
||||
#endif
|
||||
#if FONTS_TERMINUS_BOLD_11X22_ISO8859_1
|
||||
#include "data/font_terminus_bold_11x22_iso8859_1.h"
|
||||
#endif
|
||||
#if FONTS_TERMINUS_12X24_ISO8859_1
|
||||
#include "data/font_terminus_12x24_iso8859_1.h"
|
||||
#endif
|
||||
#if FONTS_TERMINUS_BOLD_12X24_ISO8859_1
|
||||
#include "data/font_terminus_bold_12x24_iso8859_1.h"
|
||||
#endif
|
||||
#if FONTS_TERMINUS_14X28_ISO8859_1
|
||||
#include "data/font_terminus_14x28_iso8859_1.h"
|
||||
#endif
|
||||
#if FONTS_TERMINUS_BOLD_14X28_ISO8859_1
|
||||
#include "data/font_terminus_bold_14x28_iso8859_1.h"
|
||||
#endif
|
||||
#if FONTS_TERMINUS_16X32_ISO8859_1
|
||||
#include "data/font_terminus_16x32_iso8859_1.h"
|
||||
#endif
|
||||
#if FONTS_TERMINUS_BOLD_16X32_ISO8859_1
|
||||
#include "data/font_terminus_bold_16x32_iso8859_1.h"
|
||||
#endif
|
||||
|
||||
#if FONTS_TERMINUS_6X12_KOI8_R
|
||||
#include "data/font_terminus_6x12_koi8_r.h"
|
||||
#endif
|
||||
|
|
@ -90,6 +134,72 @@ const font_info_t *font_builtin_fonts[] =
|
|||
[FONT_FACE_BITOCRA_7X13] = NULL,
|
||||
#endif
|
||||
|
||||
#if FONTS_TERMINUS_6X12_ISO8859_1
|
||||
[FONT_FACE_TERMINUS_6X12_ISO8859_1] = &_fonts_terminus_6x12_iso8859_1_info,
|
||||
#else
|
||||
[FONT_FACE_TERMINUS_6X12_ISO8859_1] = NULL,
|
||||
#endif
|
||||
#if FONTS_TERMINUS_8X14_ISO8859_1
|
||||
[FONT_FACE_TERMINUS_8X14_ISO8859_1] = &_fonts_terminus_8x14_iso8859_1_info,
|
||||
#else
|
||||
[FONT_FACE_TERMINUS_8X14_ISO8859_1] = NULL,
|
||||
#endif
|
||||
#if FONTS_TERMINUS_BOLD_8X14_ISO8859_1
|
||||
[FONT_FACE_TERMINUS_BOLD_8X14_ISO8859_1] = &_fonts_terminus_bold_8x14_iso8859_1_info,
|
||||
#else
|
||||
[FONT_FACE_TERMINUS_BOLD_8X14_ISO8859_1] = NULL,
|
||||
#endif
|
||||
#if FONTS_TERMINUS_10X18_ISO8859_1
|
||||
[FONT_FACE_TERMINUS_10X18_ISO8859_1] = &_fonts_terminus_10x18_iso8859_1_info,
|
||||
#else
|
||||
[FONT_FACE_TERMINUS_10X18_ISO8859_1] = NULL,
|
||||
#endif
|
||||
#if FONTS_TERMINUS_BOLD_10X18_ISO8859_1
|
||||
[FONT_FACE_TERMINUS_BOLD_10X18_ISO8859_1] = &_fonts_terminus_bold_10x18_iso8859_1_info,
|
||||
#else
|
||||
[FONT_FACE_TERMINUS_BOLD_10X18_ISO8859_1] = NULL,
|
||||
#endif
|
||||
#if FONTS_TERMINUS_11X22_ISO8859_1
|
||||
[FONT_FACE_TERMINUS_11X22_ISO8859_1] = &_fonts_terminus_11x22_iso8859_1_info,
|
||||
#else
|
||||
[FONT_FACE_TERMINUS_11X22_ISO8859_1] = NULL,
|
||||
#endif
|
||||
#if FONTS_TERMINUS_BOLD_11X22_ISO8859_1
|
||||
[FONT_FACE_TERMINUS_BOLD_11X22_ISO8859_1] = &_fonts_terminus_bold_11x22_iso8859_1_info,
|
||||
#else
|
||||
[FONT_FACE_TERMINUS_BOLD_11X22_ISO8859_1] = NULL,
|
||||
#endif
|
||||
#if FONTS_TERMINUS_12X24_ISO8859_1
|
||||
[FONT_FACE_TERMINUS_12X24_ISO8859_1] = &_fonts_terminus_12x24_iso8859_1_info,
|
||||
#else
|
||||
[FONT_FACE_TERMINUS_12X24_ISO8859_1] = NULL,
|
||||
#endif
|
||||
#if FONTS_TERMINUS_BOLD_12X24_ISO8859_1
|
||||
[FONT_FACE_TERMINUS_BOLD_12X24_ISO8859_1] = &_fonts_terminus_bold_12x24_iso8859_1_info,
|
||||
#else
|
||||
[FONT_FACE_TERMINUS_BOLD_12X24_ISO8859_1] = NULL,
|
||||
#endif
|
||||
#if FONTS_TERMINUS_14X28_ISO8859_1
|
||||
[FONT_FACE_TERMINUS_14X28_ISO8859_1] = &_fonts_terminus_14x28_iso8859_1_info,
|
||||
#else
|
||||
[FONT_FACE_TERMINUS_14X28_ISO8859_1] = NULL,
|
||||
#endif
|
||||
#if FONTS_TERMINUS_BOLD_14X28_ISO8859_1
|
||||
[FONT_FACE_TERMINUS_BOLD_14X28_ISO8859_1] = &_fonts_terminus_bold_14x28_iso8859_1_info,
|
||||
#else
|
||||
[FONT_FACE_TERMINUS_BOLD_14X28_ISO8859_1] = NULL,
|
||||
#endif
|
||||
#if FONTS_TERMINUS_16X32_ISO8859_1
|
||||
[FONT_FACE_TERMINUS_16X32_ISO8859_1] = &_fonts_terminus_16x32_iso8859_1_info,
|
||||
#else
|
||||
[FONT_FACE_TERMINUS_16X32_ISO8859_1] = NULL,
|
||||
#endif
|
||||
#if FONTS_TERMINUS_BOLD_16X32_ISO8859_1
|
||||
[FONT_FACE_TERMINUS_BOLD_16X32_ISO8859_1] = &_fonts_terminus_bold_16x32_iso8859_1_info,
|
||||
#else
|
||||
[FONT_FACE_TERMINUS_BOLD_16X32_ISO8859_1] = NULL,
|
||||
#endif
|
||||
|
||||
#if FONTS_TERMINUS_6X12_KOI8_R
|
||||
[FONT_FACE_TERMINUS_6X12_KOI8_R] = &_fonts_terminus_6x12_koi8_r_info,
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "config.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
@ -20,11 +19,28 @@ extern "C" {
|
|||
typedef enum
|
||||
{
|
||||
FONT_FACE_GLCD5x7 = 0,
|
||||
|
||||
FONT_FACE_ROBOTO_8PT,
|
||||
FONT_FACE_ROBOTO_10PT,
|
||||
|
||||
FONT_FACE_BITOCRA_4X7,
|
||||
FONT_FACE_BITOCRA_6X11,
|
||||
FONT_FACE_BITOCRA_7X13,
|
||||
|
||||
FONT_FACE_TERMINUS_6X12_ISO8859_1,
|
||||
FONT_FACE_TERMINUS_8X14_ISO8859_1,
|
||||
FONT_FACE_TERMINUS_BOLD_8X14_ISO8859_1,
|
||||
FONT_FACE_TERMINUS_10X18_ISO8859_1,
|
||||
FONT_FACE_TERMINUS_BOLD_10X18_ISO8859_1,
|
||||
FONT_FACE_TERMINUS_11X22_ISO8859_1,
|
||||
FONT_FACE_TERMINUS_BOLD_11X22_ISO8859_1,
|
||||
FONT_FACE_TERMINUS_12X24_ISO8859_1,
|
||||
FONT_FACE_TERMINUS_BOLD_12X24_ISO8859_1,
|
||||
FONT_FACE_TERMINUS_14X28_ISO8859_1,
|
||||
FONT_FACE_TERMINUS_BOLD_14X28_ISO8859_1,
|
||||
FONT_FACE_TERMINUS_16X32_ISO8859_1,
|
||||
FONT_FACE_TERMINUS_BOLD_16X32_ISO8859_1,
|
||||
|
||||
FONT_FACE_TERMINUS_6X12_KOI8_R,
|
||||
FONT_FACE_TERMINUS_8X14_KOI8_R,
|
||||
FONT_FACE_TERMINUS_BOLD_8X14_KOI8_R,
|
||||
|
|
|
|||
|
|
@ -63,12 +63,12 @@
|
|||
#define SSD1306_CHARGE_PUMP_EN (0x14)
|
||||
#define SSD1306_CHARGE_PUMP_DIS (0x10)
|
||||
|
||||
#define SSD1306_SCROL_HOR_LEFT (0x27)
|
||||
#define SSD1306_SCROL_HOR_RIGHT (0x26)
|
||||
#define SSD1306_SCROL_HOR_VER_LEFT (0x2A)
|
||||
#define SSD1306_SCROL_HOR_VER_RIGHT (0x29)
|
||||
#define SSD1306_SCROL_ENABLE (0x2F)
|
||||
#define SSD1306_SCROL_DISABLE (0x2E)
|
||||
#define SSD1306_SCROLL_HOR_LEFT (0x27)
|
||||
#define SSD1306_SCROLL_HOR_RIGHT (0x26)
|
||||
#define SSD1306_SCROLL_HOR_VER_LEFT (0x2A)
|
||||
#define SSD1306_SCROLL_HOR_VER_RIGHT (0x29)
|
||||
#define SSD1306_SCROLL_ENABLE (0x2F)
|
||||
#define SSD1306_SCROLL_DISABLE (0x2E)
|
||||
|
||||
#ifdef SSD1306_DEBUG
|
||||
#define debug(fmt, ...) printf("%s: " fmt "\n", "SSD1306", ## __VA_ARGS__)
|
||||
|
|
@ -945,22 +945,22 @@ uint8_t ssd1306_draw_string(const ssd1306_t *dev, uint8_t *fb,
|
|||
|
||||
int ssd1306_stop_scroll(const ssd1306_t *dev)
|
||||
{
|
||||
return ssd1306_command(dev, SSD1306_SCROL_DISABLE);
|
||||
return ssd1306_command(dev, SSD1306_SCROLL_DISABLE);
|
||||
}
|
||||
|
||||
int ssd1306_start_scroll_hori(const ssd1306_t *dev, bool way, uint8_t start, uint8_t stop, ssd1306_scroll_t frame)
|
||||
{
|
||||
int err ;
|
||||
int err;
|
||||
|
||||
if (way)
|
||||
{
|
||||
if ((err = ssd1306_command(dev, SSD1306_SCROL_HOR_LEFT)))
|
||||
return err ;
|
||||
if ((err = ssd1306_command(dev, SSD1306_SCROLL_HOR_LEFT)))
|
||||
return err;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((err = ssd1306_command(dev, SSD1306_SCROL_HOR_RIGHT)))
|
||||
return err ;
|
||||
if ((err = ssd1306_command(dev, SSD1306_SCROLL_HOR_RIGHT)))
|
||||
return err;
|
||||
}
|
||||
if (!ssd1306_command(dev, 0x00) && //dummy
|
||||
!ssd1306_command(dev, (start&0x07)) &&
|
||||
|
|
@ -968,7 +968,7 @@ int ssd1306_start_scroll_hori(const ssd1306_t *dev, bool way, uint8_t start, uin
|
|||
!ssd1306_command(dev, (stop&0x07)) &&
|
||||
!ssd1306_command(dev, 0x00) && //dummy
|
||||
!ssd1306_command(dev, 0xFF) && //dummy
|
||||
!ssd1306_command(dev, SSD1306_SCROL_ENABLE)) {
|
||||
!ssd1306_command(dev, SSD1306_SCROLL_ENABLE)) {
|
||||
return 0;
|
||||
}
|
||||
return -EIO;
|
||||
|
|
@ -977,34 +977,34 @@ int ssd1306_start_scroll_hori(const ssd1306_t *dev, bool way, uint8_t start, uin
|
|||
int ssd1306_set_scroll_hori_vert(const ssd1306_t *dev, bool way, uint8_t start, uint8_t stop, uint8_t dy, ssd1306_scroll_t frame)
|
||||
{
|
||||
//this function dont work well if no vertical setting.
|
||||
if ( (!dy) || (dy > 63))
|
||||
if ((!dy) || (dy > 63))
|
||||
return -EINVAL;
|
||||
int err ;
|
||||
int err;
|
||||
|
||||
//vertical scrolling selection (all screen)
|
||||
if ((err = ssd1306_command(dev, 0xA3)))
|
||||
return err ;
|
||||
return err;
|
||||
if ((err = ssd1306_command(dev, 0)))
|
||||
return err ;
|
||||
return err;
|
||||
if ((err = ssd1306_command(dev, dev->height)))
|
||||
return err ;
|
||||
return err;
|
||||
|
||||
if (way)
|
||||
{
|
||||
if ((err = ssd1306_command(dev, SSD1306_SCROL_HOR_VER_LEFT)))
|
||||
return err ;
|
||||
if ((err = ssd1306_command(dev, SSD1306_SCROLL_HOR_VER_LEFT)))
|
||||
return err;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((err = ssd1306_command(dev, SSD1306_SCROL_HOR_VER_RIGHT)))
|
||||
return err ;
|
||||
if ((err = ssd1306_command(dev, SSD1306_SCROLL_HOR_VER_RIGHT)))
|
||||
return err;
|
||||
}
|
||||
if (!ssd1306_command(dev, 0x00) && //dummy
|
||||
!ssd1306_command(dev, (start&0x07)) &&
|
||||
!ssd1306_command(dev, frame) &&
|
||||
!ssd1306_command(dev, (stop&0x07)) &&
|
||||
!ssd1306_command(dev, dy) &&
|
||||
!ssd1306_command(dev, SSD1306_SCROL_ENABLE)) {
|
||||
!ssd1306_command(dev, SSD1306_SCROLL_ENABLE)) {
|
||||
return 0;
|
||||
}
|
||||
return -EIO;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue