A simple library for Holtek's HT1621 segment LCD driver
Embed:
(wiki syntax)
Show/hide line numbers
HT1621.h
00001 #ifndef HT1621_H_ 00002 #define HT1621_H_ 00003 00004 class HT1621 { 00005 private: 00006 DigitalOut wr; 00007 DigitalOut data; 00008 DigitalOut cs; 00009 00010 public: 00011 // Commands 00012 const static uint8_t SYS_DIS = 0x00; 00013 const static uint8_t SYS_EN = 0x01; 00014 const static uint8_t LCD_OFF = 0x02; 00015 const static uint8_t LCD_ON = 0x03; 00016 const static uint8_t TIMER_DIS = 0x04; 00017 const static uint8_t WDT_DIS = 0x05; 00018 const static uint8_t TIMER_EN = 0x06; 00019 const static uint8_t WDT_EN = 0x07; 00020 const static uint8_t TONE_OFF = 0x08; 00021 const static uint8_t TONE_ON = 0x09; 00022 const static uint8_t CLR_TIMER = 0xc0; 00023 const static uint8_t CLR_WDT = 0xe0; 00024 const static uint8_t XTAL_32K = 0x14; 00025 const static uint8_t RC_256K = 0x18; 00026 const static uint8_t EXT_256K = 0x1c; 00027 const static uint8_t BIAS2_COM2 = 0x20; 00028 const static uint8_t BIAS3_COM2 = 0x21; 00029 const static uint8_t BIAS2_COM3 = 0x24; 00030 const static uint8_t BIAS3_COM3 = 0x25; 00031 const static uint8_t BIAS2_COM4 = 0x28; 00032 const static uint8_t BIAS3_COM4 = 0x29; 00033 const static uint8_t TONE_4K = 0x40; 00034 const static uint8_t TONE_2K = 0x60; 00035 const static uint8_t IRQ_DIS = 0x80; 00036 const static uint8_t IRQ_EN = 0x88; 00037 const static uint8_t F1 = 0xa0; 00038 const static uint8_t F2 = 0xa1; 00039 const static uint8_t F4 = 0xa2; 00040 const static uint8_t F8 = 0xa3; 00041 const static uint8_t F16 = 0xa4; 00042 const static uint8_t F32 = 0xa5; 00043 const static uint8_t F64 = 0xa6; 00044 const static uint8_t F128 = 0xa7; 00045 const static uint8_t TEST = 0xe0; 00046 const static uint8_t NORMAL = 0xe3; 00047 00048 HT1621(PinName wrPin, PinName dataPin, PinName csPin); 00049 ~HT1621(); 00050 00051 void write(uint8_t addr, uint8_t b); 00052 void command(uint8_t b); 00053 }; 00054 00055 #endif
Generated on Tue Jul 19 2022 00:00:24 by 1.7.2