diff --git a/docs/_static/diagrams/spi/miso_timing_waveform.json b/docs/_static/diagrams/spi/miso_timing_waveform.json new file mode 100644 index 0000000000..8f0dfed212 --- /dev/null +++ b/docs/_static/diagrams/spi/miso_timing_waveform.json @@ -0,0 +1,29 @@ +{ + "signal": [ + { + "name": "SCLK", + "wave": "p...", + "node": ".ad..." + }, + { + "name": "MISO", + "wave": "x3x.", + "node": ".b...", + "phase": -1.8 + }, + { + "name": "MISO delayed", + "wave": "x3x.", + "node": ".c.", + "phase": -2.4 + } + ], + "edge": [ + "a|->b input delay", + "b|->c gpio delay", + "c-|>d setup slack" + ], + "config": { + "hscale": 3 + } +} diff --git a/docs/_static/diagrams/spi/miso_timing_waveform.rst b/docs/_static/diagrams/spi/miso_timing_waveform.rst deleted file mode 100644 index 7740be2281..0000000000 --- a/docs/_static/diagrams/spi/miso_timing_waveform.rst +++ /dev/null @@ -1,17 +0,0 @@ -.. this picture is generated by https://wavedrom.com/, using the sphinx plugin sphinxcontrib-wavedrom -.. due to plugin issue, we cannot place only the picture information in a standalone file, but have to take .. wavedrom:: inside - -.. wavedrom:: - - { signal: [ - { name: 'SCLK', wave: 'p...', node: '.ad...' }, - { name: 'MISO', wave: 'x3x.', node: '.b...', phase:-1.8 }, - { name: 'MISO delayed', wave: 'x3x.', node: '.c.', phase:-2.4 }, - ], - edge: [ - 'a|->b input delay', - 'b|->c gpio delay', - 'c-|>d setup slack' - ], - config: { hscale: 3 } - } diff --git a/docs/_static/diagrams/spi/miso_timing_waveform_async.json b/docs/_static/diagrams/spi/miso_timing_waveform_async.json new file mode 100644 index 0000000000..73e94f517e --- /dev/null +++ b/docs/_static/diagrams/spi/miso_timing_waveform_async.json @@ -0,0 +1,33 @@ +{ + "signal": [ + { + "name": "SCLK", + "wave": "0.1....0....1...", + "node": "..a.........e" + }, + { + "name": "SLV_CLK", + "wave": "p..............", + "node": "..b..", + "phase": -0.5 + }, + { + "name": "MISO", + "wave": "x...3.....x....", + "node": "....c", + "phase": -0.5 + }, + { + "name": "MISO delayed", + "wave": "x.......3.....x.", + "node": "........d" + } + ], + "edge": [ + "a|->b sample delay", + "b|->c slave output delay", + "c|->d gpio delay", + "d-|>e setup slack", + "a-|>c input delay" + ] +} diff --git a/docs/_static/diagrams/spi/miso_timing_waveform_async.rst b/docs/_static/diagrams/spi/miso_timing_waveform_async.rst deleted file mode 100644 index 2cbf7666ec..0000000000 --- a/docs/_static/diagrams/spi/miso_timing_waveform_async.rst +++ /dev/null @@ -1,19 +0,0 @@ -.. this picture is generated by https://wavedrom.com/, using the sphinx plugin sphinxcontrib-wavedrom -.. due to plugin issue, we cannot place only the picture information in a standalone file, but have to take .. wavedrom:: inside - -.. wavedrom:: - - { signal: [ - { name: 'SCLK', wave: '0.1....0....1...', node: '..a.........e'}, - { name: 'SLV_CLK',wave: 'p..............', node: '..b..', phase: -0.5 }, - { name: 'MISO', wave: 'x...3.....x....', node: '....c', phase:-0.5}, - { name: 'MISO delayed', wave: 'x.......3.....x.', node: '........d'}, - ], - edge: [ - 'a|->b sample delay', - 'b|->c slave output delay', - 'c|->d gpio delay', - 'd-|>e setup slack', - 'a-|>c input delay' - ], - } diff --git a/docs/_static/diagrams/spi/spi_slave_miso_dma.json b/docs/_static/diagrams/spi/spi_slave_miso_dma.json new file mode 100644 index 0000000000..48185c8329 --- /dev/null +++ b/docs/_static/diagrams/spi/spi_slave_miso_dma.json @@ -0,0 +1,56 @@ +{ + "signal": [ + { + "name": "CS", + "wave": "10........" + }, + { + "name": "SCLK", + "wave": "0.10101010", + "node": "...ab" + }, + { + "name": "MISO (normal)", + "wave": "x3.3.3.3.3", + "node": "...c.d", + "data": [ + "7", + "6", + "5", + "4", + "3" + ], + "phase": -0.8 + }, + { + "name": "SCLK", + "wave": "0.10101010", + "node": "..e.f" + }, + { + "name": "MISO (DMA)", + "wave": "x33.3.3.3", + "node": "..g.h", + "data": [ + "7", + "6", + "5", + "4", + "3", + "2" + ], + "phase": -0.8 + } + ], + "edge": [ + "a|->c delay", + "b-|->c setup", + "b-|->d hold", + "e|->g delay", + "f|->g setup", + "f-|>h hold" + ], + "config": { + "hscale": 2 + } +} diff --git a/docs/_static/diagrams/spi/spi_slave_miso_dma.rst b/docs/_static/diagrams/spi/spi_slave_miso_dma.rst deleted file mode 100644 index afa2a69a4a..0000000000 --- a/docs/_static/diagrams/spi/spi_slave_miso_dma.rst +++ /dev/null @@ -1,23 +0,0 @@ -.. This is the source code to generate figure by https://wavedrom.com/. -.. We can use the sphinx plugin sphinxcontrib-wavedrom to generate the figure and put it in the html doc (by include this source code), but it is not supported by the pdf. Currently we generate the figure manually and include the stataic figure in the doc. - -.. wavedrom:: - - { signal: [ - { name:'CS', wave:'10........'}, - { name: 'SCLK', wave: '0.10101010', node: '...ab'}, - { name: 'MISO (normal)', wave: 'x3.3.3.3.3', node: '...c.d', data: ['7','6','5','4','3'], phase:-0.8}, - { name: 'SCLK', wave: '0.10101010', node: '..e.f'}, - { name: 'MISO (DMA)', wave: 'x33.3.3.3', node: '..g.h', data: ['7','6','5','4','3','2'], phase:-0.8}, - ], - edge: [ - 'a|->c delay', - 'b-|->c setup', - 'b-|->d hold', - 'e|->g delay', - 'f|->g setup', - 'f-|>h hold', - ], - config:{hscale: 2} - } - diff --git a/docs/_static/miso_timing_waveform.png b/docs/_static/miso_timing_waveform.png deleted file mode 100644 index 19cc223bc0..0000000000 Binary files a/docs/_static/miso_timing_waveform.png and /dev/null differ diff --git a/docs/_static/spi_slave_miso_dma.png b/docs/_static/spi_slave_miso_dma.png deleted file mode 100644 index c0e48cd0f8..0000000000 Binary files a/docs/_static/spi_slave_miso_dma.png and /dev/null differ diff --git a/docs/conf_common.py b/docs/conf_common.py index 6b9c6471d6..cac554628e 100644 --- a/docs/conf_common.py +++ b/docs/conf_common.py @@ -160,6 +160,7 @@ conditional_include_dict = {'SOC_BT_SUPPORTED':BT_DOCS, 'esp32c3':ESP32C3_DOCS} extensions += ['sphinx_copybutton', + 'sphinxcontrib.wavedrom', # Note: order is important here, events must # be registered by one extension before they can be # connected to another extension @@ -173,6 +174,9 @@ extensions += ['sphinx_copybutton', 'esp_docs.esp_extensions.run_doxygen', ] +# Use wavedrompy as backend, insted of wavedrom-cli +render_using_wavedrompy = True + # link roles config github_repo = 'espressif/esp-idf' diff --git a/docs/en/api-reference/peripherals/spi_master.rst b/docs/en/api-reference/peripherals/spi_master.rst index 69249f3cdf..68639eb7f6 100644 --- a/docs/en/api-reference/peripherals/spi_master.rst +++ b/docs/en/api-reference/peripherals/spi_master.rst @@ -509,9 +509,7 @@ Please note that the ISR is disabled during flash operation by default. To keep :scale: 40 % :align: center - .. wavedrom does not support rendering pdflatex till now(1.3.1), so we use the png here - - .. image:: /../_static/miso_timing_waveform.png + .. wavedrom:: /../_static/diagrams/spi/miso_timing_waveform.json The maximum allowed frequency is dependent on: diff --git a/docs/en/api-reference/peripherals/spi_slave.rst b/docs/en/api-reference/peripherals/spi_slave.rst index f4e9fe3fdd..eca77af311 100644 --- a/docs/en/api-reference/peripherals/spi_slave.rst +++ b/docs/en/api-reference/peripherals/spi_slave.rst @@ -201,7 +201,7 @@ Restrictions and Known Issues 2. Furthermore, DMA requires SPI modes 1 and 3. For SPI modes 0 and 2, the MISO signal has to be launched half a clock cycle earlier to meet the timing. The new timing is as follows: - .. image:: /../_static/spi_slave_miso_dma.png + .. wavedrom:: /../_static/diagrams/spi/spi_slave_miso_dma.json If DMA is enabled, a Device's launch edge is half of an SPI clock cycle ahead of the normal time, shifting to the Master's actual latch edge. In this case, if the GPIO matrix is bypassed, the hold time for data sampling is 68.75 ns and no longer a half of an SPI clock cycle. If the GPIO matrix is used, the hold time will increase to 93.75 ns. The Host should sample the data immediately at the latch edge or communicate in SPI modes 1 or 3. If your Host cannot meet these timing requirements, initialize your Device without DMA.