zynq之ps端开发

4 篇文章 0 订阅

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;
}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Zynq-7045芯片的PS(Processing System)初始化USB时,可以按照以下步骤进行: 1. Vivado工程配置:使用Xilinx Vivado工具创建一个新的工程,并将Zynq-7045芯片添加到工程中。根据硬件设计,配置相应的引脚映射,将USB接口与Zynq芯片的相应口连接起来。 2. 设备树配置:在Vivado工程中,生成设备树文件(device tree)。设备树文件描述了硬件的配置和连接信息,包括USB控制器的配置。根据具体的USB控制器和驱动程序要求,配置设备树文件中的相关节点。 3. Linux内核配置:如果使用Linux操作系统进行USB开发,需要在内核配置中启用相关的USB驱动程序。在内核配置中,找到对应的USB控制器驱动程序,并确保其被选中。 4. USB驱动程序开发:根据硬件和操作系统的要求,开发USB驱动程序。这包括初始化USB控制器、设置USB传输参数、处理USB中断等操作。具体的驱动程序开发可能涉及到底层寄存器访问、USB协议栈的使用等。 5. 应用程序开发:在驱动程序的基础上,开发应用程序来实现所需的USB功能。这可能包括发送和接收数据、配置USB设备等操作。在应用程序开发中,可以使用操作系统提供的USB库函数或者直接操作设备文件来进行USB通信。 需要注意的是,以上步骤只是一个大致的指导,具体的USB初始化过程和代码实现会根据硬件平台、操作系统和应用需求的不同而有所差异。在进行Zynq-7045芯片的USB初始化时,建议参考Xilinx提供的文档和示例代码,以及相关的操作系统和驱动开发指南。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值