Jump to content

SeanLock

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by SeanLock

  1. Thank you @JColvin. I have just start learning about AXI and Mircoblaze coding; I was worried I might be missing an important point. I am struggling to find a comprehensive documentation on the subject; rather the user has to check many sources.

    Regardless, as we can note in the OP,  the tool generates redundancy definitions as in the following:

    #define XPAR_GPIO_0_DEVICE_ID XPAR_AXI_GPIO_0_DEVICE_ID
    #define XPAR_AXI_GPIO_0_DEVICE_ID 0
    #define GPIO_OUTPUT_DEVICE_ID    XPAR_GPIO_0_DEVICE_ID

    GpioOutputExample( GPIO_OUTPUT_DEVICE_ID, GPIO_BITWIDTH);
    GpioInputExample(XPAR_AXI_GPIO_0_DEVICE_ID, &DataRead);

     

    A last point,  the XGPIO function: int XGpio_Initialize(XGpio *InstancePtr, u16 DeviceId); takes DeviceID as a parameter. The file xparameters.h includes the below macro definitions. Will the tool set the GPIO struct parameters (BASEADDR, HIGHADDER, INTERRUPT_PRESENT, IS_DUAL) to the corresponding defined  symbols automatically given the common "XPAR_AXI_GPIO_0" or "XPAR_GPIO_0" prefix?

     

    /* Definitions for peripheral AXI_GPIO_0 */
    #define XPAR_AXI_GPIO_0_BASEADDR 0x80000000
    #define XPAR_AXI_GPIO_0_HIGHADDR 0x8000FFFF
    #define XPAR_AXI_GPIO_0_DEVICE_ID 0
    #define XPAR_AXI_GPIO_0_INTERRUPT_PRESENT 1
    #define XPAR_AXI_GPIO_0_IS_DUAL 1


    /******************************************************************/

    /* Canonical definitions for peripheral AXI_GPIO_0 */
    #define XPAR_GPIO_0_BASEADDR 0x80000000
    #define XPAR_GPIO_0_HIGHADDR 0x8000FFFF
    #define XPAR_GPIO_0_DEVICE_ID XPAR_AXI_GPIO_0_DEVICE_ID
    #define XPAR_GPIO_0_INTERRUPT_PRESENT 1
    #define XPAR_GPIO_0_IS_DUAL 1

     

    Thank you

     

  2. 1 hour ago, Richm said:

    The base address of an AXI lite IP comes from the Vivado address editor. If you examine the documentation for the GPIO, you will find the offsets and bit definitions for all the accessible registers. In this case, the offset for the second channel is 8 so Xil_in32( baseaddress ) will read the switches and Xil_Out32( baseaddress + 8, data ) will write the leds. The problem with Xilinx's driver code is that it can over complicate something simple

    Thank you, @Richm. My question was not about the OP;I noticed that the generated "xaparameters.h"by VIVADO for a design including an AXI_GOPIO comprises two sets of identical values C macros: XPAR_AXI_GPIO_Id_XXX, and XPAR_GPIO_Id_XX.  I wonder why this duplication? I wonder which set should be used in different functions?

    Thank you

  3. Hi,

    What is the difference between the canonical definitions and the other definitions listed below

    /* Definitions for peripheral AXI_GPIO_0 */
    #define XPAR_AXI_GPIO_0_BASEADDR 0x40000000
    #define XPAR_AXI_GPIO_0_HIGHADDR 0x4000FFFF
    #define XPAR_AXI_GPIO_0_DEVICE_ID 0
    #define XPAR_AXI_GPIO_0_INTERRUPT_PRESENT 0
    #define XPAR_AXI_GPIO_0_IS_DUAL 1

    /* Canonical definitions for peripheral AXI_GPIO_0 */
    #define XPAR_GPIO_0_BASEADDR 0x40000000
    #define XPAR_GPIO_0_HIGHADDR 0x4000FFFF
    #define XPAR_GPIO_0_DEVICE_ID XPAR_AXI_GPIO_0_DEVICE_ID
    #define XPAR_GPIO_0_INTERRUPT_PRESENT 0
    #define XPAR_GPIO_0_IS_DUAL 1

    Thank you

×
×
  • Create New...