A newer version of this document is available. Customers should click here to go to the newest version.
Visible to Intel only — GUID: izy1655974643946
Ixiasoft
Visible to Intel only — GUID: izy1655974643946
Ixiasoft
7.9.2. Device Driver Source Code
In addition to the header file, the component driver might need to provide source code to be incorporated in the BSP. This source code is specific to the hardware component, and resides in one or more C files (or assembly language files).
Generally, your program passes values defined in system.h as the BASE and REGNUM parameters. These macros are defined in the file <Intel Quartus installation directory>/ip/altera/soft_processor/intel_niosv_common/HAL/inc/io.h.
Macro | Use |
---|---|
IORD(BASE, REGNUM) | Read the value of the register at offset REGNUM in a device with base address BASE. Registers are assumed to be offset by the address width of the bus. |
IOWR(BASE, REGNUM, DATA) | Write the value DATA to the register at offset REGNUM in a device with base address BASE. Registers are assumed to be offset by the address width of the bus. |
IORD_32DIRECT(BASE, OFFSET) | Make a 32-bit read access at the location with address BASE+OFFSET. |
IORD_16DIRECT(BASE, OFFSET) | Make a 16-bit read access at the location with address BASE+OFFSET. |
IORD_8DIRECT(BASE, OFFSET) | Make an 8-bit read access at the location with address BASE+OFFSET. |
IOWR_32DIRECT(BASE, OFFSET, DATA) | Make a 32-bit write access to write the value DATA at the location with address BASE+OFFSET. |
IOWR_16DIRECT(BASE, OFFSET, DATA) | Make a 16-bit write access to write the value DATA at the location with address BASE+OFFSET. |
IOWR_8DIRECT(BASE, OFFSET, DATA) | Make an 8-bit write access to write the value DATA at the location with address BASE+OFFSET. |