Skip to content

Commit a25e7ab

Browse files
committed
Merge branch 'docs/parlio_tx_programming_guide' into 'master'
docs(parlio_tx): add programming guide Closes IDF-11934 See merge request espressif/esp-idf!36298
2 parents 2c990a6 + 487a306 commit a25e7ab

File tree

19 files changed

+1009
-73
lines changed

19 files changed

+1009
-73
lines changed

components/esp_driver_parlio/src/parlio_tx.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,15 @@ esp_err_t parlio_tx_get_alignment_constraints(parlio_tx_unit_t *tx_unit, size_t
255255
static esp_err_t parlio_select_periph_clock(parlio_tx_unit_t *tx_unit, const parlio_tx_unit_config_t *config)
256256
{
257257
parlio_hal_context_t *hal = &tx_unit->base.group->hal;
258-
parlio_clock_source_t clk_src = config->clk_in_gpio_num >= 0 ? PARLIO_CLK_SRC_EXTERNAL : config->clk_src;
258+
parlio_clock_source_t clk_src = config->clk_src;
259+
if (config->clk_in_gpio_num >= 0 && clk_src != PARLIO_CLK_SRC_EXTERNAL) {
260+
ESP_LOGW(TAG, "input clock GPIO is set, use external clk src");
261+
clk_src = PARLIO_CLK_SRC_EXTERNAL;
262+
}
259263
uint32_t periph_src_clk_hz = 0;
260264
// if the source clock is input from the GPIO, then we're in the slave mode
261265
if (clk_src == PARLIO_CLK_SRC_EXTERNAL) {
266+
ESP_RETURN_ON_FALSE(config->clk_in_gpio_num >= 0, ESP_ERR_INVALID_ARG, TAG, "invalid input clock GPIO number");
262267
periph_src_clk_hz = config->input_clk_src_freq_hz;
263268
} else {
264269
// get the internal clock source frequency

components/esp_driver_parlio/test_apps/parlio/main/test_parlio_tx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ TEST_CASE("parallel tx unit use external non-free running clock", "[parlio_tx]")
410410
printf("install parlio tx unit\r\n");
411411
parlio_tx_unit_handle_t tx_unit = NULL;
412412
parlio_tx_unit_config_t config = {
413-
.clk_src = PARLIO_CLK_SRC_DEFAULT,
413+
.clk_src = PARLIO_CLK_SRC_EXTERNAL,
414414
.data_width = 8,
415415
.clk_in_gpio_num = TEST_EXT_CLK_GPIO,
416416
.input_clk_src_freq_hz = 80 * 1000 * 1000, // Note that this is not the real input frequency, we just use it to calculate the clock divider
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"signal": [
3+
{
4+
"name": "Input CLK",
5+
"wave": "0HlHl.HlHl|"
6+
},
7+
{
8+
"name": "Output CLK",
9+
"wave": "0..Hl...Hl|"
10+
},
11+
{
12+
"name": "Valid",
13+
"wave": "0..1......|"
14+
},
15+
{
16+
"name": "IO0",
17+
"wave": "0..3....4.|", "data": "A0.0 A0.4"
18+
},
19+
{
20+
"name": "IO1",
21+
"wave": "0..3....4.|", "data": "A0.1 A0.5"
22+
},
23+
{
24+
"name": "IO2",
25+
"wave": "0..3....4.|", "data": "A0.2 A0.6"
26+
},
27+
{
28+
"name": "IO3",
29+
"wave": "0..3....4.|", "data": "A0.3 A0.7"
30+
}
31+
],
32+
"head": {
33+
"text": "External Clock Input Waveform"
34+
}
35+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"signal": [
3+
{
4+
"name": "CLK",
5+
"wave": "P......|...."
6+
},
7+
{
8+
"name": "CS",
9+
"wave": "1.0....|...."
10+
},
11+
{
12+
"name": "IO0",
13+
"wave": "0.3456x|783x", "data": "A0.0 A0.4 A1.0 A1.4 A63.0 A63.4 A0.0"
14+
},
15+
{
16+
"name": "IO1",
17+
"wave": "0.3456x|783x", "data": "A0.1 A0.5 A1.1 A1.5 A63.1 A63.5 A0.1"
18+
},
19+
{
20+
"name": "IO2",
21+
"wave": "0.3456x|783x", "data": "A0.2 A0.6 A1.2 A1.6 A63.2 A63.6 A0.2"
22+
},
23+
{
24+
"name": "IO3",
25+
"wave": "0.3456x|783x", "data": "A0.3 A0.7 A1.3 A1.7 A63.3 A63.7 A0.3"
26+
}
27+
],
28+
"head": {
29+
"text": "Loop transmission Waveform"
30+
}
31+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"signal": [
3+
{
4+
"name": "CLK",
5+
"wave": "P......|.."
6+
},
7+
{
8+
"name": "CS",
9+
"wave": "1.0....|.1"
10+
},
11+
{
12+
"name": "IO0",
13+
"wave": "0.2345x|.0", "data": "A0.0 A0.4 A1.0 A1.4"
14+
},
15+
{
16+
"name": "IO1",
17+
"wave": "0.2345x|.0", "data": "A0.1 A0.5 A1.1 A1.5"
18+
},
19+
{
20+
"name": "IO2",
21+
"wave": "0.2345x|.0", "data": "A0.2 A0.6 A1.2 A1.6"
22+
},
23+
{
24+
"name": "IO3",
25+
"wave": "0.2345x|.0", "data": "A0.3 A0.7 A1.3 A1.7"
26+
}
27+
],
28+
"head": {
29+
"text": "QPI Waveform Simulator"
30+
}
31+
}

docs/conf_common.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@
115115

116116
DEDIC_GPIO_DOCS = ['api-reference/peripherals/dedic_gpio.rst']
117117

118-
PARLIO_DOCS = ['api-reference/peripherals/parlio.rst']
118+
PARLIO_DOCS = [
119+
'api-reference/peripherals/parlio/index.rst',
120+
'api-reference/peripherals/parlio/parlio_tx.rst',
121+
'api-reference/peripherals/parlio/parlio_rx.rst',
122+
]
119123

120124
PCNT_DOCS = ['api-reference/peripherals/pcnt.rst']
121125

docs/en/api-reference/peripherals/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Peripherals API
2929
:SOC_GP_LDO_SUPPORTED: ldo_regulator
3030
ledc
3131
:SOC_MCPWM_SUPPORTED: mcpwm
32-
:SOC_PARLIO_SUPPORTED: parlio
32+
:SOC_PARLIO_SUPPORTED: parlio/index
3333
:SOC_PCNT_SUPPORTED: pcnt
3434
:SOC_PPA_SUPPORTED: ppa
3535
:SOC_RMT_SUPPORTED: rmt

docs/en/api-reference/peripherals/parlio.rst

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Parallel IO
2+
===========
3+
4+
:link_to_translation:`zh_CN:[中文]`
5+
6+
Introduction
7+
------------
8+
9+
[`Parallel IO Peripheral <{IDF_TARGET_TRM_EN_URL}#parlio>`__] is a general parallel interface that can be used to connect external devices such as LED matrices, LCD displays, printers, and cameras. This peripheral has independent TX and RX units. Each unit can have up to 8 or 16 data signals and 1 or 2 clock signals.
10+
11+
The TX and RX drivers of the Parallel IO peripheral are independently designed and can be used by including the header files ``driver/parlio_tx.h`` or ``driver/parlio_rx.h``.
12+
13+
.. toctree::
14+
:maxdepth: 1
15+
16+
parlio_tx
17+
parlio_rx
18+
19+
API Reference
20+
-------------
21+
22+
.. include-build-file:: inc/components/esp_driver_parlio/include/driver/parlio_types.inc
23+
.. include-build-file:: inc/components/hal/include/hal/parlio_types.inc
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Parallel IO RX Driver
2+
=====================
3+
4+
:link_to_translation:`zh_CN:[中文]`
5+
6+
Introduction
7+
------------
8+
9+
The Parallel IO RX unit typically supports the following scenarios:
10+
11+
- High-speed data acquisition, such as camera and sensor data reading
12+
- High-speed parallel communication with other hosts as a slave device
13+
14+
Application Examples
15+
---------------------
16+
17+
* :example:`peripherals/parlio/parlio_rx/logic_analyzer` demonstrates how to use the Parallel IO RX peripheral to implement a logic analyzer. This analyzer can sample data on multiple GPIOs at high frequency, monitor internal or external signals, and save the raw sampled data to Flash or output it through a TCP stream.
18+
19+
API Reference
20+
-------------
21+
22+
.. include-build-file:: inc/parlio_rx.inc

0 commit comments

Comments
 (0)