Skip to content

Commit a49a5df

Browse files
eren-terziogluxiaoxiang781216
authored andcommitted
esp32[c3|c6|h2]: Update docs for efuse driver
1 parent 35ace41 commit a49a5df

File tree

7 files changed

+151
-3
lines changed

7 files changed

+151
-3
lines changed

Documentation/platforms/risc-v/esp32c3/boards/esp32c3-generic/index.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,43 @@ disables the NuttShell to get the best possible score.
142142
.. note:: As the NSH is disabled, the application will start as soon as the
143143
system is turned on.
144144

145+
efuse
146+
-----
147+
148+
This configuration demonstrates the use of the eFuse driver. It can be accessed
149+
through the ``/dev/efuse`` device file.
150+
Virtual eFuse mode can be used by enabling `CONFIG_ESPRESSIF_EFUSE_VIRTUAL`
151+
option to prevent possible damages on chip.
152+
153+
The following snippet demonstrates how to read MAC address:
154+
155+
.. code-block:: C
156+
157+
int fd;
158+
int ret;
159+
uint8_t mac[6];
160+
struct efuse_param_s param;
161+
struct efuse_desc_s mac_addr =
162+
{
163+
.bit_offset = 1,
164+
.bit_count = 48
165+
};
166+
167+
const efuse_desc_t* desc[] =
168+
{
169+
&mac_addr,
170+
NULL
171+
};
172+
param.field = desc;
173+
param.size = 48;
174+
param.data = mac;
175+
176+
fd = open("/dev/efuse", O_RDONLY);
177+
ret = ioctl(fd, EFUSEIOC_READ_FIELD, &param);
178+
179+
To find offset and count variables for related eFuse,
180+
please refer to Espressif's Technical Reference Manuals.
181+
145182
gpio
146183
----
147184

Documentation/platforms/risc-v/esp32c3/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ Bluetooth No
291291
CAN/TWAI Yes
292292
CDC Console Yes Rev.3
293293
DMA Yes
294-
eFuse No
294+
eFuse Yes Also virtual mode supported
295295
GPIO Yes
296296
I2C Yes
297297
LED_PWM Yes

Documentation/platforms/risc-v/esp32c6/boards/esp32c6-devkitc/index.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,43 @@ disables the NuttShell to get the best possible score.
125125
.. note:: As the NSH is disabled, the application will start as soon as the
126126
system is turned on.
127127

128+
efuse
129+
-----
130+
131+
This configuration demonstrates the use of the eFuse driver. It can be accessed
132+
through the ``/dev/efuse`` device file.
133+
Virtual eFuse mode can be used by enabling `CONFIG_ESPRESSIF_EFUSE_VIRTUAL`
134+
option to prevent possible damages on chip.
135+
136+
The following snippet demonstrates how to read MAC address:
137+
138+
.. code-block:: C
139+
140+
int fd;
141+
int ret;
142+
uint8_t mac[6];
143+
struct efuse_param_s param;
144+
struct efuse_desc_s mac_addr =
145+
{
146+
.bit_offset = 1,
147+
.bit_count = 48
148+
};
149+
150+
const efuse_desc_t* desc[] =
151+
{
152+
&mac_addr,
153+
NULL
154+
};
155+
param.field = desc;
156+
param.size = 48;
157+
param.data = mac;
158+
159+
fd = open("/dev/efuse", O_RDONLY);
160+
ret = ioctl(fd, EFUSEIOC_READ_FIELD, &param);
161+
162+
To find offset and count variables for related eFuse,
163+
please refer to Espressif's Technical Reference Manuals.
164+
128165
gpio
129166
----
130167

Documentation/platforms/risc-v/esp32c6/boards/esp32c6-devkitm/index.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,43 @@ disables the NuttShell to get the best possible score.
109109
.. note:: As the NSH is disabled, the application will start as soon as the
110110
system is turned on.
111111

112+
efuse
113+
-----
114+
115+
This configuration demonstrates the use of the eFuse driver. It can be accessed
116+
through the ``/dev/efuse`` device file.
117+
Virtual eFuse mode can be used by enabling `CONFIG_ESPRESSIF_EFUSE_VIRTUAL`
118+
option to prevent possible damages on chip.
119+
120+
The following snippet demonstrates how to read MAC address:
121+
122+
.. code-block:: C
123+
124+
int fd;
125+
int ret;
126+
uint8_t mac[6];
127+
struct efuse_param_s param;
128+
struct efuse_desc_s mac_addr =
129+
{
130+
.bit_offset = 1,
131+
.bit_count = 48
132+
};
133+
134+
const efuse_desc_t* desc[] =
135+
{
136+
&mac_addr,
137+
NULL
138+
};
139+
param.field = desc;
140+
param.size = 48;
141+
param.data = mac;
142+
143+
fd = open("/dev/efuse", O_RDONLY);
144+
ret = ioctl(fd, EFUSEIOC_READ_FIELD, &param);
145+
146+
To find offset and count variables for related eFuse,
147+
please refer to Espressif's Technical Reference Manuals.
148+
112149
gpio
113150
----
114151

Documentation/platforms/risc-v/esp32c6/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ Bluetooth No
278278
CAN/TWAI Yes
279279
DMA Yes
280280
ECC No
281-
eFuse No
281+
eFuse Yes
282282
GPIO Yes
283283
HMAC No
284284
I2C Yes

Documentation/platforms/risc-v/esp32h2/boards/esp32h2-devkit/index.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,43 @@ disables the NuttShell to get the best possible score.
108108
.. note:: As the NSH is disabled, the application will start as soon as the
109109
system is turned on.
110110

111+
efuse
112+
-----
113+
114+
This configuration demonstrates the use of the eFuse driver. It can be accessed
115+
through the ``/dev/efuse`` device file.
116+
Virtual eFuse mode can be used by enabling `CONFIG_ESPRESSIF_EFUSE_VIRTUAL`
117+
option to prevent possible damages on chip.
118+
119+
The following snippet demonstrates how to read MAC address:
120+
121+
.. code-block:: C
122+
123+
int fd;
124+
int ret;
125+
uint8_t mac[6];
126+
struct efuse_param_s param;
127+
struct efuse_desc_s mac_addr =
128+
{
129+
.bit_offset = 1,
130+
.bit_count = 48
131+
};
132+
133+
const efuse_desc_t* desc[] =
134+
{
135+
&mac_addr,
136+
NULL
137+
};
138+
param.field = desc;
139+
param.size = 48;
140+
param.data = mac;
141+
142+
fd = open("/dev/efuse", O_RDONLY);
143+
ret = ioctl(fd, EFUSEIOC_READ_FIELD, &param);
144+
145+
To find offset and count variables for related eFuse,
146+
please refer to Espressif's Technical Reference Manuals.
147+
111148
gpio
112149
----
113150

Documentation/platforms/risc-v/esp32h2/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ Bluetooth No
278278
CAN/TWAI Yes
279279
DMA Yes
280280
ECC No
281-
eFuse No
281+
eFuse Yes
282282
GPIO Yes
283283
HMAC No
284284
I2C Yes

0 commit comments

Comments
 (0)