How to implement non-blocking IO input in embedded baremetal systems?

46 views Asked by At

I'm working on CycloneVsoc(Cortex-A9 duel core) with a baremetal system with ARMCC. For now the system uses two cores and each core runs the same FPGA timer interrupt(50us) for each. The system is debuged by ARMDS IDE and PuTTY.

Now I want to implement a non-blocking scanf function. There are many answers for Linux/Windows, but few of them is for the baremetal system.

So I have a basic idea: I can set a push button as an interrupt,which has a lower priority than my FPGA timer IRQ.

The working flow is as shown IN THE USER VIEW: PB IRQ(Start the scan) ----> User input on Terminal -----> Press"ENTER" IRQ ----> Put data into the UART FIFO -----> read the UART FIFO -----> check -----> transfer to what I want.

To fulfill this I have some questions:

  1. Is that realistic? or is there other easier solutions?
  2. How to set the Uart IRQ from terminal ?
  3. How to set the "ENTER" as a interrupt ?

Thank you

0

There are 0 answers