uart problem
-
- Posts: 31
- Joined: Wed Dec 02, 2015 1:47 pm
uart problem
Does the micropython support the receive interruption of uart? And the API function is what? thank you
Re: uart problem
When the read_buf_len (argument to the init function) is non-zero, then interrupts enabled to put received characters into the buffer.
The default is a read_buf_len of 64.
The default is a read_buf_len of 64.
-
- Posts: 31
- Joined: Wed Dec 02, 2015 1:47 pm
Re: uart problem
And the callback function is...?
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: uart problem
There isn't a user callback. The UART performs I/O using interrupts in the background. You need to poll the any() method to determine how many characters are in its buffer.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 31
- Joined: Wed Dec 02, 2015 1:47 pm
Re: uart problem
dhylands wrote:You can also use select on the uarts.
thanks , and do you give me an example?
-
- Posts: 31
- Joined: Wed Dec 02, 2015 1:47 pm
Re: uart problem
thank you very much!dhylands wrote:http://forum.micropython.org/viewtopic. ... 9873#p9873