diff --git a/components/soc/include/hal/gpio_types.h b/components/soc/include/hal/gpio_types.h index 97f6130625..f979220b0e 100644 --- a/components/soc/include/hal/gpio_types.h +++ b/components/soc/include/hal/gpio_types.h @@ -26,6 +26,8 @@ typedef enum { GPIO_PORT_MAX, } gpio_port_t; +/** @cond */ //Doxy command to hide preprocessor definitions from docs */ + #define GPIO_SEL_0 (BIT(0)) /*!< Pin 0 selected */ #define GPIO_SEL_1 (BIT(1)) /*!< Pin 1 selected */ #define GPIO_SEL_2 (BIT(2)) /*!< Pin 2 selected */ @@ -130,6 +132,8 @@ typedef enum { #define GPIO_PIN_REG_46 IO_MUX_GPIO46_REG #endif +/** @endcond */ + typedef enum { GPIO_NUM_NC = -1, /*!< Use to signal not connected to S/W */ GPIO_NUM_0 = 0, /*!< GPIO0, input and output */ diff --git a/components/soc/include/hal/spi_types.h b/components/soc/include/hal/spi_types.h index 715626a820..20d5904171 100644 --- a/components/soc/include/hal/spi_types.h +++ b/components/soc/include/hal/spi_types.h @@ -29,6 +29,8 @@ typedef enum { #endif } spi_host_device_t; +/** @cond */ //Doxy command to hide preprocessor definitions from docs */ + //alias for different chips #ifdef CONFIG_IDF_TARGET_ESP32 #define SPI_HOST SPI1_HOST @@ -40,3 +42,5 @@ typedef enum { #define HSPI_HOST SPI3_HOST #define VSPI_HOST SPI4_HOST #endif + +/** @endcond */ diff --git a/docs/en/api-reference/peripherals/adc.rst b/docs/en/api-reference/peripherals/adc.rst index c030b462a9..b960148126 100644 --- a/docs/en/api-reference/peripherals/adc.rst +++ b/docs/en/api-reference/peripherals/adc.rst @@ -19,9 +19,9 @@ Configuration and Reading ADC The ADC should be configured before reading is taken. - - For ADC1, configure desired precision and attenuation by calling functions :cpp:func:`adc1_config_width` and :cpp:func:`adc1_config_channel_atten`. + - For ADC1, configure desired precision and attenuation by calling functions :cpp:func:`adc1_config_width` and :cpp:func:`adc1_config_channel_atten`. - For ADC2, configure the attenuation by :cpp:func:`adc2_config_channel_atten`. The reading width of ADC2 is configured every time you take the reading. - + Attenuation configuration is done per channel, see :cpp:type:`adc1_channel_t` and :cpp:type:`adc2_channel_t`, set as a parameter of above functions. Then it is possible to read ADC conversion result with :cpp:func:`adc1_get_raw` and :cpp:func:`adc2_get_raw`. Reading width of ADC2 should be set as a parameter of :cpp:func:`adc2_get_raw` instead of in the configuration functions. @@ -55,7 +55,7 @@ Reading voltage on ADC2 channel 7 (GPIO 27):: #include ... - + int read_raw; adc2_config_channel_atten( ADC2_CHANNEL_7, ADC_ATTEN_0db ); @@ -92,7 +92,7 @@ The ESP32 ADC can be sensitive to noise leading to large discrepancies in ADC re .. figure:: ../../../_static/adc-noise-graph.jpg :align: center :alt: ADC noise mitigation - + Graph illustrating noise mitigation using capacitor and multisampling of 64 samples. ADC Calibration @@ -103,7 +103,7 @@ The :component_file:`esp_adc_cal/include/esp_adc_cal.h` API provides functions t .. figure:: ../../../_static/adc-vref-graph.jpg :align: center :alt: ADC reference voltage comparison - + Graph illustrating effect of differing reference voltages on the ADC voltage curve. Correcting ADC readings using this API involves characterizing one of the ADCs at a given attenuation to obtain a characteristics curve (ADC-Voltage curve) that takes into account the difference in ADC reference voltage. The characteristics curve is in the form of ``y = coeff_a * x + coeff_b`` and is used to convert ADC readings to voltages in mV. Calculation of the characteristics curve is based on calibration values which can be stored in eFuse or provided by the user. @@ -115,7 +115,7 @@ Calibration values are used to generate characteristic curves that account for t * **Two Point** values represent each of the ADCs’ readings at 150mV and 850mV. To obtain more accurate calibration results these values should be measured by user and burned into eFuse ``BLOCK3``. -* **eFuse Vref** represents the true ADC reference voltage. This value is measured and burned into eFuse ``BLOCK0`` during factory calibration. +* **eFuse Vref** represents the true ADC reference voltage. This value is measured and burned into eFuse ``BLOCK0`` during factory calibration. * **Default Vref** is an estimate of the ADC reference voltage provided by the user as a parameter during characterization. If Two Point or eFuse Vref values are unavailable, **Default Vref** will be used. @@ -124,7 +124,7 @@ Individual measurement and burning of the **eFuse Vref** has been applied to ESP .. figure:: ../../../_static/chip_surface_marking.png :align: center :alt: ESP32 Chip Surface Marking - + ESP32 Chip Surface Marking If you would like to purchase chips or modules with calibration, double check with distributor or Espressif directly. @@ -135,7 +135,7 @@ If you are unable to check the date code (i.e. the chip may be enclosed inside a $IDF_PATH/components/esptool_py/esptool/espefuse.py --port /dev/ttyUSB0 adc_info -Replace ``/dev/ttyUSB0`` with ESP32 board's port name. +Replace ``/dev/ttyUSB0`` with ESP32 board's port name. A chip that has specific **eFuse Vref** value programmed (in this case 1093mV) will be reported as follows:: @@ -163,9 +163,9 @@ Characterizing an ADC at a particular attenuation:: #include "driver/adc.h" #include "esp_adc_cal.h" - + ... - + //Characterize ADC at particular atten esp_adc_cal_characteristics_t *adc_chars = calloc(1, sizeof(esp_adc_cal_characteristics_t)); esp_adc_cal_value_t val_type = esp_adc_cal_characterize(unit, atten, ADC_WIDTH_BIT_12, DEFAULT_VREF, adc_chars); @@ -182,15 +182,15 @@ Reading an ADC then converting the reading to a voltage:: #include "driver/adc.h" #include "esp_adc_cal.h" - + ... uint32_t reading = adc1_get_raw(ADC1_CHANNEL_5); uint32_t voltage = esp_adc_cal_raw_to_voltage(reading, adc_chars); - + Routing ADC reference voltage to GPIO, so it can be manually measured (for **Default Vref**):: #include "driver/adc.h" - + ... esp_err_t status = adc2_vref_to_gpio(GPIO_NUM_25); @@ -226,6 +226,8 @@ ADC driver .. include:: /_build/inc/adc.inc +.. include:: /_build/inc/adc_types.inc + .. _adc-api-reference-adc-calibration: ADC Calibration diff --git a/docs/en/api-reference/peripherals/dac.rst b/docs/en/api-reference/peripherals/dac.rst index 053ba342f5..5050a1302e 100644 --- a/docs/en/api-reference/peripherals/dac.rst +++ b/docs/en/api-reference/peripherals/dac.rst @@ -39,3 +39,4 @@ e.g. 2. ``DAC_GPIO26_CHANNEL`` is the channel number of GPIO 26 (channel 2). .. include:: /_build/inc/dac_channel.inc +.. include:: /_build/inc/dac_types.inc diff --git a/docs/en/api-reference/peripherals/gpio.rst b/docs/en/api-reference/peripherals/gpio.rst index 9cb78f6f1d..314ec6e684 100644 --- a/docs/en/api-reference/peripherals/gpio.rst +++ b/docs/en/api-reference/peripherals/gpio.rst @@ -20,9 +20,10 @@ API Reference - Normal GPIO --------------------------- .. include:: /_build/inc/gpio.inc +.. include:: /_build/inc/gpio_types.inc API Reference - RTC GPIO ------------------------ .. include:: /_build/inc/rtc_io.inc - +.. include:: /_build/inc/rtc_io_types.inc diff --git a/docs/en/api-reference/peripherals/i2c.rst b/docs/en/api-reference/peripherals/i2c.rst index 264e7e71de..ed1ccc4ea3 100644 --- a/docs/en/api-reference/peripherals/i2c.rst +++ b/docs/en/api-reference/peripherals/i2c.rst @@ -250,3 +250,4 @@ API Reference ------------- .. include:: /_build/inc/i2c.inc +.. include:: /_build/inc/i2c_types.inc diff --git a/docs/en/api-reference/peripherals/i2s.rst b/docs/en/api-reference/peripherals/i2s.rst index 90add3dee3..4ad090ff51 100644 --- a/docs/en/api-reference/peripherals/i2s.rst +++ b/docs/en/api-reference/peripherals/i2s.rst @@ -209,4 +209,5 @@ API Reference ------------- .. include:: /_build/inc/i2s.inc +.. include:: /_build/inc/i2s_types.inc diff --git a/docs/en/api-reference/peripherals/ledc.rst b/docs/en/api-reference/peripherals/ledc.rst index 6d2c9413ce..715f9ca493 100644 --- a/docs/en/api-reference/peripherals/ledc.rst +++ b/docs/en/api-reference/peripherals/ledc.rst @@ -174,4 +174,5 @@ API Reference ------------- .. include:: /_build/inc/ledc.inc +.. include:: /_build/inc/ledc_types.inc diff --git a/docs/en/api-reference/peripherals/pcnt.rst b/docs/en/api-reference/peripherals/pcnt.rst index 8934f0baf6..334f35b11e 100644 --- a/docs/en/api-reference/peripherals/pcnt.rst +++ b/docs/en/api-reference/peripherals/pcnt.rst @@ -93,4 +93,5 @@ API Reference ------------- .. include:: /_build/inc/pcnt.inc +.. include:: /_build/inc/pcnt_types.inc diff --git a/docs/en/api-reference/peripherals/rmt.rst b/docs/en/api-reference/peripherals/rmt.rst index 7e09a9e06c..74723402b3 100644 --- a/docs/en/api-reference/peripherals/rmt.rst +++ b/docs/en/api-reference/peripherals/rmt.rst @@ -265,4 +265,5 @@ API Reference ------------- .. include:: /_build/inc/rmt.inc +.. include:: /_build/inc/rmt_types.inc diff --git a/docs/en/api-reference/peripherals/sigmadelta.rst b/docs/en/api-reference/peripherals/sigmadelta.rst index 34d7c7aeb1..a1e06bc816 100644 --- a/docs/en/api-reference/peripherals/sigmadelta.rst +++ b/docs/en/api-reference/peripherals/sigmadelta.rst @@ -30,3 +30,4 @@ API Reference ------------- .. include:: /_build/inc/sigmadelta.inc +.. include:: /_build/inc/sigmadelta_types.inc diff --git a/docs/en/api-reference/peripherals/timer.rst b/docs/en/api-reference/peripherals/timer.rst index 385c5699c6..4b4f02b081 100644 --- a/docs/en/api-reference/peripherals/timer.rst +++ b/docs/en/api-reference/peripherals/timer.rst @@ -107,3 +107,4 @@ API Reference ------------- .. include:: /_build/inc/timer.inc +.. include:: /_build/inc/timer_types.inc diff --git a/docs/en/api-reference/peripherals/uart.rst b/docs/en/api-reference/peripherals/uart.rst index 859f269d5b..21d3028329 100644 --- a/docs/en/api-reference/peripherals/uart.rst +++ b/docs/en/api-reference/peripherals/uart.rst @@ -380,6 +380,7 @@ API Reference ------------- .. include:: /_build/inc/uart.inc +.. include:: /_build/inc/uart_types.inc GPIO Lookup Macros diff --git a/docs/zh_CN/api-reference/peripherals/ledc.rst b/docs/zh_CN/api-reference/peripherals/ledc.rst index d2374420f7..d35bed51a9 100644 --- a/docs/zh_CN/api-reference/peripherals/ledc.rst +++ b/docs/zh_CN/api-reference/peripherals/ledc.rst @@ -1 +1 @@ -.. include:: ../../../en/api-reference/peripherals/ledc.rst \ No newline at end of file +.. include:: ../../../en/api-reference/peripherals/ledc.rst diff --git a/docs/zh_CN/api-reference/peripherals/timer.rst b/docs/zh_CN/api-reference/peripherals/timer.rst index 2d01e6a4dd..184b245c3d 100644 --- a/docs/zh_CN/api-reference/peripherals/timer.rst +++ b/docs/zh_CN/api-reference/peripherals/timer.rst @@ -105,3 +105,4 @@ API 参考 ------------- .. include:: /_build/inc/timer.inc +.. include:: /_build/inc/timer_types.inc