|
@@ -19,50 +19,9 @@
|
|
#include "stm8l15x.h"
|
|
#include "stm8l15x.h"
|
|
|
|
|
|
/* Exported defines ----------------------------------------------------------*/
|
|
/* Exported defines ----------------------------------------------------------*/
|
|
-// соответсвие бит сегментам
|
|
|
|
-#define SEG_A 1
|
|
|
|
-#define SEG_B 3
|
|
|
|
-#define SEG_C 2
|
|
|
|
-#define SEG_D 5
|
|
|
|
-#define SEG_E 6
|
|
|
|
-#define SEG_F 0
|
|
|
|
-#define SEG_G 7
|
|
|
|
-#define SEG_DP 4
|
|
|
|
-
|
|
|
|
-// symbols
|
|
|
|
-// Для BCD
|
|
|
|
|
|
+// symbols Для BCD
|
|
#define MAX7219_CHAR_BLANK 0x0F
|
|
#define MAX7219_CHAR_BLANK 0x0F
|
|
#define MAX7219_CHAR_FULL 0x88
|
|
#define MAX7219_CHAR_FULL 0x88
|
|
-// без кодирования
|
|
|
|
-#define SYM_0 0x6F
|
|
|
|
-#define SYM_1 0x0C
|
|
|
|
-#define SYM_2 0xEA
|
|
|
|
-#define SYM_3 0xAE
|
|
|
|
-#define SYM_4 0x8D
|
|
|
|
-#define SYM_5 0xA7
|
|
|
|
-#define SYM_6 0xE7
|
|
|
|
-#define SYM_7 0x0E
|
|
|
|
-#define SYM_8 0xEF
|
|
|
|
-#define SYM_9 0xAF
|
|
|
|
-#define SYM_A 0xCF
|
|
|
|
-#define SYM_b 0xE5
|
|
|
|
-#define SYM_c 0xE0
|
|
|
|
-#define SYM_C 0x63
|
|
|
|
-#define SYM_d 0xEC
|
|
|
|
-#define SYM_E 0xE3
|
|
|
|
-#define SYM_F 0xC3
|
|
|
|
-#define SYM_H 0xCD
|
|
|
|
-#define SYM_h 0xC5
|
|
|
|
-#define SYM_P 0xCB
|
|
|
|
-#define SYM_t 0xE1
|
|
|
|
-#define SYM_Gradus 0x8B
|
|
|
|
-#define SYM_LGradus 0xE4
|
|
|
|
-#define SYM_Temp 0xE1
|
|
|
|
-#define SYM_Minus 0x80
|
|
|
|
-#define SYM_Plus 0xD1
|
|
|
|
-#define SYM_BLANK 0x00
|
|
|
|
-#define SYM_FULL 0xFF
|
|
|
|
-#define SYM_DOT 0x10
|
|
|
|
|
|
|
|
#define MAX7219_ON 0x01
|
|
#define MAX7219_ON 0x01
|
|
#define MAX7219_OFF 0x00
|
|
#define MAX7219_OFF 0x00
|
|
@@ -89,47 +48,51 @@ typedef enum _max7219_reg {
|
|
RegTest = 0x0F
|
|
RegTest = 0x0F
|
|
} max7219_reg_t;
|
|
} max7219_reg_t;
|
|
|
|
|
|
|
|
+// соответсвие бит сегментам
|
|
typedef enum _max7219_seg {
|
|
typedef enum _max7219_seg {
|
|
- SegA = SEG_A,
|
|
|
|
- SegB = SEG_B,
|
|
|
|
- SegC = SEG_C,
|
|
|
|
- SegD = SEG_D,
|
|
|
|
- SegE = SEG_E,
|
|
|
|
- SegF = SEG_F,
|
|
|
|
- SegG = SEG_G,
|
|
|
|
- SegDP = SEG_DP,
|
|
|
|
|
|
+ SegA = 1,
|
|
|
|
+ SegB = 3,
|
|
|
|
+ SegC = 2,
|
|
|
|
+ SegD = 5,
|
|
|
|
+ SegE = 6,
|
|
|
|
+ SegF = 0,
|
|
|
|
+ SegG = 7,
|
|
|
|
+ SegDP = 4,
|
|
} max7219_seg_t;
|
|
} max7219_seg_t;
|
|
|
|
|
|
|
|
+// symbols без кодирования
|
|
typedef enum _max7219_sym {
|
|
typedef enum _max7219_sym {
|
|
- Sym_0 = SYM_0,
|
|
|
|
- Sym_1 = SYM_1,
|
|
|
|
- Sym_2 = SYM_2,
|
|
|
|
- Sym_3 = SYM_3,
|
|
|
|
- Sym_4 = SYM_4,
|
|
|
|
- Sym_5 = SYM_5,
|
|
|
|
- Sym_6 = SYM_6,
|
|
|
|
- Sym_7 = SYM_7,
|
|
|
|
- Sym_8 = SYM_8,
|
|
|
|
- Sym_9 = SYM_9,
|
|
|
|
- Sym_A = SYM_A,
|
|
|
|
- Sym_b = SYM_b,
|
|
|
|
- Sym_c =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_Minus = 0x80,
|
|
|
|
+ Sym_Plus = 0xD1,
|
|
|
|
+ Sym_BLANK = 0x00,
|
|
|
|
+ Sym_FULL = 0xFF,
|
|
|
|
+ Sym_Dot = 0x10
|
|
} max7219_sym_t;
|
|
} max7219_sym_t;
|
|
|
|
|
|
/* Exported constants --------------------------------------------------------*/
|
|
/* Exported constants --------------------------------------------------------*/
|