-
Notifications
You must be signed in to change notification settings - Fork 0
/
tm1638cc.mac
45 lines (36 loc) · 1.14 KB
/
tm1638cc.mac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;=======================================================================
; tm1638cc.mac
; Assembler macros for tm1638 library
;
; written by Ralf Jardon (cosmicos at gmx dot net), May-July 2017
;
; License: GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007
;
; Version: 1.0beta-1
;=======================================================================
.MACRO TM1638_CLK_LOW ; Clock output low
cbi PORT_TM1638, CLK_PIN
.ENDMACRO
.MACRO TM1638_CLK_HIGH ; Clock output high
sbi PORT_TM1638, CLK_PIN
.ENDMACRO
.MACRO TM1638_STB_LOW ; Strobe output low
cbi PORT_TM1638, STB_PIN
.ENDMACRO
.MACRO TM1638_STB_HIGH ; Strobe output high
sbi PORT_TM1638, STB_PIN
.ENDMACRO
.MACRO TM1638_DATA_LOW ; Data input low
cbi PORT_TM1638, DATA_PIN
.ENDMACRO
.MACRO TM1638_DATA_HIGH ; Data input high
sbi PORT_TM1638, DATA_PIN
.ENDMACRO
.MACRO TM1638_CLK_LOW_DATA_LOW ; Data & Clock input high
ldi DTMP, (0<<CLK_PIN)|(0<<DATA_PIN) ; contemporaneous
out PORT_TM1638, DTMP
.ENDMACRO
.MACRO TM1638_CLK_LOW_DATA_HIGH ; Data input high, Clock
ldi DTMP, (0<<CLK_PIN)|(1<<DATA_PIN) ; input low contemporaneous
out PORT_TM1638, DTMP
.ENDMACRO