Skip to content

Commit 905903b

Browse files
committed
docs/psoc-edge: Added Pins and GPIO docs.
Signed-off-by: jaenrig-ifx <[email protected]>
1 parent 04b60fe commit 905903b

File tree

3 files changed

+136
-5
lines changed

3 files changed

+136
-5
lines changed

docs/psoc-edge/general.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.. _psoc_edge_general:
22

3+
.. include:: links.rst
4+
35
General information about the PSOC™ Edge port
46
==============================================
57

@@ -44,7 +46,7 @@ Technical specifications
4446
************************
4547
Links for product details:
4648

47-
* `KIT_PSE84_AI product page with relevant documents <https://www.infineon.com/evaluation-board/KIT-PSE84-AI>`_
48-
* `KIT_PSE84_AI MCU Datasheet <TODO: TO BE ADDED>`_
49-
50-
49+
* `KIT_PSE84_AI PSOC™ Edge E84 AI product page <pse84_kit_ai_product_page_>`_
50+
* `KIT_PSE84_AI PSOC™ Edge E84 AI Kit guide <pse84_kit_ai_guide_>`_
51+
* `PSOC™ Edge E8x2, E8x3, E8x5, E8x6 Consumer Datasheet <pse8x_consumer_datasheet_>`_
52+
* `PSOC™ Edge E8x2, E8x3, E8x5, E8x6 Architecture Reference Manual <pse8x_arch_ref_manual_>`_

docs/psoc-edge/links.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _links.rst:
2+
3+
.. _pse84_kit_ai_product_page: https://www.infineon.com/evaluation-board/KIT-PSE84-AI
4+
.. _pse84_kit_ai_guide: https://www.infineon.com/assets/row/public/documents/30/44/infineon-kit-pse84-ai-user-guide-usermanual-en.pdf
5+
.. _pse8x_consumer_datasheet: https://www.infineon.com/assets/row/public/documents/30/49/infineon-psoc-edge-e8x-consumer-datasheet-datasheet-en.pdf
6+
.. _pse8x_arch_ref_manual: https://www.infineon.com/assets/row/public/documents/30/57/infineon-psoc-edge-e8x-architecture-reference-manual-additionaltechnicalinformation-en.pdf

docs/psoc-edge/quickref.rst

Lines changed: 124 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.. _psoc_edge_quickref:
22

3+
.. include:: links.rst
4+
35
Quick reference for the PSOC™ Edge
46
===================================
57

@@ -17,4 +19,125 @@ working with this port it may be useful to get an overview of the microcontrolle
1719
:includehidden:
1820

1921
general.rst
20-
installation.rst
22+
installation.rst
23+
24+
Pins and GPIO
25+
-------------
26+
27+
See :ref:`machine.Pin <machine.Pin>` for the complete Pin API reference.
28+
This section focuses on the specific PSOC™ Edge port variations and particularities.
29+
30+
The constructor
31+
^^^^^^^^^^^^^^^
32+
33+
The controller pin naming follows the nomenclature ``P<port>_<pin>``, where:
34+
35+
- ``<port>`` is a numeric identifier for the port (e.g., 0-21 for the PSOC™ Edge E84)
36+
- ``<pin>`` is the pin number within that port.
37+
38+
Use the respective board pinout diagram to find the available pins and their locations.
39+
40+
This is the ``id`` that needs to be passed to the constructor in one of the following formats:
41+
42+
- As a **string label**, single or double quoted: ``'P<port>_<pin>'`` or ``"P<port>_<pin>"``
43+
- A **pre-instantiated object** ``Pin.cpu.<pin>`` or ``Pin.board.<pin>``.
44+
45+
::
46+
47+
from machine import Pin
48+
49+
p_in = Pin('P0_0', Pin.IN)
50+
p_out = Pin("P7_0", Pin.OUT, value=False)
51+
52+
p = Pin(Pin.cpu.P17_1, Pin.OPEN_DRAIN)
53+
54+
55+
The pre-instantiated object can be used directly without calling the constructor.
56+
Instead, you can use ``init()`` to configure it.
57+
58+
::
59+
60+
from machine import Pin
61+
62+
pin = Pin.cpu.P17_0
63+
pin.init(mode=Pin.IN)
64+
65+
66+
.. tip::
67+
Use the REPL interface to discover the available user pins, using tab for completion:
68+
69+
>>> from machine import Pin
70+
>>> Pin.cpu.P
71+
P10_5 P10_7 P11_3 P12_3
72+
P13_0 P13_1 P13_2 P13_3
73+
P13_4 P13_5 P13_6 P13_7
74+
P14_0 P14_1 P14_2 P14_3
75+
P14_4 P14_5 P14_6 P14_7
76+
P15_0 P15_1 P15_2 P15_3
77+
P15_4 P15_5 P15_6 P15_7
78+
P16_0 P16_1 P16_2 P16_3
79+
P16_4 P16_5 P16_6 P16_7
80+
P17_0 P17_1 P17_2 P17_3
81+
P17_4 P17_5 P17_7 P20_3
82+
P20_4 P20_5 P20_6 P20_7
83+
P21_1 P21_2 P21_3 P21_4
84+
P21_5 P21_6 P21_7 P3_0
85+
P3_1 P6_4 P6_6 P7_0
86+
P7_7 P8_0 P8_1 P8_5
87+
P8_6 P9_0 P9_1 P9_2
88+
P9_3
89+
90+
.. Add Pin.board.xxx when we define some pins. This will be more helpful.
91+
92+
.. warning::
93+
Currently no ``Pin.board.<pin>`` are defined for the PSOC™ Edge E84 AI Kit.
94+
95+
In addition to the supported ``pull`` configuration values, ``PULL_UP_DOWN`` is also available in this port.
96+
97+
The ``drive`` parameter accepts up to 8 levels, which set the following drive strength for the pin:
98+
99+
- ``DRIVE_0``: 1mA/2mA drive current (normal/high speed IO)
100+
- ``DRIVE_1``: 2mA/4mA drive current (normal/high speed IO)
101+
- ``DRIVE_2``: 3mA/6mA drive current (normal/high speed IO)
102+
- ``DRIVE_3``: 4mA/8mA drive current (normal/high speed IO)
103+
- ``DRIVE_4``: 5mA/10mA drive current (normal/high speed IO)
104+
- ``DRIVE_5``: 6mA/12mA drive current (normal/high speed IO)
105+
- ``DRIVE_6``: 7mA/14mA drive current (normal/high speed IO)
106+
- ``DRIVE_7``: 8mA/16mA drive current (normal/high speed IO)
107+
108+
For more information about drive strength, check the PSOC™ Edge `Datasheet <pse8x_consumer_datasheet_>`_ and `Architecture Reference Manual <pse8x_arch_ref_manual_>`_.
109+
110+
.. note::
111+
112+
The following constructor arguments and/or configuration values are NOT supported in this port:
113+
114+
- ``alt``: Alternate functionality is not supported.
115+
- ``mode``: ``Pin.ALT``, ``Pin.ALT_OPEN_DRAIN``, and ``Pin.ANALOG`` modes are not supported.
116+
117+
Methods
118+
^^^^^^^
119+
120+
.. method:: Pin.irq(handler=None, trigger=(Pin.IRQ_FALLING | Pin.IRQ_RISING), priority=7, wake=None, hard=False)
121+
122+
This port has a few variations from the standard machine API for the ``irq()`` function:
123+
124+
- ``handler``: The handler function currently does not accept any arguments.
125+
- ``priority``: Priority values range from 7 (lowest) to 0 (highest).
126+
127+
.. note::
128+
129+
All pins on the same port share the same interrupt line. Therefore, only one priority can be set for all pins on the same port.
130+
If multiple pins configure interrupts for the same port, the highest priority will be used.
131+
If only one pin is configured for an interrupt, its priority can be reconfigured to any value.
132+
133+
.. note::
134+
135+
The following ``irq()`` features are not supported in this port:
136+
137+
- ``trigger``: The ``Pin.IRQ_LOW_LEVEL`` and ``Pin.IRQ_HIGH_LEVEL`` triggers are not supported.
138+
- ``wake``: The wake parameter is currently not supported.
139+
- ``hard``: This parameter is ignored. It can be passed but currently has no effect.
140+
141+
.. note::
142+
143+
**None** of the non-core methods from the Pin API are currently implemented for this port.

0 commit comments

Comments
 (0)