Skip to content

Commit

Permalink
esp32[c3|c6|h2]: Update docs for efuse driver
Browse files Browse the repository at this point in the history
  • Loading branch information
eren-terzioglu committed Dec 16, 2024
1 parent 388f7aa commit 1527fc7
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,43 @@ disables the NuttShell to get the best possible score.
.. note:: As the NSH is disabled, the application will start as soon as the
system is turned on.

efuse
-----

This configuration demonstrates the use of the eFuse driver. It can be accessed
through the ``/dev/efuse`` device file.
Virtual eFuse mode can be used by enabling `CONFIG_ESPRESSIF_EFUSE_VIRTUAL`
option to prevent possible damages on chip.

The following snippet demonstrates how to read MAC address:

.. code-block:: C
int fd;
int ret;
uint8_t mac[6];
struct efuse_param_s param;
struct efuse_desc_s mac_addr =
{
.bit_offset = 1,
.bit_count = 48
};
const efuse_desc_t* desc[] =
{
&mac_addr,
NULL
};
param.field = desc;
param.size = 48;
param.data = mac;
fd = open("/dev/efuse", O_RDONLY);
ret = ioctl(fd, EFUSEIOC_READ_FIELD, &param);
To find offset and count variables for related eFuse,
please refer to Espressif's Technical Reference Manuals.

gpio
----

Expand Down
2 changes: 1 addition & 1 deletion Documentation/platforms/risc-v/esp32c3/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ Bluetooth No
CAN/TWAI Yes
CDC Console Yes Rev.3
DMA Yes
eFuse No
eFuse Yes Also virtual mode supported
GPIO Yes
I2C Yes
LED_PWM Yes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,43 @@ disables the NuttShell to get the best possible score.
.. note:: As the NSH is disabled, the application will start as soon as the
system is turned on.

efuse
-----

This configuration demonstrates the use of the eFuse driver. It can be accessed
through the ``/dev/efuse`` device file.
Virtual eFuse mode can be used by enabling `CONFIG_ESPRESSIF_EFUSE_VIRTUAL`
option to prevent possible damages on chip.

The following snippet demonstrates how to read MAC address:

.. code-block:: C
int fd;
int ret;
uint8_t mac[6];
struct efuse_param_s param;
struct efuse_desc_s mac_addr =
{
.bit_offset = 1,
.bit_count = 48
};
const efuse_desc_t* desc[] =
{
&mac_addr,
NULL
};
param.field = desc;
param.size = 48;
param.data = mac;
fd = open("/dev/efuse", O_RDONLY);
ret = ioctl(fd, EFUSEIOC_READ_FIELD, &param);
To find offset and count variables for related eFuse,
please refer to Espressif's Technical Reference Manuals.

gpio
----

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,43 @@ disables the NuttShell to get the best possible score.
.. note:: As the NSH is disabled, the application will start as soon as the
system is turned on.

efuse
-----

This configuration demonstrates the use of the eFuse driver. It can be accessed
through the ``/dev/efuse`` device file.
Virtual eFuse mode can be used by enabling `CONFIG_ESPRESSIF_EFUSE_VIRTUAL`
option to prevent possible damages on chip.

The following snippet demonstrates how to read MAC address:

.. code-block:: C
int fd;
int ret;
uint8_t mac[6];
struct efuse_param_s param;
struct efuse_desc_s mac_addr =
{
.bit_offset = 1,
.bit_count = 48
};
const efuse_desc_t* desc[] =
{
&mac_addr,
NULL
};
param.field = desc;
param.size = 48;
param.data = mac;
fd = open("/dev/efuse", O_RDONLY);
ret = ioctl(fd, EFUSEIOC_READ_FIELD, &param);
To find offset and count variables for related eFuse,
please refer to Espressif's Technical Reference Manuals.

gpio
----

Expand Down
2 changes: 1 addition & 1 deletion Documentation/platforms/risc-v/esp32c6/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ Bluetooth No
CAN/TWAI Yes
DMA Yes
ECC No
eFuse No
eFuse Yes
GPIO Yes
HMAC No
I2C Yes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,43 @@ disables the NuttShell to get the best possible score.
.. note:: As the NSH is disabled, the application will start as soon as the
system is turned on.

efuse
-----

This configuration demonstrates the use of the eFuse driver. It can be accessed
through the ``/dev/efuse`` device file.
Virtual eFuse mode can be used by enabling `CONFIG_ESPRESSIF_EFUSE_VIRTUAL`
option to prevent possible damages on chip.

The following snippet demonstrates how to read MAC address:

.. code-block:: C
int fd;
int ret;
uint8_t mac[6];
struct efuse_param_s param;
struct efuse_desc_s mac_addr =
{
.bit_offset = 1,
.bit_count = 48
};
const efuse_desc_t* desc[] =
{
&mac_addr,
NULL
};
param.field = desc;
param.size = 48;
param.data = mac;
fd = open("/dev/efuse", O_RDONLY);
ret = ioctl(fd, EFUSEIOC_READ_FIELD, &param);
To find offset and count variables for related eFuse,
please refer to Espressif's Technical Reference Manuals.

gpio
----

Expand Down
2 changes: 1 addition & 1 deletion Documentation/platforms/risc-v/esp32h2/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ Bluetooth No
CAN/TWAI Yes
DMA Yes
ECC No
eFuse No
eFuse Yes
GPIO Yes
HMAC No
I2C Yes
Expand Down

0 comments on commit 1527fc7

Please sign in to comment.