在fsbl里读写MIO

u32 FsblHookBeforeHandoff(void)
{
        u32 Status;

        Status = XST_SUCCESS;

        /*
         * User logic to be added here.
         * Errors to be stored in the status variable and returned
         */
        fsbl_printf(DEBUG_INFO,"In FsblHookBeforeHandoff function \r\n");

        // set MIO48=1 to use eMMC memory on TE0729 PCB
        XGpioPs Gpio;
        XGpioPs_Config *GPIOConfigPtr;

        //GPIO Initilization
        GPIOConfigPtr = XGpioPs_LookupConfig(XPAR_PS7_GPIO_0_DEVICE_ID);
        Status = XGpioPs_CfgInitialize(&Gpio, GPIOConfigPtr, GPIOConfigPtr->BaseAddr);
        if (Status != XST_SUCCESS) {
                return XST_FAILURE;
        }

        const int sel_sd_pin = 48;
        XGpioPs_SetDirectionPin(&Gpio, sel_sd_pin, 1);//output

        XGpioPs_SetOutputEnablePin(&Gpio, sel_sd_pin, 1);
        XGpioPs_WritePin(&Gpio, sel_sd_pin, 0x1);

        return (Status);
}

你可能感兴趣的:(xilinx,FPGA,常识)