Xil_DCacheInvalidateRange((INTPTR)UartTxBuf, UartRxLen); usleep(2); XAxiDma_SimpleTransfer(&DmaInst, (UINTPTR)UartTxBuf, UartRxLen, XAXIDMA_DEVICE_TO_DMA); while(!RxDone); RxDone = 0; XUartPs_Send(&UartInst, UartTxBuf, UartRxLen); XUartPs_Recv(&UartInst, UartRxBuf, 4096);//...
Status= XUartPs_CfgInitialize(&Uart_PS, Config, Config->BaseAddress); if(Status != XST_SUCCESS) { returnXST_FAILURE; } /*配置UART模式 XUartPs_SetOperMode(&Uart_PS,XUARTPS_OPER_MODE_NORMAL); /*配置UART数据格式波特率:115200,数据:8bits,无校验, 1个停止位*/ XUartPs_SetDataFormat(&Uart_...
57 rec_data = XUartPs_RecvByte(XPAR_PS7_UART_0_BASEADDR); 58 //清除中断标志 59 XUartPs_WriteReg(uart_instance_ptr->Config.BaseAddress, 60 XUARTPS_ISR_OFFSET, XUARTPS_IXR_RXOVR) ; 61 } 62 XUartPs_SendByte(XPAR_PS7_UART_0_BASEADDR,rec_data); 63 } 64 65 //串口中断初始化...
XUartPs_SetDataFormat(&Uart_PS,&UartFormat) ; /*设置中断 XUartPs_SetFifoThreshold(&Uart_PS,1); /*使能接收FIFO触发电平和FIFO空中断 XUartPs_SetInterruptMask(&Uart_PS,XUARTPS_IXR_RXOVR|XUARTPS_IXR_RXEMPTY); SetupInterruptSystem(&IntcInstPtr,&Uart_PS, UART_INT_IRQ_ID) ; //发送数据 ...
RecvBufferPtr = RecvBuffer; TotalRecvCnt = 0; /* 初始化UART设备 */ Config = XUartPs_LookupConfig(DeviceId); if (NULL == Config) { return XST_FAILURE; } Status = XUartPs_CfgInitialize(Uart_Ps, Config, Config->BaseAddress); if (Status != XST_SUCCESS) { ...
int Init_UartPsIntr(XUartPs *UartInstPtr,u16 DeviceId ) { int Status; XUartPs_Config *Config; u32 IntrMask; if (XGetPlatform_Info() == XPLAT_ZYNQ_ULTRA_MP) { #ifdef XPAR_XUARTPS_1_DEVICE_ID DeviceId = XPAR_XUARTPS_1_DEVICE_ID; ...
XUARTPS_IMR_OFFSET);isr_status &= XUartPs_ReadReg(uart_instance_ptr->Config.BaseAddress,XUARTPS_ISR_OFFSET);//判断中断标志位RxFIFO是否触发if (isr_status & (u32)XUARTPS_IXR_RXOVR){rec_data = XUartPs_RecvByte(XPAR_PS7_UART_0_BASEADDR);...
XUartPs debug_uart; // UART实例 int debug_init(void) { int Status; XUartPs_Config *Config; //默认使用uart0 如果要用uart1 请改成 XPAR_XUARTPS_1_DEVICE_ID Config = XUartPs_LookupConfig(XPAR_XUARTPS_0_DEVICE_ID); if (NULL == Config) { ...
(Status != XST_SUCCESS) {return XST_FAILURE;}/* Set the receiver timeout.*/XUartPs_SetRecvTimeout(UartInstancePtr, 8);/*Set receiver FIFO interrupt trigger level, here set to 1*/XUartPs_SetFifoThreshold(UartInstancePtr, 1);/* 设置中断触发类型 */XUartPs_SetInterruptMask(UartInstance...
1、PS7参数配置。 启用ETH0外设(根据硬件连接,直接用MIO引脚),同时开启其MDIO接口(同样用MIO引脚),将速率调整为1000Mbps。 开启UART0外设,使用EMIO引脚(UART0的MIO引脚没有在板子上引出)。 开启PS7的AXI GP0 Master Port。(PS7通过AXI GP接口对BRAM进行操作) ...