[Answered] How to use the UART interrupt handler ...

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

[Answered] How to use the UART interrupt handler ...

Postby kolban » Sun Jan 01, 2017 12:59 am

Looking at the UART driver I see functions such as:

* uart_disable_intr_mask
* uart_enable_intr_mask
* uart_disable_rx_intr
* uart_enable_rx_intr
* uart_disable_tx_intr
* uart_enable_tx_intr
* uart_isr_free
* uart_intr_config

I'm wondering if anyone has tried to use these? For example, looking at uart_enable_intr_mask, I see that it has a parameter called "enable_mask" which appears to be a bit field but I'm having trouble finding the bit pattern description.
Last edited by kolban on Sun Jan 01, 2017 10:04 pm, edited 1 time in total.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

WiFive
Posts: 2619
Joined: Tue Dec 01, 2015 7:35 am

Re: How to use the UART interrupt handler ...

Postby WiFive » Sun Jan 01, 2017 2:46 am

The register bits of UART_INT_ENA_REG

https://github.com/espressif/esp-idf/bl ... reg.h#L293

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: How to use the UART interrupt handler ...

Postby kolban » Sun Jan 01, 2017 2:29 pm

Howdy sir, I looked at the link you provided ... but I'm afraid it doesn't add anything at all to my understanding. When I go to the link you provide, all I see is:

Code: Select all

#define UART_INT_ENA_REG(i)          (REG_UART_BASE(i) + 0xC)
How do I go from that to the possible bit patterns allowed to the high level API for function call "uart_enable_intr_mask"? My desire is to help the community as much as possible by pushing the ball forward. I want to make knowledge as clear and easy to consume as possible. What I want to do is have ESP32 consumed by anyone and everyone with as minimal an amount of effort as possible. Turning that around, if early community members learn something then we should make it clear for those who follow so that they don't have to do nearly as much work as we might at the beginning. Knowing that we have done the right thing will be its own reward.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

WiFive
Posts: 2619
Joined: Tue Dec 01, 2015 7:35 am

Re: How to use the UART interrupt handler ...

Postby WiFive » Sun Jan 01, 2017 7:59 pm

Look below that. All the bits of that register are defined. Then look at an example of a mask in uart.c which uses an OR'ed combo of these bits.

Who is online

Users browsing this forum: No registered users and 17 guests