|
95 | 95 | # fmt: off |
96 | 96 | # Constant from |
97 | 97 | # https://github.com/espressif/esp-idf/blob/master/components/soc/esp32/include/soc/soc.h |
98 | | -_DR_REG_EFUSE_BASE = const(0x3FF5A000) |
| 98 | +_DR_REG_EFUSE_BASE = const(0x3FF5A000) |
99 | 99 |
|
100 | 100 | # Constants from |
101 | 101 | # https://github.com/espressif/esp-idf/blob/master/components/soc/esp32/include/soc/efuse_reg.h |
102 | | -_EFUSE_ADC_VREF = const(0x0000001F) |
103 | | -_EFUSE_BLK0_RDATA4_REG = _DR_REG_EFUSE_BASE + 0x010 |
| 102 | +_EFUSE_ADC_VREF = const(0x0000001F) |
| 103 | +_EFUSE_BLK0_RDATA4_REG = _DR_REG_EFUSE_BASE + 0x010 |
104 | 104 |
|
105 | 105 | # Constants from |
106 | 106 | # esp_adc_cal_esp32.c |
107 | | -_ADC_12_BIT_RES = const(4096) |
108 | | -_LIN_COEFF_A_SCALE = const(65536) |
| 107 | +_ADC_12_BIT_RES = const(4096) |
| 108 | +_LIN_COEFF_A_SCALE = const(65536) |
109 | 109 | # LIN_COEFF_A_SCALE/2 |
110 | | -_LIN_COEFF_A_ROUND = const(32768) |
111 | | -_ADC1_VREF_ATTEN_SCALE = [57431, 76236, 105481, 196602] |
| 110 | +_LIN_COEFF_A_ROUND = const(32768) |
| 111 | +_ADC1_VREF_ATTEN_SCALE = [57431, 76236, 105481, 196602] |
112 | 112 | _ADC1_VREF_ATTEN_OFFSET = [75, 78, 107, 142] |
113 | | -_VREF_REG = _EFUSE_BLK0_RDATA4_REG |
114 | | -_VREF_OFFSET = const(1100) |
115 | | -_VREF_STEP_SIZE = const(7) |
116 | | -_VREF_FORMAT = const(0) |
117 | | -_VREF_MASK = const(0x1F) |
118 | | -_LUT_VREF_LOW = const(1000) |
119 | | -_LUT_VREF_HIGH = const(1200) |
120 | | -_LUT_ADC_STEP_SIZE = const(64) |
121 | | -_LUT_POINTS = const(20) |
122 | | -_LUT_LOW_THRESH = const(2880) |
123 | | -_LUT_HIGH_THRESH = _LUT_LOW_THRESH + _LUT_ADC_STEP_SIZE |
| 113 | +_VREF_REG = _EFUSE_BLK0_RDATA4_REG |
| 114 | +_VREF_OFFSET = const(1100) |
| 115 | +_VREF_STEP_SIZE = const(7) |
| 116 | +_VREF_FORMAT = const(0) |
| 117 | +_VREF_MASK = const(0x1F) |
| 118 | +_LUT_VREF_LOW = const(1000) |
| 119 | +_LUT_VREF_HIGH = const(1200) |
| 120 | +_LUT_ADC_STEP_SIZE = const(64) |
| 121 | +_LUT_POINTS = const(20) |
| 122 | +_LUT_LOW_THRESH = const(2880) |
| 123 | +_LUT_HIGH_THRESH = _LUT_LOW_THRESH + _LUT_ADC_STEP_SIZE |
124 | 124 | # fmt: on |
125 | 125 |
|
126 | 126 | # 20 Point lookup tables, covering ADC readings from 2880 to 4096, step size of 64 |
|
0 commit comments