找回密码
 立即注册

QQ登录

只需一步,快速开始

打印 上一主题 下一主题
开启左侧

[NUC] 关于NUC123 数据参考手册USB 部分疑问

[复制链接]
跳转到指定楼层
楼主
qq729101414 发表于 2016-7-16 14:57:27 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
在USB部分 关于端点0~5 在整个寻址空间内部有两个地方,一个是0x020,另一个是0x500,不知道这样的用意是啥?但是库用的是0x500部分地址。
比如:USB_MXPLD0~5
USB_CFGP0~5
6.16.6Page 486 of 532

  1. typedef struct
  2. {


  3. /**
  4. * @var USBD_EP_T::BUFSEG0
  5. * Offset: 0x500/0x510/0x520/0x530/0x540/0x550/0x560/0x570  Endpoint 0~7 Buffer Segmentation Register
  6. * ---------------------------------------------------------------------------------------------------
  7. * |Bits    |Field     |Descriptions
  8. * | :----: | :----:   | :---- |
  9. * |[8:3]   |BUFSEG    |Endpoint Buffer Segmentation
  10. * |        |          |It is used to indicate the offset address for each endpoint with the USB SRAM starting address The effective starting address of the endpoint is
  11. * |        |          |USB_SRAM address + { BUFSEG[8:3], 3'b000}
  12. * |        |          |Where the USB_SRAM address = USBD_BA+0x100h.
  13. * @var USBD_EP_T::MXPLD0
  14. * Offset: 0x504/0x514/0x524/0x534/0x544/0x554/0x564/0x574  Endpoint 0~7 Maximal Payload Register
  15. * ---------------------------------------------------------------------------------------------------
  16. * |Bits    |Field     |Descriptions
  17. * | :----: | :----:   | :---- |
  18. * |[8:0]   |MXPLD     |Maximal Payload
  19. * |        |          |Define the data length which is transmitted to host (IN token) or the actual data length which is received from the host (OUT token).
  20. * |        |          |It also used to indicate that the endpoint is ready to be transmitted in IN token or received in OUT token.
  21. * |        |          |(1) When the register is written by CPU,
  22. * |        |          |For IN token, the value of MXPLD is used to define the data length to be transmitted and indicate the data buffer is ready.
  23. * |        |          |For OUT token, it means that the controller is ready to receive data from the host and the value of MXPLD is the maximal data length comes from host.
  24. * |        |          |(2) When the register is read by CPU,
  25. * |        |          |For IN token, the value of MXPLD is indicated by the data length be transmitted to host
  26. * |        |          |For OUT token, the value of MXPLD is indicated the actual data length receiving from host.
  27. * |        |          |Note: Once MXPLD is written, the data packets will be transmitted/received immediately after IN/OUT token arrived.
  28. * @var USBD_EP_T::CFG0
  29. * Offset: 0x508/0x518/0x528/0x538/0x548/0x558/0x568/0x578  Endpoint 0~7 Configuration Register
  30. * ---------------------------------------------------------------------------------------------------
  31. * |Bits    |Field     |Descriptions
  32. * | :----: | :----:   | :---- |
  33. * |[3:0]   |EP_NUM    |Endpoint Number
  34. * |        |          |These bits are used to define the endpoint number of the current endpoint.
  35. * |[4]     |ISOCH     |Isochronous Endpoint
  36. * |        |          |This bit is used to set the endpoint as Isochronous endpoint, no handshake.
  37. * |        |          |0 = No Isochronous endpoint.
  38. * |        |          |1 = Isochronous endpoint.
  39. * |[6:5]   |STATE     |Endpoint STATE
  40. * |        |          |00 = Endpoint is Disabled.
  41. * |        |          |01 = Out endpoint.
  42. * |        |          |10 = IN endpoint.
  43. * |        |          |11 = Undefined.
  44. * |[7]     |DSQ_SYNC  |Data Sequence Synchronization
  45. * |        |          |0 = DATA0 PID.
  46. * |        |          |1 = DATA1 PID.
  47. * |        |          |Note: It is used to specify the DATA0 or DATA1 PID in the following IN token transaction.
  48. * |        |          |Hardware will toggle automatically in IN token base on the bit.
  49. * |[9]     |CSTALL    |Clear STALL Response
  50. * |        |          |0 = Disable the device to clear the STALL handshake in setup stage.
  51. * |        |          |1 = Clear the device to response STALL handshake in setup stage.
  52. * @var USBD_EP_T::CFGP0
  53. * Offset: 0x50C/0x51C/0x52C/0x53C/0x54C/0x55C/0x56C/0x57C  Endpoint 0~7 Set Stall and Clear In/Out Ready Control Register
  54.     * ---------------------------------------------------------------------------------------------------
  55.     * |Bits    |Field     |Descriptions
  56.     * | :----: | :----:   | :---- |
  57.     * |[0]     |CLRRDY    |Clear Ready
  58.     * |        |          |When the USB_MXPLD register is set by user, it means that the endpoint is ready to transmit or receive data.
  59.     * |        |          |If the user wants to turn off this transaction before the transaction start, users can set this bit to 1 to turn it off and it will be cleared to 0 automatically.
  60.     * |        |          |For IN token, write '1' to clear the IN token had ready to transmit the data to USB.
  61.     * |        |          |For OUT token, write '1' to clear the OUT token had ready to receive the data from USB.
  62.     * |        |          |This bit is write 1 only and is always 0 when it is read back.
  63.     * |[1]     |SSTALL    |Set STALL
  64.     * |        |          |0 = Disable the device to response STALL.
  65.     * |        |          |1 = Set the device to respond STALL automatically.
  66.     */

  67.     __IO uint32_t BUFSEG;        /* Offset: 0x500/0x510/0x520/0x530/0x540/0x550/0x560/0x570  Endpoint 0~7 Buffer Segmentation Register */
  68.     __IO uint32_t MXPLD;         /* Offset: 0x504/0x514/0x524/0x534/0x544/0x554/0x564/0x574  Endpoint 0~7 Maximal Payload Register */
  69.     __IO uint32_t CFG;           /* Offset: 0x508/0x518/0x528/0x538/0x548/0x558/0x568/0x578  Endpoint 0~7 Configuration Register */
  70.     __IO uint32_t CFGP;          /* Offset: 0x50C/0x51C/0x52C/0x53C/0x54C/0x55C/0x56C/0x57C  Endpoint 0~7 Set Stall and Clear In/Out Ready Control Register */

  71. } USBD_EP_T;
复制代码



分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 顶 踩
回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies |上传

本版积分规则

新唐MCU