TM1638_plus  2.0.0
Arduino library for Tm1638 modules
TM1638plus_common.h
Go to the documentation of this file.
1 
9 #ifndef TM1638PLUS_COMMON_H
10 #define TM1638PLUS_COMMON_H
11 
12 #if (ARDUINO >=100)
13  #include "Arduino.h"
14 #else
15  #include "WProgram.h"
16 #endif
17 
18 #define TM_ACTIVATE 0x8F
19 #define TM_BUTTONS_MODE 0x42
20 #define TM_WRITE_LOC 0x44
21 #define TM_WRITE_INC 0x40
22 #define TM_SEG_ADR 0xC0
23 #define TM_LEDS_ADR 0xC1
24 #define TM_BRIGHT_ADR 0x88
25 #define TM_BRIGHT_MASK 0x07
26 #define TM_DEFAULT_BRIGHTNESS 0x02
27 #define TM_DISPLAY_SIZE 8
29 #define TM_ASCII_OFFSET 32
30 #define TM_HEX_OFFSET 16
31 #define TM_DOT_MASK_DEC 128
33 #define TM_RED_LED 0x02
34 #define TM_GREEN_LED 0x01
35 #define TM_OFF_LED 0x00
37 #define TM_HFIN_DELAY 1
38 #define TM_HFOUT_DELAY 1
42 typedef enum : uint8_t
43 {
45  TMAlignTextLeft = 2
47 
48 extern const unsigned char * pFontSevenSegptr;
54 
55 public:
56 
58  void displayBegin();
59  void reset(void);
60  void brightness(uint8_t brightness);
61 
62 protected:
63 
64  uint8_t HighFreqshiftin(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder) ;
65  void HighFreqshiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
66  void sendCommand(uint8_t value);
67  void sendData(uint8_t data);
68 
69  uint8_t _STROBE_IO;
70  uint8_t _DATA_IO;
71  uint8_t _CLOCK_IO;
72  bool _HIGH_FREQ = false;
74 private:
75 
76 };
77 
78 #endif
const unsigned char * pFontSevenSegptr
Definition: TM1638plus_common.cpp:233
AlignTextType_e
Definition: TM1638plus_common.h:43
@ TMAlignTextRight
Definition: TM1638plus_common.h:44
@ TMAlignTextLeft
Definition: TM1638plus_common.h:45
The base Class , used to store common data & functions for all models types.
Definition: TM1638plus_common.h:53
void sendData(uint8_t data)
Send Data to display.
Definition: TM1638plus_common.cpp:45
TM1638plus_common()
Constructor for class TM1638plus_common.
Definition: TM1638plus_common.cpp:12
uint8_t HighFreqshiftin(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder)
Shifts in a byte of data from the Tm1638 SPI-like bus.
Definition: TM1638plus_common.cpp:87
bool _HIGH_FREQ
Definition: TM1638plus_common.h:72
uint8_t _DATA_IO
Definition: TM1638plus_common.h:70
uint8_t _STROBE_IO
Definition: TM1638plus_common.h:69
void HighFreqshiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val)
Shifts out a byte of data on to the Tm1638 SPI-like bus.
Definition: TM1638plus_common.cpp:116
uint8_t _CLOCK_IO
Definition: TM1638plus_common.h:71
void reset(void)
Reset / clear the display.
Definition: TM1638plus_common.cpp:57
void brightness(uint8_t brightness)
Sets the brightness level of segments in display on a scale of brightness.
Definition: TM1638plus_common.cpp:72
void sendCommand(uint8_t value)
Send command to display.
Definition: TM1638plus_common.cpp:34
void displayBegin()
Begin method , sets pin modes and activate display.
Definition: TM1638plus_common.cpp:21