Chapter 2. API Reference
Type Definitions
typedef struct dedic_gpio_bundle_t *dedic_gpio_bundle_handle_t
Type of Dedicated GPIO bundle.
typedef bool (*dedic_gpio_isr_callback_t)(dedic_gpio_bundle_handle_t bundle, uint32_t in-
dex, void *args)
Type of dedicated GPIO ISR callback function.
Return If a high priority task is woken up by the callback function
Parameters
• bundle: Handle of GPIO bundle that returned from “dedic_gpio_new_bundle”
• index: Index of the GPIO in its corresponding bundle (count from 0)
• args: User defined arguments for the callback function. It’s passed through
dedic_gpio_bundle_set_interrupt_and_callback
Enumerations
enum dedic_gpio_intr_type_t
Supported type of dedicated GPIO interrupt.
Values:
DEDIC_GPIO_INTR_NONE
No interrupt
DEDIC_GPIO_INTR_LOW_LEVEL = 2
Interrupt on low level
DEDIC_GPIO_INTR_HIGH_LEVEL
Interrupt on high level
DEDIC_GPIO_INTR_NEG_EDGE
Interrupt on negedge
DEDIC_GPIO_INTR_POS_EDGE
Interrupt on posedge
DEDIC_GPIO_INTR_BOTH_EDGE
Interrupt on both negedge and posedge
2.2.6 Hash-based Message Authentication Code (HMAC)
The HMAC (Hash-based Message Authentication Code) module provides hardware acceleration for SHA256-
HMAC generation using a key burned into an eFuse block. HMACs work with pre-shared secret keys and provide
authenticity and integrity to a message.
For more detailed information on the application workflow and the HMAC calculation process, see ESP32-S2 Tech-
nical Reference Manual > HMAC Accelerator (HMAC) [PDF].
Generalized Application Scheme
Let there be two parties, A and B. They want to verify the authenticity and integrity of messages sent between each
other. Before they can start sending messages, they need to exchange the secret key via a secure channel. To verify
A’s messages, B can do the following:
• A calculates the HMAC of the message it wants to send.
• A sends the message and the HMAC to B.
• B calculates HMAC of the received message itself.
• B checks wether the received and calculated HMACs match. If they do match, the message is authentic.
However, the HMAC itself isn’t bound to this use case. It can also be used for challenge-response protocols
supporting HMAC or as a key input for further security modules (see below), etc.
Espressif Systems 272
Submit Document Feedback
Release v4.4