Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

altera_avalon_pio_regs.h functions

where can we find the description and the functionality of the functions included in ''altera_avalon_pio_regs.h''?Generally, how can we work with I/O ports?

6 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If you're using the altera_avalon_pio_regs.h header you can use the ALTERA_AVALON_PIO_DATA(base) to read and ALTERA_AVALON_PIO_DATA(base, value) to write.

    Alternatively, you could use the <io.h> header and use the IORD(base, offset) and IOWR(base, offset, value) directly if you wanted.

    Altera has a pdf on their PIO core somewhere on their website as well if you need more info.

    Hope that helps.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Refer to the PIO datasheet.

    This in included in sopc builder embedded peripherals guide

    http://www.altera.com/literature/ug/ug_embedded_ip.pdf

    The functions/macros available in altera_avalon_pio_regs.h are quite straightforward.

    They are mainly used to directly read/write the PIO registers, so you can understand everything if you read the above datasheet.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I have another question, has Altera provided any documentations about the software use of its IP cores ? for example how to use the functions included in the altera_avalon_uart.h ? Ive studied the ug_embedded_ip.pdf, but i couldnt find much software help in this documentation. tnx in advance

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I don't know if "official" information from Altera exists about all of functions included in HAL drivers. Usually you can find the basic function to access IP cores if you browse .h files.

    You can also find a lot of information if you search the forum: I usually find all I need in older posts. If the search is ineffective you can possibly start a new thread and often you get the right answer in short time.

    The core user guides are useful if you need to access the module at the hw level, I mean directly reading and writing hw register, thus bypassing HAL driver. Sometimes, knowledge of the underlying hardware is also useful to pull out maximum performance from the core.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    tnx!anyway im new to this forum,but so far Ive found it extremely useful!!!!!