EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #281 background imageLoading...
Page #281 background image
Chapter 2. API Reference
Functions
esp_err_t dedic_gpio_get_out_mask(dedic_gpio_bundle_handle_t bundle, uint32_t *mask)
Get allocated channel mask.
Return
ESP_OK: Get channel mask successfully
ESP_ERR_INVALID_ARG: Get channel mask failed because of invalid argument
ESP_FAIL: Get channel mask failed because of other error
Note Each bundle should have at least one mask (in or/and out), based on bundle configuration.
Note With the returned mask, user can directly invoke LL function likecpu_ll_write_dedic_gpio_maskor
write assembly code with dedicated GPIO instructions, to get better performance on GPIO manipulation.
Parameters
[in] bundle: Handle of GPIO bundle that returned from dedic_gpio_new_bundle
[out] mask: Returned mask value for on specific direction (in or out)
esp_err_t dedic_gpio_get_in_mask(dedic_gpio_bundle_handle_t bundle, uint32_t *mask)
esp_err_t dedic_gpio_new_bundle(const dedic_gpio_bundle_config_t *config,
dedic_gpio_bundle_handle_t *ret_bundle)
Create GPIO bundle and return the handle.
Return
ESP_OK: Create GPIO bundle successfully
ESP_ERR_INVALID_ARG: Create GPIO bundle failed because of invalid argument
ESP_ERR_NO_MEM: Create GPIO bundle failed because of no capable memory
ESP_ERR_NOT_FOUND: Create GPIO bundle failed because of no enough continuous dedicated
channels
ESP_FAIL: Create GPIO bundle failed because of other error
Note One has to enable at least input or output mode in configparameter.
Parameters
[in] config: Configuration of GPIO bundle
[out] ret_bundle: Returned handle of the new created GPIO bundle
esp_err_t dedic_gpio_del_bundle(dedic_gpio_bundle_handle_t bundle)
Destory GPIO bundle.
Return
ESP_OK: Destory GPIO bundle successfully
ESP_ERR_INVALID_ARG: Destory GPIO bundle failed because of invalid argument
ESP_FAIL: Destory GPIO bundle failed because of other error
Parameters
[in] bundle: Handle of GPIO bundle that returned from dedic_gpio_new_bundle
void dedic_gpio_bundle_write(dedic_gpio_bundle_handle_t bundle, uint32_t mask, uint32_t
value)
Write value to GPIO bundle.
Note The mask is seen from the view of GPIO bundle. For example, bundleA contains [GPIO10, GPIO12,
GPIO17], to set GPIO17 individually, the mask should be 0x04.
Note For performance reasons, this function doesnt check the validity of any parameters, and is placed in
IRAM.
Parameters
[in] bundle: Handle of GPIO bundle that returned from dedic_gpio_new_bundle
[in] mask: Mask of the GPIOs to be written in the given bundle
[in] value: Value to write to given GPIO bundle, low bit represents low member in the bundle
uint32_t dedic_gpio_bundle_read_out(dedic_gpio_bundle_handle_t bundle)
Read the value that output from the given GPIO bundle.
Return Value that output from the GPIO bundle, low bit represents low member in the bundle
Note For performance reasons, this function doesnt check the validity of any parameters, and is placed in
IRAM.
Parameters
[in] bundle: Handle of GPIO bundle that returned from dedic_gpio_new_bundle
Espressif Systems 270
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish