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 ,效果一样 。

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

  • 相关阅读:
    Nginx 的 server_names_hash_bucket_size 问题
    Linux 查看CPU信息、机器型号等硬件信息
    JS中的prototype[转载]
    memcache适用和不适用场景[转载]
    php的socket通信【转载】
    fastcgi与cgi的区别[转载]
    PHP类和对象
    SVN的配置和使用
    PHP_pear的安装和使用
    [转]Python tips: 什么是*args和**kwargs?
  • 原文地址:https://www.cnblogs.com/suozhang/p/14957583.html
Copyright © 2011-2022 走看看