- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
I have an SOPC system with some custom components and 2 Altera PIO components. I am trying to write to a PIO using this function, for example:
IOWR(PIO_0_BASE, 3, 0x0); // Clear edge capture register However, I get a compile error saying that PIO_0_BASE is undeclared, even though i am doing a# include "system.h" at the top of my code. Isn't that the preferred way to access components in the system? My code will work if I copy this file from system.h into my code: # define PIO_0_BASE 0x00010800 But that defeats the purpose of having all the registers defined in one place! I was under the impression (from reading the niow SW dev manual) that you don't normally have to explicity# include system.h. anyway. Any ideas on what I'm doing wrong? I'm relatively new to C AND the Nios so this may be a C newbie error or a Nios newbie error. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gifLien copié
2 Réponses
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Look at the software templates/examples. Any that need base addresses, always# include "system.h".
What's more, for the PIO, you'll probably want to be including altera_avalon_pio_regs.h. Cheers, - slacker- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Thanks, slacker.
Including system.h AND altera_avalon_pio_regs.h worked. --- Quote Start --- originally posted by slacker@Mar 22 2007, 11:03 AM look at the software templates/examples. any that need base addresses, always# include "system.h".
what's more, for the pio, you'll probably want to be including altera_avalon_pio_regs.h.
cheers,
- slacker
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=22429)
--- quote end ---
--- Quote End ---

Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable