zynq之ps端开发

printf和xil_printf的不同

https://www.eefocus.com/walkie/blog/09-02/165549_bf04c.html

ps端对DDR的读写

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

*

  • @brief Performs an input operation for a memory location by reading

  •       from the specified address and returning the 8 bit Value read from
    
  •        that address.
    
  • @param Addr: contains the address to perform the input operation

  • @return The 8 bit Value read from the specified input address.

******************************************************************************/
static INLINE u8 Xil_In8(UINTPTR Addr)
{
return *(volatile u8 *) Addr;
}

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

*

  • @brief Performs an input operation for a memory location by reading from
  •       the specified address and returning the 16 bit Value read from that
    
  •       address.
    
  • @param Addr: contains the address to perform the input operation
  • @return The 16 bit Value read from the specified input address.

******************************************************************************/
static INLINE u16 Xil_In16(UINTPTR Addr)
{
return *(volatile u16 *) Addr;
}

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

*

  • @brief Performs an input operation for a memory location by
  •       reading from the specified address and returning the 32 bit Value
    
  •       read  from that address.
    
  • @param Addr: contains the address to perform the input operation
  • @return The 32 bit Value read from the specified input address.

******************************************************************************/
static INLINE u32 Xil_In32(UINTPTR Addr)
{
return *(volatile u32 *) Addr;
}

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

*

  • @brief Performs an input operation for a memory location by reading the
  •        64 bit Value read  from that address.
    
  • @param Addr: contains the address to perform the input operation
  • @return The 64 bit Value read from the specified input address.

******************************************************************************/
static INLINE u64 Xil_In64(UINTPTR Addr)
{
return *(volatile u64 *) Addr;
}

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

*

  • @brief Performs an output operation for an memory location by
  •       writing the 8 bit Value to the the specified address.
    
  • @param Addr: contains the address to perform the output operation
  • @param Value: contains the 8 bit Value to be written at the specified
  •       address.
    
  • @return None.

******************************************************************************/
static INLINE void Xil_Out8(UINTPTR Addr, u8 Value)
{
volatile u8 *LocalAddr = (volatile u8 *)Addr;
*LocalAddr = Value;
}

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

*

  • @brief Performs an output operation for a memory location by writing the
  •        16 bit Value to the the specified address.
    
  • @param Addr contains the address to perform the output operation
  • @param Value contains the Value to be written at the specified address.
  • @return None.

******************************************************************************/
static INLINE void Xil_Out16(UINTPTR Addr, u16 Value)
{
volatile u16 *LocalAddr = (volatile u16 *)Addr;
*LocalAddr = Value;
}

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

*

  • @brief Performs an output operation for a memory location by writing the
  •       32 bit Value to the the specified address.
    
  • @param Addr contains the address to perform the output operation
  • @param Value contains the 32 bit Value to be written at the specified
  •       address.
    
  • @return None.

******************************************************************************/
static INLINE void Xil_Out32(UINTPTR Addr, u32 Value)
{
#ifndef ENABLE_SAFETY
volatile u32 *LocalAddr = (volatile u32 *)Addr;
*LocalAddr = Value;
#else
XStl_RegUpdate(Addr, Value);
#endif
}

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

*

  • @brief Performs an output operation for a memory location by writing the
  •       64 bit Value to the the specified address.
    
  • @param Addr contains the address to perform the output operation
  • @param Value contains 64 bit Value to be written at the specified address.
  • @return None.

******************************************************************************/
static INLINE void Xil_Out64(UINTPTR Addr, u64 Value)
{
volatile u64 *LocalAddr = (volatile u64 *)Addr;
*LocalAddr = Value;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值