31 lines
1.1 KiB
C
31 lines
1.1 KiB
C
#ifndef TM1650_H_
|
||
#define TM1650_H_
|
||
#include "config.h"
|
||
// 显示参数
|
||
#define TM1650_BRIGHT1 0x11 /*一级亮度,打开LED显示*/
|
||
#define TM1650_BRIGHT2 0x21 /*二级亮度,打开LED显示*/
|
||
#define TM1650_BRIGHT3 0x31 /*三级亮度,打开LED显示*/
|
||
#define TM1650_BRIGHT4 0x41 /*四级亮度,打开LED显示*/
|
||
#define TM1650_BRIGHT5 0x51 /*五级亮度,打开LED显示*/
|
||
#define TM1650_BRIGHT6 0x61 /*六级亮度,打开LED显示*/
|
||
#define TM1650_BRIGHT7 0x71 /*七级亮度,打开LED显示*/
|
||
#define TM1650_BRIGHT8 0x01 /*八级亮度,打开LED显示*/
|
||
#define TM1650_DSP_OFF 0x00 /*关闭LED显示*/
|
||
|
||
// 数码管位选
|
||
#define TM1650_DIG1 0
|
||
#define TM1650_DIG2 1
|
||
#define TM1650_DIG3 2
|
||
#define TM1650_DIG4 3
|
||
|
||
#define sda P33
|
||
#define scl P32
|
||
void TM1650_init(void); // 初始化
|
||
void TM1650_print(unsigned char dig, unsigned char seg_data);
|
||
void TM1650_printpogrun(u8 set,u8 mode);// 显示----页面0显示
|
||
void TM1650_printpogstop(u8 set);// 显示----页面0显示
|
||
void TM1650_print_SMG1(u8 set);
|
||
void TM1650_print_SMG2(u16 set);
|
||
void TM1650_print_SMG3(u8 set) ;
|
||
#endif
|