diff options
| author | elagil <[email protected]> | 2024-08-24 20:23:10 +0200 |
|---|---|---|
| committer | elagil <[email protected]> | 2024-08-24 20:23:10 +0200 |
| commit | 557cff708505eb02c2b4c7f264a726bb9c17812a (patch) | |
| tree | 71c1fe26f9dbd3bb6dc16e40585e5ab4279ba76b /embassy-usb-synopsys-otg | |
| parent | b88dc137e766d89eca5472bfa6f3bb78cfd1f7e0 (diff) | |
feat: Add support for a full-speed ULPI mode
Diffstat (limited to 'embassy-usb-synopsys-otg')
| -rw-r--r-- | embassy-usb-synopsys-otg/src/lib.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/embassy-usb-synopsys-otg/src/lib.rs b/embassy-usb-synopsys-otg/src/lib.rs index b90e059f6..82752010a 100644 --- a/embassy-usb-synopsys-otg/src/lib.rs +++ b/embassy-usb-synopsys-otg/src/lib.rs | |||
| @@ -179,6 +179,8 @@ pub enum PhyType { | |||
| 179 | /// | 179 | /// |
| 180 | /// Available on a few STM32 chips. | 180 | /// Available on a few STM32 chips. |
| 181 | InternalHighSpeed, | 181 | InternalHighSpeed, |
| 182 | /// External ULPI Full-Speed PHY (or High-Speed PHY in Full-Speed mode) | ||
| 183 | ExternalFullSpeed, | ||
| 182 | /// External ULPI High-Speed PHY | 184 | /// External ULPI High-Speed PHY |
| 183 | ExternalHighSpeed, | 185 | ExternalHighSpeed, |
| 184 | } | 186 | } |
| @@ -188,14 +190,14 @@ impl PhyType { | |||
| 188 | pub fn internal(&self) -> bool { | 190 | pub fn internal(&self) -> bool { |
| 189 | match self { | 191 | match self { |
| 190 | PhyType::InternalFullSpeed | PhyType::InternalHighSpeed => true, | 192 | PhyType::InternalFullSpeed | PhyType::InternalHighSpeed => true, |
| 191 | PhyType::ExternalHighSpeed => false, | 193 | PhyType::ExternalHighSpeed | PhyType::ExternalFullSpeed => false, |
| 192 | } | 194 | } |
| 193 | } | 195 | } |
| 194 | 196 | ||
| 195 | /// Get whether this PHY is any of the high-speed types. | 197 | /// Get whether this PHY is any of the high-speed types. |
| 196 | pub fn high_speed(&self) -> bool { | 198 | pub fn high_speed(&self) -> bool { |
| 197 | match self { | 199 | match self { |
| 198 | PhyType::InternalFullSpeed => false, | 200 | PhyType::InternalFullSpeed | PhyType::ExternalFullSpeed => false, |
| 199 | PhyType::ExternalHighSpeed | PhyType::InternalHighSpeed => true, | 201 | PhyType::ExternalHighSpeed | PhyType::InternalHighSpeed => true, |
| 200 | } | 202 | } |
| 201 | } | 203 | } |
| @@ -204,6 +206,7 @@ impl PhyType { | |||
| 204 | match self { | 206 | match self { |
| 205 | PhyType::InternalFullSpeed => vals::Dspd::FULL_SPEED_INTERNAL, | 207 | PhyType::InternalFullSpeed => vals::Dspd::FULL_SPEED_INTERNAL, |
| 206 | PhyType::InternalHighSpeed => vals::Dspd::HIGH_SPEED, | 208 | PhyType::InternalHighSpeed => vals::Dspd::HIGH_SPEED, |
| 209 | PhyType::ExternalFullSpeed => vals::Dspd::FULL_SPEED_EXTERNAL, | ||
| 207 | PhyType::ExternalHighSpeed => vals::Dspd::HIGH_SPEED, | 210 | PhyType::ExternalHighSpeed => vals::Dspd::HIGH_SPEED, |
| 208 | } | 211 | } |
| 209 | } | 212 | } |
