0

I need to set an interruption for the serial (uart) port in Beaglebone, in such a way that when the serial port receives any info an interruption (function) is automatically activated doing something with the received data.

I have searched methods to do so, but no success. I have worked with interruption for uart ports in microcontrollers, and I though I could do the same in Beaglebone.

Any suggestion to do it?

Thanks in advance.

dsolimano
  • 8,870
  • 3
  • 48
  • 63
gus
  • 355
  • 2
  • 5
  • 19
  • 1
    Do you intend to use the Beaglebone processor in a "bare-metal" fashion or are you intending to use one of the Linux distributions that are available? I you intend to use Linux on the Beaglebone there are many good references to serial port programming under Linux that are available. – andy mango Feb 17 '13 at 05:48
  • I am intending to use a Linux distro, and after some web search I found out that the required interruptions can be set using the library for the serial port, without setting the registers of the processor (as in the u-controllers). Thanks for your reply. – gus Feb 19 '13 at 01:15

1 Answers1

1

Use the

select() or poll()

system call to do a polling on the tty file. As soon as any data arrives on the device file, you take the data and do the stuff you intend to do.

Or you can run a dedicated thread which continuously polls the uart and deals with the data.

S.I.J
  • 979
  • 1
  • 10
  • 22