From 7abd9bc023d183b1ebdd01da39b57a62cdff088b Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Wed, 31 May 2017 18:22:48 +0800 Subject: [PATCH 1/2] ULP: remove deprecated cycle_sel field from ADC instruction Cycle_sel field was never used in binutils and was always set to zero. This change removes it from documentation and examples. Needs ULP binutils with this change: https://github.com/espressif/binutils-esp32ulp/commit/af79434 --- docs/api-guides/ulp_instruction_set.rst | 12 ++++++------ examples/system/ulp_adc/main/ulp/adc.S | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/api-guides/ulp_instruction_set.rst b/docs/api-guides/ulp_instruction_set.rst index fdabb7f6b..dda5a7067 100755 --- a/docs/api-guides/ulp_instruction_set.rst +++ b/docs/api-guides/ulp_instruction_set.rst @@ -651,21 +651,21 @@ Similar considerations apply to ``LD`` and ``ST`` instructions. Consider the fol --------------------------------- **Syntax** - **ADC** *Rdst, Sar_sel, Mux, Cycles* + - **ADC** *Rdst, Sar_sel, Mux* + + - **ADC** *Rdst, Sar_sel, Mux, 0* — deprecated form **Operands** - - *Rdst* – Destination Register R[0..3], result will be stored to this register - - *Sar_sel* – selected ADC : 0=SARADC0, 1=SARADC1 + - *Rdst* – Destination Register R[0..3], result will be stored to this register + - *Sar_sel* – Select ADC: 0 = SARADC1, 1 = SARADC2 - *Mux* - selected PAD, SARADC Pad[Mux+1] is enabled - - *Cycle* – number of cycles used to perform measurement **Description** The instruction makes measurements from ADC. **Examples**:: - 1: ADC R1, 0, 1, 100 // Measure value using ADC1 pad 2, - // for 100 cycles and move result to R1 + 1: ADC R1, 0, 1 // Measure value using ADC1 pad 2 and store result into R1 **REG_RD** – read from peripheral register diff --git a/examples/system/ulp_adc/main/ulp/adc.S b/examples/system/ulp_adc/main/ulp/adc.S index 9450f55d2..1f0f6d5ac 100644 --- a/examples/system/ulp_adc/main/ulp/adc.S +++ b/examples/system/ulp_adc/main/ulp/adc.S @@ -72,7 +72,7 @@ entry: stage_rst measure: /* measure and add value to accumulator */ - adc r1, 0, adc_channel + 1, 0 + adc r1, 0, adc_channel + 1 add r0, r0, r1 /* increment loop counter and check exit condition */ stage_inc 1 From 3a787c48307247e359007d3c2f150a3102d631e7 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Wed, 31 May 2017 18:23:24 +0800 Subject: [PATCH 2/2] ulp: fix macro names in documentation --- docs/api-guides/ulp_instruction_set.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-guides/ulp_instruction_set.rst b/docs/api-guides/ulp_instruction_set.rst index dda5a7067..fa280b8b8 100755 --- a/docs/api-guides/ulp_instruction_set.rst +++ b/docs/api-guides/ulp_instruction_set.rst @@ -740,7 +740,7 @@ READ_RTC_FIELD(rtc_reg, field) #include "soc/sens_reg.h" /* Read 8-bit SENS_TSENS_OUT field of SENS_SAR_SLAVE_ADDR3_REG into R0 */ - READ_RTC_REG(SENS_SAR_SLAVE_ADDR3_REG, SENS_TSENS_OUT) + READ_RTC_FIELD(SENS_SAR_SLAVE_ADDR3_REG, SENS_TSENS_OUT) WRITE_RTC_REG(rtc_reg, low_bit, bit_width, value) Write immediate value into rtc_reg[low_bit + bit_width - 1 : low_bit], bit_width <= 8. For example:: @@ -759,7 +759,7 @@ WRITE_RTC_FIELD(rtc_reg, field, value) #include "soc/rtc_cntl_reg.h" /* Set RTC_CNTL_ULP_CP_SLP_TIMER_EN field of RTC_CNTL_STATE0_REG to 0 */ - READ_RTC_REG(RTC_CNTL_STATE0_REG, RTC_CNTL_ULP_CP_SLP_TIMER_EN, 0) + WRITE_RTC_FIELD(RTC_CNTL_STATE0_REG, RTC_CNTL_ULP_CP_SLP_TIMER_EN, 0)