Interrupt/Callback for UART 1 ?



  • Hi Guys,
    Is there a way to use interrupt/callback for UART 1 so that it triggers whenever data arrives ?
    If it is not available....then I would love to have that feature.....

    Thanks & regards,
    MK HB


  • administrators

    @mkharibalaji that callback is not yet available, but it's planned to have it implemented.



  • A UART callback on data arrival would be very nice but would have to be implemented well to be truly useful.

    A call back on every byte/symbol received would be too processing intensive in Python code, at higher baud rates.
    Symbol buffering should be done at the C driver level (as it is now) and the callback initialiser would be passed 2 parameters;

    Example:
    buffCount = callback triggered if the rx buffer holds this many bytes/symbols
    (Useful when the rx message length is known/fixed)
    idleCount = callback triggered if the rx buffer contains 1 or more symbols, but the rx line has now been idle for this many symbols
    (Useful for communication gap driven flow control with variable length messages)
    (Also catches broken/incomplete messages)

    idleCount, should accept fractions of a symbol, EG 1.5 symbol idle time, or it could simply be a timeout period and the caller must convert the symbol delay required into a time delay.


Log in to reply
 

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.