-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.py
50 lines (39 loc) · 1.31 KB
/
constants.py
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
REGISTER_COMMAND = 0xFD
REGISTER_COMMAND_WRITE_LOCK = 0xFE
REGISTER_INTERRUPT_MASK = 0xF0
REGISTER_INTERRUPT_STATUS = 0xF1
REGISTER_ID = 0xFC # only used by later devices
REGISTER_ID_VALUE_IS31FL3733 = 0
PAGE_LEDONOFF = 0x00
PAGE_LEDPWM = 0x01
PAGE_LEDAUTOBREATH = 0x02
PAGE_FUNCTION = 0x03
COMMAND_WRITE_LOCK_DISABLE_ONCE = 0xC5
COMMAND_WRITE_LOCK_ENABLED = 0x00
REGISTER_LEDONOFF_ONOFF_START = 0x00
REGISTER_LEDONOFF_ONOFF_STOP = 0x17
REGISTER_LEDONOFF_OPEN_START = 0x18
REGISTER_LEDONOFF_OPEN_STOP = 0x2F
REGISTER_LEDONOFF_SHORT_START = 0x30
REGISTER_LEDONOFF_SHORT_STOP = 0x47
REGISTER_FUNCTION_CONFIGURATION = 0x00
REGISTER_FUNCTION_CONFIGURATION_SYNC_CLOCK_MASTER = 64
REGISTER_FUNCTION_CONFIGURATION_SYNC_CLOCK_SLAVE = 128
REGISTER_FUNCTION_CONFIGURATION_SYNC_CLOCK_SINGLE = 0
REGISTER_FUNCTION_CONFIGURATION_TRIGGER_OPEN_SHORT_DETECTION = 4
REGISTER_FUNCTION_CONFIGURATION_BREATHING_ENABLE = 2
REGISTER_FUNCTION_CONFIGURATION_SOFTWARE_SHUTDOWN = 1
REGISTER_FUNCTION_CURRENT_CONTROL = 0x01
# all the auto breathing stuff here TK TK TODO
REGISTER_FUNCTION_TIME_UPDATE = 0x0E
REGISTER_FUNCTION_PULL_UP_RESISTOR = 0x0F
REGISTER_FUNCTION_PULL_DOWN_RESISTOR = 0x10
REGISTER_FUNCTION_RESET = 0x11
RESISTOR_NONE = 0
RESISTOR_500 = 1
RESISTOR_1K = 2
RESISTOR_2K = 3
RESISTOR_4K = 4
RESISTOR_8K = 5
RESISTOR_16K = 6
RESISTOR_32K = 7