mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-01 06:27:29 +00:00
Moved api documentation to new folders / categories
This commit is contained in:
152
docs/api/peripherals/gpio.rst
Normal file
152
docs/api/peripherals/gpio.rst
Normal file
@@ -0,0 +1,152 @@
|
||||
GPIO
|
||||
====
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
The ESP32 chip features 40 physical GPIO pads. Some GPIO pads cannot be used or do not have the corresponding pin on the chip package(refer to technical reference manual ). Each pad can be used as a general purpose I/O or can be connected to an internal peripheral signal.
|
||||
Note that GPIO6-11 are usually used for SPI flash. GPIO34-39 can only be set as input mode.
|
||||
|
||||
Application Example
|
||||
-------------------
|
||||
|
||||
GPIO output and input interrupt example: `examples/21_gpio <https://github.com/espressif/esp-idf/tree/master/examples/21_gpio>`_.
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
|
||||
Header Files
|
||||
^^^^^^^^^^^^
|
||||
|
||||
* `driver/include/driver/driver/gpio.h <https://github.com/espressif/esp-idf/blob/master/components/driver/include/driver/gpio.h>`_
|
||||
|
||||
Macros
|
||||
^^^^^^
|
||||
|
||||
.. doxygendefine:: GPIO_SEL_0
|
||||
.. doxygendefine:: GPIO_SEL_1
|
||||
.. doxygendefine:: GPIO_SEL_2
|
||||
.. doxygendefine:: GPIO_SEL_3
|
||||
.. doxygendefine:: GPIO_SEL_4
|
||||
.. doxygendefine:: GPIO_SEL_5
|
||||
.. doxygendefine:: GPIO_SEL_6
|
||||
.. doxygendefine:: GPIO_SEL_7
|
||||
.. doxygendefine:: GPIO_SEL_8
|
||||
.. doxygendefine:: GPIO_SEL_9
|
||||
.. doxygendefine:: GPIO_SEL_10
|
||||
.. doxygendefine:: GPIO_SEL_11
|
||||
.. doxygendefine:: GPIO_SEL_12
|
||||
.. doxygendefine:: GPIO_SEL_13
|
||||
.. doxygendefine:: GPIO_SEL_14
|
||||
.. doxygendefine:: GPIO_SEL_15
|
||||
.. doxygendefine:: GPIO_SEL_16
|
||||
.. doxygendefine:: GPIO_SEL_17
|
||||
.. doxygendefine:: GPIO_SEL_18
|
||||
.. doxygendefine:: GPIO_SEL_19
|
||||
.. doxygendefine:: GPIO_SEL_21
|
||||
.. doxygendefine:: GPIO_SEL_22
|
||||
.. doxygendefine:: GPIO_SEL_23
|
||||
.. doxygendefine:: GPIO_SEL_25
|
||||
.. doxygendefine:: GPIO_SEL_26
|
||||
.. doxygendefine:: GPIO_SEL_27
|
||||
.. doxygendefine:: GPIO_SEL_32
|
||||
.. doxygendefine:: GPIO_SEL_33
|
||||
.. doxygendefine:: GPIO_SEL_34
|
||||
.. doxygendefine:: GPIO_SEL_35
|
||||
.. doxygendefine:: GPIO_SEL_36
|
||||
.. doxygendefine:: GPIO_SEL_37
|
||||
.. doxygendefine:: GPIO_SEL_38
|
||||
.. doxygendefine:: GPIO_SEL_39
|
||||
.. doxygendefine:: GPIO_PIN_REG_0
|
||||
.. doxygendefine:: GPIO_PIN_REG_1
|
||||
.. doxygendefine:: GPIO_PIN_REG_2
|
||||
.. doxygendefine:: GPIO_PIN_REG_3
|
||||
.. doxygendefine:: GPIO_PIN_REG_4
|
||||
.. doxygendefine:: GPIO_PIN_REG_5
|
||||
.. doxygendefine:: GPIO_PIN_REG_6
|
||||
.. doxygendefine:: GPIO_PIN_REG_7
|
||||
.. doxygendefine:: GPIO_PIN_REG_8
|
||||
.. doxygendefine:: GPIO_PIN_REG_9
|
||||
.. doxygendefine:: GPIO_PIN_REG_10
|
||||
.. doxygendefine:: GPIO_PIN_REG_11
|
||||
.. doxygendefine:: GPIO_PIN_REG_12
|
||||
.. doxygendefine:: GPIO_PIN_REG_13
|
||||
.. doxygendefine:: GPIO_PIN_REG_14
|
||||
.. doxygendefine:: GPIO_PIN_REG_15
|
||||
.. doxygendefine:: GPIO_PIN_REG_16
|
||||
.. doxygendefine:: GPIO_PIN_REG_17
|
||||
.. doxygendefine:: GPIO_PIN_REG_18
|
||||
.. doxygendefine:: GPIO_PIN_REG_19
|
||||
.. doxygendefine:: GPIO_PIN_REG_20
|
||||
.. doxygendefine:: GPIO_PIN_REG_21
|
||||
.. doxygendefine:: GPIO_PIN_REG_22
|
||||
.. doxygendefine:: GPIO_PIN_REG_23
|
||||
.. doxygendefine:: GPIO_PIN_REG_25
|
||||
.. doxygendefine:: GPIO_PIN_REG_26
|
||||
.. doxygendefine:: GPIO_PIN_REG_27
|
||||
.. doxygendefine:: GPIO_PIN_REG_32
|
||||
.. doxygendefine:: GPIO_PIN_REG_33
|
||||
.. doxygendefine:: GPIO_PIN_REG_34
|
||||
.. doxygendefine:: GPIO_PIN_REG_35
|
||||
.. doxygendefine:: GPIO_PIN_REG_36
|
||||
.. doxygendefine:: GPIO_PIN_REG_37
|
||||
.. doxygendefine:: GPIO_PIN_REG_38
|
||||
.. doxygendefine:: GPIO_PIN_REG_39
|
||||
.. doxygendefine:: GPIO_APP_CPU_INTR_ENA
|
||||
.. doxygendefine:: GPIO_APP_CPU_NMI_INTR_ENA
|
||||
.. doxygendefine:: GPIO_PRO_CPU_INTR_ENA
|
||||
.. doxygendefine:: GPIO_PRO_CPU_NMI_INTR_ENA
|
||||
.. doxygendefine:: GPIO_SDIO_EXT_INTR_ENA
|
||||
.. doxygendefine:: GPIO_MODE_DEF_INPUT
|
||||
.. doxygendefine:: GPIO_MODE_DEF_OUTPUT
|
||||
.. doxygendefine:: GPIO_MODE_DEF_OD
|
||||
.. doxygendefine:: GPIO_PIN_COUNT
|
||||
.. doxygendefine:: GPIO_IS_VALID_GPIO
|
||||
.. doxygendefine:: GPIO_IS_VALID_OUTPUT_GPIO
|
||||
|
||||
Type Definitions
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygentypedef:: gpio_isr_t
|
||||
.. doxygentypedef:: gpio_isr_handle_t
|
||||
|
||||
Enumerations
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. doxygenenum:: gpio_num_t
|
||||
.. doxygenenum:: gpio_int_type_t
|
||||
.. doxygenenum:: gpio_mode_t
|
||||
.. doxygenenum:: gpio_pullup_t
|
||||
.. doxygenenum:: gpio_pulldown_t
|
||||
.. doxygenenum:: gpio_pull_mode_t
|
||||
|
||||
Structures
|
||||
^^^^^^^^^^
|
||||
|
||||
.. doxygenstruct:: gpio_config_t
|
||||
:members:
|
||||
|
||||
|
||||
Functions
|
||||
^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: gpio_config
|
||||
.. doxygenfunction:: gpio_set_intr_type
|
||||
.. doxygenfunction:: gpio_intr_enable
|
||||
.. doxygenfunction:: gpio_intr_disable
|
||||
.. doxygenfunction:: gpio_set_level
|
||||
.. doxygenfunction:: gpio_get_level
|
||||
.. doxygenfunction:: gpio_set_direction
|
||||
.. doxygenfunction:: gpio_set_pull_mode
|
||||
.. doxygenfunction:: gpio_wakeup_enable
|
||||
.. doxygenfunction:: gpio_wakeup_disable
|
||||
.. doxygenfunction:: gpio_isr_register
|
||||
.. doxygenfunction:: gpio_pullup_en
|
||||
.. doxygenfunction:: gpio_pullup_dis
|
||||
.. doxygenfunction:: gpio_pulldown_en
|
||||
.. doxygenfunction:: gpio_pulldown_dis
|
||||
.. doxygenfunction:: gpio_install_isr_service
|
||||
.. doxygenfunction:: gpio_uninstall_isr_service
|
||||
.. doxygenfunction:: gpio_isr_handler_add
|
||||
.. doxygenfunction:: gpio_isr_handler_remove
|
||||
|
82
docs/api/peripherals/i2c.rst
Normal file
82
docs/api/peripherals/i2c.rst
Normal file
@@ -0,0 +1,82 @@
|
||||
I2C
|
||||
===========
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
ESP32 has two I2C controllers which can be set as master mode or slave mode.
|
||||
|
||||
Application Example
|
||||
-------------------
|
||||
|
||||
I2C master and slave example: `examples/18_i2c <https://github.com/espressif/esp-idf/tree/master/examples/18_i2c>`_.
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
|
||||
Header Files
|
||||
^^^^^^^^^^^^
|
||||
|
||||
* `driver/include/driver/i2c.h <https://github.com/espressif/esp-idf/blob/master/components/driver/include/driver/i2c.h>`_
|
||||
|
||||
Macros
|
||||
^^^^^^
|
||||
|
||||
.. doxygendefine:: I2C_APB_CLK_FREQ
|
||||
.. doxygendefine:: I2C_FIFO_LEN
|
||||
|
||||
Type Definitions
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygentypedef:: i2c_cmd_handle_t
|
||||
|
||||
Enumerations
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. doxygenenum:: i2c_mode_t
|
||||
.. doxygenenum:: i2c_rw_t
|
||||
.. doxygenenum:: i2c_trans_mode_t
|
||||
.. doxygenenum:: i2c_opmode_t
|
||||
.. doxygenenum:: i2c_port_t
|
||||
.. doxygenenum:: i2c_addr_mode_t
|
||||
|
||||
Structures
|
||||
^^^^^^^^^^
|
||||
|
||||
.. doxygenstruct:: i2c_config_t
|
||||
:members:
|
||||
|
||||
|
||||
Functions
|
||||
^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: i2c_driver_install
|
||||
.. doxygenfunction:: i2c_driver_delete
|
||||
.. doxygenfunction:: i2c_param_config
|
||||
.. doxygenfunction:: i2c_reset_tx_fifo
|
||||
.. doxygenfunction:: i2c_reset_rx_fifo
|
||||
.. doxygenfunction:: i2c_isr_register
|
||||
.. doxygenfunction:: i2c_isr_free
|
||||
.. doxygenfunction:: i2c_set_pin
|
||||
.. doxygenfunction:: i2c_master_start
|
||||
.. doxygenfunction:: i2c_master_write_byte
|
||||
.. doxygenfunction:: i2c_master_write
|
||||
.. doxygenfunction:: i2c_master_read_byte
|
||||
.. doxygenfunction:: i2c_master_read
|
||||
.. doxygenfunction:: i2c_master_stop
|
||||
.. doxygenfunction:: i2c_master_cmd_begin
|
||||
.. doxygenfunction:: i2c_slave_write_buffer
|
||||
.. doxygenfunction:: i2c_slave_read
|
||||
.. doxygenfunction:: i2c_set_period
|
||||
.. doxygenfunction:: i2c_get_period
|
||||
.. doxygenfunction:: i2c_set_start_timing
|
||||
.. doxygenfunction:: i2c_get_start_timing
|
||||
.. doxygenfunction:: i2c_set_stop_timing
|
||||
.. doxygenfunction:: i2c_get_stop_timing
|
||||
.. doxygenfunction:: i2c_set_data_timing
|
||||
.. doxygenfunction:: i2c_get_data_timing
|
||||
.. doxygenfunction:: i2c_set_data_mode
|
||||
.. doxygenfunction:: i2c_get_data_mode
|
||||
.. doxygenfunction:: i2c_cmd_link_create
|
||||
.. doxygenfunction:: i2c_cmd_link_delete
|
||||
|
16
docs/api/peripherals/index.rst
Normal file
16
docs/api/peripherals/index.rst
Normal file
@@ -0,0 +1,16 @@
|
||||
Peripherals API
|
||||
***************
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
GPIO <gpio>
|
||||
UART <uart>
|
||||
I2C <i2c>
|
||||
SPI Master <spi_master>
|
||||
Timer <timer>
|
||||
Pulse Counter <pcnt>
|
||||
Sigma-delta Modulation <sigmadelta>
|
||||
LED Control <ledc>
|
||||
Remote Control <rmt>
|
||||
|
80
docs/api/peripherals/ledc.rst
Normal file
80
docs/api/peripherals/ledc.rst
Normal file
@@ -0,0 +1,80 @@
|
||||
LED Control
|
||||
===========
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
The LED control module is primarily designed to control the intensity of LEDs, although it can be used to generate PWM signals for other purposes as well.
|
||||
It has 16 channels which can generate independent waveforms that can be used to drive e.g. RGB LED devices. For maximum flexibility, the high-speed as well
|
||||
as the low-speed channels can be driven from one of four high-speed/low-speed timers. The PWM controller also has the ability to automatically increase or
|
||||
decrease the duty cycle gradually, allowing for fades without any processor interference.
|
||||
|
||||
Application Example
|
||||
-------------------
|
||||
|
||||
LEDC change duty cycle and fading control example: `examples/29_ledc <https://github.com/espressif/esp-idf/tree/master/examples/29_ledc>`_.
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
|
||||
Header Files
|
||||
^^^^^^^^^^^^
|
||||
|
||||
* `driver/include/driver/ledc.h <https://github.com/espressif/esp-idf/blob/master/components/driver/include/driver/ledc.h>`_
|
||||
|
||||
Macros
|
||||
^^^^^^
|
||||
|
||||
.. doxygendefine:: LEDC_APB_CLK_HZ
|
||||
.. doxygendefine:: LEDC_REF_CLK_HZ
|
||||
|
||||
Type Definitions
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygentypedef:: ledc_isr_handle_t
|
||||
|
||||
Enumerations
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. doxygenenum:: ledc_mode_t
|
||||
.. doxygenenum:: ledc_intr_type_t
|
||||
.. doxygenenum:: ledc_duty_direction_t
|
||||
.. doxygenenum:: ledc_clk_src_t
|
||||
.. doxygenenum:: ledc_timer_t
|
||||
.. doxygenenum:: ledc_channel_t
|
||||
.. doxygenenum:: ledc_timer_bit_t
|
||||
|
||||
Structures
|
||||
^^^^^^^^^^
|
||||
|
||||
.. doxygenstruct:: ledc_channel_config_t
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: ledc_timer_config_t
|
||||
:members:
|
||||
|
||||
|
||||
Functions
|
||||
^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: ledc_channel_config
|
||||
.. doxygenfunction:: ledc_timer_config
|
||||
.. doxygenfunction:: ledc_update_duty
|
||||
.. doxygenfunction:: ledc_stop
|
||||
.. doxygenfunction:: ledc_set_freq
|
||||
.. doxygenfunction:: ledc_get_freq
|
||||
.. doxygenfunction:: ledc_set_duty
|
||||
.. doxygenfunction:: ledc_get_duty
|
||||
.. doxygenfunction:: ledc_set_fade
|
||||
.. doxygenfunction:: ledc_isr_register
|
||||
.. doxygenfunction:: ledc_timer_set
|
||||
.. doxygenfunction:: ledc_timer_rst
|
||||
.. doxygenfunction:: ledc_timer_pause
|
||||
.. doxygenfunction:: ledc_timer_resume
|
||||
.. doxygenfunction:: ledc_bind_channel_timer
|
||||
.. doxygenfunction:: ledc_set_fade_with_step
|
||||
.. doxygenfunction:: ledc_set_fade_with_time
|
||||
.. doxygenfunction:: ledc_fade_func_install
|
||||
.. doxygenfunction:: ledc_fade_func_uninstall
|
||||
.. doxygenfunction:: ledc_fade_start
|
||||
|
66
docs/api/peripherals/pcnt.rst
Normal file
66
docs/api/peripherals/pcnt.rst
Normal file
@@ -0,0 +1,66 @@
|
||||
Pulse Counter
|
||||
=============
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
The PCNT (Pulse Counter) module is designed to count the number of rising and/or falling edges of an input signal. Each pulse counter unit has a 16-bit signed counter register and two channels that can be configured to either increment or decrement the counter. Each channel has a signal input that accepts signal edges to be detected, as well as a control input that can be used to enable or disable the signal input. The inputs have optional filters that can be used to discard unwanted glitches in the signal.
|
||||
|
||||
Application Example
|
||||
-------------------
|
||||
|
||||
Pulse counter with control signal and event interrupt example: `examples/16_pcnt <https://github.com/espressif/esp-idf/tree/master/examples/16_pcnt>`_.
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
|
||||
Header Files
|
||||
^^^^^^^^^^^^
|
||||
|
||||
* `driver/pcnt.h <https://github.com/espressif/esp-idf/blob/master/components/driver/include/driver/pcnt.h>`_
|
||||
|
||||
|
||||
Macros
|
||||
^^^^^^
|
||||
|
||||
|
||||
Type Definitions
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
Enumerations
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. doxygenenum:: pcnt_ctrl_mode_t
|
||||
.. doxygenenum:: pcnt_count_mode_t
|
||||
.. doxygenenum:: pcnt_unit_t
|
||||
.. doxygenenum:: pcnt_channel_t
|
||||
.. doxygenenum:: pcnt_evt_type_t
|
||||
|
||||
Structures
|
||||
^^^^^^^^^^
|
||||
|
||||
.. doxygenstruct:: pcnt_config_t
|
||||
|
||||
Functions
|
||||
^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: pcnt_unit_config
|
||||
.. doxygenfunction:: pcnt_get_counter_value
|
||||
.. doxygenfunction:: pcnt_counter_pause
|
||||
.. doxygenfunction:: pcnt_counter_resume
|
||||
.. doxygenfunction:: pcnt_counter_clear
|
||||
.. doxygenfunction:: pcnt_intr_enable
|
||||
.. doxygenfunction:: pcnt_intr_disable
|
||||
.. doxygenfunction:: pcnt_event_enable
|
||||
.. doxygenfunction:: pcnt_event_disable
|
||||
.. doxygenfunction:: pcnt_set_event_value
|
||||
.. doxygenfunction:: pcnt_get_event_value
|
||||
.. doxygenfunction:: pcnt_isr_register
|
||||
.. doxygenfunction:: pcnt_set_pin
|
||||
.. doxygenfunction:: pcnt_filter_enable
|
||||
.. doxygenfunction:: pcnt_filter_disable
|
||||
.. doxygenfunction:: pcnt_set_filter_value
|
||||
.. doxygenfunction:: pcnt_get_filter_value
|
||||
.. doxygenfunction:: pcnt_set_mode
|
||||
|
93
docs/api/peripherals/rmt.rst
Normal file
93
docs/api/peripherals/rmt.rst
Normal file
@@ -0,0 +1,93 @@
|
||||
RMT
|
||||
========
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
The RMT (Remote Control) module driver can be used to send and receive infrared remote control signals. Due to flexibility of RMT module, the driver can also be used to generate many other types of signals.
|
||||
|
||||
Application Example
|
||||
-------------------
|
||||
|
||||
NEC remote control TX and RX example: `examples/11_rmt_nec_tx_rx <https://github.com/espressif/esp-idf/tree/master/examples/11_rmt_nec_tx_rx>`_.
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
|
||||
Header Files
|
||||
^^^^^^^^^^^^
|
||||
|
||||
* `driver/rmt.h <https://github.com/espressif/esp-idf/blob/master/components/driver/include/driver/rmt.h>`_
|
||||
|
||||
Macros
|
||||
^^^^^^
|
||||
|
||||
.. doxygendefine:: RMT_MEM_BLOCK_BYTE_NUM
|
||||
.. doxygendefine:: RMT_MEM_ITEM_NUM
|
||||
|
||||
Enumerations
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. doxygenenum:: rmt_channel_t
|
||||
.. doxygenenum:: rmt_mem_owner_t
|
||||
.. doxygenenum:: rmt_source_clk_t
|
||||
.. doxygenenum:: rmt_data_mode_t
|
||||
.. doxygenenum:: rmt_mode_t
|
||||
.. doxygenenum:: rmt_idle_level_t
|
||||
.. doxygenenum:: rmt_carrier_level_t
|
||||
|
||||
Structures
|
||||
^^^^^^^^^^
|
||||
|
||||
.. doxygenstruct:: rmt_tx_config_t
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: rmt_rx_config_t
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: rmt_config_t
|
||||
:members:
|
||||
|
||||
|
||||
Functions
|
||||
^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: rmt_set_clk_div
|
||||
.. doxygenfunction:: rmt_get_clk_div
|
||||
.. doxygenfunction:: rmt_set_rx_idle_thresh
|
||||
.. doxygenfunction:: rmt_get_rx_idle_thresh
|
||||
.. doxygenfunction:: rmt_set_mem_block_num
|
||||
.. doxygenfunction:: rmt_get_mem_block_num
|
||||
.. doxygenfunction:: rmt_set_tx_carrier
|
||||
.. doxygenfunction:: rmt_set_mem_pd
|
||||
.. doxygenfunction:: rmt_get_mem_pd
|
||||
.. doxygenfunction:: rmt_tx_start
|
||||
.. doxygenfunction:: rmt_tx_stop
|
||||
.. doxygenfunction:: rmt_rx_start
|
||||
.. doxygenfunction:: rmt_rx_stop
|
||||
.. doxygenfunction:: rmt_memory_rw_rst
|
||||
.. doxygenfunction:: rmt_set_memory_owner
|
||||
.. doxygenfunction:: rmt_get_memory_owner
|
||||
.. doxygenfunction:: rmt_set_tx_loop_mode
|
||||
.. doxygenfunction:: rmt_get_tx_loop_mode
|
||||
.. doxygenfunction:: rmt_set_rx_filter
|
||||
.. doxygenfunction:: rmt_set_source_clk
|
||||
.. doxygenfunction:: rmt_get_source_clk
|
||||
.. doxygenfunction:: rmt_set_idle_level
|
||||
.. doxygenfunction:: rmt_get_status
|
||||
.. doxygenfunction:: rmt_set_intr_enable_mask
|
||||
.. doxygenfunction:: rmt_clr_intr_enable_mask
|
||||
.. doxygenfunction:: rmt_set_rx_intr_en
|
||||
.. doxygenfunction:: rmt_set_err_intr_en
|
||||
.. doxygenfunction:: rmt_set_tx_intr_en
|
||||
.. doxygenfunction:: rmt_set_evt_intr_en
|
||||
.. doxygenfunction:: rmt_set_pin
|
||||
.. doxygenfunction:: rmt_config
|
||||
.. doxygenfunction:: rmt_isr_register
|
||||
.. doxygenfunction:: rmt_fill_tx_items
|
||||
.. doxygenfunction:: rmt_driver_install
|
||||
.. doxygenfunction:: rmt_driver_uninstall
|
||||
.. doxygenfunction:: rmt_write_items
|
||||
.. doxygenfunction:: rmt_wait_tx_done
|
||||
.. doxygenfunction:: rmt_get_ringbuf_handler
|
||||
|
51
docs/api/peripherals/sigmadelta.rst
Normal file
51
docs/api/peripherals/sigmadelta.rst
Normal file
@@ -0,0 +1,51 @@
|
||||
Sigma-delta Modulation
|
||||
======================
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
ESP32 has a second-order sigma-delta modulation module.
|
||||
This driver configures the channels of the sigma-delta module.
|
||||
|
||||
Application Example
|
||||
-------------------
|
||||
|
||||
Sigma-delta Modulation example: `examples/14_sigmadelta <https://github.com/espressif/esp-idf/tree/master/examples/14_sigmadelta>`_.
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
|
||||
Header Files
|
||||
^^^^^^^^^^^^
|
||||
|
||||
* `driver/sigmadelta.h <https://github.com/espressif/esp-idf/blob/master/components/driver/include/driver/sigmadelta.h>`_
|
||||
|
||||
|
||||
Macros
|
||||
^^^^^^
|
||||
|
||||
|
||||
Type Definitions
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
Enumerations
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. doxygenenum:: sigmadelta_channel_t
|
||||
|
||||
Structures
|
||||
^^^^^^^^^^
|
||||
|
||||
.. doxygenstruct:: sigmadelta_config_t
|
||||
:members:
|
||||
|
||||
|
||||
Functions
|
||||
^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: sigmadelta_config
|
||||
.. doxygenfunction:: sigmadelta_set_duty
|
||||
.. doxygenfunction:: sigmadelta_set_prescale
|
||||
.. doxygenfunction:: sigmadelta_set_pin
|
||||
|
167
docs/api/peripherals/spi_master.rst
Normal file
167
docs/api/peripherals/spi_master.rst
Normal file
@@ -0,0 +1,167 @@
|
||||
SPI Master driver
|
||||
=================
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
The ESP32 has four SPI peripheral devices, called SPI0, SPI1, HSPI and VSPI. SPI0 is entirely dedicated to
|
||||
the flash cache the ESP32 uses to map the SPI flash device it is connected to into memory. SPI1 is
|
||||
connected to the same hardware lines as SPI0 and is used to write to the flash chip. HSPI and VSPI
|
||||
are free to use. SPI1, HSPI and VSPI all have three chip select lines, allowing them to drive up to
|
||||
three SPI devices each as a master. The SPI peripherals also can be used in slave mode, driven from
|
||||
another SPI master.
|
||||
|
||||
The spi_master driver
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The spi_master driver allows easy communicating with SPI slave devices, even in a multithreaded environment.
|
||||
It fully transparently handles DMA transfers to read and write data and automatically takes care of
|
||||
multiplexing between different SPI slaves on the same master
|
||||
|
||||
Terminology
|
||||
^^^^^^^^^^^
|
||||
|
||||
The spi_master driver uses the following terms:
|
||||
|
||||
* Host: The SPI peripheral inside the ESP32 initiating the SPI transmissions. One of SPI, HSPI or VSPI. (For
|
||||
now, only HSPI or VSPI are actually supported in the driver; it will support all 3 peripherals
|
||||
somewhere in the future.)
|
||||
* Bus: The SPI bus, common to all SPI devices connected to one host. In general the bus consists of the
|
||||
miso, mosi, sclk and optionally quadwp and quadhd signals. The SPI slaves are connected to these
|
||||
signals in parallel.
|
||||
|
||||
- miso - Also known as q, this is the input of the serial stream into the ESP32
|
||||
|
||||
- mosi - Also known as d, this is the output of the serial stream from the ESP32
|
||||
|
||||
- sclk - Clock signal. Each data bit is clocked out or in on the positive or negative edge of this signal
|
||||
|
||||
- quadwp - Write Protect signal. Only used for 4-bit (qio/qout) transactions.
|
||||
|
||||
- quadhd - Hold signal. Only used for 4-bit (qio/qout) transactions.
|
||||
|
||||
* Device: A SPI slave. Each SPI slave has its own chip select (CS) line, which is made active when
|
||||
a transmission to/from the SPI slave occurs.
|
||||
* Transaction: One instance of CS going active, data transfer from and/or to a device happening, and
|
||||
CS going inactive again. Transactions are atomic, as in they will never be interrupted by another
|
||||
transaction.
|
||||
|
||||
|
||||
SPI transactions
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
A transaction on the SPI bus consists of five phases, any of which may be skipped:
|
||||
|
||||
* The command phase. In this phase, a command (0-16 bit) is clocked out.
|
||||
* The address phase. In this phase, an address (0-64 bit) is clocked out.
|
||||
* The read phase. The slave sends data to the master.
|
||||
* The write phase. The master sends data to the slave.
|
||||
|
||||
In full duplex, the read and write phases are combined, causing the SPI host to read and
|
||||
write data simultaneously.
|
||||
|
||||
The command and address phase are optional in that not every SPI device will need to be sent a command
|
||||
and/or address. Tis is reflected in the device configuration: when the ``command_bits`` or ``data_bits``
|
||||
fields are set to zero, no command or address phase is done.
|
||||
|
||||
Something similar is true for the read and write phase: not every transaction needs both data to be written
|
||||
as well as data to be read. When ``rx_buffer`` is NULL (and SPI_USE_RXDATA) is not set) the read phase
|
||||
is skipped. When ``tx_buffer`` is NULL (and SPI_USE_TXDATA) is not set) the write phase is skipped.
|
||||
|
||||
Using the spi_master driver
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- Initialize a SPI bus by calling ``spi_bus_initialize``. Make sure to set the correct IO pins in
|
||||
the ``bus_config`` struct. Take care to set signals that are not needed to -1.
|
||||
|
||||
- Tell the driver about a SPI slave device conencted to the bus by calling spi_bus_add_device.
|
||||
Make sure to configure any timing requirements the device has in the ``dev_config`` structure.
|
||||
You should now have a handle for the device, to be used when sending it a transaction.
|
||||
|
||||
- To interact with the device, fill one or more spi_transaction_t structure with any transaction
|
||||
parameters you need. Either queue all transactions by calling ``spi_device_queue_trans``, later
|
||||
quering the result using ``spi_device_get_trans_result``, or handle all requests synchroneously
|
||||
by feeding them into ``spi_device_transmit``.
|
||||
|
||||
- Optional: to unload the driver for a device, call ``spi_bus_remove_device`` with the device
|
||||
handle as an argument
|
||||
|
||||
- Optional: to remove the driver for a bus, make sure no more drivers are attached and call
|
||||
``spi_bus_free``.
|
||||
|
||||
|
||||
Transaction data
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
Normally, data to be transferred to or from a device will be read from or written to a chunk of memory
|
||||
indicated by the ``rx_buffer`` and ``tx_buffer`` members of the transaction structure. The SPI driver
|
||||
may decide to use DMA for transfers, so these buffers should be allocated in DMA-capable memory using
|
||||
``pvPortMallocCaps(size, MALLOC_CAP_DMA)``.
|
||||
|
||||
Sometimes, the amount of data is very small making it less than optimal allocating a separate buffer
|
||||
for it. If the data to be transferred is 32 bits or less, it can be stored in the transaction struct
|
||||
itself. For transmitted data, use the ``tx_data`` member for this and set the ``SPI_USE_TXDATA`` flag
|
||||
on the transmission. For received data, use ``rx_data`` and set ``SPI_USE_RXDATA``. In both cases, do
|
||||
not touch the ``tx_buffer`` or ``rx_buffer`` members, because they use the same memory locations
|
||||
as ``tx_data`` and ``rx_data``.
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
|
||||
Header Files
|
||||
^^^^^^^^^^^^
|
||||
|
||||
* `drivers/include/drivers/spi_master.h <https://github.com/espressif/esp-idf/blob/master/components/drivers/include/drivers/spi_master.h>`_
|
||||
|
||||
Macros
|
||||
^^^^^^
|
||||
|
||||
.. doxygendefine:: SPI_DEVICE_TXBIT_LSBFIRST
|
||||
.. doxygendefine:: SPI_DEVICE_RXBIT_LSBFIRST
|
||||
.. doxygendefine:: SPI_DEVICE_BIT_LSBFIRST
|
||||
.. doxygendefine:: SPI_DEVICE_3WIRE
|
||||
.. doxygendefine:: SPI_DEVICE_POSITIVE_CS
|
||||
.. doxygendefine:: SPI_DEVICE_HALFDUPLEX
|
||||
.. doxygendefine:: SPI_DEVICE_CLK_AS_CS
|
||||
|
||||
.. doxygendefine:: SPI_TRANS_MODE_DIO
|
||||
.. doxygendefine:: SPI_TRANS_MODE_QIO
|
||||
.. doxygendefine:: SPI_TRANS_MODE_DIOQIO_ADDR
|
||||
.. doxygendefine:: SPI_TRANS_USE_RXDATA
|
||||
.. doxygendefine:: SPI_TRANS_USE_TXDATA
|
||||
|
||||
Type Definitions
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygentypedef:: spi_device_handle_t
|
||||
|
||||
Enumerations
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. doxygenenum:: spi_host_device_t
|
||||
|
||||
Structures
|
||||
^^^^^^^^^^
|
||||
|
||||
.. doxygenstruct:: spi_transaction_t
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: spi_bus_config_t
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: spi_device_interface_config_t
|
||||
:members:
|
||||
|
||||
|
||||
|
||||
Functions
|
||||
---------
|
||||
|
||||
.. doxygenfunction:: spi_bus_initialize
|
||||
.. doxygenfunction:: spi_bus_free
|
||||
.. doxygenfunction:: spi_bus_add_device
|
||||
.. doxygenfunction:: spi_bus_remove_device
|
||||
.. doxygenfunction:: spi_device_queue_trans
|
||||
.. doxygenfunction:: spi_device_get_trans_result
|
||||
.. doxygenfunction:: spi_device_transmit
|
||||
|
73
docs/api/peripherals/timer.rst
Normal file
73
docs/api/peripherals/timer.rst
Normal file
@@ -0,0 +1,73 @@
|
||||
TIMER
|
||||
========
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
ESP32 chip contains two hardware timer groups, each containing two general-purpose hardware timers.
|
||||
|
||||
They are all 64-bit generic timers based on 16-bit prescalers and 64-bit auto-reload-capable up/down counters.
|
||||
|
||||
|
||||
Application Example
|
||||
-------------------
|
||||
|
||||
64-bit hardware timer example: `examples/13_timer_group <https://github.com/espressif/esp-idf/tree/master/examples/13_timer_group>`_.
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
|
||||
Header Files
|
||||
^^^^^^^^^^^^
|
||||
|
||||
* `components/driver/timer.h <https://github.com/espressif/esp-idf/blob/master/components/driver/include/driver/timer.h>`_
|
||||
|
||||
Macros
|
||||
^^^^^^
|
||||
|
||||
.. doxygendefine:: TIMER_BASE_CLK
|
||||
|
||||
Type Definitions
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
Enumerations
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. doxygenenum:: timer_group_t
|
||||
.. doxygenenum:: timer_idx_t
|
||||
.. doxygenenum:: timer_count_dir_t
|
||||
.. doxygenenum:: timer_start_t
|
||||
.. doxygenenum:: timer_alarm_t
|
||||
.. doxygenenum:: timer_intr_mode_t
|
||||
.. doxygenenum:: timer_autoreload_t
|
||||
|
||||
Structures
|
||||
^^^^^^^^^^
|
||||
|
||||
.. doxygenstruct:: timer_config_t
|
||||
:members:
|
||||
|
||||
|
||||
Functions
|
||||
^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: timer_get_counter_value
|
||||
.. doxygenfunction:: timer_get_counter_time_sec
|
||||
.. doxygenfunction:: timer_set_counter_value
|
||||
.. doxygenfunction:: timer_start
|
||||
.. doxygenfunction:: timer_pause
|
||||
.. doxygenfunction:: timer_set_counter_mode
|
||||
.. doxygenfunction:: timer_set_auto_reload
|
||||
.. doxygenfunction:: timer_set_divider
|
||||
.. doxygenfunction:: timer_set_alarm_value
|
||||
.. doxygenfunction:: timer_get_alarm_value
|
||||
.. doxygenfunction:: timer_set_alarm
|
||||
.. doxygenfunction:: timer_isr_register
|
||||
.. doxygenfunction:: timer_init
|
||||
.. doxygenfunction:: timer_get_config
|
||||
.. doxygenfunction:: timer_group_intr_enable
|
||||
.. doxygenfunction:: timer_group_intr_disable
|
||||
.. doxygenfunction:: timer_enable_intr
|
||||
.. doxygenfunction:: timer_disable_intr
|
||||
|
100
docs/api/peripherals/uart.rst
Normal file
100
docs/api/peripherals/uart.rst
Normal file
@@ -0,0 +1,100 @@
|
||||
UART
|
||||
====
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
`Instructions`_
|
||||
|
||||
Application Example
|
||||
-------------------
|
||||
|
||||
`Instructions`_
|
||||
|
||||
API Reference
|
||||
-------------
|
||||
|
||||
`Instructions`_
|
||||
|
||||
.. _Instructions: template.html
|
||||
|
||||
Header Files
|
||||
^^^^^^^^^^^^
|
||||
|
||||
* `driver/include/driver/uart.h <https://github.com/espressif/esp-idf/blob/master/components/driver/include/driver/uart.h>`_
|
||||
|
||||
Data Structures
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
.. doxygenstruct:: uart_config_t
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: uart_intr_config_t
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: uart_event_t
|
||||
:members:
|
||||
|
||||
Macros
|
||||
^^^^^^
|
||||
|
||||
.. doxygendefine:: UART_FIFO_LEN
|
||||
.. doxygendefine:: UART_INTR_MASK
|
||||
.. doxygendefine:: UART_LINE_INV_MASK
|
||||
.. doxygendefine:: UART_BITRATE_MAX
|
||||
.. doxygendefine:: UART_PIN_NO_CHANGE
|
||||
.. doxygendefine:: UART_INVERSE_DISABLE
|
||||
.. doxygendefine:: UART_INVERSE_RXD
|
||||
.. doxygendefine:: UART_INVERSE_CTS
|
||||
.. doxygendefine:: UART_INVERSE_TXD
|
||||
.. doxygendefine:: UART_INVERSE_RTS
|
||||
|
||||
Enumerations
|
||||
^^^^^^^^^^^^
|
||||
|
||||
.. doxygenenum:: uart_word_length_t
|
||||
.. doxygenenum:: uart_stop_bits_t
|
||||
.. doxygenenum:: uart_port_t
|
||||
.. doxygenenum:: uart_parity_t
|
||||
.. doxygenenum:: uart_hw_flowcontrol_t
|
||||
.. doxygenenum:: uart_event_type_t
|
||||
|
||||
Functions
|
||||
^^^^^^^^^
|
||||
|
||||
.. doxygenfunction:: uart_set_word_length
|
||||
.. doxygenfunction:: uart_get_word_length
|
||||
.. doxygenfunction:: uart_set_stop_bits
|
||||
.. doxygenfunction:: uart_get_stop_bits
|
||||
.. doxygenfunction:: uart_set_parity
|
||||
.. doxygenfunction:: uart_get_parity
|
||||
.. doxygenfunction:: uart_set_baudrate
|
||||
.. doxygenfunction:: uart_get_baudrate
|
||||
.. doxygenfunction:: uart_set_line_inverse
|
||||
.. doxygenfunction:: uart_set_hw_flow_ctrl
|
||||
.. doxygenfunction:: uart_get_hw_flow_ctrl
|
||||
.. doxygenfunction:: uart_clear_intr_status
|
||||
.. doxygenfunction:: uart_enable_intr_mask
|
||||
.. doxygenfunction:: uart_disable_intr_mask
|
||||
.. doxygenfunction:: uart_enable_rx_intr
|
||||
.. doxygenfunction:: uart_disable_rx_intr
|
||||
.. doxygenfunction:: uart_disable_tx_intr
|
||||
.. doxygenfunction:: uart_enable_tx_intr
|
||||
.. doxygenfunction:: uart_isr_register
|
||||
.. doxygenfunction:: uart_set_pin
|
||||
.. doxygenfunction:: uart_set_rts
|
||||
.. doxygenfunction:: uart_set_dtr
|
||||
.. doxygenfunction:: uart_param_config
|
||||
.. doxygenfunction:: uart_intr_config
|
||||
.. doxygenfunction:: uart_driver_install
|
||||
.. doxygenfunction:: uart_driver_delete
|
||||
.. doxygenfunction:: uart_wait_tx_done
|
||||
.. doxygenfunction:: uart_tx_chars
|
||||
.. doxygenfunction:: uart_write_bytes
|
||||
.. doxygenfunction:: uart_write_bytes_with_break
|
||||
.. doxygenfunction:: uart_read_bytes
|
||||
.. doxygenfunction:: uart_flush
|
||||
.. doxygenfunction:: uart_get_buffered_data_len
|
||||
.. doxygenfunction:: uart_disable_pattern_det_intr
|
||||
.. doxygenfunction:: uart_enable_pattern_det_intr
|
||||
|
Reference in New Issue
Block a user