Skip to content

Commit

Permalink
fix(usbfs/otgfs): Introduce Enums
Browse files Browse the repository at this point in the history
  • Loading branch information
Codetector1374 authored and andelf committed Oct 28, 2024
1 parent 5aa9653 commit f03c4ee
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions data/registers/otg_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ fieldset/USB_INT_ST:
description: RO, bit mask of current token PID code received for USB device mode.
bit_offset: 4
bit_size: 2
enum: USB_TOKEN
- name: TOG_OK
description: RO, indicate current USB transfer toggle is OK.
bit_offset: 6
Expand Down Expand Up @@ -470,6 +471,7 @@ fieldset/UEP_TX_CTRL:
description: bit mask of handshake response type for USB endpoint X transmittal (IN).
bit_offset: 0
bit_size: 2
enum: EP_TX_RESPONSE
- name: T_TOG
description: "prepared data toggle flag of USB endpoint X transmittal (IN): 0=DATA0, 1=DATA1."
bit_offset: 2
Expand All @@ -486,6 +488,7 @@ fieldset/UEP_RX_CTRL:
description: bit mask of handshake response type for USB endpoint X receiving (OUT).
bit_offset: 0
bit_size: 2
enum: EP_RX_RESPONSE
- name: R_TOG
description: "expected data toggle flag of USB endpoint X receiving (OUT): 0=DATA0, 1=DATA1."
bit_offset: 2
Expand Down Expand Up @@ -592,3 +595,51 @@ fieldset/UH_TX_CTRL:
- name: T_AUTO_TOG
bit_offset: 3
bit_size: 1

enum/EP_TX_RESPONSE:
bit_size: 2
variants:
- name: ACK
description: Respond with DATA0/DATA1 and expect ACK
value: 0
- name: None
description: Respond with DATA0/DATA1 and not expect ACK
value: 1
- name: NAK
description: Respond with NAK or Busy
value: 2
- name: STALL
description: Respond with STALL or Error
value: 3

enum/EP_RX_RESPONSE:
bit_size: 2
variants:
- name: ACK
description: Respond with ACK
value: 0
- name: None
description: Timeout / No Response, used for non-EP0 iso/sync transfer
value: 1
- name: NAK
description: Respond with NAK or Busy
value: 2
- name: STALL
description: Respond with STALL or Error
value: 3

enum/USB_TOKEN:
bit_size: 2
variants:
- name: OUT
description: OUT Packet
value: 0
- name: Rsvd
description: Reserved
value: 1
- name: IN
description: IN Packet
value: 2
- name: SETUP
description: Setup Packet
value: 3

0 comments on commit f03c4ee

Please sign in to comment.