Skip to content

Commit 03b1b6d

Browse files
robert-hhdpgeorge
authored andcommitted
docs/library/machine.UART: Extend the documentation for UART.irq.
For more ports and trigger options, based on the current state of the code. Signed-off-by: robert-hh <[email protected]>
1 parent 9bbe616 commit 03b1b6d

File tree

1 file changed

+48
-5
lines changed

1 file changed

+48
-5
lines changed

docs/library/machine.UART.rst

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,19 +188,59 @@ Methods
188188
triggers. The handler must take exactly one argument which is the
189189
``UART`` instance.
190190

191-
- *trigger* configures the event which can generate an interrupt.
192-
Possible values are:
191+
- *trigger* configures the event(s) which can generate an interrupt.
192+
Possible values are a mask of one or more of the following:
193193

194194
- ``UART.IRQ_RXIDLE`` interrupt after receiving at least one character
195195
and then the RX line goes idle.
196+
- ``UART.IRQ_RX`` interrupt after each received character.
197+
- ``UART.IRQ_TXIDLE`` interrupt after or while the last character(s) of
198+
a message are or have been sent.
199+
- ``UART.IRQ_BREAK`` interrupt when a break state is detected at RX
196200

197201
- *hard* if true a hardware interrupt is used. This reduces the delay
198-
between the pin change and the handler being called. Hard interrupt
202+
between the pin change and the handler being called. Hard interrupt
199203
handlers may not allocate memory; see :ref:`isr_rules`.
200204

201205
Returns an irq object.
202206

203-
Availability: renesas-ra, stm32.
207+
Due to limitations of the hardware not all trigger events are available on all ports.
208+
209+
.. table:: Availability of triggers
210+
:align: center
211+
212+
============== ========== ====== ========== =========
213+
Port / Trigger IRQ_RXIDLE IRQ_RX IRQ_TXIDLE IRQ_BREAK
214+
============== ========== ====== ========== =========
215+
CC3200 yes
216+
ESP32 yes yes yes
217+
MIMXRT yes yes
218+
NRF yes yes
219+
RENESAS-RA yes yes
220+
RP2 yes yes yes
221+
SAMD yes yes yes
222+
STM32 yes yes
223+
============== ========== ====== ========== =========
224+
225+
226+
.. note::
227+
- The ESP32 port does not support the option hard=True.
228+
229+
- The rp2 port's UART.IRQ_TXIDLE is only triggered when the message
230+
is longer than 5 characters and the trigger happens when still 5 characters
231+
are to be sent.
232+
233+
- The rp2 port's UART.IRQ_BREAK needs receiving valid characters for triggering
234+
again.
235+
236+
- The SAMD port's UART.IRQ_TXIDLE is triggered while the last character is sent.
237+
238+
- On STM32F4xx MCU's, using the trigger UART.IRQ_RXIDLE the handler will be called once
239+
after the first character and then after the end of the message, when the line is
240+
idle.
241+
242+
243+
Availability: cc3200, esp32, mimxrt, nrf, renesas-ra, rp2, samd, stm32.
204244

205245
Constants
206246
---------
@@ -213,7 +253,10 @@ Constants
213253
Availability: esp32, mimxrt, renesas-ra, rp2, stm32.
214254

215255
.. data:: UART.IRQ_RXIDLE
256+
UART.IRQ_RX
257+
UART.IRQ_TXIDLE
258+
UART.IRQ_BREAK
216259

217260
IRQ trigger sources.
218261

219-
Availability: stm32.
262+
Availability: renesas-ra, stm32, esp32, rp2040, mimxrt, samd, cc3200.

0 commit comments

Comments
 (0)