# HT1621 7 segment LCD library
Library for 7-segment lcds based on the HT1621 driver. Very often marked as PDC-6X1.
<img src="extras/photo1.jpg" alt="photo" width="500">
Based on the bitbanging efforts by [anxzhu](https://github.com/anxzhu) (2016-2018).
APIs rewritten in 2018 to follow the LiquidCrystal format by [valerio\new]
(https://github.com/5N44P).
Refactored. Removed dependency on any MCU hardware. Added SPI support and text support.
By Viacheslav Balandin
https://github.com/hedgehogV/HT1621-lcd
## APIs reference
* `HT1621(pPinSet *pCs, pPinSet *pSck, pPinSet *pMosi, pPinSet *pBacklight)`
Ctor. Starts the lcd with the pin assignment declared. The backlight pin is optional
* `HT1621(pInterface *pSpi, pPinSet *pCs, pPinSet *pBacklight)`
Starts the lcd with SPI interface. CS and backlight pins are optional. Tested with CPOL=LOW, EDGE=1
* `void clear()`
Clears the display
* `void backlightOn()`
Turns on the backlight
* `void backlightOff()`
Turns off the backlight
* `void batteryLevel(uint8_t percents)`
Accepts values from 0 to 100. Bigger values will be treated as 100. Battery charge represented by the rectangles above the battery symbol.
* `void print(const char *str)`
Print string (up to 6 characters)
Allowed characters: letters, digits, space, minus, underscore. Not allowed characters will be displayed as spaces.
See characters appearance in `Internal functioning` chapter
* `void print(int32_t num)`
Prints a signed integer between -99999 and 999999. Larger and smaller values will be displayed as -99999 and 999999
* `void print(float num, int precision)`
Prints a float with 0 to 3 decimals, based on the `precision` parameter. Default value is 3
* `void print(int32_t multiplied_float, uint32_t multiplier)`
Prints number with dot. Use it instead float. Float type usage may slow down many systems
* `void displayOff()`
Turns off the display (doesn't turn off the backlight)
* `void displayOn()`
Turns the display back on after it has been disabled by `noDisplay()`
## API usage
To start display you have to call one of Ctors with pointers to toggle_Gpio or SpiTx functions.
You may need a function wrapper. Wrapper example:
```cpp
// spi wrapper
void SpiTx(uint8_t *ptr, uint8_t size)
{
HAL_SPI_Transmit(&hspi2, ptr, size, 2000);
}
// cs wrapper
void toggle_CS(bool b)
{
HAL_GPIO_WritePin(CS_GPIO_Port, CS_Pin, b? GPIO_PIN_SET:GPIO_PIN_RESET);
}
// ctor call example
HT1621 lcd = HT1621(&SpiTx, &toggle_CS);
// prints "hello" on display
lcd.print("HELLO");
```
## Internal functioning
Letters example. Source: https://www.dcode.fr/7-segment-display
Some of them looks a bit strange. But 7-segment display isn't
the best thing to show letters
<img src="extras/letters.png" alt="photo" width="500">
° -> 0x33 = 10 + 20 + 01 + 02
C -> 0x1D = 10 + 01 + 04 + 08
```
___10___
| |
01 20
|___02___|
| |
04 40
|___08___|
```
没有合适的资源?快使用搜索试试~ 我知道了~
汇总:TH1621 LCD开发资料(20240406)
共513个文件
zip:188个
h:41个
c:37个
需积分: 5 0 下载量 65 浏览量
2024-04-03
20:58:08
上传
评论
收藏 282.51MB RAR 举报
温馨提示
汇总:TH1621 LCD开发资料(20240403) Arduino UNO 驱动程序修改测试(20240405 21:55) JXJ1S008O(2024.01.24) TH1621B LCD STM32驱动(20240403) 多功能计时器(LONCIN&Rato)(LCD图纸)(20240406) HGSEMI(华冠)_C5310837_HT1621驱动数据手册(20240403)
资源推荐
资源详情
资源评论
收起资源包目录
汇总:TH1621 LCD开发资料(20240406) (513个子文件)
HS-test.uvguix.Administrator 92KB
J017A-004.ASM 129KB
startup1_l.asm 2KB
HS-test.axf 296KB
keilkill.bat 399B
J017A-004.bin 16KB
stm32f10x_tim.c 107KB
stm32f10x_flash.c 61KB
stm32f10x_rcc.c 50KB
stm32f10x_adc.c 46KB
stm32f10x_i2c.c 45KB
stm32f10x_can.c 44KB
stm32f10x_usart.c 37KB
system_stm32f10x.c 36KB
stm32f10x_fsmc.c 35KB
stm32f10x_spi.c 30KB
stm32f10x_dma.c 29KB
stm32f10x_sdio.c 28KB
J017A-004.c 27KB
stm32f10x_gpio.c 23KB
stm32f10x_dac.c 19KB
core_cm3.c 17KB
system_stm32l1xx.c 13KB
stm32f10x_cec.c 11KB
24C02.c 9KB
stm32f10x_pwr.c 9KB
ht1621c.c 8KB
stm32f10x_rtc.c 8KB
stm32f10x_bkp.c 8KB
misc.c 7KB
stm32f10x_exti.c 7KB
bsp_AM2302.c 6KB
stm32f10x_wwdg.c 6KB
stm32f10x_it.c 5KB
stm32f10x_dbgmcu.c 5KB
stm32f10x_iwdg.c 5KB
adc.c 4KB
stm32f10x_crc.c 3KB
delay.c 2KB
printf.c 2KB
main.c 991B
Gpio.c 931B
sys.c 876B
HT1621.cpp 12KB
HT1621.cpp 12KB
HT1621.cpp 11KB
ht1621c.crf 348KB
main.crf 347KB
stm32f10x_rcc.crf 347KB
stm32f10x_flash.crf 347KB
stm32f10x_usart.crf 345KB
printf.crf 344KB
stm32f10x_gpio.crf 343KB
bsp_am2302.crf 343KB
stm32f10x_dma.crf 343KB
system_stm32f10x.crf 341KB
sys.crf 340KB
misc.crf 340KB
delay.crf 340KB
gpio.crf 339KB
stm32f10x_crc.crf 339KB
stm32f10x_it.crf 339KB
core_cm3.crf 4KB
J017A-004.CV 16KB
stm32f10x_flash.d 3KB
stm32f10x_usart.d 3KB
stm32f10x_gpio.d 3KB
system_stm32f10x.d 3KB
stm32f10x_rcc.d 3KB
stm32f10x_crc.d 3KB
stm32f10x_dma.d 3KB
bsp_am2302.d 3KB
main.d 2KB
stm32f10x_it.d 2KB
ht1621c.d 2KB
printf.d 2KB
gpio.d 2KB
misc.d 2KB
delay.d 2KB
sys.d 2KB
core_cm3.d 136B
startup_stm32f10x_hd.d 117B
J017A-004.DBG 20KB
HS-test_STM32F103C8_1.0.0.dbgconf 2KB
HS-test_HS-test.dep 45KB
新建 Microsoft Word 文档.docx 321KB
新建 Microsoft Word 文档.docx 321KB
Design Rule Check - Copy of JXJ1S009C_P - 副本.drc 6KB
Design Rule Check - LCD_1621.drc 2KB
X094444PHTPS(1).dwg 511KB
J394444PHTPS-01-J017A-001液晶_recover.dwg 357KB
J394444PHTPS-01-J017A-001液晶.dwg 307KB
3500i液晶显示模块贴花2D.dwg 207KB
stm32f10x.h 619KB
stm32l1xx.h 351KB
core_cm3.h 84KB
stm32f10x_tim.h 51KB
stm32f10x_rcc.h 30KB
stm32f10x_i2c.h 29KB
stm32f10x_can.h 27KB
共 513 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
Naiva
- 粉丝: 2w+
- 资源: 222
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功