Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/ulp_fsm_adc_s3' into 'master'
ulp-fsm: Update ulp-fsm ADC example with S3 support Closes IDFGH-6299 See merge request espressif/esp-idf!19924
- Loading branch information
Showing
11 changed files
with
118 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "hal/adc_types.h" | ||
#include "esp_err.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef struct { | ||
adc_unit_t adc_n; // ADC Unit | ||
adc_channel_t channel; // ADC channel | ||
adc_atten_t atten; // ADC channel attenuation | ||
adc_bitwidth_t width; // ADC bit width, only used for ADC unit 1 | ||
adc_ulp_mode_t ulp_mode; // ADC ULP Mode | ||
} ulp_adc_cfg_t; // ULP FSM ADC configuration parameters | ||
|
||
/** | ||
* @brief Initialize and calibrate the ADC for use by ULP FSM | ||
* | ||
* @param cfg Configuration parameters | ||
* @return esp_err_t ESP_OK for successful. | ||
*/ | ||
esp_err_t ulp_adc_init(const ulp_adc_cfg_t *cfg); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Unlicense OR CC0-1.0 | ||
*/ | ||
#pragma once | ||
|
||
/* Ints are used here to be able to include the file in assembly as well */ | ||
#define EXAMPLE_ADC_CHANNEL 6 // ADC_CHANNEL_6, GPIO34 on ESP32, GPIO7 on ESP32-S3 | ||
#define EXAMPLE_ADC_UNIT 0 // ADC_UNIT_1 | ||
#define EXAMPLE_ADC_ATTEN 3 // ADC_ATTEN_DB_11 | ||
#define EXAMPLE_ADC_WIDTH 0 // ADC_BITWIDTH_DEFAULT | ||
|
||
/* Set low and high thresholds, approx. 1.35V - 1.75V*/ | ||
#define EXAMPLE_ADC_LOW_TRESHOLD 1500 | ||
#define EXAMPLE_ADC_HIGH_TRESHOLD 2000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
|
||
|
||
@pytest.mark.esp32 | ||
@pytest.mark.esp32s3 | ||
@pytest.mark.generic | ||
def test_ulp_fsm_adc(dut: Dut) -> None: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters