Page 1 of 1

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

Posted: Sun Jan 01, 2017 12:59 am
by kolban
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.

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

Posted: Sun Jan 01, 2017 2:46 am
by WiFive
The register bits of UART_INT_ENA_REG

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

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

Posted: Sun Jan 01, 2017 2:29 pm
by kolban
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.

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

Posted: Sun Jan 01, 2017 7:59 pm
by WiFive
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.