zoukankan      html  css  js  c++  java
  • XUartPs_SetFifoThreshold

    /****************************************************************************/
    /**
    *
    * This functions sets the receive FIFO trigger level. The receive trigger
    * level specifies the number of bytes in the receive FIFO that cause a receive
    * data event (interrupt) to be generated.
    *
    * @param    InstancePtr is a pointer to the XUartPs instance.
    * @param    TriggerLevel contains the trigger level to set.
    *
    * @return    None
    *
    * @note        None.
    *
    *****************************************************************************/
    void XUartPs_SetFifoThreshold(XUartPs *InstancePtr, u8 TriggerLevel)
    {
        u32 RtrigRegister;
    
        /* Assert validates the input arguments */
        Xil_AssertVoid(InstancePtr != NULL);
        Xil_AssertVoid(TriggerLevel <= (u8)XUARTPS_RXWM_MASK);
        Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
    
        RtrigRegister = ((u32)TriggerLevel) & (u32)XUARTPS_RXWM_MASK;
    
        /*
         * Write the new value for the FIFO control register to it such that the
         * threshold is changed
         */
        XUartPs_WriteReg(InstancePtr->Config.BaseAddress,
                   XUARTPS_RXWM_OFFSET, RtrigRegister);
    
    }

    这里 调用 XUartPs_SetFifoThreshold 函数 设置 寄存器 XUARTPS_RXWM_MASK , 根据 UG585 手册 

     这里设置 接收 FIFO,接收到 多少字节,触发 中断 ,我 默认设置为 0和设置1 ,效果一样 。

    ------------恢复内容结束------------

  • 相关阅读:
    python字典的遍历
    python字典
    python可变对象
    python元组
    python的range()
    python遍历列表
    Kafka的知识总结(18个知识点)
    为什么fastjson字段为null时不输出空字符串?
    oracle建表字段包含关键字注意事项
    spring websocket 使用@SendToUser
  • 原文地址:https://www.cnblogs.com/suozhang/p/14957583.html
Copyright © 2011-2022 走看看