forked from quasipedia/Lanterns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreg_mnemonics.h
78 lines (71 loc) · 2.06 KB
/
reg_mnemonics.h
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
* Scratch variable, may be used in any interrupt handler
*/
#define REG_I_SCRATCH_R0 r0
#define REG_I_SCRATCH_R1 r1
/*
* used in TLC_spiTimerInterrupt, but saved
*/
#define REG_I_CHANGE_COUNTER r2
/*
* this variable is increased in timerInterrupt (62.5 Hz), and checked
* and decremented in the main loop to see if a tick has occurred
*/
#define REG_TICKED r2
/* Set in tlcInit, R/W in TLC_spiInterrupt */
/* SPI byte index. Starts at max + 1, then decremented */
#define REG_I_G_SPI_BYTE_INDEX r3
/* REG_CHANNEL_INTENSITY_x contains the desired intensity for the current
ambient light level */
#define REG_CHANNEL_INTENSITY_LOW r4
#define REG_CHANNEL_INTENSITY_HIGH r5
#define REG_I_G_SPI_BYTE_TYPE r6
#define REG_SCRATCH_1 r7
#define REG_SCRATCH_2 r8
#define REG_SCRATCH_3 r9
#define REG_SCRATCH_4 r16
#define MINS_PAST r17
#define HOURS r18
#define REG_I_G_SPI_POINTER r11
#define REG_I_G_SPI_POINTER_LOW r11
#define REG_I_G_SPI_POINTER_HIGH r12
/* 62.5Hz time counter */
#define REG_TICK_COUNTER r20
#define REG_TICK_COUNTER_LOW r20
#define REG_TICK_COUNTER_HIGH r21
/*
* Parameters to TLC functions
*/
#define REG_TLC_CHANNEL_NUMBER r10
#define REG_TLC_CHANNEL_INTENSITY_LOW r22
#define REG_TLC_CHANNEL_INTENSITY_HIGH r23
/*
* Used for loop in TLC_spiTimerInterrupt, but pushed on entry
*/
#define REG_I_CHANNEL_INDEX r19
/*
* The input state of port C last time around
*/
#define REG_PREV_BUTTON_STATE r19
/*
* Used in TLC SPI Timer interrupt for storing current LED value
* I in name stands for interrupt time variable
*
* TODO: Move a global variable currently stored in r0-r15 to r24.
* Use reg previously used for the global variable as interrupt scratch for
* saving sreg. Reserve r0,r1 for mul result or scratch. Free up these regs.
*/
#define REG_I_LED_CURRENT_LOW r24
#define REG_I_LED_CURRENT_HIGH r25
/*
* Two below used in TLC_spiInterrupt (so can use same regs as stuff in
* TLC_spiTimerInterrupt)
*/
#define REG_I_FIRST_BYTE r24
#define REG_I_SECOND_BYTE r25
#define XL r26
#define XH r27
#define YL r28
#define YH r29
#define ZL r30
#define ZH r31