-
Notifications
You must be signed in to change notification settings - Fork 0
/
rp2_i2c.h
91 lines (69 loc) · 2.94 KB
/
rp2_i2c.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
rp2_i2c.h
Copyright (C) 2023-2024 Sfera Labs S.r.l. - All rights reserved.
For information, see:
http://www.sferalabs.cc/
*/
#pragma once
#define I2C_SLAVE_ADDRESS 0x35
#define I2C_REG_FW_VER 1
#define I2C_REG_USER_CFG_CMD 5
#define I2C_REG_USER_CFG_STATE 6
#define I2C_REG_BUTTON 14
#define I2C_REG_BUZZER_T_ON 17
#define I2C_REG_BUZZER_T_OFF (I2C_REG_BUZZER_T_ON + 1)
#define I2C_REG_BUZZER_REPS (I2C_REG_BUZZER_T_ON + 2)
#define I2C_REG_BUZZER_TONE (I2C_REG_BUZZER_T_ON + 3)
#define I2C_REG_LED_RED_T_ON 22
#define I2C_REG_LED_RED_T_OFF (I2C_REG_LED_RED_T_ON + 1)
#define I2C_REG_LED_RED_REPS (I2C_REG_LED_RED_T_ON + 2)
#define I2C_REG_LED_GREEN_T_ON 26
#define I2C_REG_LED_GREEN_T_OFF (I2C_REG_LED_GREEN_T_ON + 1)
#define I2C_REG_LED_GREEN_REPS (I2C_REG_LED_GREEN_T_ON + 2)
#define I2C_REG_EXPB_EN 31
#define I2C_REG_EXPB_TYPE_S1 (I2C_REG_EXPB_EN + 1)
#define I2C_REG_EXPB_TYPE_S2 (I2C_REG_EXPB_TYPE_S1 + 1)
#define I2C_REG_EXPB_TYPE_S3 (I2C_REG_EXPB_TYPE_S1 + 2)
#define I2C_REG_EXPB_TYPE_S4 (I2C_REG_EXPB_TYPE_S1 + 3)
#define I2C_REG_EXPB_SERIAL_S1_LOW 80
#define I2C_REG_EXPB_SERIAL_S1_HIGH 81
#define I2C_REG_EXPB_SERIAL_S2_LOW 82
#define I2C_REG_EXPB_SERIAL_S2_HIGH 83
#define I2C_REG_EXPB_SERIAL_S3_LOW 84
#define I2C_REG_EXPB_SERIAL_S3_HIGH 85
#define I2C_REG_EXPB_SERIAL_S4_LOW 86
#define I2C_REG_EXPB_SERIAL_S4_HIGH 87
#define I2C_REG_SD 39
#define I2C_REG_PCIE 42
#define I2C_REG_USB 45
#define I2C_REG_WDT_MAIN 48
#define I2C_REG_WDT_TIMEOUT (I2C_REG_WDT_MAIN + 1)
#define I2C_REG_WDT_TIMEOUT_CFG (I2C_REG_WDT_MAIN + 2)
#define I2C_REG_WDT_DOWN_DELAY (I2C_REG_WDT_MAIN + 3)
#define I2C_REG_WDT_SD_SWITCH_CNT (I2C_REG_WDT_MAIN + 4)
#define I2C_REG_WDT_PCIE_SWITCH_CNT (I2C_REG_WDT_MAIN + 5)
#define I2C_REG_POWER_MAIN 56
#define I2C_REG_POWER_DOWN_DELAY (I2C_REG_POWER_MAIN + 1)
#define I2C_REG_POWER_OFF_TIME (I2C_REG_POWER_MAIN + 2)
#define I2C_REG_POWER_UP_DELAY (I2C_REG_POWER_MAIN + 3)
#define I2C_REG_SYSMON_VIN_V 63
#define I2C_REG_SYSMON_VIN_I 64
#define I2C_REG_SYSMON_SYS_ERRS 74
#define I2C_REG_SYSMON_IOEXP_ERRS (I2C_REG_SYSMON_SYS_ERRS + 1)
#define I2C_REG_ACCEL_X 68
#define I2C_REG_ACCEL_Y (I2C_REG_ACCEL_X + 1)
#define I2C_REG_ACCEL_Z (I2C_REG_ACCEL_X + 2)
#define I2C_REG_ATE_ADC_CH2 89
#define I2C_REG_ATE_ADC_CH3 90
#define I2C_REG_EXPB_START 100
#define I2C_REG_EXPB_SIZE 25
#define I2C_EXPB_IDX_TO_REG_START(EXPB_IDX) (I2C_REG_EXPB_START + (EXPB_IDX * I2C_REG_EXPB_SIZE))
#define I2C_REG_TO_EXPB_IDX(REG) ((REG - I2C_REG_EXPB_START) / I2C_REG_EXPB_SIZE)
#define I2C_REG_OFST_UPS_MAIN 0
#define I2C_REG_OFST_UPS_CAPACITY (I2C_REG_OFST_UPS_MAIN + 1)
#define I2C_REG_OFST_UPS_MAX_CHARGE_I (I2C_REG_OFST_UPS_MAIN + 2)
#define I2C_REG_OFST_UPS_MAX_CHARGE_I_CFG (I2C_REG_OFST_UPS_MAIN + 3)
#define I2C_REG_OFST_UPS_POWER_DOWN_DELAY (I2C_REG_OFST_UPS_MAIN + 4)
#define I2C_REG_OFST_UPS_STATE (I2C_REG_OFST_UPS_MAIN + 6)
#define I2C_REG_OFST_UPS_VBAT_V (I2C_REG_OFST_UPS_MAIN + 7)
#define I2C_REG_OFST_UPS_VBAT_I (I2C_REG_OFST_UPS_MAIN + 8)