USB OTG引脚初始化时需要设置成哪种模式

[复制链接]
 楼主| wendi_fwy 发表于 2010-10-18 19:44 | 显示全部楼层 |阅读模式
本帖最后由 wendi_fwy 于 2010-10-19 08:32 编辑

想用STM32F105VC的USB OTG,准备用主模式,USBDMUSBDP初始化时GPIO_InitStructure.GPIO_Mode的模式需要选择为哪种模式
typedef enum
{ GPIO_Mode_AIN = 0x0,
  GPIO_Mode_IN_FLOATING = 0x04,
  GPIO_Mode_IPD = 0x28,
  GPIO_Mode_IPU = 0x48,
  GPIO_Mode_Out_OD = 0x14,
  GPIO_Mode_Out_PP = 0x10,
  GPIO_Mode_AF_OD = 0x1C,
  GPIO_Mode_AF_PP = 0x18
}GPIOMode_TypeDef;

谢谢
weibn 发表于 2010-10-19 14:38 | 显示全部楼层
哪种模式都不用设置,
weibn 发表于 2010-10-19 14:54 | 显示全部楼层
哪种模式都不用设置,
weibn 发表于 2010-10-19 14:55 | 显示全部楼层
Table 28. OTG_FS pin configuration(1)
1. This table applies to connectivity line devices only.
OTG_FS pinout Configuration GPIO configuration
OTG_FS_SOF
Host AF push-pull, if used
Device AF push-pull, if used
OTG AF push-pull, if used
OTG_FS_VBUS
(2)
2. For the OTG_FS_VBUS pin (PA9) to be used by another shared peripheral or as a general-purpose IO,
the PHY Power-down mode has to be active (clear bit 16 in the OTG_FS_GCCFG register).
Host Input floating
Device Input floating
OTG Input floating
OTG_FS_ID
Host
No need if the Force host mode is selected by software
(FHMOD set in the OTG_FS_GUSBCFG register)
Device
No need if the Force device mode is selected by software
(FDMOD set in the OTG_FS_GUSBCFG register)
OTG Input pull-up
OTG_FS_DM
Host Controlled automatically by the USB power-down
Device Controlled automatically by the USB power-down
OTG Controlled automatically by the USB power-down
OTG_FS_DP
Host Controlled automatically by the USB power-down
Device Controlled automatically by the USB power-down
OTG Controlled automatically by the USB power-down
vigia 发表于 2010-10-19 15:07 | 显示全部楼层
不用设置USB的管脚

LZ你可以参考OTG模块的库来做你的项目
 楼主| wendi_fwy 发表于 2010-10-19 18:59 | 显示全部楼层
好的,谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则

11

主题

22

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部