Device ID of GPIO

Hi, there

I want to use GPIO to control the LED. Before that, I need to use XStatus XGpio_Initialize(XGpio *InstancePtr, Xuint16 DeviceId); to instiantiate a GPIO object.

Here, I use a "LEDs_4Bit" IP but I don't know what's the DeviceId for it. Could anybody tell me what's the Device Id, and where could I find it?

Thank you for the help Roger

Reply to
agou
Loading thread data ...

Hi, there

I want to use GPIO to control the LEDs. Before that, I need to use XStatus XGpio_Initialize(XGpio *InstancePtr, Xuint16 DeviceId); to instiantiate a GPIO object.

Here, I use a "LEDs_4Bit" IP but I don't know what's the DeviceId for it. Could anybody tell me what's the Device Id, and where could I find it?

Thank you for the help Roger

Reply to
agou

Hi, there

I want to use GPIO to control the LEDs. Before that, I need to use XStatus XGpio_Initialize(XGpio *InstancePtr, Xuint16 DeviceId); to instiantiate a GPIO object.

Here, I use a "LEDs_4Bit" IP but I don't know what's the DeviceId for it. Could anybody tell me what's the Device Id, and where could I find it?

Thank you for the help Roger

Reply to
agou

This ID can be found in the xparameters.h file which is automatically generated by the EDK. If you have, for example, the following block in the .mhs file:

BEGIN opb_gpio PARAMETER INSTANCE = opb_dbg_leds PARAMETER HW_VER = 3.01.a PARAMETER C_GPIO_WIDTH = 4 PARAMETER C_ALL_INPUTS = 0 PARAMETER C_BASEADDR = 0x80004200 PARAMETER C_HIGHADDR = 0x800043FF PORT GPIO_IO = dbg_leds BUS_INTERFACE SOPB = opb_bus END

Then the ID would be like: XPAR_OPB_DBG_LEDS_DEVICE_ID.

Frank

Reply to
Frank van Eijkelenburg

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.