Select one of the symbols to view example projects that use it.
 
Outline
#include <stdint.h>
#include "sdkconfig.h"
#include "esp_rom_regi2c.h"
#include "soc/regi2c_defs.h"
#define regi2c_read_reg_raw
#define regi2c_read_reg_mask_raw
#define regi2c_write_reg_raw
#define regi2c_write_reg_mask_raw
#define regi2c_ctrl_read_reg
#define regi2c_ctrl_read_reg_mask
#define regi2c_ctrl_write_reg
#define regi2c_ctrl_write_reg_mask
regi2c_ctrl_read_reg(uint8_t, uint8_t, uint8_t);
regi2c_ctrl_read_reg_mask(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t);
regi2c_ctrl_write_reg(uint8_t, uint8_t, uint8_t, uint8_t);
regi2c_ctrl_write_reg_mask(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t);
regi2c_enter_critical();
regi2c_exit_critical();
regi2c_saradc_enable();
regi2c_saradc_disable();
Files
loading...
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/esp_hw_support/include/esp_private/regi2c_ctrl.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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */ #pragma once #include <stdint.h> #include "sdkconfig.h" #include "esp_rom_regi2c.h" #include "soc/regi2c_defs.h" #ifdef __cplusplus extern "C" { #endif #define regi2c_read_reg_raw esp_rom_regi2c_read #define regi2c_read_reg_mask_raw esp_rom_regi2c_read_mask #define regi2c_write_reg_raw esp_rom_regi2c_write #define regi2c_write_reg_mask_raw esp_rom_regi2c_write_mask #ifdef BOOTLOADER_BUILD /** * If compiling for the bootloader, ROM functions can be called directly, * without the need of a lock. *//* ... */ #define regi2c_ctrl_read_reg regi2c_read_reg_raw #define regi2c_ctrl_read_reg_mask regi2c_read_reg_mask_raw #define regi2c_ctrl_write_reg regi2c_write_reg_raw #define regi2c_ctrl_write_reg_mask regi2c_write_reg_mask_raw /* ... */ #else /* Access internal registers, don't use in application */ uint8_t regi2c_ctrl_read_reg(uint8_t block, uint8_t host_id, uint8_t reg_add); uint8_t regi2c_ctrl_read_reg_mask(uint8_t block, uint8_t host_id, uint8_t reg_add, uint8_t msb, uint8_t lsb); void regi2c_ctrl_write_reg(uint8_t block, uint8_t host_id, uint8_t reg_add, uint8_t data); void regi2c_ctrl_write_reg_mask(uint8_t block, uint8_t host_id, uint8_t reg_add, uint8_t msb, uint8_t lsb, uint8_t data); /* enter the critical section that protects internal registers. Don't use it in SDK. Use the functions above. */ void regi2c_enter_critical(void); void regi2c_exit_critical(void); /* ... */ #endif // BOOTLOADER_BUILD /* Convenience macros for the above functions, these use register definitions * from regi2c_xxx.h header files. *//* ... */ #define REGI2C_WRITE_MASK(block, reg_add, indata) \ regi2c_ctrl_write_reg_mask(block, block##_HOSTID, reg_add, reg_add##_MSB, reg_add##_LSB, indata)... #define REGI2C_READ_MASK(block, reg_add) \ regi2c_ctrl_read_reg_mask(block, block##_HOSTID, reg_add, reg_add##_MSB, reg_add##_LSB)... #define REGI2C_WRITE(block, reg_add, indata) \ regi2c_ctrl_write_reg(block, block##_HOSTID, reg_add, indata)... #define REGI2C_READ(block, reg_add) \ regi2c_ctrl_read_reg(block, block##_HOSTID, reg_add)... /** * Restore regi2c analog calibration related configuration registers. * This is a workaround, and is fixed on later chips *//* ... */ #if REGI2C_ANA_CALI_PD_WORKAROUND void regi2c_analog_cali_reg_read(void); void regi2c_analog_cali_reg_write(void);/* ... */ #endif //#if ADC_CALI_PD_WORKAROUND #if SOC_TEMPERATURE_SENSOR_SUPPORT_SLEEP_RETENTION // regi2c would be powered down in light sleep, but measure range is recorded // in regi2c, so this function is used for record. void regi2c_tsens_reg_read(void); void regi2c_tsens_reg_write(void);/* ... */ #endif /* Enable/Disable regi2c_saradc with calling these two functions. With reference count protection inside. Internal use only. *//* ... */ void regi2c_saradc_enable(void); void regi2c_saradc_disable(void); #ifdef __cplusplus }{...} #endif
Details