Altera_Forum
Honored Contributor
20 years agoAccess to the PIO in eCos
Hi. What is the best way to access the PIO in eCos. I would like access to led_pio and button_pio. I would have been nice to be able to make a program similar to count_binary, but I don't know how to get the interrupt in eCos, and we'll be using switches in our prosject so I think it's enough to just pull it.
It's not possible to access the altera_avalon_pio_regs.h file from eCos is it? So it's not possible to write and read directly to and from the PIOs. I thought it could be nice to access the led_pio and button_pio as /dev/led_pio and /dev/button_pio and thus threat them as files in eCos. But I'm not sure how to do this. I have begone a little, as you can see from this package: altera_avalon_pio.zip (http://hovedprosjekter.hig.no/v2005/elektro/adc/ecos/altera_avalon_pio.zip). I think I got the basic functions right, but I'm not entierly sure how to make the devtab. And I'm not sure how to handle initialisation properly when the PIO can be without IRQ. If any of you could take a look and give me some advice, I'd be very happy. I wonder why there's no driver for the PIO in the eCos package. Is it so obvious and simple that they didn't think to include it or is it so difficult that they didn't bother to make it? Ole